summaryrefslogtreecommitdiff
path: root/frame.c
diff options
context:
space:
mode:
Diffstat (limited to 'frame.c')
-rw-r--r--frame.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/frame.c b/frame.c
index e750211..793bace 100644
--- a/frame.c
+++ b/frame.c
@@ -731,14 +731,10 @@ static void recalc_size( struct gwm_window *window, int x, int y,
static void frame_button_press( struct gwm_window *window,
xcb_button_press_event_t *ev ) {
- if( !initial_press( ev ) )
+ if( pointer_demux || ev->child == window->u.frame.child->w )
return;
- if( ev->child == window->u.frame.child->w ) {
- passive_grab = XCB_NONE;
-
- return;
- }
+ pointer_demux = window->w;
window_op = ( ev->detail > 1 ) ==
( ( window->u.frame.decoration & DEC_TITLE ) &&
@@ -768,7 +764,7 @@ static void frame_motion_notify( struct gwm_window *window,
uint32_t values[ 2 ];
- if( window->w != passive_grab )
+ if( !pointer_demux )
return;
/* Hint to the server that we're ready for further motion events. */
@@ -841,7 +837,7 @@ static void frame_motion_notify( struct gwm_window *window,
static void frame_button_release( struct gwm_window *window,
xcb_button_release_event_t *ev ) {
- if( !final_release( ev ) || window->w != passive_grab )
+ if( !final_release( ev ) || !pointer_demux )
return;
if( moved )
@@ -859,13 +855,15 @@ static void frame_button_release( struct gwm_window *window,
forget_window( feedback );
feedback = NULL;
}
+
+ pointer_demux = XCB_NONE;
}
static void frame_enter_notify( struct gwm_window *window,
xcb_enter_notify_event_t *ev ) {
uint32_t n;
- if( focus_frame == window )
+ if( pointer_demux || focus_frame == window )
/* We have the focus already -- probably an inferior change or
ungrab. */
return;
@@ -929,7 +927,7 @@ static void frame_enter_notify( struct gwm_window *window,
static void frame_destroy_notify( struct gwm_window *window,
xcb_destroy_notify_event_t *ev ) {
- if( window->w != passive_grab )
+ if( window->w != pointer_demux )
return;
if( moved )