summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2016-05-27 06:20:10 (GMT)
committerTobias Markmann <tm@ayena.de>2016-05-27 06:20:10 (GMT)
commit402d37b3b6cc9cd4a03bc4290d204b4977dbc1d4 (patch)
treebd3beafcdeca466a271758047408ef9fabc37df0 /Swift/QtUI
parentcf90536b5b015289ce8834b5417ba0fc7636cee6 (diff)
downloadswift-402d37b3b6cc9cd4a03bc4290d204b4977dbc1d4.zip
swift-402d37b3b6cc9cd4a03bc4290d204b4977dbc1d4.tar.bz2
Fix QtSuggestingJIDInput popup behavior on OS X
QtSuggestingJIDInput is used by the 'Start Chat…' dialog and other dialogs. Keyboard usage of the widget works fine. Clicking on a suggested item via touchpad/mouse will correctly select the item. However, when the popup is hidden, the dialog containing the QtSuggestingJIDInput is not the top window but will be in the background instead. With the workaround, the dialog will be on top of the window hierarchy if a suggested item is selected by click. Test-Information: Tested that this workaround is not required on Windows 8 and Ubuntu 16.04. Tested this workaround works on OS X 10.11.5 with Qt 5.4.2. Change-Id: I77f0aa5f92268da1867f61d9f6e1fbc66a724c17
Diffstat (limited to 'Swift/QtUI')
-rw-r--r--Swift/QtUI/UserSearch/QtSuggestingJIDInput.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/Swift/QtUI/UserSearch/QtSuggestingJIDInput.cpp b/Swift/QtUI/UserSearch/QtSuggestingJIDInput.cpp
index d20c285..8c46e38 100644
--- a/Swift/QtUI/UserSearch/QtSuggestingJIDInput.cpp
+++ b/Swift/QtUI/UserSearch/QtSuggestingJIDInput.cpp
@@ -19,6 +19,7 @@
#include <QApplication>
#include <QDesktopWidget>
#include <QKeyEvent>
+#include <QtGlobal>
#include <Swift/Controllers/Settings/SettingsProvider.h>
@@ -204,6 +205,11 @@ void QtSuggestingJIDInput::hidePopup() {
// Give focus back to input widget because the hide() call passes the focus to the wrong widget.
setFocus();
+#if defined(Q_WS_MAC)
+ // This workaround is needed on OS X, to bring the dialog containing this widget back to the front after
+ // the popup is hidden. Ubuntu 16.04 and Windows 8 do not have this issue.
+ window()->raise();
+#endif
}
}