diff options
author | Rohan McGovern <rohan.mcgovern@nokia.com> | 2012-02-29 09:18:59 +1000 |
---|---|---|
committer | Rohan McGovern <rohan.mcgovern@nokia.com> | 2012-02-29 09:23:14 +1000 |
commit | 98dd1781d9256f68025d2a2db408f4f5947f3214 (patch) | |
tree | dbe1424abd90014edb5546c920ca585ed62b46e3 /src/plugins/platforms/xcb/qxcbwindow.cpp | |
parent | 6c1bdc1854a7700c2b3a345b95f6a2fdca84037d (diff) | |
parent | fa1b9070af66edb81b2a3735c1951f78b22bd666 (diff) |
Merge master -> api_changes
Includes fixes for tst_qfiledialog2, tst_qtextedit autotests on mac.
Change-Id: I49cac26894d31291a8339ccc1eb80b6a940f0827
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbwindow.cpp')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbwindow.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp index 43e4a6b7d9..067cb775c8 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.cpp +++ b/src/plugins/platforms/xcb/qxcbwindow.cpp @@ -77,6 +77,7 @@ #define xcb_size_hints_set_win_gravity xcb_icccm_size_hints_set_win_gravity #define xcb_wm_hints_set_iconic xcb_icccm_wm_hints_set_iconic #define xcb_wm_hints_set_normal xcb_icccm_wm_hints_set_normal +#define xcb_wm_hints_set_input xcb_icccm_wm_hints_set_input #define xcb_wm_hints_t xcb_icccm_wm_hints_t #define XCB_WM_STATE_ICONIC XCB_ICCCM_WM_STATE_ICONIC #define XCB_WM_STATE_WITHDRAWN XCB_ICCCM_WM_STATE_WITHDRAWN @@ -322,6 +323,8 @@ void QXcbWindow::create() memset(&hints, 0, sizeof(hints)); xcb_wm_hints_set_normal(&hints); + xcb_wm_hints_set_input(&hints, !(window()->windowFlags() & Qt::WindowDoesNotAcceptFocus)); + xcb_set_wm_hints(xcb_connection(), m_window, &hints); xcb_window_t leader = m_screen->clientLeader(); @@ -509,6 +512,8 @@ void QXcbWindow::show() else xcb_wm_hints_set_normal(&hints); + xcb_wm_hints_set_input(&hints, !(window()->windowFlags() & Qt::WindowDoesNotAcceptFocus)); + xcb_set_wm_hints(xcb_connection(), m_window, &hints); // update WM_NORMAL_HINTS @@ -730,6 +735,7 @@ Qt::WindowFlags QXcbWindow::setWindowFlags(Qt::WindowFlags flags) setMotifWindowFlags(flags); setTransparentForMouseEvents(flags & Qt::WindowTransparentForInput); + updateDoesNotAcceptFocus(flags & Qt::WindowDoesNotAcceptFocus); return flags; } @@ -1062,6 +1068,24 @@ void QXcbWindow::setTransparentForMouseEvents(bool transparent) m_transparent = transparent; } +void QXcbWindow::updateDoesNotAcceptFocus(bool doesNotAcceptFocus) +{ + xcb_get_property_cookie_t cookie = xcb_get_wm_hints(xcb_connection(), m_window); + + xcb_generic_error_t *error; + + xcb_wm_hints_t hints; + xcb_get_wm_hints_reply(xcb_connection(), cookie, &hints, &error); + + if (error) { + connection()->handleXcbError(error); + free(error); + return; + } + + xcb_wm_hints_set_input(&hints, !doesNotAcceptFocus); + xcb_set_wm_hints(xcb_connection(), m_window, &hints); +} WId QXcbWindow::winId() const { |