display: get button events state from helper functions

This commit is contained in:
Carlos Garnacho 2011-06-08 18:57:28 +02:00
parent 166559059a
commit 4c4f21c001

View File

@ -1721,7 +1721,7 @@ event_callback (XEvent *event,
{ {
Window xwindow = meta_input_event_get_window (display, event); Window xwindow = meta_input_event_get_window (display, event);
Time evtime = meta_input_event_get_time (display, event); Time evtime = meta_input_event_get_time (display, event);
guint n_button; guint n_button, state;
if (window && !window->override_redirect && if (window && !window->override_redirect &&
((evtype == KeyPress) || (evtype == ButtonPress))) ((evtype == KeyPress) || (evtype == ButtonPress)))
@ -1761,6 +1761,7 @@ event_callback (XEvent *event,
break; break;
case ButtonPress: case ButtonPress:
meta_input_event_get_button (display, event, &n_button); meta_input_event_get_button (display, event, &n_button);
meta_input_event_get_state (display, event, &state);
if (display->grab_op == META_GRAB_OP_COMPOSITOR) if (display->grab_op == META_GRAB_OP_COMPOSITOR)
break; break;
@ -1810,7 +1811,7 @@ event_callback (XEvent *event,
* frame, the other is our focus_window_grab on unmodified * frame, the other is our focus_window_grab on unmodified
* button 1. So for all such events we focus the window. * button 1. So for all such events we focus the window.
*/ */
unmodified = (event->xbutton.state & grab_mask) == 0; unmodified = (state & grab_mask) == 0;
if (unmodified || n_button == 1) if (unmodified || n_button == 1)
{ {