summaryrefslogtreecommitdiff
path: root/vcl/qt5/QtX11Support.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/qt5/QtX11Support.cxx')
-rw-r--r--vcl/qt5/QtX11Support.cxx79
1 files changed, 0 insertions, 79 deletions
diff --git a/vcl/qt5/QtX11Support.cxx b/vcl/qt5/QtX11Support.cxx
index d6f372fdadf5..84036fb8a565 100644
--- a/vcl/qt5/QtX11Support.cxx
+++ b/vcl/qt5/QtX11Support.cxx
@@ -20,40 +20,8 @@
#include <QtX11Extras/QX11Info>
#endif
-#if QT5_HAVE_XCB_ICCCM
-#include <xcb/xcb_icccm.h>
-#endif
-
#include <unx/gensys.h>
-xcb_atom_t QtX11Support::m_nWindowGroupAtom = 0;
-bool QtX11Support::m_bDidAtomLookups = false;
-
-xcb_atom_t QtX11Support::lookupAtom(xcb_connection_t* pConn, const char* const sAtomName)
-{
- xcb_atom_t nAtom = 0;
- xcb_intern_atom_cookie_t atom_cookie = xcb_intern_atom(pConn, 1, strlen(sAtomName), sAtomName);
- xcb_intern_atom_reply_t* atom_reply = xcb_intern_atom_reply(pConn, atom_cookie, nullptr);
- if (atom_reply)
- {
- nAtom = atom_reply->atom;
- free(atom_reply);
- }
- return nAtom;
-}
-
-void QtX11Support::fetchAtoms()
-{
-#if CHECK_QT5_USING_X11
- if (m_bDidAtomLookups)
- return;
- m_bDidAtomLookups = true;
-
- xcb_connection_t* pXcbConn = QX11Info::connection();
- m_nWindowGroupAtom = lookupAtom(pXcbConn, m_sWindowGroupName);
-#endif
-}
-
void QtX11Support::setApplicationID(const xcb_window_t nWinId, std::u16string_view rWMClass)
{
#if CHECK_QT5_USING_X11
@@ -77,51 +45,4 @@ void QtX11Support::setApplicationID(const xcb_window_t nWinId, std::u16string_vi
#endif
}
-bool QtX11Support::fixICCCMwindowGroup(const xcb_window_t nWinId)
-{
-#if CHECK_QT5_USING_X11 && QT5_HAVE_XCB_ICCCM
- // older Qt5 just sets WM_CLIENT_LEADER, but not the XCB_ICCCM_WM_HINT_WINDOW_GROUP
- // see Qt commit 0de4b326d8 ("xcb: fix issue with dialogs hidden by other windows")
- // or QTBUG-46626. So LO has to set this itself to help some WMs.
- if (QVersionNumber::fromString(qVersion()) >= QVersionNumber(5, 12))
- return false;
-
- xcb_connection_t* pXcbConn = QX11Info::connection();
- xcb_icccm_wm_hints_t hints;
-
- xcb_get_property_cookie_t prop_cookie = xcb_icccm_get_wm_hints_unchecked(pXcbConn, nWinId);
- if (!xcb_icccm_get_wm_hints_reply(pXcbConn, prop_cookie, &hints, nullptr))
- return false;
-
- if (hints.flags & XCB_ICCCM_WM_HINT_WINDOW_GROUP)
- return false;
-
- fetchAtoms();
- if (!m_nWindowGroupAtom)
- return false;
-
- prop_cookie = xcb_get_property(pXcbConn, 0, nWinId, m_nWindowGroupAtom, XCB_ATOM_WINDOW, 0, 1);
- xcb_get_property_reply_t* prop_reply = xcb_get_property_reply(pXcbConn, prop_cookie, nullptr);
- if (!prop_reply)
- return true;
-
- if (xcb_get_property_value_length(prop_reply) != 4)
- {
- free(prop_reply);
- return true;
- }
-
- xcb_window_t leader = *static_cast<xcb_window_t*>(xcb_get_property_value(prop_reply));
- free(prop_reply);
-
- hints.flags |= XCB_ICCCM_WM_HINT_WINDOW_GROUP;
- hints.window_group = leader;
- xcb_icccm_set_wm_hints(pXcbConn, nWinId, &hints);
- return true;
-#else
- Q_UNUSED(nWinId);
- return false;
-#endif
-}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */