mirror of
https://github.com/brl/mutter.git
synced 2024-11-28 02:50:41 -05:00
display: Get the right window/time for input events
This commit is contained in:
parent
d381c0465b
commit
dc4ecdd0d2
@ -2657,15 +2657,11 @@ static Window
|
|||||||
event_get_modified_window (MetaDisplay *display,
|
event_get_modified_window (MetaDisplay *display,
|
||||||
XEvent *event)
|
XEvent *event)
|
||||||
{
|
{
|
||||||
|
if (meta_input_event_get_type (display, event, NULL))
|
||||||
|
return meta_input_event_get_window (display, event);
|
||||||
|
|
||||||
switch (event->type)
|
switch (event->type)
|
||||||
{
|
{
|
||||||
case KeyPress:
|
|
||||||
case KeyRelease:
|
|
||||||
case ButtonPress:
|
|
||||||
case ButtonRelease:
|
|
||||||
case MotionNotify:
|
|
||||||
case FocusIn:
|
|
||||||
case FocusOut:
|
|
||||||
case KeymapNotify:
|
case KeymapNotify:
|
||||||
case Expose:
|
case Expose:
|
||||||
case GraphicsExpose:
|
case GraphicsExpose:
|
||||||
@ -2678,8 +2674,6 @@ event_get_modified_window (MetaDisplay *display,
|
|||||||
case SelectionNotify:
|
case SelectionNotify:
|
||||||
case ColormapNotify:
|
case ColormapNotify:
|
||||||
case ClientMessage:
|
case ClientMessage:
|
||||||
case EnterNotify:
|
|
||||||
case LeaveNotify:
|
|
||||||
return event->xany.window;
|
return event->xany.window;
|
||||||
|
|
||||||
case CreateNotify:
|
case CreateNotify:
|
||||||
@ -2736,19 +2730,11 @@ static guint32
|
|||||||
event_get_time (MetaDisplay *display,
|
event_get_time (MetaDisplay *display,
|
||||||
XEvent *event)
|
XEvent *event)
|
||||||
{
|
{
|
||||||
|
if (meta_input_event_get_type (display, event, NULL))
|
||||||
|
return meta_input_event_get_time (display, event);
|
||||||
|
|
||||||
switch (event->type)
|
switch (event->type)
|
||||||
{
|
{
|
||||||
case KeyPress:
|
|
||||||
case KeyRelease:
|
|
||||||
return event->xkey.time;
|
|
||||||
|
|
||||||
case ButtonPress:
|
|
||||||
case ButtonRelease:
|
|
||||||
return event->xbutton.time;
|
|
||||||
|
|
||||||
case MotionNotify:
|
|
||||||
return event->xmotion.time;
|
|
||||||
|
|
||||||
case PropertyNotify:
|
case PropertyNotify:
|
||||||
return event->xproperty.time;
|
return event->xproperty.time;
|
||||||
|
|
||||||
@ -2757,12 +2743,6 @@ event_get_time (MetaDisplay *display,
|
|||||||
case SelectionNotify:
|
case SelectionNotify:
|
||||||
return event->xselection.time;
|
return event->xselection.time;
|
||||||
|
|
||||||
case EnterNotify:
|
|
||||||
case LeaveNotify:
|
|
||||||
return event->xcrossing.time;
|
|
||||||
|
|
||||||
case FocusIn:
|
|
||||||
case FocusOut:
|
|
||||||
case KeymapNotify:
|
case KeymapNotify:
|
||||||
case Expose:
|
case Expose:
|
||||||
case GraphicsExpose:
|
case GraphicsExpose:
|
||||||
|
Loading…
Reference in New Issue
Block a user