ecore-wl2: Improve popup support to be able to use the parent windows

seat

Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
Chris Michael 2015-09-24 11:54:19 -04:00
parent e0b3d1250b
commit 4d193552a8
1 changed files with 34 additions and 20 deletions

View File

@ -148,30 +148,44 @@ _ecore_wl2_window_type_set(Ecore_Wl2_Window *win)
win->geometry.x, win->geometry.y, 0); win->geometry.x, win->geometry.y, 0);
break; break;
case ECORE_WL2_WINDOW_TYPE_MENU: case ECORE_WL2_WINDOW_TYPE_MENU:
if ((win->xdg_surface) && (win->input))
{ {
win->xdg_popup = Ecore_Wl2_Input *input;
xdg_shell_get_xdg_popup(win->display->wl.xdg_shell,
win->surface, win->parent->surface, input = win->input;
win->input->wl.seat, if ((!input) && (win->parent))
win->display->serial,
win->geometry.x, win->geometry.y);
if (!win->xdg_popup)
{ {
ERR("Could not create xdg popup: %m"); input = win->parent->input;
return;
} }
xdg_popup_set_user_data(win->xdg_popup, win); if ((!input) || (!input->wl.seat)) return;
xdg_popup_add_listener(win->xdg_popup, &_xdg_popup_listener, win);
} if (win->xdg_surface)
else if ((win->wl_shell_surface) && (win->input)) {
{ win->xdg_popup =
wl_shell_surface_set_popup(win->wl_shell_surface, xdg_shell_get_xdg_popup(win->display->wl.xdg_shell,
win->input->wl.seat, win->surface, win->parent->surface,
win->display->serial, input->wl.seat,
win->parent->surface, win->display->serial,
win->geometry.x, win->geometry.y, 0); win->geometry.x, win->geometry.y);
if (!win->xdg_popup)
{
ERR("Could not create xdg popup: %m");
return;
}
xdg_popup_set_user_data(win->xdg_popup, win);
xdg_popup_add_listener(win->xdg_popup,
&_xdg_popup_listener, win);
}
else if (win->wl_shell_surface)
{
wl_shell_surface_set_popup(win->wl_shell_surface,
input->wl.seat,
win->display->serial,
win->parent->surface,
win->geometry.x,
win->geometry.y, 0);
}
} }
break; break;
case ECORE_WL2_WINDOW_TYPE_TOPLEVEL: case ECORE_WL2_WINDOW_TYPE_TOPLEVEL: