summaryrefslogtreecommitdiff
path: root/src/lib/ecore_wl2
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2017-08-11 18:43:15 -0400
committerMike Blumenkrantz <zmike@osg.samsung.com>2017-08-11 18:43:12 -0400
commit398ffe40a34eaab5e572b0eec47e4993c6238431 (patch)
treeafcaf289a14892f72de4bc430c594b8477f771bd /src/lib/ecore_wl2
parentcb57ea7587e7d00aa429e19996129c48619d3f11 (diff)
wayland: fix xdg-shell popup windows
@fix
Diffstat (limited to 'src/lib/ecore_wl2')
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_window.c69
1 files changed, 40 insertions, 29 deletions
diff --git a/src/lib/ecore_wl2/ecore_wl2_window.c b/src/lib/ecore_wl2/ecore_wl2_window.c
index bb5196f474..b7b4450afc 100644
--- a/src/lib/ecore_wl2/ecore_wl2_window.c
+++ b/src/lib/ecore_wl2/ecore_wl2_window.c
@@ -297,7 +297,6 @@ _ecore_wl2_window_zxdg_popup_create(Ecore_Wl2_Window *win)
297 struct zxdg_positioner_v6 *pos; 297 struct zxdg_positioner_v6 *pos;
298 298
299 EINA_SAFETY_ON_NULL_RETURN(win->parent); 299 EINA_SAFETY_ON_NULL_RETURN(win->parent);
300 EINA_SAFETY_ON_NULL_RETURN(win->grab);
301 pos = zxdg_shell_v6_create_positioner(win->display->wl.zxdg_shell); 300 pos = zxdg_shell_v6_create_positioner(win->display->wl.zxdg_shell);
302 if (!pos) return; 301 if (!pos) return;
303 302
@@ -313,8 +312,9 @@ _ecore_wl2_window_zxdg_popup_create(Ecore_Wl2_Window *win)
313 win->parent->zxdg_surface, pos); 312 win->parent->zxdg_surface, pos);
314 313
315 zxdg_positioner_v6_destroy(pos); 314 zxdg_positioner_v6_destroy(pos);
316 zxdg_popup_v6_grab(win->zxdg_popup, win->grab->wl.seat, 315 if (win->grab)
317 wl_display_get_serial(win->display->wl.display)); 316 zxdg_popup_v6_grab(win->zxdg_popup, win->grab->wl.seat,
317 wl_display_get_serial(win->display->wl.display));
318 zxdg_popup_v6_set_user_data(win->zxdg_popup, win); 318 zxdg_popup_v6_set_user_data(win->zxdg_popup, win);
319 zxdg_popup_v6_add_listener(win->zxdg_popup, &_zxdg_popup_listener, win); 319 zxdg_popup_v6_add_listener(win->zxdg_popup, &_zxdg_popup_listener, win);
320 320
@@ -365,8 +365,6 @@ _ecore_wl2_window_type_set(Ecore_Wl2_Window *win)
365 if (ptop) 365 if (ptop)
366 zxdg_toplevel_v6_set_parent(win->zxdg_toplevel, ptop); 366 zxdg_toplevel_v6_set_parent(win->zxdg_toplevel, ptop);
367 } 367 }
368 else if (win->xdg_surface)
369 xdg_surface_set_parent(win->xdg_surface, NULL);
370 break; 368 break;
371 default: 369 default:
372 break; 370 break;
@@ -449,33 +447,46 @@ _ecore_wl2_window_shell_surface_init(Ecore_Wl2_Window *window)
449 zxdg_surface_v6_add_listener(window->zxdg_surface, 447 zxdg_surface_v6_add_listener(window->zxdg_surface,
450 &_zxdg_surface_listener, window); 448 &_zxdg_surface_listener, window);
451 449
452 window->zxdg_toplevel =
453 zxdg_surface_v6_get_toplevel(window->zxdg_surface);
454 zxdg_toplevel_v6_set_user_data(window->zxdg_toplevel, window);
455 zxdg_toplevel_v6_add_listener(window->zxdg_toplevel,
456 &_zxdg_toplevel_listener, window);
457
458 if (window->title)
459 zxdg_toplevel_v6_set_title(window->zxdg_toplevel, window->title);
460 if (window->class)
461 zxdg_toplevel_v6_set_app_id(window->zxdg_toplevel, window->class);
462
463 window->zxdg_set_min_size = zxdg_toplevel_v6_set_min_size;
464 window->zxdg_set_max_size = zxdg_toplevel_v6_set_max_size;
465
466 window->zxdg_configure_ack = zxdg_surface_v6_ack_configure; 450 window->zxdg_configure_ack = zxdg_surface_v6_ack_configure;
467 _ecore_wl2_window_type_set(window);
468
469 window->pending.configure = EINA_TRUE; 451 window->pending.configure = EINA_TRUE;
470 452
471 if (window->maximized) 453 if (window->type == ECORE_WL2_WINDOW_TYPE_MENU)
472 zxdg_toplevel_v6_set_maximized(window->zxdg_toplevel); 454 _ecore_wl2_window_zxdg_popup_create(window);
473 455 else
474 if (window->fullscreen) 456 {
475 zxdg_toplevel_v6_set_fullscreen(window->zxdg_toplevel, NULL); 457 window->zxdg_toplevel =
476 if (window->aspect.set && window->display->wl.efl_hints) 458 zxdg_surface_v6_get_toplevel(window->zxdg_surface);
477 efl_hints_set_aspect(window->display->wl.efl_hints, window->zxdg_toplevel, 459 zxdg_toplevel_v6_set_user_data(window->zxdg_toplevel, window);
478 window->aspect.w, window->aspect.h, window->aspect.aspect); 460 zxdg_toplevel_v6_add_listener(window->zxdg_toplevel,
461 &_zxdg_toplevel_listener, window);
462
463 if (window->title)
464 zxdg_toplevel_v6_set_title(window->zxdg_toplevel, window->title);
465 if (window->class)
466 zxdg_toplevel_v6_set_app_id(window->zxdg_toplevel, window->class);
467
468 window->zxdg_set_min_size = zxdg_toplevel_v6_set_min_size;
469 window->zxdg_set_max_size = zxdg_toplevel_v6_set_max_size;
470
471 {
472 struct zxdg_toplevel_v6 *ptop = NULL;
473
474 if (window->parent)
475 ptop = window->parent->zxdg_toplevel;
476
477 if (ptop)
478 zxdg_toplevel_v6_set_parent(window->zxdg_toplevel, ptop);
479 }
480
481 if (window->maximized)
482 zxdg_toplevel_v6_set_maximized(window->zxdg_toplevel);
483
484 if (window->fullscreen)
485 zxdg_toplevel_v6_set_fullscreen(window->zxdg_toplevel, NULL);
486 if (window->aspect.set && window->display->wl.efl_hints)
487 efl_hints_set_aspect(window->display->wl.efl_hints, window->zxdg_toplevel,
488 window->aspect.w, window->aspect.h, window->aspect.aspect);
489 }
479 490
480 wl_surface_commit(window->surface); 491 wl_surface_commit(window->surface);
481 } 492 }