mirror of
https://github.com/brl/mutter.git
synced 2024-11-28 02:50:41 -05:00
display: separate input/non-input events handling in the event callback
We now use meta_input_event_get_type() to discern input events from the others. This commit has involved plenty of indenting changes, so it's better seen with git diff -b.
This commit is contained in:
parent
38a0aecf61
commit
d381c0465b
@ -48,6 +48,7 @@
|
||||
#include "xprops.h"
|
||||
#include "workspace-private.h"
|
||||
#include "bell.h"
|
||||
#include "input-events.h"
|
||||
#include <meta/compositor.h>
|
||||
#include <X11/Xatom.h>
|
||||
#include <X11/cursorfont.h>
|
||||
@ -1579,6 +1580,7 @@ event_callback (XEvent *event,
|
||||
gboolean frame_was_receiver;
|
||||
gboolean bypass_compositor;
|
||||
gboolean filter_out_event;
|
||||
guint evtype;
|
||||
|
||||
display = data;
|
||||
|
||||
@ -1715,8 +1717,10 @@ event_callback (XEvent *event,
|
||||
}
|
||||
#endif /* HAVE_SHAPE */
|
||||
|
||||
if (meta_input_event_get_type (display, event, &evtype))
|
||||
{
|
||||
if (window && !window->override_redirect &&
|
||||
((event->type == KeyPress) || (event->type == ButtonPress)))
|
||||
((evtype == KeyPress) || (evtype == ButtonPress)))
|
||||
{
|
||||
if (CurrentTime == display->current_time)
|
||||
{
|
||||
@ -1735,7 +1739,7 @@ event_callback (XEvent *event,
|
||||
}
|
||||
}
|
||||
|
||||
switch (event->type)
|
||||
switch (evtype)
|
||||
{
|
||||
case KeyPress:
|
||||
case KeyRelease:
|
||||
@ -2087,8 +2091,8 @@ event_callback (XEvent *event,
|
||||
meta_topic (META_DEBUG_FOCUS,
|
||||
"Focus %s event received on no_focus_window 0x%lx "
|
||||
"mode %s detail %s\n",
|
||||
event->type == FocusIn ? "in" :
|
||||
event->type == FocusOut ? "out" :
|
||||
evtype == FocusIn ? "in" :
|
||||
evtype == FocusOut ? "out" :
|
||||
"???",
|
||||
event->xany.window,
|
||||
meta_event_mode_to_string (event->xfocus.mode),
|
||||
@ -2105,14 +2109,14 @@ event_callback (XEvent *event,
|
||||
meta_topic (META_DEBUG_FOCUS,
|
||||
"Focus %s event received on root window 0x%lx "
|
||||
"mode %s detail %s\n",
|
||||
event->type == FocusIn ? "in" :
|
||||
event->type == FocusOut ? "out" :
|
||||
evtype == FocusIn ? "in" :
|
||||
evtype == FocusOut ? "out" :
|
||||
"???",
|
||||
event->xany.window,
|
||||
meta_event_mode_to_string (event->xfocus.mode),
|
||||
meta_event_detail_to_string (event->xfocus.detail));
|
||||
|
||||
if (event->type == FocusIn &&
|
||||
if (evtype == FocusIn &&
|
||||
event->xfocus.detail == NotifyDetailNone)
|
||||
{
|
||||
meta_topic (META_DEBUG_FOCUS,
|
||||
@ -2123,7 +2127,7 @@ event_callback (XEvent *event,
|
||||
NULL,
|
||||
meta_display_get_current_time_roundtrip (display));
|
||||
}
|
||||
else if (event->type == FocusIn &&
|
||||
else if (evtype == FocusIn &&
|
||||
event->xfocus.mode == NotifyNormal &&
|
||||
event->xfocus.detail == NotifyInferior)
|
||||
{
|
||||
@ -2135,9 +2139,14 @@ event_callback (XEvent *event,
|
||||
NULL,
|
||||
meta_display_get_current_time_roundtrip (display));
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (event->type)
|
||||
{
|
||||
case KeymapNotify:
|
||||
break;
|
||||
case Expose:
|
||||
@ -2626,6 +2635,7 @@ event_callback (XEvent *event,
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (display->compositor && !bypass_compositor)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user