From ba88d460538b5fd8f0378064ed4b3733a687a307 Mon Sep 17 00:00:00 2001 From: tadam Date: Thu, 31 Dec 2009 17:35:47 +0000 Subject: [PATCH] Add "BugOpts QtDragnDropWorkaround" This adds an option to not forward unknown ClientEvents to windows -- in the case of Qt, this is needed for workable Drag-n-drop where Qt seems to not be able to handle the messages in its queue as they come from XSendEvent(). --- ChangeLog | 9 ++++++++- NEWS | 2 ++ doc/ChangeLog | 4 ++++ doc/commands/BugOpts.xml | 8 +++++++- fvwm/builtins.c | 18 ++++++++++++++++++ fvwm/events.c | 7 ++++++- fvwm/fvwm.c | 1 + fvwm/screen.h | 1 + 8 files changed, 47 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 33bc9c50a..6d67cce9c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,11 @@ -2009-12-39 Thomas Adam +2009-12-31 Thomas Adam + * fvwm/builtins.c (CMD_BugOpts): + * fvwm/fvwm.c (InitVariables): + * fvwm/screen.h: + Add new BugOpts QtDragnDropWorkaround option to handle an oddity in how + Qt windows handle having ClientMessage events sent to them. + +2009-12-30 Thomas Adam * fvwm/placement.c (__pl_minoverlap_get_pos_penalty): Fix y-axis offset calculations when using MinOverlapPlacement, by forcing the window on-screen when over-zealous penality calculations diff --git a/NEWS b/NEWS index 3ed47578d..cc35927b9 100644 --- a/NEWS +++ b/NEWS @@ -8,6 +8,8 @@ Changes in beta release 2.5.29 (not released yet) - Added new fvwm-convert-2.6 script to convert older fvwm 2.4.x config files. + - New option "BugOpts QtDragnDropWorkaround" to work around an oddity in + handling drag-n-drop events to Qt applications. * Bug fixes: - Fixed the InitialMapCommand style from running when FVWM diff --git a/doc/ChangeLog b/doc/ChangeLog index 474a13912..9ef6a72ee 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,7 @@ +2009-12-31 Thomas Adam + * commands/BugOpts.xml: + New option "QtDragnDropWorkaround" to BugOpts. + 2009-08-19 Viktor Griph * commands/BugOpts.xml: diff --git a/doc/commands/BugOpts.xml b/doc/commands/BugOpts.xml index cbfd8b344..643a59c29 100644 --- a/doc/commands/BugOpts.xml +++ b/doc/commands/BugOpts.xml @@ -6,7 +6,7 @@ %myents; ]> - +
BugOpts @@ -82,6 +82,12 @@ visually disturbing for other applications using windows not managed by fvwm. Since these applications are rare it is most likely safe to leave this option at its default. + +surpresses the forwarding of unknown ClientEvent messages to windows -- +usually this is harmless, but Qt has problems handling unrecognised +ClientEvent messages. Enabling this option might therefore help for Qt +applications using DragnDrop. This option is off by default. + is needed by EWMH compliant pagers or taskbars which represent windows which are on a different desktops as iconified. These diff --git a/fvwm/builtins.c b/fvwm/builtins.c index b93a30f95..5811b4c99 100644 --- a/fvwm/builtins.c +++ b/fvwm/builtins.c @@ -3658,6 +3658,24 @@ void CMD_BugOpts(F_CMD_ARGS) break; } } + else if (StrEquals(opt, "QtDragnDropWorkaround") ) + { + switch (toggle) + { + case -1: + Scr.bo.do_enable_qt_drag_n_drop_workaround ^= 1; + break; + case 0: + case 1: + Scr.bo.do_enable_qt_drag_n_drop_workaround = toggle; + break; + default: + Scr.bo.do_enable_qt_drag_n_drop_workaround = 0; + break; + } + fprintf(stderr, "BugOpts QtDragnDropWorkaround: %d\n", + Scr.bo.do_enable_qt_drag_n_drop_workaround); + } else if (EWMH_BugOpts(opt, toggle)) { /* work is done in EWMH_BugOpts */ diff --git a/fvwm/events.c b/fvwm/events.c index b89efae9e..93b480e83 100644 --- a/fvwm/events.c +++ b/fvwm/events.c @@ -1843,9 +1843,14 @@ void HandleClientMessage(const evh_args_t *ea) * sure this should be done or not, since every other window manager * I've looked at doesn't. But it might be handy for a free drag and * drop setup being developed for Linux. */ + /* TA: 20091231 - But this confuses QT Drag and Drop since it handles + * processing XSendEvents in an odd order. For now, workaround this + * by using a BugOpts option. + */ if (fw) { - if (te->xclient.window != FW_W(fw)) + if ((!Scr.bo.do_enable_qt_drag_n_drop_workaround) && + (te->xclient.window != FW_W(fw))) { XEvent e; diff --git a/fvwm/fvwm.c b/fvwm/fvwm.c index 7096baa04..710f5ecb4 100644 --- a/fvwm/fvwm.c +++ b/fvwm/fvwm.c @@ -1211,6 +1211,7 @@ static void InitVariables(void) Scr.bo.do_disable_configure_notify = 0; Scr.bo.do_install_root_cmap = 0; Scr.bo.do_enable_flickering_qt_dialogs_workaround = 1; + Scr.bo.do_enable_qt_drag_n_drop_workaround = 0; Scr.bo.do_enable_ewmh_iconic_state_workaround = 0; Scr.gs.do_emulate_mwm = DEFAULT_EMULATE_MWM; diff --git a/fvwm/screen.h b/fvwm/screen.h index cbc4b19cc..40aaf2cf6 100644 --- a/fvwm/screen.h +++ b/fvwm/screen.h @@ -477,6 +477,7 @@ typedef struct ScreenInfo unsigned do_display_new_window_names : 1; unsigned do_enable_ewmh_iconic_state_workaround : 1; unsigned do_enable_flickering_qt_dialogs_workaround : 1; + unsigned do_enable_qt_drag_n_drop_workaround : 1; unsigned do_explain_window_placement : 1; unsigned do_install_root_cmap : 1; unsigned do_raise_over_unmanaged : 1; -- 2.11.4.GIT