actually replace(rename) patch

This commit is contained in:
Rex Dieter 2015-08-06 08:24:58 -05:00
parent c5b8b67cf6
commit 33acfc6bc4

View File

@ -1,5 +1,28 @@
From 61a0656eb4149fe793854d703521bf2df48f8f7a Mon Sep 17 00:00:00 2001
From: Stefan Becker <chemobejk@gmail.com>
Date: Mon, 25 May 2015 17:46:49 +0300
Subject: [PATCH 123/255] xcb: set SM_CLIENT_ID property
SM_CLIENT_ID is required by kwin for proper session management.
- move client leader initialization from screen to connection
- add SM_CLIENT_ID property to client leader
Change-Id: I19fb0d098811c865f6f13d5bc3e59a173c596a65
Task-number: QTBUG-46310
Reviewed-by: Alexander Volkov <a.volkov@rusbitech.ru>
Reviewed-by: Uli Schlachter <psychon@znc.in>
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
---
src/plugins/platforms/xcb/qxcbconnection.cpp | 53 ++++++++++++++++++++++++++++
src/plugins/platforms/xcb/qxcbconnection.h | 2 ++
src/plugins/platforms/xcb/qxcbscreen.cpp | 32 -----------------
src/plugins/platforms/xcb/qxcbscreen.h | 3 --
src/plugins/platforms/xcb/qxcbwindow.cpp | 4 +--
5 files changed, 57 insertions(+), 37 deletions(-)
diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp
index 80c844e..d21ff4e 100644 index 4e558f9..74f48b0 100644
--- a/src/plugins/platforms/xcb/qxcbconnection.cpp --- a/src/plugins/platforms/xcb/qxcbconnection.cpp
+++ b/src/plugins/platforms/xcb/qxcbconnection.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection.cpp
@@ -454,6 +454,7 @@ QXcbConnection::QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGra @@ -454,6 +454,7 @@ QXcbConnection::QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGra
@ -10,10 +33,10 @@ index 80c844e..d21ff4e 100644
, m_systemTrayTracker(0) , m_systemTrayTracker(0)
, m_glIntegration(Q_NULLPTR) , m_glIntegration(Q_NULLPTR)
, m_xiGrab(false) , m_xiGrab(false)
@@ -1353,6 +1354,58 @@ void *QXcbConnection::createVisualInfoForDefaultVisualId() const @@ -1336,6 +1337,58 @@ xcb_window_t QXcbConnection::rootWindow()
return s ? s->root() : 0;
#endif }
+xcb_window_t QXcbConnection::clientLeader() +xcb_window_t QXcbConnection::clientLeader()
+{ +{
+ if (m_clientLeader == 0) { + if (m_clientLeader == 0) {
@ -66,37 +89,37 @@ index 80c844e..d21ff4e 100644
+ return m_clientLeader; + return m_clientLeader;
+} +}
+ +
void QXcbConnection::processXcbEvents() #ifdef XCB_USE_XLIB
void *QXcbConnection::xlib_display() const
{ {
int connection_error = xcb_connection_has_error(xcb_connection());
diff --git a/src/plugins/platforms/xcb/qxcbconnection.h b/src/plugins/platforms/xcb/qxcbconnection.h diff --git a/src/plugins/platforms/xcb/qxcbconnection.h b/src/plugins/platforms/xcb/qxcbconnection.h
index 2005ae0..dcfb3f0 100644 index 348af5f..ee5ed89 100644
--- a/src/plugins/platforms/xcb/qxcbconnection.h --- a/src/plugins/platforms/xcb/qxcbconnection.h
+++ b/src/plugins/platforms/xcb/qxcbconnection.h +++ b/src/plugins/platforms/xcb/qxcbconnection.h
@@ -402,6 +402,7 @@ public: @@ -403,6 +403,7 @@ public:
QXcbWMSupport *wmSupport() const { return m_wmSupport.data(); } QXcbWMSupport *wmSupport() const { return m_wmSupport.data(); }
xcb_window_t rootWindow(); xcb_window_t rootWindow();
+ xcb_window_t clientLeader(); + xcb_window_t clientLeader();
bool hasDefaultVisualId() const { return m_defaultVisualId != UINT_MAX; } bool hasDefaultVisualId() const { return m_defaultVisualId != UINT_MAX; }
xcb_visualid_t defaultVisualId() const { return m_defaultVisualId; } xcb_visualid_t defaultVisualId() const { return m_defaultVisualId; }
@@ -640,6 +641,7 @@ private: @@ -640,6 +641,7 @@ private:
QXcbWindow *m_focusWindow; QXcbWindow *m_focusWindow;
+ xcb_window_t m_clientLeader; + xcb_window_t m_clientLeader;
QByteArray m_startupId; QByteArray m_startupId;
QXcbSystemTrayTracker *m_systemTrayTracker; QXcbSystemTrayTracker *m_systemTrayTracker;
QXcbGlIntegration *m_glIntegration; QXcbGlIntegration *m_glIntegration;
diff --git a/src/plugins/platforms/xcb/qxcbscreen.cpp b/src/plugins/platforms/xcb/qxcbscreen.cpp diff --git a/src/plugins/platforms/xcb/qxcbscreen.cpp b/src/plugins/platforms/xcb/qxcbscreen.cpp
index 63e4d9e..9783682 100644 index 040cea1..c7f8114 100644
--- a/src/plugins/platforms/xcb/qxcbscreen.cpp --- a/src/plugins/platforms/xcb/qxcbscreen.cpp
+++ b/src/plugins/platforms/xcb/qxcbscreen.cpp +++ b/src/plugins/platforms/xcb/qxcbscreen.cpp
@@ -170,38 +170,6 @@ QXcbScreen::QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDe @@ -170,38 +170,6 @@ QXcbScreen::QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDe
else else
m_syncRequestSupported = true; m_syncRequestSupported = true;
- m_clientLeader = xcb_generate_id(xcb_connection()); - m_clientLeader = xcb_generate_id(xcb_connection());
- Q_XCB_CALL2(xcb_create_window(xcb_connection(), - Q_XCB_CALL2(xcb_create_window(xcb_connection(),
- XCB_COPY_FROM_PARENT, - XCB_COPY_FROM_PARENT,
@ -131,21 +154,21 @@ index 63e4d9e..9783682 100644
- -
xcb_depth_iterator_t depth_iterator = xcb_depth_iterator_t depth_iterator =
xcb_screen_allowed_depths_iterator(screen()); xcb_screen_allowed_depths_iterator(screen());
diff --git a/src/plugins/platforms/xcb/qxcbscreen.h b/src/plugins/platforms/xcb/qxcbscreen.h diff --git a/src/plugins/platforms/xcb/qxcbscreen.h b/src/plugins/platforms/xcb/qxcbscreen.h
index ec05e3b..6534206 100644 index 4451947..ccc30c0 100644
--- a/src/plugins/platforms/xcb/qxcbscreen.h --- a/src/plugins/platforms/xcb/qxcbscreen.h
+++ b/src/plugins/platforms/xcb/qxcbscreen.h +++ b/src/plugins/platforms/xcb/qxcbscreen.h
@@ -116,8 +116,6 @@ public: @@ -116,8 +116,6 @@ public:
xcb_randr_crtc_t crtc() const { return m_crtc; } xcb_randr_crtc_t crtc() const { return m_crtc; }
xcb_randr_mode_t mode() const { return m_mode; } xcb_randr_mode_t mode() const { return m_mode; }
- xcb_window_t clientLeader() const { return m_clientLeader; } - xcb_window_t clientLeader() const { return m_clientLeader; }
- -
void windowShown(QXcbWindow *window); void windowShown(QXcbWindow *window);
QString windowManagerName() const { return m_windowManagerName; } QString windowManagerName() const { return m_windowManagerName; }
bool syncRequestSupported() const { return m_syncRequestSupported; } bool syncRequestSupported() const { return m_syncRequestSupported; }
@@ -171,7 +169,6 @@ private: @@ -173,7 +171,6 @@ private:
Qt::ScreenOrientation m_orientation; Qt::ScreenOrientation m_orientation;
QString m_windowManagerName; QString m_windowManagerName;
bool m_syncRequestSupported; bool m_syncRequestSupported;
@ -154,19 +177,19 @@ index ec05e3b..6534206 100644
QMap<xcb_visualid_t, quint8> m_visualDepths; QMap<xcb_visualid_t, quint8> m_visualDepths;
QXcbCursor *m_cursor; QXcbCursor *m_cursor;
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp
index 7c043fb..adc8973 100644 index 9c5609b..af4a88b 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.cpp --- a/src/plugins/platforms/xcb/qxcbwindow.cpp
+++ b/src/plugins/platforms/xcb/qxcbwindow.cpp +++ b/src/plugins/platforms/xcb/qxcbwindow.cpp
@@ -623,7 +623,7 @@ void QXcbWindow::create() @@ -622,7 +622,7 @@ void QXcbWindow::create()
xcb_set_wm_hints(xcb_connection(), m_window, &hints); xcb_set_wm_hints(xcb_connection(), m_window, &hints);
- xcb_window_t leader = platformScreen->clientLeader(); - xcb_window_t leader = platformScreen->clientLeader();
+ xcb_window_t leader = connection()->clientLeader(); + xcb_window_t leader = connection()->clientLeader();
Q_XCB_CALL(xcb_change_property(xcb_connection(), XCB_PROP_MODE_REPLACE, m_window, Q_XCB_CALL(xcb_change_property(xcb_connection(), XCB_PROP_MODE_REPLACE, m_window,
atom(QXcbAtom::WM_CLIENT_LEADER), XCB_ATOM_WINDOW, 32, atom(QXcbAtom::WM_CLIENT_LEADER), XCB_ATOM_WINDOW, 32,
1, &leader)); 1, &leader));
@@ -864,7 +864,7 @@ void QXcbWindow::show() @@ -874,7 +874,7 @@ void QXcbWindow::show()
// Default to client leader if there is no transient parent, else modal dialogs can // Default to client leader if there is no transient parent, else modal dialogs can
// be hidden by their parents. // be hidden by their parents.
if (!transientXcbParent) if (!transientXcbParent)
@ -175,3 +198,6 @@ index 7c043fb..adc8973 100644
if (transientXcbParent) { // ICCCM 4.1.2.6 if (transientXcbParent) { // ICCCM 4.1.2.6
Q_XCB_CALL(xcb_change_property(xcb_connection(), XCB_PROP_MODE_REPLACE, m_window, Q_XCB_CALL(xcb_change_property(xcb_connection(), XCB_PROP_MODE_REPLACE, m_window,
XCB_ATOM_WM_TRANSIENT_FOR, XCB_ATOM_WINDOW, 32, XCB_ATOM_WM_TRANSIENT_FOR, XCB_ATOM_WINDOW, 32,
--
2.4.3