Hello community,

here is the log from the commit of package kwindowsystem for openSUSE:Factory 
checked in at 2015-03-16 09:34:14
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/kwindowsystem (Old)
 and      /work/SRC/openSUSE:Factory/.kwindowsystem.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "kwindowsystem"

Changes:
--------
--- /work/SRC/openSUSE:Factory/kwindowsystem/kwindowsystem.changes      
2015-02-16 17:32:48.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.kwindowsystem.new/kwindowsystem.changes 
2015-03-16 09:34:15.000000000 +0100
@@ -1,0 +2,10 @@
+Sat Mar  7 16:58:57 UTC 2015 - [email protected]
+
+- Update to 5.8.0
+  * KSelectionWatcher and KSelectionOwner can be used without
+    depending on QX11Info.
+  * KXMessages can be used without depending on QX11Info
+  * For more details please see:
+    https://www.kde.org/announcements/kde-frameworks-5.8.0.php
+
+-------------------------------------------------------------------

Old:
----
  kwindowsystem-5.7.0.tar.xz

New:
----
  kwindowsystem-5.8.0.tar.xz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ kwindowsystem.spec ++++++
--- /var/tmp/diff_new_pack.0ZJO4w/_old  2015-03-16 09:34:16.000000000 +0100
+++ /var/tmp/diff_new_pack.0ZJO4w/_new  2015-03-16 09:34:16.000000000 +0100
@@ -17,12 +17,12 @@
 
 
 %define lname   libKF5WindowSystem5
-%define _tar_path 5.7
+%define _tar_path 5.8
 Name:           kwindowsystem
 Version:        %{_tar_path}.0
 Release:        0
 BuildRequires:  cmake >= 2.8.12
-BuildRequires:  extra-cmake-modules >= 1.7.0
+BuildRequires:  extra-cmake-modules >= 1.8.0
 BuildRequires:  fdupes
 BuildRequires:  kf5-filesystem
 BuildRequires:  libqt5-linguist-devel >= 5.2.0

++++++ kwindowsystem-5.7.0.tar.xz -> kwindowsystem-5.8.0.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kwindowsystem-5.7.0/CMakeLists.txt 
new/kwindowsystem-5.8.0/CMakeLists.txt
--- old/kwindowsystem-5.7.0/CMakeLists.txt      2015-02-08 16:27:10.000000000 
+0100
+++ new/kwindowsystem-5.8.0/CMakeLists.txt      2015-03-07 15:52:31.000000000 
+0100
@@ -3,7 +3,7 @@
 project(KWindowSystem)
 
 # ECM setup
-find_package(ECM 1.7.0 REQUIRED NO_MODULE)
+find_package(ECM 1.8.0 REQUIRED NO_MODULE)
 set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
 
 include(FeatureSummary)
@@ -15,7 +15,7 @@
 
 include(ECMPoQmTools)
 
-set(KF5_VERSION "5.7.0") # handled by release scripts
+set(KF5_VERSION "5.8.0") # handled by release scripts
 
 ecm_setup_version(${KF5_VERSION} VARIABLE_PREFIX KWINDOWSYSTEM
                         VERSION_HEADER 
"${CMAKE_CURRENT_BINARY_DIR}/kwindowsystem_version.h"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/kwindowsystem-5.7.0/autotests/kxmessages_unittest.cpp 
new/kwindowsystem-5.8.0/autotests/kxmessages_unittest.cpp
--- old/kwindowsystem-5.7.0/autotests/kxmessages_unittest.cpp   2015-02-08 
16:27:10.000000000 +0100
+++ new/kwindowsystem-5.8.0/autotests/kxmessages_unittest.cpp   2015-03-07 
15:52:31.000000000 +0100
@@ -32,6 +32,10 @@
         BroadcastStaticDisplay,
         BroadcastStaticConnection
     };
+    enum ReceiverType {
+        ReceiverTypeDefault,
+        ReceiverTypeConnection
+    };
     KXMessages_UnitTest()
         : m_msgs()
     {
@@ -46,27 +50,44 @@
 };
 
 Q_DECLARE_METATYPE(KXMessages_UnitTest::BroadcastType)
+Q_DECLARE_METATYPE(KXMessages_UnitTest::ReceiverType)
 
 void KXMessages_UnitTest::testStart_data()
 {
     QTest::addColumn<KXMessages_UnitTest::BroadcastType>("broadcastType");
+    QTest::addColumn<KXMessages_UnitTest::ReceiverType>("receiverType");
 
-    QTest::newRow("object")     << BroadcastMessageObject;
-    QTest::newRow("display")    << BroadcastStaticDisplay;
-    QTest::newRow("connection") << BroadcastStaticConnection;
+    QTest::newRow("object")     << BroadcastMessageObject << 
ReceiverTypeDefault;
+    QTest::newRow("display")    << BroadcastStaticDisplay << 
ReceiverTypeDefault;
+    QTest::newRow("connection") << BroadcastStaticConnection << 
ReceiverTypeDefault;
+    QTest::newRow("object/xcb")     << BroadcastMessageObject << 
ReceiverTypeConnection;
+    QTest::newRow("display/xcb")    << BroadcastStaticDisplay << 
ReceiverTypeConnection;
+    QTest::newRow("connection/xcb") << BroadcastStaticConnection << 
ReceiverTypeConnection;
 }
 
 void KXMessages_UnitTest::testStart()
 {
     QFETCH(KXMessages_UnitTest::BroadcastType, broadcastType);
+    QFETCH(KXMessages_UnitTest::ReceiverType, receiverType);
     const QByteArray type = "kxmessage_unittest";
-    KXMessages receiver(type);
+    QScopedPointer<KXMessages> receiver;
+    switch (receiverType) {
+    case KXMessages_UnitTest::ReceiverTypeDefault:
+        receiver.reset(new KXMessages(type));
+        break;
+    case KXMessages_UnitTest::ReceiverTypeConnection:
+        receiver.reset(new KXMessages(QX11Info::connection(), 
QX11Info::appRootWindow(), type));
+        break;
+    default:
+        Q_UNREACHABLE();
+        break;
+    }
 
     // Check that all message sizes work, i.e. no bug when exactly 20 or 40 
bytes,
     // despite the internal splitting.
     QString message;
     for (int i = 1; i < 50; ++i) {
-        QSignalSpy spy(&receiver, SIGNAL(gotMessage(QString)));
+        QSignalSpy spy(receiver.data(), SIGNAL(gotMessage(QString)));
         message += "a";
         switch (broadcastType) {
         case KXMessages_UnitTest::BroadcastMessageObject:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kwindowsystem-5.7.0/po/bs/kwindowsystem5_qt.po 
new/kwindowsystem-5.8.0/po/bs/kwindowsystem5_qt.po
--- old/kwindowsystem-5.7.0/po/bs/kwindowsystem5_qt.po  2015-02-08 
16:27:10.000000000 +0100
+++ new/kwindowsystem-5.8.0/po/bs/kwindowsystem5_qt.po  2015-03-07 
15:52:31.000000000 +0100
@@ -1,38 +1,21 @@
-# translation of kdelibs4.po to bosanski
-# Marko Rosic <[email protected]>, 2003.
-# Toplica Tanaskovic <[email protected]>, 2003, 2004, 2005.
-# Chusslove Illich <[email protected]>, 2003, 2004, 2005, 2006, 2007, 2008, 
2009, 2010.
-# Dalibor Djuric <[email protected]>, 2009, 2010.
-# Dalibor Djuric <[email protected]>, 2010.
-# KDE 4 <[email protected]>, 2011.
-# Bosnian translation of kdelibs4
-# Initially converted from translation of kdelibs4.po by
-# Samir Ribić <[email protected]>
 msgid ""
 msgstr ""
-"Project-Id-Version: kdelibs4\n"
-"Report-Msgid-Bugs-To: http://bugs.kde.org\n";
-"POT-Creation-Date: 2014-03-23 01:50+0000\n"
-"PO-Revision-Date: 2013-12-21 17:26+0000\n"
-"Last-Translator: Ademovic Saudin <[email protected]>\n"
-"Language-Team: bosanski <[email protected]>\n"
-"Language: bosnian\n"
+"Project-Id-Version: kde5\n"
+"POT-Creation-Date: \n"
+"PO-Revision-Date: 2015-02-24 19:46+0100\n"
+"Last-Translator: Samir Ribić <[email protected]>\n"
+"Language-Team: Bosnian\n"
+"Language: bs\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
+"X-Qt-Contexts: true\n"
 "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
 "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
-"X-Generator: Launchpad (build 16872)\n"
-"X-Launchpad-Export-Date: 2013-12-22 05:52+0000\n"
-"X-Accelerator-Marker: &\n"
-"X-Text-Markup: kde4\n"
-"X-Environment: kde\n"
-"X-Qt-Contexts: true\n"
 
 #: kwindowsystem_mac.cpp:580 kwindowsystem_win.cpp:632
 #: kwindowsystem_x11.cpp:946
-#, fuzzy, qt-format
-#| msgid "Desktop %1"
+#, qt-format
 msgctxt "KWindowSystem|"
 msgid "Desktop %1"
 msgstr "Površ %1"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kwindowsystem-5.7.0/po/fr/kwindowsystem5_qt.po 
new/kwindowsystem-5.8.0/po/fr/kwindowsystem5_qt.po
--- old/kwindowsystem-5.7.0/po/fr/kwindowsystem5_qt.po  2015-02-08 
16:27:10.000000000 +0100
+++ new/kwindowsystem-5.8.0/po/fr/kwindowsystem5_qt.po  2015-03-07 
15:52:31.000000000 +0100
@@ -24,10 +24,10 @@
 "PO-Revision-Date: 2014-03-16 18:32+0100\n"
 "Last-Translator: Sebastien Renard <[email protected]>\n"
 "Language-Team: French <[email protected]>\n"
+"Language: fr\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
-"Language: fr\n"
 "Plural-Forms: nplurals=2; plural=(n > 1);\n"
 "X-Generator: Lokalize 1.5\n"
 "X-Environment: kde\n"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kwindowsystem-5.7.0/src/kselectionowner.cpp 
new/kwindowsystem-5.8.0/src/kselectionowner.cpp
--- old/kwindowsystem-5.7.0/src/kselectionowner.cpp     2015-02-08 
16:27:10.000000000 +0100
+++ new/kwindowsystem-5.8.0/src/kselectionowner.cpp     2015-03-07 
15:52:31.000000000 +0100
@@ -67,10 +67,11 @@
 public:
     enum State { Idle, WaitingForTimestamp, WaitingForPreviousOwner };
 
-    Private(KSelectionOwner *owner_P, xcb_atom_t selection_P, int screen_P)
+    Private(KSelectionOwner *owner_P, xcb_atom_t selection_P, xcb_connection_t 
*c, xcb_window_t root)
         : state(Idle),
           selection(selection_P),
-          root(QX11Info::appRootWindow(screen_P)),
+          connection(c),
+          root(root),
           window(XCB_NONE),
           prev_owner(XCB_NONE),
           timestamp(XCB_CURRENT_TIME),
@@ -88,6 +89,7 @@
 
     State state;
     const xcb_atom_t selection;
+    xcb_connection_t *connection;
     xcb_window_t root;
     xcb_window_t window;
     xcb_window_t prev_owner;
@@ -102,6 +104,8 @@
 
     static Private *create(KSelectionOwner *owner, xcb_atom_t selection_P, int 
screen_P);
     static Private *create(KSelectionOwner *owner, const char *selection_P, 
int screen_P);
+    static Private *create(KSelectionOwner *owner, xcb_atom_t selection_P, 
xcb_connection_t *c, xcb_window_t root);
+    static Private *create(KSelectionOwner *owner, const char *selection_P, 
xcb_connection_t *c, xcb_window_t root);
 
 protected:
     bool nativeEventFilter(const QByteArray &eventType, void *message, long 
*result) Q_DECL_OVERRIDE {
@@ -120,21 +124,31 @@
 KSelectionOwner::Private* KSelectionOwner::Private::create(KSelectionOwner 
*owner, xcb_atom_t selection_P, int screen_P)
 {
     if (QGuiApplication::platformName() == QStringLiteral("xcb")) {
-        return new Private(owner, selection_P, screen_P);
+        return create(owner, selection_P, QX11Info::connection(), 
QX11Info::appRootWindow(screen_P));
     }
     qWarning() << "Trying to use KSelectionOwner on a non-X11 platform! This 
is an application bug.";
     return Q_NULLPTR;
 }
 
+KSelectionOwner::Private *KSelectionOwner::Private::create(KSelectionOwner 
*owner, xcb_atom_t selection_P, xcb_connection_t *c, xcb_window_t root)
+{
+    return new Private(owner, selection_P, c, root);
+}
+
 KSelectionOwner::Private *KSelectionOwner::Private::create(KSelectionOwner 
*owner, const char *selection_P, int screen_P)
 {
     if (QGuiApplication::platformName() == QStringLiteral("xcb")) {
-        return new Private(owner, intern_atom(QX11Info::connection(), 
selection_P), screen_P);
+        return create(owner, selection_P, QX11Info::connection(), 
QX11Info::appRootWindow(screen_P));
     }
     qWarning() << "Trying to use KSelectionOwner on a non-X11 platform! This 
is an application bug.";
     return Q_NULLPTR;
 }
 
+KSelectionOwner::Private *KSelectionOwner::Private::create(KSelectionOwner 
*owner, const char *selection_P, xcb_connection_t *c, xcb_window_t root)
+{
+    return new Private(owner, intern_atom(c, selection_P), c, root);
+}
+
 KSelectionOwner::KSelectionOwner(xcb_atom_t selection_P, int screen_P, QObject 
*parent_P)
     :   QObject(parent_P),
         d(Private::create(this, selection_P, screen_P))
@@ -147,12 +161,24 @@
 {
 }
 
+KSelectionOwner::KSelectionOwner(xcb_atom_t selection, xcb_connection_t *c, 
xcb_window_t root, QObject *parent)
+    : QObject(parent)
+    , d(Private::create(this, selection, c, root))
+{
+}
+
+KSelectionOwner::KSelectionOwner(const char *selection, xcb_connection_t *c, 
xcb_window_t root, QObject *parent)
+    : QObject(parent)
+    , d(Private::create(this, selection, c, root))
+{
+}
+
 KSelectionOwner::~KSelectionOwner()
 {
     if (d) {
         release();
         if (d->window != XCB_WINDOW_NONE) {
-            xcb_destroy_window(QX11Info::connection(), d->window); // also 
makes the selection not owned
+            xcb_destroy_window(d->connection, d->window); // also makes the 
selection not owned
         }
         delete d;
     }
@@ -173,7 +199,7 @@
     ev.data.data32[3] = extra1;
     ev.data.data32[4] = extra2;
 
-    xcb_send_event(QX11Info::connection(), false, root, 
XCB_EVENT_MASK_STRUCTURE_NOTIFY, (const char *) &ev);
+    xcb_send_event(connection, false, root, XCB_EVENT_MASK_STRUCTURE_NOTIFY, 
(const char *) &ev);
 
     // qDebug() << "Claimed selection";
 
@@ -186,7 +212,7 @@
 
     state = Idle;
 
-    xcb_connection_t *c = QX11Info::connection();
+    xcb_connection_t *c = connection;
 
     // Set the selection owner and immediately verify that the claim was 
successful
     xcb_set_selection_owner(c, window, selection, timestamp);
@@ -223,7 +249,7 @@
 
     if (force_kill) {
         // qDebug() << "Killing previous owner";
-        xcb_connection_t *c = QX11Info::connection();
+        xcb_connection_t *c = connection;
 
         // Ignore any errors from the kill request
         xcb_generic_error_t *err = xcb_request_check(c, 
xcb_kill_client_checked(c, prev_owner));
@@ -250,7 +276,7 @@
         release();
     }
 
-    xcb_connection_t *c = QX11Info::connection();
+    xcb_connection_t *c = d->connection;
     d->prev_owner = get_selection_owner(c, d->selection);
 
     if (d->prev_owner != XCB_NONE) {
@@ -292,7 +318,7 @@
         return;
     }
 
-    xcb_destroy_window(QX11Info::connection(), d->window); // also makes the 
selection not owned
+    xcb_destroy_window(d->connection, d->window); // also makes the selection 
not owned
     d->window = XCB_NONE;
 
     // qDebug() << "Releasing selection";
@@ -353,8 +379,8 @@
 
         // Unset the event mask before we destroy the window so we don't get a 
destroy event
         uint32_t event_mask = XCB_NONE;
-        xcb_change_window_attributes(QX11Info::connection(), window, 
XCB_CW_EVENT_MASK, &event_mask);
-        xcb_destroy_window(QX11Info::connection(), window);
+        xcb_change_window_attributes(d->connection, window, XCB_CW_EVENT_MASK, 
&event_mask);
+        xcb_destroy_window(d->connection, window);
         return true;
     }
     case XCB_DESTROY_NOTIFY: {
@@ -444,7 +470,7 @@
 
     // qDebug() << "Got selection request";
 
-    xcb_connection_t *c = QX11Info::connection();
+    xcb_connection_t *c = d->connection;
     bool handled = false;
 
     if (ev->target == Private::xa_multiple) {
@@ -508,7 +534,7 @@
     }
     if (target_P == Private::xa_timestamp) {
         // qDebug() << "Handling timestamp request";
-        xcb_change_property(QX11Info::connection(), requestor_P, property_P, 
XCB_ATOM_INTEGER, 32,
+        xcb_change_property(d->connection, requestor_P, property_P, 
XCB_ATOM_INTEGER, 32,
                             XCB_PROP_MODE_REPLACE, 1, reinterpret_cast<const 
void *>(&d->timestamp));
     } else if (target_P == Private::xa_targets) {
         replyTargets(property_P, requestor_P);
@@ -528,7 +554,7 @@
     }
     xcb_atom_t atoms[3] = { Private::xa_multiple, Private::xa_timestamp, 
Private::xa_targets };
 
-    xcb_change_property(QX11Info::connection(), requestor_P, property_P, 
XCB_ATOM_ATOM, 32, XCB_PROP_MODE_REPLACE,
+    xcb_change_property(d->connection, requestor_P, property_P, XCB_ATOM_ATOM, 
32, XCB_PROP_MODE_REPLACE,
                         sizeof(atoms) / sizeof(atoms[0]), 
reinterpret_cast<const void *>(atoms));
 
     // qDebug() << "Handling targets request";
@@ -548,7 +574,7 @@
         return;
     }
 
-    xcb_connection_t *c = QX11Info::connection();
+    xcb_connection_t *c = d->connection;
 
     struct {
         const char *name;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kwindowsystem-5.7.0/src/kselectionowner.h 
new/kwindowsystem-5.8.0/src/kselectionowner.h
--- old/kwindowsystem-5.7.0/src/kselectionowner.h       2015-02-08 
16:27:10.000000000 +0100
+++ new/kwindowsystem-5.8.0/src/kselectionowner.h       2015-03-07 
15:52:31.000000000 +0100
@@ -39,9 +39,10 @@
  is claimed by another owner.
  @short ICCCM manager selection owner
 
- This class is only useful on the xcb platform. On other platforms the code is 
not
- functional. In case you inherit from this class ensure that you don't use xcb 
and/or
- XLib without verifying the platform.
+ This class is only useful on the xcb platform. On other platforms the code is 
only
+ functional if the constructor overloads taking an xcb_connection_t are used. 
In case
+ you inherit from this class ensure that you don't use xcb and/or XLib without 
verifying
+ the platform.
 */
 class KWINDOWSYSTEM_EXPORT KSelectionOwner
     : public QObject
@@ -68,6 +69,33 @@
      * @param parent parent object, or NULL if there is none
      */
     explicit KSelectionOwner(const char *selection, int screen = -1, QObject 
*parent = NULL);
+    /**
+     * @overload
+     * This constructor accepts the xcb_connection_t and root window and 
doesn't depend on
+     * running on the xcb platform. Otherwise this constructor behaves like 
the similar one
+     * without the xcb_connection_t.
+     *
+     * @param selection atom representing the manager selection
+     * @param c the xcb connection this KSelectionWatcher should use
+     * @param root the root window this KSelectionWatcher should use
+     * @param parent parent object, or NULL if there is none
+     * @since 5.8
+     **/
+    explicit KSelectionOwner(xcb_atom_t selection, xcb_connection_t *c, 
xcb_window_t root, QObject *parent = Q_NULLPTR);
+
+    /**
+     * @overload
+     * This constructor accepts the xcb_connection_t and root window and 
doesn't depend on
+     * running on the xcb platform. Otherwise this constructor behaves like 
the similar one
+     * without the xcb_connection_t.
+     *
+     * @param selection name of the manager selection
+     * @param c the xcb connection this KSelectionWatcher should use
+     * @param root the root window this KSelectionWatcher should use
+     * @param parent parent object, or NULL if there is none
+     * @since 5.8
+     **/
+    explicit KSelectionOwner(const char *selection, xcb_connection_t *c, 
xcb_window_t root, QObject *parent = Q_NULLPTR);
 
     /**
      * Destructor. Calls release().
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kwindowsystem-5.7.0/src/kselectionwatcher.cpp 
new/kwindowsystem-5.8.0/src/kselectionwatcher.cpp
--- old/kwindowsystem-5.7.0/src/kselectionwatcher.cpp   2015-02-08 
16:27:10.000000000 +0100
+++ new/kwindowsystem-5.8.0/src/kselectionwatcher.cpp   2015-03-07 
15:52:31.000000000 +0100
@@ -66,8 +66,9 @@
     : public QAbstractNativeEventFilter
 {
 public:
-    Private(KSelectionWatcher *watcher_P, xcb_atom_t selection_P, int screen_P)
-        : root(QX11Info::appRootWindow(screen_P)),
+    Private(KSelectionWatcher *watcher_P, xcb_atom_t selection_P, 
xcb_connection_t *c, xcb_window_t root)
+        : connection(c),
+          root(root),
           selection(selection_P),
           selection_owner(XCB_NONE),
           watcher(watcher_P)
@@ -75,6 +76,7 @@
         QCoreApplication::instance()->installNativeEventFilter(this);
     }
 
+    xcb_connection_t *connection;
     xcb_window_t root;
     const xcb_atom_t selection;
     xcb_window_t selection_owner;
@@ -82,6 +84,8 @@
 
     static Private *create(KSelectionWatcher *watcher, xcb_atom_t selection_P, 
int screen_P);
     static Private *create(KSelectionWatcher *watcher, const char 
*selection_P, int screen_P);
+    static Private *create(KSelectionWatcher *watcher, xcb_atom_t selection_P, 
xcb_connection_t *c, xcb_window_t root);
+    static Private *create(KSelectionWatcher *watcher, const char 
*selection_P, xcb_connection_t *c, xcb_window_t root);
 
 protected:
     bool nativeEventFilter(const QByteArray &eventType, void *message, long 
*result) Q_DECL_OVERRIDE {
@@ -101,19 +105,29 @@
 KSelectionWatcher::Private 
*KSelectionWatcher::Private::create(KSelectionWatcher *watcher, xcb_atom_t 
selection_P, int screen_P)
 {
     if (QGuiApplication::platformName() == QStringLiteral("xcb")) {
-        return new Private(watcher, selection_P, screen_P);
+        return create(watcher, selection_P, QX11Info::connection(), 
QX11Info::appRootWindow(screen_P));
     }
     return Q_NULLPTR;
 }
 
+KSelectionWatcher::Private 
*KSelectionWatcher::Private::create(KSelectionWatcher *watcher, xcb_atom_t 
selection_P, xcb_connection_t *c, xcb_window_t root)
+{
+    return new Private(watcher, selection_P, c, root);
+}
+
 KSelectionWatcher::Private 
*KSelectionWatcher::Private::create(KSelectionWatcher *watcher, const char 
*selection_P, int screen_P)
 {
     if (QGuiApplication::platformName() == QStringLiteral("xcb")) {
-        return new Private(watcher, intern_atom(QX11Info::connection(), 
selection_P), screen_P);
+        return create(watcher, selection_P, QX11Info::connection(), 
QX11Info::appRootWindow(screen_P));
     }
     return Q_NULLPTR;
 }
 
+KSelectionWatcher::Private 
*KSelectionWatcher::Private::create(KSelectionWatcher *watcher, const char 
*selection_P, xcb_connection_t *c, xcb_window_t root)
+{
+    return new Private(watcher, intern_atom(c, selection_P), c, root);
+}
+
 KSelectionWatcher::KSelectionWatcher(xcb_atom_t selection_P, int screen_P, 
QObject *parent_P)
     :   QObject(parent_P),
         d(Private::create(this, selection_P, screen_P))
@@ -128,6 +142,20 @@
     init();
 }
 
+KSelectionWatcher::KSelectionWatcher(xcb_atom_t selection, xcb_connection_t 
*c, xcb_window_t root, QObject *parent)
+    : QObject(parent)
+    , d(Private::create(this, selection, c, root))
+{
+    init();
+}
+
+KSelectionWatcher::KSelectionWatcher(const char *selection, xcb_connection_t 
*c, xcb_window_t root, QObject *parent)
+    : QObject(parent)
+    , d(Private::create(this, selection, c, root))
+{
+    init();
+}
+
 KSelectionWatcher::~KSelectionWatcher()
 {
     delete d;
@@ -139,7 +167,7 @@
         return;
     }
     if (Private::manager_atom == XCB_NONE) {
-        xcb_connection_t *c = QX11Info::connection();
+        xcb_connection_t *c = d->connection;
 
         xcb_intern_atom_cookie_t atom_cookie = xcb_intern_atom(c, false, 
strlen("MANAGER"), "MANAGER");
         xcb_get_window_attributes_cookie_t attr_cookie = 
xcb_get_window_attributes(c, d->root);
@@ -167,7 +195,7 @@
     if (!d) {
         return XCB_WINDOW_NONE;
     }
-    xcb_connection_t *c = QX11Info::connection();
+    xcb_connection_t *c = d->connection;
 
     xcb_window_t current_owner = get_selection_owner(c, d->selection);
     if (current_owner == XCB_NONE) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kwindowsystem-5.7.0/src/kselectionwatcher.h 
new/kwindowsystem-5.8.0/src/kselectionwatcher.h
--- old/kwindowsystem-5.7.0/src/kselectionwatcher.h     2015-02-08 
16:27:10.000000000 +0100
+++ new/kwindowsystem-5.8.0/src/kselectionwatcher.h     2015-03-07 
15:52:31.000000000 +0100
@@ -38,9 +38,10 @@
  out current owner of the selection, owner() can be used.
  @short ICCCM manager selection watching
 
- This class is only useful on the xcb platform. On other platforms the code is 
not
- functional. In case you inherit from this class ensure that you don't use xcb 
and/or
- XLib without verifying the platform.
+ This class is only useful on the xcb platform. On other platforms the code is 
only
+ functional if the constructor overloads taking an xcb_connection_t are used. 
In case
+ you inherit from this class ensure that you don't use xcb and/or XLib without 
verifying
+ the platform.
 */
 class KWINDOWSYSTEM_EXPORT KSelectionWatcher
     : public QObject
@@ -66,6 +67,30 @@
      * @param parent parent object, or NULL if there is none
      */
     explicit KSelectionWatcher(const char *selection, int screen = -1, QObject 
*parent = NULL);
+    /**
+     * @overload
+     * This constructor accepts the xcb_connection_t and root window and 
doesn't depend on
+     * running on the xcb platform. Otherwise this constructor behaves like 
the similar one
+     * without the xcb_connection_t.
+     *
+     * @param selection atom representing the manager selection
+     * @param c the xcb connection this KSelectionWatcher should use
+     * @param root the root window this KSelectionWatcher should use
+     * @since 5.8
+     **/
+    explicit KSelectionWatcher(xcb_atom_t selection, xcb_connection_t *c, 
xcb_window_t root, QObject *parent = Q_NULLPTR);
+    /**
+     * @overload
+     * This constructor accepts the xcb_connection_t and root window and 
doesn't depend on
+     * running on the xcb platform. Otherwise this constructor behaves like 
the similar one
+     * without the xcb_connection_t.
+     *
+     * @param selection name of the manager selection
+     * @param c the xcb connection this KSelectionWatcher should use
+     * @param root the root window this KSelectionWatcher should use
+     * @since 5.8
+     **/
+    explicit KSelectionWatcher(const char *selection, xcb_connection_t *c, 
xcb_window_t root, QObject *parent = Q_NULLPTR);
     virtual ~KSelectionWatcher();
     /**
      * Return the current owner of the manager selection, if any. Note that if 
the event
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kwindowsystem-5.7.0/src/kwindowsystem.h 
new/kwindowsystem-5.8.0/src/kwindowsystem.h
--- old/kwindowsystem-5.7.0/src/kwindowsystem.h 2015-02-08 16:27:10.000000000 
+0100
+++ new/kwindowsystem-5.8.0/src/kwindowsystem.h 2015-03-07 15:52:31.000000000 
+0100
@@ -702,7 +702,7 @@
     void compositingChanged(bool enabled);
 
 protected:
-    virtual void connectNotify(const QMetaMethod &signal) Q_DECL_OVERRIDE;
+    void connectNotify(const QMetaMethod &signal) Q_DECL_OVERRIDE;
 
 private:
     friend class KWindowSystemStaticContainer;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kwindowsystem-5.7.0/src/kwindowsystem_p.h 
new/kwindowsystem-5.8.0/src/kwindowsystem_p.h
--- old/kwindowsystem-5.7.0/src/kwindowsystem_p.h       2015-02-08 
16:27:10.000000000 +0100
+++ new/kwindowsystem-5.8.0/src/kwindowsystem_p.h       2015-03-07 
15:52:31.000000000 +0100
@@ -93,7 +93,7 @@
     void setCurrentDesktop(int desktop) Q_DECL_OVERRIDE;
     void setOnAllDesktops(WId win, bool b) Q_DECL_OVERRIDE;
     void setOnDesktop(WId win, int desktop) Q_DECL_OVERRIDE;
-    virtual void setOnActivities(WId win, const QStringList &activities) 
Q_DECL_OVERRIDE;
+    void setOnActivities(WId win, const QStringList &activities) 
Q_DECL_OVERRIDE;
 #ifndef KWINDOWSYSTEM_NO_DEPRECATED
     WId transientFor(WId window) Q_DECL_OVERRIDE;
     WId groupLeader(WId window) Q_DECL_OVERRIDE;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kwindowsystem-5.7.0/src/kwindowsystem_p_x11.h 
new/kwindowsystem-5.8.0/src/kwindowsystem_p_x11.h
--- old/kwindowsystem-5.7.0/src/kwindowsystem_p_x11.h   2015-02-08 
16:27:10.000000000 +0100
+++ new/kwindowsystem-5.8.0/src/kwindowsystem_p_x11.h   2015-03-07 
15:52:31.000000000 +0100
@@ -132,14 +132,14 @@
     int xfixesEventBase;
     bool mapViewport();
 
-    virtual bool nativeEventFilter(const QByteArray &eventType, void *message, 
long int *result) Q_DECL_OVERRIDE;
+    bool nativeEventFilter(const QByteArray &eventType, void *message, long 
int *result) Q_DECL_OVERRIDE;
 
     void updateStackingOrder();
     bool removeStrutWindow(WId);
 
 protected:
-    virtual void addClient(xcb_window_t) Q_DECL_OVERRIDE;
-    virtual void removeClient(xcb_window_t) Q_DECL_OVERRIDE;
+    void addClient(xcb_window_t) Q_DECL_OVERRIDE;
+    void removeClient(xcb_window_t) Q_DECL_OVERRIDE;
 
 private:
     bool nativeEventFilter(xcb_generic_event_t *event);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kwindowsystem-5.7.0/src/kxmessages.cpp 
new/kwindowsystem-5.8.0/src/kxmessages.cpp
--- old/kwindowsystem-5.7.0/src/kxmessages.cpp  2015-02-08 16:27:10.000000000 
+0100
+++ new/kwindowsystem-5.8.0/src/kxmessages.cpp  2015-03-07 15:52:31.000000000 
+0100
@@ -109,17 +109,19 @@
     : public QAbstractNativeEventFilter
 {
 public:
-    KXMessagesPrivate(KXMessages *parent, const char *acceptBroadcast)
+    KXMessagesPrivate(KXMessages *parent, const char *acceptBroadcast, 
xcb_connection_t *c, xcb_window_t root)
         : accept_atom1(acceptBroadcast ? QByteArray(acceptBroadcast) + 
QByteArrayLiteral("_BEGIN") : QByteArray())
         , accept_atom2(acceptBroadcast ? QByteArray(acceptBroadcast) : 
QByteArray())
         , handle(new QWidget)
         , q(parent)
-        , valid(QX11Info::isPlatformX11())
+        , valid(c)
+        , connection(c)
+        , rootWindow(root)
         {
             if (acceptBroadcast) {
-                accept_atom1.setConnection(QX11Info::connection());
+                accept_atom1.setConnection(c);
                 accept_atom1.fetch();
-                accept_atom2.setConnection(QX11Info::connection());
+                accept_atom2.setConnection(c);
                 accept_atom2.fetch();
                 QCoreApplication::instance()->installNativeEventFilter(this);
             }
@@ -130,6 +132,8 @@
     QScopedPointer<QWidget> handle;
     KXMessages *q;
     bool valid;
+    xcb_connection_t *connection;
+    xcb_window_t rootWindow;
 
     bool nativeEventFilter(const QByteArray &eventType, void *message, long 
*result)
     {
@@ -186,7 +190,13 @@
 
 KXMessages::KXMessages(const char *accept_broadcast_P, QObject *parent_P)
     : QObject(parent_P)
-    , d(new KXMessagesPrivate(this, accept_broadcast_P))
+    , d(new KXMessagesPrivate(this, accept_broadcast_P, 
QX11Info::isPlatformX11() ? QX11Info::connection() : Q_NULLPTR, 
QX11Info::isPlatformX11() ? QX11Info::appRootWindow() : 0))
+{
+}
+
+KXMessages::KXMessages(xcb_connection_t *connection, xcb_window_t rootWindow, 
const char *accept_broadcast, QObject *parent)
+    : QObject(parent)
+    , d(new KXMessagesPrivate(this, accept_broadcast, connection, rootWindow))
 {
 }
 
@@ -195,6 +205,19 @@
     delete d;
 }
 
+static
+xcb_screen_t *defaultScreen(xcb_connection_t *c, int screen)
+{
+    for (xcb_screen_iterator_t it = xcb_setup_roots_iterator(xcb_get_setup(c));
+            it.rem;
+            --screen, xcb_screen_next(&it)) {
+        if (screen == 0) {
+            return it.data;
+        }
+    }
+    return Q_NULLPTR;
+}
+
 void KXMessages::broadcastMessage(const char *msg_type_P, const QString 
&message_P, int screen_P)
 {
     if (!d->valid) {
@@ -202,10 +225,10 @@
         return;
     }
     const QByteArray msg(msg_type_P);
-    XcbAtom a2(QX11Info::connection(), msg);
-    XcbAtom a1(QX11Info::connection(), msg + QByteArrayLiteral("_BEGIN"));
-    xcb_window_t root = screen_P == -1 ? QX11Info::appRootWindow() : 
QX11Info::appRootWindow(screen_P);
-    send_message_internal(root, message_P, QX11Info::connection(),
+    XcbAtom a2(d->connection, msg);
+    XcbAtom a1(d->connection, msg + QByteArrayLiteral("_BEGIN"));
+    xcb_window_t root = screen_P == -1 ? d->rootWindow : 
defaultScreen(d->connection, screen_P)->root;
+    send_message_internal(root, message_P, d->connection,
                           a1, a2, d->handle->winId());
 }
 
@@ -229,18 +252,6 @@
 }
 #endif
 
-xcb_screen_t *defaultScreen(xcb_connection_t *c, int screen)
-{
-    for (xcb_screen_iterator_t it = xcb_setup_roots_iterator(xcb_get_setup(c));
-            it.rem;
-            --screen, xcb_screen_next(&it)) {
-        if (screen == 0) {
-            return it.data;
-        }
-    }
-    return Q_NULLPTR;
-}
-
 bool KXMessages::broadcastMessageX(xcb_connection_t *c, const char 
*msg_type_P, const QString &message, int screenNumber)
 {
     if (!c) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kwindowsystem-5.7.0/src/kxmessages.h 
new/kwindowsystem-5.8.0/src/kxmessages.h
--- old/kwindowsystem-5.7.0/src/kxmessages.h    2015-02-08 16:27:10.000000000 
+0100
+++ new/kwindowsystem-5.8.0/src/kxmessages.h    2015-03-07 15:52:31.000000000 
+0100
@@ -31,8 +31,8 @@
 
 #include <config-kwindowsystem.h> // KWINDOWSYSTEM_HAVE_X11
 #if KWINDOWSYSTEM_HAVE_X11
+#include <xcb/xcb.h>
 typedef struct _XDisplay Display;
-struct xcb_connection_t;
 
 class QString;
 
@@ -61,6 +61,19 @@
      */
     explicit KXMessages(const char *accept_broadcast = NULL, QObject *parent = 
NULL);
 
+    /**
+     * @overload
+     * Overload passing in the xcb_connection_t to use instead relying on 
platform xcb.
+     *
+     * @param connection The xcb connection
+     * @param rootWindow The rootWindow to use
+     * @param accept_broadcast if non-NULL, all broadcast messages with
+     *                         this message type will be received.
+     * @param parent the parent of this object
+     * @since 5.8
+     **/
+    explicit KXMessages(xcb_connection_t *connection, xcb_window_t rootWindow, 
const char *accept_broadcast = Q_NULLPTR, QObject *parent = Q_NULLPTR);
+
     virtual ~KXMessages();
     /**
      * Broadcasts the given message with the given message type.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kwindowsystem-5.7.0/tests/backgroundcontrasttest.cpp 
new/kwindowsystem-5.8.0/tests/backgroundcontrasttest.cpp
--- old/kwindowsystem-5.7.0/tests/backgroundcontrasttest.cpp    2015-02-08 
16:27:10.000000000 +0100
+++ new/kwindowsystem-5.8.0/tests/backgroundcontrasttest.cpp    2015-03-07 
15:52:31.000000000 +0100
@@ -31,7 +31,7 @@
 public:
     ContrastTestWindow();
 
-    virtual void resizeEvent(QResizeEvent *) Q_DECL_OVERRIDE;
+    void resizeEvent(QResizeEvent *) Q_DECL_OVERRIDE;
 
 private:
     QPushButton *m_btnNothing;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kwindowsystem-5.7.0/tests/blurbehindtest.cpp 
new/kwindowsystem-5.8.0/tests/blurbehindtest.cpp
--- old/kwindowsystem-5.7.0/tests/blurbehindtest.cpp    2015-02-08 
16:27:10.000000000 +0100
+++ new/kwindowsystem-5.8.0/tests/blurbehindtest.cpp    2015-03-07 
15:52:31.000000000 +0100
@@ -30,7 +30,7 @@
 public:
     BlurTestWindow();
 
-    virtual void resizeEvent(QResizeEvent *) Q_DECL_OVERRIDE;
+    void resizeEvent(QResizeEvent *) Q_DECL_OVERRIDE;
 
 private:
     QPushButton *m_btnNothing;

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to