wayland: Move away from MetaEventRoute

Use the current grab op for the same effect.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2683>
This commit is contained in:
Carlos Garnacho 2022-09-30 12:54:58 +02:00 committed by Marge Bot
parent ee94b07159
commit 6bd4468b25
2 changed files with 13 additions and 33 deletions

View File

@ -327,24 +327,16 @@ sync_focus_surface (MetaWaylandPointer *pointer)
return;
}
switch (display->event_route)
if (display->grab_op == META_GRAB_OP_NONE)
{
const MetaWaylandPointerGrabInterface *interface = pointer->grab->interface;
interface->focus (pointer->grab, pointer->current);
}
else
{
case META_EVENT_ROUTE_WINDOW_OP:
/* The compositor has a grab, so remove our focus... */
meta_wayland_pointer_set_focus (pointer, NULL);
break;
case META_EVENT_ROUTE_NORMAL:
{
const MetaWaylandPointerGrabInterface *interface = pointer->grab->interface;
interface->focus (pointer->grab, pointer->current);
}
break;
default:
g_assert_not_reached ();
}
}
static void
@ -504,15 +496,8 @@ default_grab_focus (MetaWaylandPointerGrab *grab,
if (pointer->button_count > 0)
return;
switch (display->event_route)
{
case META_EVENT_ROUTE_WINDOW_OP:
return;
break;
case META_EVENT_ROUTE_NORMAL:
break;
}
if (display->grab_op != META_GRAB_OP_NONE)
return;
if (surface)
{

View File

@ -585,19 +585,14 @@ sync_focus_surface (MetaWaylandTabletTool *tool,
return;
}
switch (display->event_route)
if (display->grab_op == META_GRAB_OP_NONE)
{
meta_wayland_tablet_tool_set_focus (tool, tool->current, event);
}
else
{
case META_EVENT_ROUTE_WINDOW_OP:
/* The compositor has a grab, so remove our focus */
meta_wayland_tablet_tool_set_focus (tool, NULL, event);
break;
case META_EVENT_ROUTE_NORMAL:
meta_wayland_tablet_tool_set_focus (tool, tool->current, event);
break;
default:
g_assert_not_reached ();
}
}