diff options
author | Robert Griebl <rgriebl@trolltech.com> | 2010-03-22 15:00:23 (GMT) |
---|---|---|
committer | Robert Griebl <rgriebl@trolltech.com> | 2010-03-22 15:02:54 (GMT) |
commit | 9cfda3493ce4086313072a216d6a5b4f796c40d3 (patch) | |
tree | 09bd056a81589b1363d422a76631a637895f14d7 /src | |
parent | 0a03e65d9e1722cb055ccce93801e1471e7f6e84 (diff) | |
download | Qt-9cfda3493ce4086313072a216d6a5b4f796c40d3.zip Qt-9cfda3493ce4086313072a216d6a5b4f796c40d3.tar.gz Qt-9cfda3493ce4086313072a216d6a5b4f796c40d3.tar.bz2 |
Add a new WA_X11DoNotAcceptFocus attribute for top-level widgets (part 2).
Forgot the documentation and ignoring WM_TAKE_FOCUS messages for modal
windows in part 1 (9da453e5579ebb6fb0361e4df4cfa7107e560b23)
Reviewed-by: bhughes
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/global/qnamespace.qdoc | 4 | ||||
-rw-r--r-- | src/gui/kernel/qapplication_x11.cpp | 2 |
2 files changed, 6 insertions, 0 deletions
diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc index f8f3c49..775c0f3 100644 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@ -1255,6 +1255,10 @@ window boundary (widget without parent or dialog) is found. This attribute currently has effect only on Symbian platforms + \value WA_X11DoNoAcceptFocus Asks the window manager to not give focus + to this top level window. This attribute has no effect on non-X11 + platforms. + \omitvalue WA_SetLayoutDirection \omitvalue WA_InputMethodTransparent \omitvalue WA_WState_CompressKeys diff --git a/src/gui/kernel/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp index e276ed2..67e0865 100644 --- a/src/gui/kernel/qapplication_x11.cpp +++ b/src/gui/kernel/qapplication_x11.cpp @@ -3060,6 +3060,8 @@ int QApplication::x11ClientMessage(QWidget* w, XEvent* event, bool passive_only) if ((ulong) event->xclient.data.l[1] > X11->time) X11->time = event->xclient.data.l[1]; QWidget *amw = activeModalWidget(); + if (amw && amw->testAttribute(Qt::WA_X11DoNotAcceptFocus)) + amw = 0; if (amw && !QApplicationPrivate::tryModalHelper(widget, 0)) { QWidget *p = amw->parentWidget(); while (p && p != widget) |