summaryrefslogtreecommitdiff
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-09-15 13:08:22 -0400
commit2d079fb112ae0b2aff60b3ba6f40a542084f6410 (patch)
treeb3cbcc1680ecac9dd3a4b2ed3e1b8b600e1d5740
parentd5148120bf06d54c904a50635b0fde4611333306 (diff)
wayland: fix xdg-shell popup windows
@fix
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_window.c55
-rw-r--r--src/lib/elementary/efl_ui_win.c12
-rw-r--r--src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c1
3 files changed, 44 insertions, 24 deletions
diff --git a/src/lib/ecore_wl2/ecore_wl2_window.c b/src/lib/ecore_wl2/ecore_wl2_window.c
index 78f6129..caa2a7b 100644
--- a/src/lib/ecore_wl2/ecore_wl2_window.c
+++ b/src/lib/ecore_wl2/ecore_wl2_window.c
@@ -296,7 +296,6 @@ _ecore_wl2_window_zxdg_popup_create(Ecore_Wl2_Window *win)
296 struct zxdg_positioner_v6 *pos; 296 struct zxdg_positioner_v6 *pos;
297 297
298 EINA_SAFETY_ON_NULL_RETURN(win->parent); 298 EINA_SAFETY_ON_NULL_RETURN(win->parent);
299 EINA_SAFETY_ON_NULL_RETURN(win->grab);
300 pos = zxdg_shell_v6_create_positioner(win->display->wl.zxdg_shell); 299 pos = zxdg_shell_v6_create_positioner(win->display->wl.zxdg_shell);
301 if (!pos) return; 300 if (!pos) return;
302 301
@@ -312,8 +311,9 @@ _ecore_wl2_window_zxdg_popup_create(Ecore_Wl2_Window *win)
312 win->parent->zxdg_surface, pos); 311 win->parent->zxdg_surface, pos);
313 312
314 zxdg_positioner_v6_destroy(pos); 313 zxdg_positioner_v6_destroy(pos);
315 zxdg_popup_v6_grab(win->zxdg_popup, win->grab->wl.seat, 314 if (win->grab)
316 wl_display_get_serial(win->display->wl.display)); 315 zxdg_popup_v6_grab(win->zxdg_popup, win->grab->wl.seat,
316 wl_display_get_serial(win->display->wl.display));
317 zxdg_popup_v6_set_user_data(win->zxdg_popup, win); 317 zxdg_popup_v6_set_user_data(win->zxdg_popup, win);
318 zxdg_popup_v6_add_listener(win->zxdg_popup, &_zxdg_popup_listener, win); 318 zxdg_popup_v6_add_listener(win->zxdg_popup, &_zxdg_popup_listener, win);
319 319
@@ -448,30 +448,43 @@ _ecore_wl2_window_shell_surface_init(Ecore_Wl2_Window *window)
448 zxdg_surface_v6_add_listener(window->zxdg_surface, 448 zxdg_surface_v6_add_listener(window->zxdg_surface,
449 &_zxdg_surface_listener, window); 449 &_zxdg_surface_listener, window);
450 450
451 window->zxdg_toplevel = 451 window->zxdg_configure_ack = zxdg_surface_v6_ack_configure;
452 zxdg_surface_v6_get_toplevel(window->zxdg_surface); 452 window->pending.configure = EINA_TRUE;
453 zxdg_toplevel_v6_set_user_data(window->zxdg_toplevel, window);
454 zxdg_toplevel_v6_add_listener(window->zxdg_toplevel,
455 &_zxdg_toplevel_listener, window);
456 453
457 if (window->title) 454 if (window->type == ECORE_WL2_WINDOW_TYPE_MENU)
458 zxdg_toplevel_v6_set_title(window->zxdg_toplevel, window->title); 455 _ecore_wl2_window_zxdg_popup_create(window);
459 if (window->class) 456 else
460 zxdg_toplevel_v6_set_app_id(window->zxdg_toplevel, window->class); 457 {
458 window->zxdg_toplevel =
459 zxdg_surface_v6_get_toplevel(window->zxdg_surface);
460 zxdg_toplevel_v6_set_user_data(window->zxdg_toplevel, window);
461 zxdg_toplevel_v6_add_listener(window->zxdg_toplevel,
462 &_zxdg_toplevel_listener, window);
461 463
462 window->zxdg_set_min_size = zxdg_toplevel_v6_set_min_size; 464 if (window->title)
463 window->zxdg_set_max_size = zxdg_toplevel_v6_set_max_size; 465 zxdg_toplevel_v6_set_title(window->zxdg_toplevel, window->title);
466 if (window->class)
467 zxdg_toplevel_v6_set_app_id(window->zxdg_toplevel, window->class);
464 468
465 window->zxdg_configure_ack = zxdg_surface_v6_ack_configure; 469 window->zxdg_set_min_size = zxdg_toplevel_v6_set_min_size;
466 _ecore_wl2_window_type_set(window); 470 window->zxdg_set_max_size = zxdg_toplevel_v6_set_max_size;
467 471
468 window->pending.configure = EINA_TRUE; 472 {
473 struct zxdg_toplevel_v6 *ptop = NULL;
469 474
470 if (window->maximized) 475 if (window->parent)
471 zxdg_toplevel_v6_set_maximized(window->zxdg_toplevel); 476 ptop = window->parent->zxdg_toplevel;
472 477
473 if (window->fullscreen) 478 if (ptop)
474 zxdg_toplevel_v6_set_fullscreen(window->zxdg_toplevel, NULL); 479 zxdg_toplevel_v6_set_parent(window->zxdg_toplevel, ptop);
480 }
481
482 if (window->maximized)
483 zxdg_toplevel_v6_set_maximized(window->zxdg_toplevel);
484
485 if (window->fullscreen)
486 zxdg_toplevel_v6_set_fullscreen(window->zxdg_toplevel, NULL);
487 }
475 488
476 wl_surface_commit(window->surface); 489 wl_surface_commit(window->surface);
477 } 490 }
diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c
index 31b3f20..306da95 100644
--- a/src/lib/elementary/efl_ui_win.c
+++ b/src/lib/elementary/efl_ui_win.c
@@ -4437,7 +4437,11 @@ _elm_win_frame_style_update(Efl_Ui_Win_Data *sd, Eina_Bool force_emit, Eina_Bool
4437 } 4437 }
4438 4438
4439 if ((sd->type == ELM_WIN_INLINED_IMAGE) || 4439 if ((sd->type == ELM_WIN_INLINED_IMAGE) ||
4440 (sd->type == ELM_WIN_SOCKET_IMAGE)) 4440 (sd->type == ELM_WIN_SOCKET_IMAGE) ||
4441 (sd->type == ELM_WIN_TOOLTIP) ||
4442 (sd->type == ELM_WIN_COMBO) ||
4443 (sd->type == ELM_WIN_MENU) ||
4444 (sd->type == ELM_WIN_POPUP_MENU))
4441 { 4445 {
4442 sd->csd.need_shadow = EINA_FALSE; 4446 sd->csd.need_shadow = EINA_FALSE;
4443 sd->csd.need_borderless = EINA_TRUE; 4447 sd->csd.need_borderless = EINA_TRUE;
@@ -4656,6 +4660,7 @@ _elm_win_finalize_internal(Eo *obj, Efl_Ui_Win_Data *sd, const char *name, Elm_W
4656 Eina_Stringshare *accel = NULL; 4660 Eina_Stringshare *accel = NULL;
4657 Eina_Bool is_gl_accel; 4661 Eina_Bool is_gl_accel;
4658 int i, p = 0; 4662 int i, p = 0;
4663 int parent_id = 0;
4659 4664
4660 Efl_Ui_Win_Data tmp_sd; 4665 Efl_Ui_Win_Data tmp_sd;
4661 4666
@@ -4922,6 +4927,7 @@ _elm_win_finalize_internal(Eo *obj, Efl_Ui_Win_Data *sd, const char *name, Elm_W
4922#endif 4927#endif
4923 } 4928 }
4924 } 4929 }
4930 if (parent) parent_id = elm_win_window_id_get(parent);
4925 for (i = 0; i < p; i++) 4931 for (i = 0; i < p; i++)
4926 { 4932 {
4927 if (!strcmp(enginelist[i], ELM_SOFTWARE_X11)) 4933 if (!strcmp(enginelist[i], ELM_SOFTWARE_X11))
@@ -4957,9 +4963,9 @@ _elm_win_finalize_internal(Eo *obj, Efl_Ui_Win_Data *sd, const char *name, Elm_W
4957 tmp_sd.ee = ecore_evas_gl_x11_new(NULL, 0, 0, 0, 0, 0); 4963 tmp_sd.ee = ecore_evas_gl_x11_new(NULL, 0, 0, 0, 0, 0);
4958 } 4964 }
4959 else if (!strcmp(enginelist[i], ELM_WAYLAND_SHM)) 4965 else if (!strcmp(enginelist[i], ELM_WAYLAND_SHM))
4960 tmp_sd.ee = ecore_evas_wayland_shm_new(NULL, 0, 0, 0, 0, 0, 0); 4966 tmp_sd.ee = ecore_evas_wayland_shm_new(NULL, parent_id, 0, 0, 0, 0, 0);
4961 else if (!strcmp(enginelist[i], ELM_WAYLAND_EGL)) 4967 else if (!strcmp(enginelist[i], ELM_WAYLAND_EGL))
4962 tmp_sd.ee = ecore_evas_wayland_egl_new(NULL, 0, 0, 0, 0, 0, 0); 4968 tmp_sd.ee = ecore_evas_wayland_egl_new(NULL, parent_id, 0, 0, 0, 0, 0);
4963 else if (!strcmp(enginelist[i], ELM_SOFTWARE_WIN32)) 4969 else if (!strcmp(enginelist[i], ELM_SOFTWARE_WIN32))
4964 tmp_sd.ee = ecore_evas_software_gdi_new(NULL, 0, 0, 1, 1); 4970 tmp_sd.ee = ecore_evas_software_gdi_new(NULL, 0, 0, 1, 1);
4965 else if (!strcmp(enginelist[i], ELM_SOFTWARE_DDRAW)) 4971 else if (!strcmp(enginelist[i], ELM_SOFTWARE_DDRAW))
diff --git a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c
index 417c6e9..579b5f0 100644
--- a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c
+++ b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c
@@ -1987,6 +1987,7 @@ _ecore_evas_wl_common_show(Ecore_Evas *ee)
1987 1987
1988 evas_output_framespace_get(ee->evas, NULL, NULL, &fw, &fh); 1988 evas_output_framespace_get(ee->evas, NULL, NULL, &fw, &fh);
1989 1989
1990 ecore_wl2_window_geometry_set(wdata->win, 0, 0, ee->w, ee->h);
1990 ecore_wl2_window_show(wdata->win); 1991 ecore_wl2_window_show(wdata->win);
1991 ecore_wl2_window_alpha_set(wdata->win, ee->alpha); 1992 ecore_wl2_window_alpha_set(wdata->win, ee->alpha);
1992 1993