diff options
Diffstat (limited to 'src/gui/kernel')
-rw-r--r-- | src/gui/kernel/qapplication.cpp | 3 | ||||
-rw-r--r-- | src/gui/kernel/qdnd_x11.cpp | 21 |
2 files changed, 22 insertions, 2 deletions
diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index 57c4c99..0d11b27 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -666,7 +666,8 @@ void QApplicationPrivate::process_cmdline() \o -geometry \e geometry, sets the client geometry of the first window that is shown. \o -fn or \c -font \e font, defines the application font. The font - should be specified using an X logical font description. + should be specified using an X logical font description. Note that + this option is ignored when Qt is built with fontconfig support enabled. \o -bg or \c -background \e color, sets the default background color and an application palette (light and dark shades are calculated). \o -fg or \c -foreground \e color, sets the default foreground color. diff --git a/src/gui/kernel/qdnd_x11.cpp b/src/gui/kernel/qdnd_x11.cpp index 2b12317..92dd0a1 100644 --- a/src/gui/kernel/qdnd_x11.cpp +++ b/src/gui/kernel/qdnd_x11.cpp @@ -64,6 +64,7 @@ #include "qtextcodec.h" #include "qdnd_p.h" +#include "qapplication_p.h" #include "qt_x11_p.h" #include "qx11info_x11.h" @@ -1111,7 +1112,20 @@ void qt_xdnd_send_leave() waiting_for_status = false; } - +// TODO: remove and use QApplication::currentKeyboardModifiers() in Qt 4.8. +static Qt::KeyboardModifiers currentKeyboardModifiers() +{ + Window root; + Window child; + int root_x, root_y, win_x, win_y; + uint keybstate; + for (int i = 0; i < ScreenCount(X11->display); ++i) { + if (XQueryPointer(X11->display, QX11Info::appRootWindow(i), &root, &child, + &root_x, &root_y, &win_x, &win_y, &keybstate)) + return X11->translateModifiers(keybstate & 0x00ff); + } + return 0; +} void QX11Data::xdndHandleDrop(QWidget *, const XEvent * xe, bool passive) { @@ -1159,6 +1173,11 @@ void QX11Data::xdndHandleDrop(QWidget *, const XEvent * xe, bool passive) if (!dropData) dropData = (manager->object) ? manager->dragPrivate()->data : manager->dropData; + // Drop coming from another app? Update keyboard modifiers. + if (!qt_xdnd_dragging) { + QApplicationPrivate::modifier_buttons = currentKeyboardModifiers(); + } + QDropEvent de(qt_xdnd_current_position, possible_actions, dropData, QApplication::mouseButtons(), QApplication::keyboardModifiers()); QApplication::sendEvent(qt_xdnd_current_widget, &de); |