mirror of
https://github.com/brl/mutter.git
synced 2024-11-13 01:36:10 -05:00
display: Move barrier event processing to barrier.c
This puts all the code that's easily ported to Clutter events in one giant switch statement, as Clutter doesn't translate barrier events.
This commit is contained in:
parent
64a848fcb7
commit
84d26e31f1
@ -366,11 +366,25 @@ meta_barrier_fire_event (MetaBarrier *barrier,
|
||||
}
|
||||
|
||||
gboolean
|
||||
meta_display_process_barrier_event (MetaDisplay *display,
|
||||
XIBarrierEvent *xev)
|
||||
meta_display_process_barrier_event (MetaDisplay *display,
|
||||
XIEvent *event)
|
||||
{
|
||||
MetaBarrier *barrier;
|
||||
XIBarrierEvent *xev;
|
||||
|
||||
if (event == NULL)
|
||||
return FALSE;
|
||||
|
||||
switch (event->evtype)
|
||||
{
|
||||
case XI_BarrierHit:
|
||||
case XI_BarrierLeave:
|
||||
break;
|
||||
default:
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
xev = (XIBarrierEvent *) event;
|
||||
barrier = g_hash_table_lookup (display->xids, &xev->barrier);
|
||||
if (barrier != NULL)
|
||||
{
|
||||
|
@ -486,8 +486,8 @@ gboolean meta_display_handle_xevent (MetaDisplay *display,
|
||||
XEvent *event);
|
||||
|
||||
#ifdef HAVE_XI23
|
||||
gboolean meta_display_process_barrier_event (MetaDisplay *display,
|
||||
XIBarrierEvent *event);
|
||||
gboolean meta_display_process_barrier_event (MetaDisplay *display,
|
||||
XIEvent *event);
|
||||
#endif /* HAVE_XI23 */
|
||||
|
||||
void meta_display_set_input_focus_xwindow (MetaDisplay *display,
|
||||
|
@ -2407,6 +2407,14 @@ meta_display_handle_xevent (MetaDisplay *display,
|
||||
}
|
||||
#endif /* HAVE_SHAPE */
|
||||
|
||||
#ifdef HAVE_XI23
|
||||
if (meta_display_process_barrier_event (display, input_event))
|
||||
{
|
||||
filter_out_event = bypass_compositor = TRUE;
|
||||
goto out;
|
||||
}
|
||||
#endif /* HAVE_XI23 */
|
||||
|
||||
if (input_event != NULL)
|
||||
{
|
||||
XIDeviceEvent *device_event = (XIDeviceEvent *) input_event;
|
||||
@ -2763,13 +2771,6 @@ meta_display_handle_xevent (MetaDisplay *display,
|
||||
|
||||
}
|
||||
break;
|
||||
#ifdef HAVE_XI23
|
||||
case XI_BarrierHit:
|
||||
case XI_BarrierLeave:
|
||||
if (meta_display_process_barrier_event (display, (XIBarrierEvent *) input_event))
|
||||
filter_out_event = bypass_compositor = TRUE;
|
||||
break;
|
||||
#endif /* HAVE_XI23 */
|
||||
}
|
||||
}
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user