diff options
author | Alexander Volkov <a.volkov@rusbitech.ru> | 2018-05-03 20:17:57 +0300 |
---|---|---|
committer | Alexander Volkov <a.volkov@rusbitech.ru> | 2018-07-09 17:35:36 +0000 |
commit | 5b8702fd557afa9d5e426b669b61ed65d8368da0 (patch) | |
tree | a16c2db182ca5ff565d8fa5ccc818d4073126ea3 /src/plugins/platforms/xcb/qxcbwindow.cpp | |
parent | 17e29fada46ac8a941227d9ea5b9342e02d3d367 (diff) |
xcb: Set WM_CLIENT_MACHINE property
It can be useful to detect that a window belongs to an
application running on a remote host. E.g. a window manager
may display the name of the remote host in the window title.
Or it can detect whether a client can be killed.
This property is set by Xlib's function XSetWMProperties(),
which is called by GTK and Qt 4, so it's also good to do
for consistency.
Change-Id: I0693156635cb2696b2fbe7006cbecb25d2680513
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbwindow.cpp')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbwindow.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp index b5f219c22a..d866ae025f 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.cpp +++ b/src/plugins/platforms/xcb/qxcbwindow.cpp @@ -490,6 +490,13 @@ void QXcbWindow::create() atom(QXcbAtom::_NET_WM_PID), XCB_ATOM_CARDINAL, 32, 1, &pid); + const QByteArray clientMachine = QSysInfo::machineHostName().toLocal8Bit(); + if (!clientMachine.isEmpty()) { + xcb_change_property(xcb_connection(), XCB_PROP_MODE_REPLACE, m_window, + atom(QXcbAtom::WM_CLIENT_MACHINE), XCB_ATOM_STRING, 8, + clientMachine.size(), clientMachine.constData()); + } + xcb_wm_hints_t hints; memset(&hints, 0, sizeof(hints)); xcb_wm_hints_set_normal(&hints); |