diff options
author | Błażej Szczygieł <spaz16@wp.pl> | 2016-06-10 00:11:35 +0200 |
---|---|---|
committer | Błażej Szczygieł <spaz16@wp.pl> | 2016-07-28 18:16:01 +0000 |
commit | 444ba31a0a68421ee9ff7de788f6026599202455 (patch) | |
tree | 06f283ea02afa64987e2e9c87ea56c65761aecc5 /src | |
parent | f5af4428c3ede16c742df7890bc5f5ebf8ed2535 (diff) |
xcb: Don't activate bypassed windows on mouse press
Windows with "Qt::BypassWindowManagerHint" flag can't be activated by
mouse. They can be activated only from code calling "activateWindow()"
or "requestActivate()" methods.
The patch applies also for "Qt::ToolTip" and "Qt::Popup" windows which
have implicit "Qt::BypassWindowManagerHint" flag.
The patch fixes some major issues:
- don't activate tooltips on mouse press - this causes that Qt "thinks"
that original windows loses its focus causing e.g. that text cursor
stops blinking,
- don't activate X11 tray icon - this causes that the active window
looses its focus by clicking tray icon.
The patch restores the Qt4 behavior.
Task-number: QTBUG-53993
Change-Id: I80b226f2f5ea0ebbfe8922c90d9da9f4132e8cce
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbwindow.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp index 0c2f0d7c4d..b5cde141f1 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.cpp +++ b/src/plugins/platforms/xcb/qxcbwindow.cpp @@ -2201,8 +2201,11 @@ void QXcbWindow::handleButtonPressEvent(int event_x, int event_y, int root_x, in const bool isWheel = detail >= 4 && detail <= 7; if (!isWheel && window() != QGuiApplication::focusWindow()) { QWindow *w = static_cast<QWindowPrivate *>(QObjectPrivate::get(window()))->eventReceiver(); - if (!(w->flags() & Qt::WindowDoesNotAcceptFocus)) + if (!(w->flags() & (Qt::WindowDoesNotAcceptFocus | Qt::BypassWindowManagerHint)) + && w->type() != Qt::ToolTip + && w->type() != Qt::Popup) { w->requestActivate(); + } } updateNetWmUserTime(timestamp); |