mirror of
https://github.com/brl/mutter.git
synced 2025-02-26 01:34:09 +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
38a0aecf61
commit
d381c0465b
@ -48,6 +48,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 <X11/Xatom.h>
|
#include <X11/Xatom.h>
|
||||||
#include <X11/cursorfont.h>
|
#include <X11/cursorfont.h>
|
||||||
@ -1579,6 +1580,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;
|
||||||
|
|
||||||
@ -1715,8 +1717,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)
|
||||||
{
|
{
|
||||||
@ -1735,7 +1739,7 @@ event_callback (XEvent *event,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (event->type)
|
switch (evtype)
|
||||||
{
|
{
|
||||||
case KeyPress:
|
case KeyPress:
|
||||||
case KeyRelease:
|
case KeyRelease:
|
||||||
@ -2087,8 +2091,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),
|
||||||
@ -2105,14 +2109,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,
|
||||||
@ -2123,7 +2127,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)
|
||||||
{
|
{
|
||||||
@ -2135,9 +2139,14 @@ event_callback (XEvent *event,
|
|||||||
NULL,
|
NULL,
|
||||||
meta_display_get_current_time_roundtrip (display));
|
meta_display_get_current_time_roundtrip (display));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
switch (event->type)
|
||||||
|
{
|
||||||
case KeymapNotify:
|
case KeymapNotify:
|
||||||
break;
|
break;
|
||||||
case Expose:
|
case Expose:
|
||||||
@ -2626,6 +2635,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