The mvwm repository's master branch has been updated. The following shows the diffstat and patchsets between the merged result and HEAD.
commit 6cae365087850d6f60533024af9617a1b4e0bdb5 Merge: 9449e91 0857996 Author: Thomas Adam <[email protected]> Date: Fri Sep 5 15:06:11 2014 +0100 Merge remote-tracking branch 'fvwm/branch-2_6' Conflicts: mvwm/events.c commit 0857996adfde41ba83d393a030dea8cb3959298c Merge: cedbcb6 530f4f8 Author: Thomas Adam <[email protected]> Date: Tue Sep 2 22:47:20 2014 +0100 Merge remote-tracking branch 'cvs/branch-2_6' into branch-2_6 commit 530f4f8c22ffc9bb31749578852f0969bfb06367 Author: domivogt <domivogt> Date: Tue Sep 2 21:32:13 2014 +0000 * Added a comment about GetNextSimpleOption(). --- fvwm/conditional.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fvwm/conditional.c b/fvwm/conditional.c index f0c7f29..b5be475 100644 --- a/fvwm/conditional.c +++ b/fvwm/conditional.c @@ -2095,7 +2095,12 @@ void CMD_Test(F_CMD_ARGS) } char *pattern; /* unfortunately, GetNextSimpleOption is - * broken, does not accept quoted empty "" */ + * broken, does not accept quoted empty "" + * + * DV (2-Sep-2014): It is *not* broken. The + * parsing functions never return empty tokens + * by design. + */ flags_ptr = GetNextSimpleOption( flags_ptr, &pattern); if (!value) commit f0b83a62ce2c4a3b17925787ee94f7201e8659c0 Author: tadam <tadam> Date: Tue Sep 2 21:19:33 2014 +0000 Update passive grabs tracking modifiers In the case of GTK's link widget which doesn't handle passive grabs following FVWM's window bindings (which assumes the underlying application can handle a PointerReplay), update the grabs in this context by always ungrabbing the button and grabbing it for modifiers other than ALL_MODIFIERS. I've had this in testing for three years and recently dusted it off for a bug report I received for another application with this problem, called darktable. --- ChangeLog | 13 +++++++++++++ fvwm/bindings.c | 7 +++++++ fvwm/bindings.h | 1 + fvwm/events.c | 29 +++++++++++++++++++++++++++++ 4 files changed, 50 insertions(+) diff --git a/ChangeLog b/ChangeLog index 5d5bb27..2eda1d8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2014-09-02 Thomas Adam <[email protected]> + * fvwm/bindings.c (active_modifiers): + * fvwm/bindings.h: + * fvwm/events.c (__handle_bpress_on_managed): + * fvwm/events.c (HandleButtonPress): + Update passive grabs tracking modifiers + + In the case of GTK's link widget which doesn't handle passive grabs + following FVWM's window bindings (which assumes the underlying + application can handle a PointerReplay), update the grabs in this + context by always ungrabbing the button and grabbing it for modifiers + other than ALL_MODIFIERS. + 2014-09-02 Dominik Vogt <dominik(dot)vogt(at)gmx(dot)de> * fvwm/builtins.c (CMD_Wait): diff --git a/fvwm/bindings.c b/fvwm/bindings.c index c1aa6af..78bccc7 100644 --- a/fvwm/bindings.c +++ b/fvwm/bindings.c @@ -712,6 +712,13 @@ unsigned int GetUnusedModifiers(void) return mods_unused; } +/* Returns active modifiers. */ +unsigned int active_modifiers(void) +{ + return (~GetUnusedModifiers() & ALL_MODIFIERS); +} + + /* ---------------------------- builtin commands --------------------------- */ void CMD_Key(F_CMD_ARGS) diff --git a/fvwm/bindings.h b/fvwm/bindings.h index e3e6afa..86dd9a1 100644 --- a/fvwm/bindings.h +++ b/fvwm/bindings.h @@ -20,6 +20,7 @@ void update_key_bindings(void); unsigned int MaskUsedModifiers(unsigned int in_modifiers); unsigned int GetUnusedModifiers(void); +unsigned int active_modifiers(void); void print_bindings(void); #endif /* BINDINGS_H */ diff --git a/fvwm/events.c b/fvwm/events.c index dacf167..b87f006 100644 --- a/fvwm/events.c +++ b/fvwm/events.c @@ -66,6 +66,7 @@ #include "libs/Colorset.h" #include "libs/charmap.h" #include "libs/wcontext.h" +#include "libs/modifiers.h" #include "fvwm.h" #include "externs.h" #include "cursor.h" @@ -160,6 +161,7 @@ static const FvwmWindow *xcrossing_last_grab_window = NULL; STROKE_CODE(static int send_motion); STROKE_CODE(static char sequence[STROKE_MAX_SEQUENCE + 1]); static event_group_t *base_event_group = NULL; +static unsigned int event_modifiers = 0; /* ---------------------------- exported variables (globals) --------------- */ @@ -1704,7 +1706,18 @@ static void __handle_bpress_on_managed(const exec_context_t *exc) /* clean up */ if (!f.do_swallow_click) { + event_modifiers = (e->xbutton.state & active_modifiers()); + /* pass the click to the application */ + + /* TA: Ungrab the button based on the modifiers in use, so + * that legitimate button presses aren't ignored. GTK 3.x is + * using passive grabs for some of its link widgets for + * example. + */ + XUngrabButton(dpy, e->xbutton.button, event_modifiers, + FW_W_PARENT(fw)); + XAllowEvents(dpy, ReplayPointer, CurrentTime); XFlush(dpy); } @@ -1744,6 +1757,22 @@ void HandleButtonPress(const evh_args_t *ea) else if (ea->exc->w.fw != NULL) { __handle_bpress_on_managed(ea->exc); + + if (event_modifiers > 0) + { + /* TA: The passive grab was unbound because we sent + * the click to the application. We must restore it + * *AFTER* handling the click from + * __handle_bpress_on_managed() + */ + FvwmWindow* const fw = ea->exc->w.fw; + XEvent *e = ea->exc->x.etrigger; + + XGrabButton(dpy, e->xbutton.button, event_modifiers, + FW_W_PARENT(fw), + False, ButtonPressMask, GrabModeSync, + GrabModeAsync, None, None); + } } else {
