mirror of
https://github.com/brl/mutter.git
synced 2024-11-22 16:10:41 -05:00
events: Fix get_window_for_event for the new route logic
I forgot to write the new logic for this function.
This commit is contained in:
parent
fb6438cdd4
commit
977de8c5d4
@ -43,23 +43,35 @@ static MetaWindow *
|
|||||||
get_window_for_event (MetaDisplay *display,
|
get_window_for_event (MetaDisplay *display,
|
||||||
const ClutterEvent *event)
|
const ClutterEvent *event)
|
||||||
{
|
{
|
||||||
ClutterActor *source;
|
switch (display->event_route)
|
||||||
|
|
||||||
/* Always use the key focused window for key events. */
|
|
||||||
switch (event->type)
|
|
||||||
{
|
{
|
||||||
case CLUTTER_KEY_PRESS:
|
case META_EVENT_ROUTE_NORMAL:
|
||||||
case CLUTTER_KEY_RELEASE:
|
{
|
||||||
return display->focus_window;
|
ClutterActor *source;
|
||||||
|
|
||||||
|
/* Always use the key focused window for key events. */
|
||||||
|
switch (event->type)
|
||||||
|
{
|
||||||
|
case CLUTTER_KEY_PRESS:
|
||||||
|
case CLUTTER_KEY_RELEASE:
|
||||||
|
return display->focus_window;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
source = clutter_event_get_source (event);
|
||||||
|
if (META_IS_SURFACE_ACTOR (source))
|
||||||
|
return meta_surface_actor_get_window (META_SURFACE_ACTOR (source));
|
||||||
|
else
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
case META_EVENT_ROUTE_WAYLAND_POPUP:
|
||||||
|
case META_EVENT_ROUTE_WINDOW_OP:
|
||||||
|
case META_EVENT_ROUTE_COMPOSITOR_GRAB:
|
||||||
|
return display->grab_window;
|
||||||
default:
|
default:
|
||||||
break;
|
g_assert_not_reached ();
|
||||||
}
|
}
|
||||||
|
|
||||||
source = clutter_event_get_source (event);
|
|
||||||
if (META_IS_SURFACE_ACTOR (source))
|
|
||||||
return meta_surface_actor_get_window (META_SURFACE_ACTOR (source));
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
Reference in New Issue
Block a user