summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2017-05-17 16:02:53 -0400
committerMike Blumenkrantz <zmike@osg.samsung.com>2017-05-19 13:17:15 -0400
commit13cf5a1d43bfba8e0e2d86522cd300d43a5b6a0e (patch)
tree3eb7e0e67f52d76f91a5dd159f404623a043daeb
parent7caf3b88cea5087b7dc67c6dd8528bc56fa095a7 (diff)
downloadefl-13cf5a1d43bfba8e0e2d86522cd300d43a5b6a0e.tar.gz
ecore-wl2: do not attempt to call zxdg_surface_v6.get_popup without a parent
this is a protocol error so ensure that it can never occur @fix
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_window.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/lib/ecore_wl2/ecore_wl2_window.c b/src/lib/ecore_wl2/ecore_wl2_window.c
index 4b9dc6d161..bda4f69188 100644
--- a/src/lib/ecore_wl2/ecore_wl2_window.c
+++ b/src/lib/ecore_wl2/ecore_wl2_window.c
@@ -255,6 +255,8 @@ _ecore_wl2_window_zxdg_popup_create(Ecore_Wl2_Window *win)
{
struct zxdg_positioner_v6 *pos;
+ EINA_SAFETY_ON_NULL_RETURN(win->parent);
+ EINA_SAFETY_ON_NULL_RETURN(win->grab);
pos = zxdg_shell_v6_create_positioner(win->display->wl.zxdg_shell);
if (!pos) return;
@@ -266,17 +268,8 @@ _ecore_wl2_window_zxdg_popup_create(Ecore_Wl2_Window *win)
zxdg_positioner_v6_set_gravity(pos, ZXDG_POSITIONER_V6_ANCHOR_BOTTOM |
ZXDG_POSITIONER_V6_ANCHOR_RIGHT);
- if (win->parent)
- {
- win->zxdg_popup =
- zxdg_surface_v6_get_popup(win->zxdg_surface,
- win->parent->zxdg_surface, pos);
- }
- else
- {
- win->zxdg_popup =
- zxdg_surface_v6_get_popup(win->zxdg_surface, NULL, pos);
- }
+ win->zxdg_popup = zxdg_surface_v6_get_popup(win->zxdg_surface,
+ win->parent->zxdg_surface, pos);
zxdg_positioner_v6_destroy(pos);
zxdg_popup_v6_grab(win->zxdg_popup, win->grab->wl.seat,
@@ -300,6 +293,8 @@ _ecore_wl2_window_type_set(Ecore_Wl2_Window *win)
_ecore_wl2_window_zxdg_popup_create(win);
else if (win->xdg_surface)
{
+ EINA_SAFETY_ON_TRUE_RETURN(!win->parent);
+ EINA_SAFETY_ON_TRUE_RETURN(!win->grab);
win->xdg_popup =
xdg_shell_get_xdg_popup(win->display->wl.xdg_shell,
win->surface, win->parent->surface,