mirror of
https://github.com/brl/mutter.git
synced 2025-04-21 17:39:39 +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 "xprops.h"
|
||||||
#include "workspace-private.h"
|
#include "workspace-private.h"
|
||||||
#include "bell.h"
|
#include "bell.h"
|
||||||
|
#include "input-events.h"
|
||||||
#include <meta/compositor.h>
|
#include <meta/compositor.h>
|
||||||
#include <meta/compositor-mutter.h>
|
#include <meta/compositor-mutter.h>
|
||||||
#include <X11/Xatom.h>
|
#include <X11/Xatom.h>
|
||||||
@ -1801,6 +1802,7 @@ event_callback (XEvent *event,
|
|||||||
gboolean frame_was_receiver;
|
gboolean frame_was_receiver;
|
||||||
gboolean bypass_compositor;
|
gboolean bypass_compositor;
|
||||||
gboolean filter_out_event;
|
gboolean filter_out_event;
|
||||||
|
guint evtype;
|
||||||
|
|
||||||
display = data;
|
display = data;
|
||||||
|
|
||||||
@ -1934,8 +1936,10 @@ event_callback (XEvent *event,
|
|||||||
}
|
}
|
||||||
#endif /* HAVE_SHAPE */
|
#endif /* HAVE_SHAPE */
|
||||||
|
|
||||||
|
if (meta_input_event_get_type (display, event, &evtype))
|
||||||
|
{
|
||||||
if (window && !window->override_redirect &&
|
if (window && !window->override_redirect &&
|
||||||
((event->type == KeyPress) || (event->type == ButtonPress)))
|
((evtype == KeyPress) || (evtype == ButtonPress)))
|
||||||
{
|
{
|
||||||
if (CurrentTime == display->current_time)
|
if (CurrentTime == display->current_time)
|
||||||
{
|
{
|
||||||
@ -1954,7 +1958,7 @@ event_callback (XEvent *event,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (event->type)
|
switch (evtype)
|
||||||
{
|
{
|
||||||
case KeyPress:
|
case KeyPress:
|
||||||
case KeyRelease:
|
case KeyRelease:
|
||||||
@ -2284,8 +2288,8 @@ event_callback (XEvent *event,
|
|||||||
meta_topic (META_DEBUG_FOCUS,
|
meta_topic (META_DEBUG_FOCUS,
|
||||||
"Focus %s event received on no_focus_window 0x%lx "
|
"Focus %s event received on no_focus_window 0x%lx "
|
||||||
"mode %s detail %s\n",
|
"mode %s detail %s\n",
|
||||||
event->type == FocusIn ? "in" :
|
evtype == FocusIn ? "in" :
|
||||||
event->type == FocusOut ? "out" :
|
evtype == FocusOut ? "out" :
|
||||||
"???",
|
"???",
|
||||||
event->xany.window,
|
event->xany.window,
|
||||||
meta_event_mode_to_string (event->xfocus.mode),
|
meta_event_mode_to_string (event->xfocus.mode),
|
||||||
@ -2302,14 +2306,14 @@ event_callback (XEvent *event,
|
|||||||
meta_topic (META_DEBUG_FOCUS,
|
meta_topic (META_DEBUG_FOCUS,
|
||||||
"Focus %s event received on root window 0x%lx "
|
"Focus %s event received on root window 0x%lx "
|
||||||
"mode %s detail %s\n",
|
"mode %s detail %s\n",
|
||||||
event->type == FocusIn ? "in" :
|
evtype == FocusIn ? "in" :
|
||||||
event->type == FocusOut ? "out" :
|
evtype == FocusOut ? "out" :
|
||||||
"???",
|
"???",
|
||||||
event->xany.window,
|
event->xany.window,
|
||||||
meta_event_mode_to_string (event->xfocus.mode),
|
meta_event_mode_to_string (event->xfocus.mode),
|
||||||
meta_event_detail_to_string (event->xfocus.detail));
|
meta_event_detail_to_string (event->xfocus.detail));
|
||||||
|
|
||||||
if (event->type == FocusIn &&
|
if (evtype == FocusIn &&
|
||||||
event->xfocus.detail == NotifyDetailNone)
|
event->xfocus.detail == NotifyDetailNone)
|
||||||
{
|
{
|
||||||
meta_topic (META_DEBUG_FOCUS,
|
meta_topic (META_DEBUG_FOCUS,
|
||||||
@ -2320,7 +2324,7 @@ event_callback (XEvent *event,
|
|||||||
NULL,
|
NULL,
|
||||||
meta_display_get_current_time_roundtrip (display));
|
meta_display_get_current_time_roundtrip (display));
|
||||||
}
|
}
|
||||||
else if (event->type == FocusIn &&
|
else if (evtype == FocusIn &&
|
||||||
event->xfocus.mode == NotifyNormal &&
|
event->xfocus.mode == NotifyNormal &&
|
||||||
event->xfocus.detail == NotifyInferior)
|
event->xfocus.detail == NotifyInferior)
|
||||||
{
|
{
|
||||||
@ -2335,6 +2339,12 @@ event_callback (XEvent *event,
|
|||||||
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
switch (event->type)
|
||||||
|
{
|
||||||
case KeymapNotify:
|
case KeymapNotify:
|
||||||
break;
|
break;
|
||||||
case Expose:
|
case Expose:
|
||||||
@ -2820,6 +2830,7 @@ event_callback (XEvent *event,
|
|||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (display->compositor && !bypass_compositor)
|
if (display->compositor && !bypass_compositor)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user