aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfgang Bauer <[email protected]>2015-08-04 19:51:05 +0200
committerWolfgang Bauer <[email protected]>2015-08-04 19:51:05 +0200
commit46f1055ffdcd2e068296576a7824012f42e9b9a8 (patch)
tree8bd928a61b48303f5d5f71d132267e70af337e36
parent9212cfc655eb9de48897de9c02d93f7e199bae9a (diff)
Fix input focus for KDM's dialogs when GrabInput is not active
Commit d03df616 made input grabbing optional in KDM. But without it, input dialogs do not correctly get focus and keyboard shortcuts don't work. KDM does call activateWindow() on opened dialogs, but this doesn't seem to have the desired effect without a window manager running. And if you hover the mouse over a widget, it visually looks like it has focus, but often it doesn't accept input anyway. This patch sets the input focus via XSetInputFocus() instead, this also has the positive side-effect that a widget retains the focus if you move the mouse away. BUG: 268988 BUG: 338018 REVIEW: 121755
-rw-r--r--kdm/kfrontend/kfdialog.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/kdm/kfrontend/kfdialog.cpp b/kdm/kfrontend/kfdialog.cpp
index 3f6fa84..237545c 100644
--- a/kdm/kfrontend/kfdialog.cpp
+++ b/kdm/kfrontend/kfdialog.cpp
@@ -149,7 +149,7 @@ FDialog::exec()
if (_grabInput)
fakeFocusIn(winId());
else
- activateWindow();
+ XSetInputFocus(QX11Info::display(), winId(), RevertToParent, CurrentTime);
QWidget *previous = current;
current = this;
inherited::exec();
@@ -158,7 +158,7 @@ FDialog::exec()
if (_grabInput)
fakeFocusIn(current->winId());
else
- current->activateWindow();
+ XSetInputFocus(QX11Info::display(), current->winId(), RevertToParent, CurrentTime);
} else {
if (_grabInput)
unsecureInputs(QX11Info::display());