From 459a23244f8b81f2ef231b86ae44027d44cc27a8 Mon Sep 17 00:00:00 2001 From: Chris Michael Date: Wed, 4 Jan 2017 14:23:52 -0500 Subject: [PATCH] elementary: Support xdg_shell version 6 show_window_menu function As we now support xdg_shell version 6 on the client-side, we need to use the zxdg_toplevel_v6 function call to show window menus. Signed-off-by: Chris Michael --- src/lib/elementary/efl_ui_win.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c index 4d2b945..3c7005d 100644 --- a/src/lib/elementary/efl_ui_win.c +++ b/src/lib/elementary/efl_ui_win.c @@ -4007,16 +4007,23 @@ _elm_win_frame_cb_menu(void *data, { ELM_WIN_DATA_GET(data, sd); #ifdef HAVE_ELEMENTARY_WL2 + Ecore_Wl2_Input *input; int x, y, wx, wy; - if ((!sd->wl.win) || (!sd->wl.win->xdg_surface)) return; + if (!sd->wl.win) return; evas_canvas_pointer_canvas_xy_get(sd->evas, &x, &y); ecore_wl2_window_geometry_get(sd->wl.win, &wx, &wy, NULL, NULL); if (x < 0) x += wx; if (y < 0) y += wy; - xdg_surface_show_window_menu(sd->wl.win->xdg_surface, - ecore_wl2_input_seat_get(ecore_wl2_window_input_get(sd->wl.win)), 0, - x, y); + + input = ecore_wl2_window_input_get(sd->wl.win); + + if (sd->wl.win->zxdg_toplevel) + zxdg_toplevel_v6_show_window_menu(sd->wl.win->zxdg_toplevel, + ecore_wl2_input_seat_get(input), 0, x, y); + else if (sd->wl.win->xdg_surface) + xdg_surface_show_window_menu(sd->wl.win->xdg_surface, + ecore_wl2_input_seat_get(input), 0, x, y); #else (void)sd; #endif -- 2.7.4