Hello community, here is the log from the commit of package libkscreen for openSUSE:Factory checked in at 2014-10-14 07:09:09 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libkscreen (Old) and /work/SRC/openSUSE:Factory/.libkscreen.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libkscreen" Changes: -------- --- /work/SRC/openSUSE:Factory/libkscreen/libkscreen.changes 2014-05-15 21:31:26.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.libkscreen.new/libkscreen.changes 2014-10-14 07:09:16.000000000 +0200 @@ -1,0 +2,16 @@ +Tue Sep 30 22:50:23 UTC 2014 - [email protected] + +- Explicitly buildrequire needed x11 libraries, do not count + with them coming indirectly. + +------------------------------------------------------------------- +Mon Aug 4 19:56:24 UTC 2014 - [email protected] + +- Update to version 1.0.5: + * Bugfix release: + - Use a xcb private connection to query for xrandr version, kde#331784 + - Don't leave dangling pointer when primary output is removed + - Fix crash in XRandR backend when primary output is not set, + kde#335366, kde#334598 + +------------------------------------------------------------------- Old: ---- libkscreen-1.0.4.tar.xz New: ---- libkscreen-1.0.5.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libkscreen.spec ++++++ --- /var/tmp/diff_new_pack.nwq5Ew/_old 2014-10-14 07:09:17.000000000 +0200 +++ /var/tmp/diff_new_pack.nwq5Ew/_new 2014-10-14 07:09:17.000000000 +0200 @@ -19,7 +19,7 @@ # %define soversion 1 Name: libkscreen -Version: 1.0.4 +Version: 1.0.5 Release: 0 Summary: KDE's screen management library License: GPL-2.0+ @@ -28,9 +28,11 @@ Source: http://download.kde.org/stable/%{name}/%{version}/src/%{name}-%{version}.tar.xz BuildRequires: libkde4-devel >= 4.7.0 BuildRequires: libqjson-devel >= 0.8.1 +BuildRequires: pkgconfig(x11) BuildRequires: pkgconfig(xcb) BuildRequires: pkgconfig(xcb-image) BuildRequires: pkgconfig(xcb-renderutil) +BuildRequires: pkgconfig(xrandr) Provides: libkscreen-plugin BuildRoot: %{_tmppath}/%{name}-%{version}-build ++++++ libkscreen-1.0.4.tar.xz -> libkscreen-1.0.5.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libkscreen-1.0.4/backends/xrandr/CMakeLists.txt new/libkscreen-1.0.5/backends/xrandr/CMakeLists.txt --- old/libkscreen-1.0.4/backends/xrandr/CMakeLists.txt 2014-05-11 03:17:35.000000000 +0200 +++ new/libkscreen-1.0.5/backends/xrandr/CMakeLists.txt 2014-08-03 23:14:49.000000000 +0200 @@ -23,6 +23,8 @@ ${KDE4_KDEUI_LIBS} ${X11_Xrandr_LIB} ${X11_LIBRARIES} + ${XCB_RANDR_LIBRARIES} + ${XCB_XCB_LIBRARIES} kscreen ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libkscreen-1.0.4/backends/xrandr/xrandr.cpp new/libkscreen-1.0.5/backends/xrandr/xrandr.cpp --- old/libkscreen-1.0.4/backends/xrandr/xrandr.cpp 2014-05-11 03:17:35.000000000 +0200 +++ new/libkscreen-1.0.5/backends/xrandr/xrandr.cpp 2014-08-03 23:14:49.000000000 +0200 @@ -34,6 +34,8 @@ #include <QtGui/QX11Info> #include <QApplication> +#include <xcb/randr.h> + #include <kdebug.h> Q_EXPORT_PLUGIN2(XRandR, XRandR) @@ -55,25 +57,35 @@ , m_x11Helper(0) , m_isValid(false) { - if (s_display == 0) { - s_display = QX11Info::display(); - s_screen = DefaultScreen(s_display); - s_rootWindow = XRootWindow(s_display, s_screen); + // Use our own connection to make sure that we won't mess up Qt's connection + // if something goes wrong on our side. + xcb_generic_error_t *error = 0; + xcb_randr_query_version_reply_t* version; + xcb_connection_t *connection = xcb_connect(0, 0); + version = xcb_randr_query_version_reply(connection, xcb_randr_query_version(connection, XCB_RANDR_MAJOR_VERSION, XCB_RANDR_MINOR_VERSION), &error); + xcb_disconnect(connection); - XRRQueryExtension(s_display, &s_randrBase, &s_randrError); + if (!version || error) { + free(error); + return; } - int majorVersion = 0, minorVersion = 0; - XRRQueryVersion(s_display, &majorVersion, &minorVersion); - - if ((majorVersion > 1) || ((majorVersion == 1) && (minorVersion >= 2))) { + if ((version->major_version > 1) || ((version->major_version == 1) && (version->minor_version >= 2))) { m_isValid = true; } else { kDebug() << "XRandR extension not available or unsupported version"; return; } - XRandR::s_has_1_3 = (majorVersion > 1 || (majorVersion == 1 && minorVersion >= 3)); + if (s_display == 0) { + s_display = QX11Info::display(); + s_screen = DefaultScreen(s_display); + s_rootWindow = XRootWindow(s_display, s_screen); + + XRRQueryExtension(s_display, &s_randrBase, &s_randrError); + } + + XRandR::s_has_1_3 = (version->major_version > 1 || (version->major_version == 1 && version->minor_version >= 3)); if (s_internalConfig == 0) { s_internalConfig = new XRandRConfig(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libkscreen-1.0.4/backends/xrandr/xrandrconfig.cpp new/libkscreen-1.0.5/backends/xrandr/xrandrconfig.cpp --- old/libkscreen-1.0.4/backends/xrandr/xrandrconfig.cpp 2014-05-11 03:17:35.000000000 +0200 +++ new/libkscreen-1.0.5/backends/xrandr/xrandrconfig.cpp 2014-08-03 23:14:49.000000000 +0200 @@ -125,7 +125,7 @@ config->setOutputs(kscreenOutputs); config->setScreen(m_screen->toKScreenScreen(config)); - if (m_primaryOutput != -1 && config->primaryOutput()->id() != m_primaryOutput) { + if (m_primaryOutput != -1 && (!config->primaryOutput() || config->primaryOutput()->id() != m_primaryOutput)) { config->setPrimaryOutput(kscreenOutputs.value(m_primaryOutput)); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libkscreen-1.0.4/backends/xrandr1.1/wrapper.h new/libkscreen-1.0.5/backends/xrandr1.1/wrapper.h --- old/libkscreen-1.0.4/backends/xrandr1.1/wrapper.h 2014-05-11 03:17:35.000000000 +0200 +++ new/libkscreen-1.0.5/backends/xrandr1.1/wrapper.h 2014-08-03 23:14:49.000000000 +0200 @@ -24,14 +24,22 @@ #include <QtGui/QX11Info> -Display* display() +static xcb_connection_t *XRandR11XCBConnection = 0; + +xcb_connection_t *connection() { - return QX11Info::display(); + // Use our own connection to make sure that we won't mess up Qt's connection + // if something goes wrong on our side. + if (XRandR11XCBConnection == 0) { + XRandR11XCBConnection = xcb_connect(0, 0); + } + return XRandR11XCBConnection; } -xcb_connection_t *connection() +void closeConnection() { - return XGetXCBConnection(display()); + xcb_disconnect(XRandR11XCBConnection); + XRandR11XCBConnection = 0; } xcb_screen_t *screen_of_display (xcb_connection_t *c, int screen) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libkscreen-1.0.4/backends/xrandr1.1/xrandr11.cpp new/libkscreen-1.0.5/backends/xrandr1.1/xrandr11.cpp --- old/libkscreen-1.0.4/backends/xrandr1.1/xrandr11.cpp 2014-05-11 03:17:35.000000000 +0200 +++ new/libkscreen-1.0.5/backends/xrandr1.1/xrandr11.cpp 2014-08-03 23:14:49.000000000 +0200 @@ -51,7 +51,8 @@ qDebug() << "Can't get XRandR version"; return; } - if (version->minor_version > 1) { + + if (version->major_version != 1 || version->minor_version != 1) { qDebug() << "This backend is only for XRandR 1.1, your version is: " << version->major_version << "." << version->minor_version; return; } @@ -65,6 +66,7 @@ XRandR11::~XRandR11() { + closeConnection(); delete m_currentConfig; delete m_x11Helper; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libkscreen-1.0.4/src/config.cpp new/libkscreen-1.0.5/src/config.cpp --- old/libkscreen-1.0.4/src/config.cpp 2014-05-11 03:17:35.000000000 +0200 +++ new/libkscreen-1.0.5/src/config.cpp 2014-08-03 23:14:49.000000000 +0200 @@ -268,6 +268,9 @@ Output *output = d->outputs.take(outputId); if (output) { output->deleteLater(); + if (d->primaryOutput == output) { + setPrimaryOutput(0); + } } Q_EMIT outputRemoved(outputId); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libkscreen-1.0.4/src/config.h new/libkscreen-1.0.5/src/config.h --- old/libkscreen-1.0.4/src/config.h 2014-05-11 03:17:35.000000000 +0200 +++ new/libkscreen-1.0.5/src/config.h 2014-08-03 23:14:49.000000000 +0200 @@ -29,6 +29,18 @@ namespace KScreen { +/** + * Represents a (or the) screen configuration. + * + * This is the main class of KScreen, with it you can use + * the static methods current() to get the systems config and + * setConfig() to apply a config to the system. + * + * Also, you can instance an empty Config, this is usualy done + * to create a config (with the objective of setting it) from scratch + * and for example unserialize a saved config to it. + * + */ class KSCREEN_EXPORT Config : public QObject { Q_OBJECT @@ -36,14 +48,64 @@ Q_PROPERTY(OutputList outputs READ outputs) public: + /** + * Tries to load a backend (it might be already loaded) + * + * @return true if there is a working backend, false if none are found or work + */ static bool loadBackend(); + + /** + * Gets the current system configuration + * + * The returned config is a representation of the current system setup, for + * example if your screens a currently cloned, it will show that. + * + * @return the current system config, or null on error + */ static Config* current(); + + /** + * Sets the given config to the system + * + * The config will first be validated via canBeApplied(), then + * it will be applied to the system. + * + * @arg config to be applied + * @return true if everything went well, false if something failed + */ static bool setConfig(Config* config); + + /** + * Validates that a config can be applied in the current system + * + * Each system has different constrains, this method will test + * the given config with those constrains to see if it + * can be applied. + * + * @arg config to be checked + * @return true if the configuration can be applied, false if not. + */ static bool canBeApplied(Config* config); + /** + * Instance an empty config + * + * Usually you never want to use this constructor since there are some + * values that make no sense to set (for example you want the Screen of + * the current systme). + * + * So usually what you do is call current() and then modify + * whatever you need. + */ explicit Config(QObject *parent = 0); virtual ~Config(); + /** + * Duplicates the config + * + * @return a new Config instance with same property values + */ Config* clone() const; Screen* screen() const; -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
