summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config_host/config_vclplug.h.in1
-rw-r--r--configure.ac7
-rw-r--r--vcl/inc/qt5/QtFrame.hxx2
-rw-r--r--vcl/inc/qt5/QtX11Support.hxx8
-rw-r--r--vcl/qt5/QtFrame.cxx23
-rw-r--r--vcl/qt5/QtX11Support.cxx79
6 files changed, 0 insertions, 120 deletions
diff --git a/config_host/config_vclplug.h.in b/config_host/config_vclplug.h.in
index 63dacb1bc10e..2334288cd49d 100644
--- a/config_host/config_vclplug.h.in
+++ b/config_host/config_vclplug.h.in
@@ -31,7 +31,6 @@ Settings about which desktops have support enabled.
#define ENABLE_GSTREAMER_1_0 0
#define QT5_HAVE_GOBJECT 0
#define QT5_USING_X11 0
-#define QT5_HAVE_XCB_ICCCM 0
#define QT6_USING_X11 0
#endif
diff --git a/configure.ac b/configure.ac
index 39857bb25f6f..999ab64289e8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -13119,13 +13119,6 @@ then
if test "$USING_X11" = TRUE; then
PKG_CHECK_MODULES(QT5_XCB,[xcb],,[AC_MSG_ERROR([XCB not found, which is needed for correct app grouping in X11.])])
- PKG_CHECK_MODULES(QT5_XCB_ICCCM,[xcb-icccm],[
- QT5_HAVE_XCB_ICCCM=1
- AC_DEFINE(QT5_HAVE_XCB_ICCCM)
- ],[
- AC_MSG_WARN([XCB ICCCM not found, which is needed for old Qt versions (< 5.12) on some WMs to correctly group dialogs (like QTBUG-46626)])
- add_warning "XCB ICCCM not found, which is needed for Qt versions (< 5.12) on some WMs to correctly group dialogs (like QTBUG-46626)"
- ])
QT5_CFLAGS="$QT5_CFLAGS $QT5_XCB_CFLAGS $QT5_XCB_ICCCM_CFLAGS"
QT5_LIBS="$QT5_LIBS $QT5_XCB_LIBS $QT5_XCB_ICCCM_LIBS -lQt5X11Extras"
QT5_USING_X11=1
diff --git a/vcl/inc/qt5/QtFrame.hxx b/vcl/inc/qt5/QtFrame.hxx
index b5ae7508a506..b80818687c0e 100644
--- a/vcl/inc/qt5/QtFrame.hxx
+++ b/vcl/inc/qt5/QtFrame.hxx
@@ -132,8 +132,6 @@ class VCLPLUG_QT_PUBLIC QtFrame : public QObject, public SalFrame
bool isMaximized() const;
void SetWindowStateImpl(Qt::WindowStates eState);
- void fixICCCMwindowGroup();
-
private Q_SLOTS:
void screenChanged(QScreen*);
diff --git a/vcl/inc/qt5/QtX11Support.hxx b/vcl/inc/qt5/QtX11Support.hxx
index 2931e82e4d1a..17696a89529d 100644
--- a/vcl/inc/qt5/QtX11Support.hxx
+++ b/vcl/inc/qt5/QtX11Support.hxx
@@ -15,15 +15,7 @@
class QtX11Support final
{
- static constexpr const char* m_sWindowGroupName = "WM_CLIENT_LEADER\0";
- static xcb_atom_t m_nWindowGroupAtom;
- static bool m_bDidAtomLookups;
-
- static xcb_atom_t lookupAtom(xcb_connection_t*, const char* const sAtomName);
- static void fetchAtoms();
-
public:
- static bool fixICCCMwindowGroup(xcb_window_t nWinId);
static void setApplicationID(xcb_window_t nWinId, std::u16string_view rWMClass);
};
diff --git a/vcl/qt5/QtFrame.cxx b/vcl/qt5/QtFrame.cxx
index 7a9b5f3861f8..cde1a06b3dd8 100644
--- a/vcl/qt5/QtFrame.cxx
+++ b/vcl/qt5/QtFrame.cxx
@@ -66,10 +66,6 @@
#include <unx/fontmanager.hxx>
-#if CHECK_QT5_USING_X11 && QT5_HAVE_XCB_ICCCM
-static bool g_bNeedsWmHintsWindowGroup = true;
-#endif
-
static void SvpDamageHandler(void* handle, sal_Int32 nExtentsX, sal_Int32 nExtentsY,
sal_Int32 nExtentsWidth, sal_Int32 nExtentsHeight)
{
@@ -192,8 +188,6 @@ QtFrame::QtFrame(QtFrame* pParent, SalFrameStyleFlags nStyle, bool bUseCairo)
}
SetIcon(SV_ICON_ID_OFFICE);
-
- fixICCCMwindowGroup();
}
void QtFrame::screenChanged(QScreen*) { m_pQWidget->fakeResize(); }
@@ -221,23 +215,6 @@ void QtFrame::FillSystemEnvData(SystemEnvData& rData, sal_IntPtr pWindow, QWidge
rData.pWidget = pWidget;
}
-void QtFrame::fixICCCMwindowGroup()
-{
-#if CHECK_QT5_USING_X11 && QT5_HAVE_XCB_ICCCM
- if (!g_bNeedsWmHintsWindowGroup)
- return;
- g_bNeedsWmHintsWindowGroup = false;
-
- assert(m_aSystemData.platform != SystemEnvData::Platform::Invalid);
- if (m_aSystemData.platform != SystemEnvData::Platform::Xcb)
- return;
-
- g_bNeedsWmHintsWindowGroup = QtX11Support::fixICCCMwindowGroup(asChild()->winId());
-#else
- (void)this; // avoid loplugin:staticmethods
-#endif
-}
-
QtFrame::~QtFrame()
{
QtInstance* pInst = GetQtInstance();
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: */