summaryrefslogtreecommitdiff
path: root/src/lib
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
parentcb57ea7587e7d00aa429e19996129c48619d3f11 (diff)
wayland: fix xdg-shell popup windows
@fix
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_window.c69
-rw-r--r--src/lib/elementary/efl_ui_win.c12
2 files changed, 49 insertions, 32 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 }
diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c
index 3643a3d6a6..e08ebcd9f6 100644
--- a/src/lib/elementary/efl_ui_win.c
+++ b/src/lib/elementary/efl_ui_win.c
@@ -4433,7 +4433,11 @@ _elm_win_frame_style_update(Efl_Ui_Win_Data *sd, Eina_Bool force_emit, Eina_Bool
4433 } 4433 }
4434 4434
4435 if ((sd->type == ELM_WIN_INLINED_IMAGE) || 4435 if ((sd->type == ELM_WIN_INLINED_IMAGE) ||
4436 (sd->type == ELM_WIN_SOCKET_IMAGE)) 4436 (sd->type == ELM_WIN_SOCKET_IMAGE) ||
4437 (sd->type == ELM_WIN_TOOLTIP) ||
4438 (sd->type == ELM_WIN_COMBO) ||
4439 (sd->type == ELM_WIN_MENU) ||
4440 (sd->type == ELM_WIN_POPUP_MENU))
4437 { 4441 {
4438 sd->csd.need_shadow = EINA_FALSE; 4442 sd->csd.need_shadow = EINA_FALSE;
4439 sd->csd.need_borderless = EINA_TRUE; 4443 sd->csd.need_borderless = EINA_TRUE;
@@ -4652,6 +4656,7 @@ _elm_win_finalize_internal(Eo *obj, Efl_Ui_Win_Data *sd, const char *name, Elm_W
4652 Eina_Stringshare *accel = NULL; 4656 Eina_Stringshare *accel = NULL;
4653 Eina_Bool is_gl_accel; 4657 Eina_Bool is_gl_accel;
4654 int i, p = 0; 4658 int i, p = 0;
4659 int parent_id = 0;
4655 4660
4656 Efl_Ui_Win_Data tmp_sd; 4661 Efl_Ui_Win_Data tmp_sd;
4657 4662
@@ -4918,6 +4923,7 @@ _elm_win_finalize_internal(Eo *obj, Efl_Ui_Win_Data *sd, const char *name, Elm_W
4918#endif 4923#endif
4919 } 4924 }
4920 } 4925 }
4926 if (parent) parent_id = elm_win_window_id_get(parent);
4921 for (i = 0; i < p; i++) 4927 for (i = 0; i < p; i++)
4922 { 4928 {
4923 if (!strcmp(enginelist[i], ELM_SOFTWARE_X11)) 4929 if (!strcmp(enginelist[i], ELM_SOFTWARE_X11))
@@ -4953,9 +4959,9 @@ _elm_win_finalize_internal(Eo *obj, Efl_Ui_Win_Data *sd, const char *name, Elm_W
4953 tmp_sd.ee = ecore_evas_gl_x11_new(NULL, 0, 0, 0, 0, 0); 4959 tmp_sd.ee = ecore_evas_gl_x11_new(NULL, 0, 0, 0, 0, 0);
4954 } 4960 }
4955 else if (!strcmp(enginelist[i], ELM_WAYLAND_SHM)) 4961 else if (!strcmp(enginelist[i], ELM_WAYLAND_SHM))
4956 tmp_sd.ee = ecore_evas_wayland_shm_new(NULL, 0, 0, 0, 0, 0, 0); 4962 tmp_sd.ee = ecore_evas_wayland_shm_new(NULL, parent_id, 0, 0, 0, 0, 0);
4957 else if (!strcmp(enginelist[i], ELM_WAYLAND_EGL)) 4963 else if (!strcmp(enginelist[i], ELM_WAYLAND_EGL))
4958 tmp_sd.ee = ecore_evas_wayland_egl_new(NULL, 0, 0, 0, 0, 0, 0); 4964 tmp_sd.ee = ecore_evas_wayland_egl_new(NULL, parent_id, 0, 0, 0, 0, 0);
4959 else if (!strcmp(enginelist[i], ELM_SOFTWARE_WIN32)) 4965 else if (!strcmp(enginelist[i], ELM_SOFTWARE_WIN32))
4960 tmp_sd.ee = ecore_evas_software_gdi_new(NULL, 0, 0, 1, 1); 4966 tmp_sd.ee = ecore_evas_software_gdi_new(NULL, 0, 0, 1, 1);
4961 else if (!strcmp(enginelist[i], ELM_SOFTWARE_DDRAW)) 4967 else if (!strcmp(enginelist[i], ELM_SOFTWARE_DDRAW))