mirror of
https://github.com/brl/mutter.git
synced 2025-04-13 13:49:38 +00: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
f440af2c02
commit
03ddc0cd94
@ -49,6 +49,7 @@
|
||||
#include "xprops.h"
|
||||
#include "workspace-private.h"
|
||||
#include "bell.h"
|
||||
#include "input-events.h"
|
||||
#include <meta/compositor.h>
|
||||
#include <meta/compositor-mutter.h>
|
||||
#include <X11/Xatom.h>
|
||||
@ -1801,6 +1802,7 @@ event_callback (XEvent *event,
|
||||
gboolean frame_was_receiver;
|
||||
gboolean bypass_compositor;
|
||||
gboolean filter_out_event;
|
||||
guint evtype;
|
||||
|
||||
display = data;
|
||||
|
||||
@ -1934,8 +1936,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)
|
||||
{
|
||||
@ -1954,7 +1958,7 @@ event_callback (XEvent *event,
|
||||
}
|
||||
}
|
||||
|
||||
switch (event->type)
|
||||
switch (evtype)
|
||||
{
|
||||
case KeyPress:
|
||||
case KeyRelease:
|
||||
@ -2284,8 +2288,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),
|
||||
@ -2302,14 +2306,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,
|
||||
@ -2320,7 +2324,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)
|
||||
{
|
||||
@ -2335,6 +2339,12 @@ event_callback (XEvent *event,
|
||||
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (event->type)
|
||||
{
|
||||
case KeymapNotify:
|
||||
break;
|
||||
case Expose:
|
||||
@ -2820,6 +2830,7 @@ event_callback (XEvent *event,
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (display->compositor && !bypass_compositor)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user