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 <cp.michael@samsung.com>
This commit is contained in:
Chris Michael 2017-01-04 14:23:52 -05:00
parent 4c04958f87
commit 459a23244f
1 changed files with 11 additions and 4 deletions

View File

@ -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