diff options
| author | Dana Jansens <danakj@orodu.net> | 2008-02-02 11:36:17 -0500 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2008-02-02 11:37:35 -0500 |
| commit | 0dc7eca4cdfff6425e19a0bace0f9ae8834d04e8 (patch) | |
| tree | 0fe4df591efed9b1d50607ac1ec1d45565714403 /openbox/mouse.c | |
| parent | 76fcb473fa801728badf916cfebe349822759056 (diff) | |
| parent | 746859c1017e9cdf73eb91470e795f0c4b98b21a (diff) | |
Merge branch 'backport' into work
Conflicts:
openbox/client.c
openbox/event.c
openbox/mouse.c
openbox/openbox.c
openbox/prop.c
openbox/prop.h
openbox/screen.c
parser/parse.c
parser/parse.h
Diffstat (limited to 'openbox/mouse.c')
| -rw-r--r-- | openbox/mouse.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/openbox/mouse.c b/openbox/mouse.c index dca6e6ba..b2893cee 100644 --- a/openbox/mouse.c +++ b/openbox/mouse.c @@ -224,6 +224,17 @@ void mouse_event(ObClient *client, XEvent *e) button = e->xbutton.button; state = e->xbutton.state; + /* if the binding was in a client context, then we need to call + XAllowEvents with ReplayPointer at some point, to send the event + through to the client. when this happens though depends. if + windows are going to be moved on screen, then the click will end + up going somewhere wrong, so have the action system perform the + ReplayPointer for us if that is the case. */ + if (CLIENT_CONTEXT(context, client)) + actions_set_need_pointer_replay_before_move(TRUE); + else + actions_set_need_pointer_replay_before_move(FALSE); + fire_binding(OB_MOUSE_ACTION_PRESS, context, client, e->xbutton.state, e->xbutton.button, @@ -234,11 +245,14 @@ void mouse_event(ObClient *client, XEvent *e) if (grab_on_pointer()) button = 0; - if (CLIENT_CONTEXT(context, client)) { - /* Replay the event, so it goes to the client*/ + /* replay the pointer event if it hasn't been replayed yet (i.e. no + windows were moved) */ + if (actions_get_need_pointer_replay_before_move()) XAllowEvents(obt_display, ReplayPointer, event_curtime); - /* Fall through to the release case! */ - } else + + /* in the client context, we won't get a button release because of the + way it is grabbed, so just fake one */ + if (!CLIENT_CONTEXT(context, client)) break; case ButtonRelease: |
