From 5df9fa8f3a7209c067a5d5068776b9aa52273d3b Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 8 Feb 2016 14:56:50 +0100 Subject: Bump version Change-Id: Iedef6ec611866ed28d7c7efdc60e45f20006e7b0 --- .qmake.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.qmake.conf b/.qmake.conf index 66a0241..b642527 100644 --- a/.qmake.conf +++ b/.qmake.conf @@ -1,3 +1,3 @@ load(qt_build_config) -MODULE_VERSION = 5.6.0 +MODULE_VERSION = 5.6.1 -- cgit v1.2.1 From f3ac70bb3f826b269412c4aeeef8f886863f3c9d Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 12 Feb 2016 16:54:23 +0100 Subject: consistently put {qt,qml}_{module,plugin} at the end of project files this fixes static builds by ensuring that all dependencies are exported. Task-number: QTBUG-51071 Change-Id: If23f1aa1583ff48d370b1c85ebc017726521b5c0 Reviewed-by: Joerg Bornemann --- src/x11extras/x11extras.pro | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/x11extras/x11extras.pro b/src/x11extras/x11extras.pro index 730a145..707b0af 100644 --- a/src/x11extras/x11extras.pro +++ b/src/x11extras/x11extras.pro @@ -4,9 +4,9 @@ DEFINES += QT_NO_USING_NAMESPACE QMAKE_DOCS = $$PWD/doc/qtx11extras.qdocconf -load(qt_module) - QT += gui-private HEADERS += qx11info_x11.h SOURCES += qx11info_x11.cpp + +load(qt_module) -- cgit v1.2.1 From f43b5d926e5940299230e7ea50cc7d07ae93d6ba Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 12 Feb 2016 16:54:33 +0100 Subject: don't over-expose private dependencies Change-Id: I64c6bcde0f374f4807e6b7ceccc6cc0f81e33459 Reviewed-by: Friedemann Kleint Reviewed-by: David Faure --- src/x11extras/x11extras.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/x11extras/x11extras.pro b/src/x11extras/x11extras.pro index 707b0af..a400276 100644 --- a/src/x11extras/x11extras.pro +++ b/src/x11extras/x11extras.pro @@ -4,7 +4,7 @@ DEFINES += QT_NO_USING_NAMESPACE QMAKE_DOCS = $$PWD/doc/qtx11extras.qdocconf -QT += gui-private +QT_PRIVATE += gui-private HEADERS += qx11info_x11.h SOURCES += qx11info_x11.cpp -- cgit v1.2.1 From f27489d66cc6d8263130451c26c7e4ae40acc6b4 Mon Sep 17 00:00:00 2001 From: Alexander Volkov Date: Wed, 22 Apr 2015 19:28:24 +0300 Subject: Properly get appDpiX, appDpiY and appRootWindow for X screen X screen is a virtual desktop in Qt terminology. So find the first QScreen which belongs to the requested virtual desktop and use it to get the values. Change-Id: If5c08ff6c3e19e1d49d17ae8e1c54e09ffeb97cf Reviewed-by: Friedemann Kleint Reviewed-by: Laszlo Agocs --- src/x11extras/qx11info_x11.cpp | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/src/x11extras/qx11info_x11.cpp b/src/x11extras/qx11info_x11.cpp index 8d8f337..2d4c5d2 100644 --- a/src/x11extras/qx11info_x11.cpp +++ b/src/x11extras/qx11info_x11.cpp @@ -43,6 +43,7 @@ #include #include +#include #include #include #include @@ -50,6 +51,14 @@ QT_BEGIN_NAMESPACE +static QScreen *findScreenForVirtualDesktop(int virtualDesktopNumber) +{ + foreach (QScreen *screen, QGuiApplication::screens()) { + if (QXcbScreenFunctions::virtualDesktopNumber(screen) == virtualDesktopNumber) + return screen; + } + return Q_NULLPTR; +} /*! \class QX11Info @@ -103,11 +112,11 @@ int QX11Info::appDpiX(int screen) return qRound(scr->logicalDotsPerInchX()); } - QList screens = QGuiApplication::screens(); - if (screen >= screens.size()) + QScreen *scr = findScreenForVirtualDesktop(screen); + if (!scr) return 0; - return screens[screen]->logicalDotsPerInchX(); + return scr->logicalDotsPerInchX(); } /*! @@ -130,11 +139,11 @@ int QX11Info::appDpiY(int screen) return qRound(scr->logicalDotsPerInchY()); } - QList screens = QGuiApplication::screens(); - if (screen > screens.size()) + QScreen *scr = findScreenForVirtualDesktop(screen); + if (!scr) return 0; - return screens[screen]->logicalDotsPerInchY(); + return scr->logicalDotsPerInchY(); } /*! @@ -151,11 +160,13 @@ unsigned long QX11Info::appRootWindow(int screen) { if (!qApp) return 0; - Q_UNUSED(screen); QPlatformNativeInterface *native = qApp->platformNativeInterface(); if (!native) return 0; - return static_cast(reinterpret_cast(native->nativeResourceForIntegration(QByteArrayLiteral("rootwindow")))); + QScreen *scr = screen == -1 ? QGuiApplication::primaryScreen() : findScreenForVirtualDesktop(screen); + if (!scr) + return 0; + return static_cast(reinterpret_cast(native->nativeResourceForScreen(QByteArrayLiteral("rootwindow"), scr))); } /*! -- cgit v1.2.1 From fbf5e9403e15655bd479e4cc6b26bf1451e5b8c5 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Mon, 29 Feb 2016 14:30:14 -0800 Subject: Add QX11Info::isCompositingManagerRunning() function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QTBUG-41195 Change-Id: Id4b385478dad85dd02c484fe9c44666bae46268b Reviewed-by: Błażej Szczygieł Reviewed-by: Shawn Rutledge --- src/x11extras/qx11info_x11.cpp | 25 +++++++++++++++++++++++++ src/x11extras/qx11info_x11.h | 2 ++ tests/auto/qx11info/tst_qx11info.cpp | 2 ++ 3 files changed, 29 insertions(+) diff --git a/src/x11extras/qx11info_x11.cpp b/src/x11extras/qx11info_x11.cpp index e5aa678..a201547 100644 --- a/src/x11extras/qx11info_x11.cpp +++ b/src/x11extras/qx11info_x11.cpp @@ -376,4 +376,29 @@ xcb_connection_t *QX11Info::connection() return reinterpret_cast(connection); } +/*! + \since 5.7 + + Returns true if there is a compositing manager running for the connection + attached to \a screen. + + If \l -1, the application primary screen is used. +*/ +bool QX11Info::isCompositingManagerRunning(int screen) +{ + if (!qApp) + return false; + QPlatformNativeInterface *native = qApp->platformNativeInterface(); + if (!native) + return false; + + QScreen *scr = screen == -1 ? QGuiApplication::primaryScreen() : findScreenForVirtualDesktop(screen); + if (!scr) { + qWarning() << "isCompositingManagerRunning: Could not find screen number" << screen; + return false; + } + + return native->nativeResourceForScreen(QByteArray("compositingEnabled"), scr); +} + QT_END_NAMESPACE diff --git a/src/x11extras/qx11info_x11.h b/src/x11extras/qx11info_x11.h index 620428d..ab72686 100644 --- a/src/x11extras/qx11info_x11.h +++ b/src/x11extras/qx11info_x11.h @@ -73,6 +73,8 @@ public: static Display *display(); static xcb_connection_t *connection(); + static bool isCompositingManagerRunning(int screen = -1); + private: QX11Info(); }; diff --git a/tests/auto/qx11info/tst_qx11info.cpp b/tests/auto/qx11info/tst_qx11info.cpp index 0a19d7f..a27f443 100644 --- a/tests/auto/qx11info/tst_qx11info.cpp +++ b/tests/auto/qx11info/tst_qx11info.cpp @@ -96,6 +96,8 @@ void tst_QX11Info::staticFunctionsBeforeQApplication() appUserTime = QX11Info::appUserTime(); QCOMPARE(appTime, 0ul); QCOMPARE(appTime, 0ul); + + QX11Info::isCompositingManagerRunning(); } static const char idFromEnv[] = "startupid_TIME123456"; -- cgit v1.2.1 From b414120c60ef8c3cc2aad7dca41092647d741a36 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 24 Mar 2016 10:17:29 +0100 Subject: Fix documentation of QX11Info::isCompositingManagerRunning(). Fix warning: qtx11extras/src/x11extras/qx11info_x11.cpp:379: warning: Can't link to '-1' Change-Id: I8165a6e2b512a1fc265f4946e8fdc47dc3558109 Reviewed-by: Gabriel de Dietrich --- src/x11extras/qx11info_x11.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/x11extras/qx11info_x11.cpp b/src/x11extras/qx11info_x11.cpp index a201547..0473fda 100644 --- a/src/x11extras/qx11info_x11.cpp +++ b/src/x11extras/qx11info_x11.cpp @@ -382,7 +382,7 @@ xcb_connection_t *QX11Info::connection() Returns true if there is a compositing manager running for the connection attached to \a screen. - If \l -1, the application primary screen is used. + If \a screen equals -1, the application's primary screen is used. */ bool QX11Info::isCompositingManagerRunning(int screen) { -- cgit v1.2.1