From c3362fe866dd6368855905b8fbc6e828197cb538 Mon Sep 17 00:00:00 2001 From: Anthony Fieroni Date: Tue, 21 Mar 2017 20:56:25 +0200 Subject: [PATCH 1/3] [kcm_kwindecoration] Respect theme colors in buttons https://phabricator.kde.org/D5116 Signed-off-by: Anthony Fieroni --- kcmkwin/kwindecoration/qml/Buttons.qml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kcmkwin/kwindecoration/qml/Buttons.qml b/kcmkwin/kwindecoration/qml/Buttons.qml index 64ab0f9be3..d8ca4258de 100644 --- a/kcmkwin/kwindecoration/qml/Buttons.qml +++ b/kcmkwin/kwindecoration/qml/Buttons.qml @@ -39,7 +39,7 @@ Item { anchors.fill: parent anchors.topMargin: units.gridUnit / 2 border.width: Math.ceil(units.gridUnit / 16.0) - color: SystemPalette.base; + color: backgroundColor; border.color: highlightColor; ColumnLayout { id: layout @@ -51,7 +51,7 @@ Item { Layout.fillWidth: true border.width: Math.ceil(units.gridUnit / 16.0) border.color: highlightColor - color: SystemPalette.base; + color: backgroundColor; RowLayout { id: buttonPreviewRow anchors.top: parent.top; @@ -194,7 +194,7 @@ Item { id: dragHint visible: !(leftButtonsView.dragging || rightButtonsView.dragging || availableGrid.dragging) Layout.fillWidth: true - color: SystemPalette.text; + color: backgroundColor; opacity: 0.66 horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignTop From 1bfe1164f41dc328d54f7dc6ed13b2fabfde09f6 Mon Sep 17 00:00:00 2001 From: Vladyslav Tronko Date: Fri, 24 Mar 2017 16:57:43 +0100 Subject: [PATCH 2/3] Fix crash on dragging titlebar buttons in System Settings Summary: Currently, if user tries to move one of buttons to the left, ending up dragging one button onto another, crash occurs. In addition, this patch replaces verbose replacement(remove/insert) with more elegant QVector::move(int, int) BUG: 374153 FIXED-IN: 5.8.7 Reviewers: graesslin, #kwin Reviewed By: graesslin, #kwin Subscribers: kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D5117 --- .../declarative-plugin/buttonsmodel.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/kcmkwin/kwindecoration/declarative-plugin/buttonsmodel.cpp b/kcmkwin/kwindecoration/declarative-plugin/buttonsmodel.cpp index b2ac124ed3..8053c80b34 100644 --- a/kcmkwin/kwindecoration/declarative-plugin/buttonsmodel.cpp +++ b/kcmkwin/kwindecoration/declarative-plugin/buttonsmodel.cpp @@ -162,8 +162,18 @@ void ButtonsModel::move(int sourceIndex, int targetIndex) if (sourceIndex == qMax(0, targetIndex)) { return; } - beginMoveRows(QModelIndex(), sourceIndex, sourceIndex, QModelIndex(), targetIndex + 1); - m_buttons.insert(qMax(0, targetIndex), m_buttons.takeAt(sourceIndex)); + + /* When moving an item down, the destination index needs to be incremented + by one, as explained in the documentation: + http://doc.qt.nokia.com/qabstractitemmodel.html#beginMoveRows */ + if (targetIndex > sourceIndex) { + // Row will be moved down + beginMoveRows(QModelIndex(), sourceIndex, sourceIndex, QModelIndex(), targetIndex + 1); + } else { + beginMoveRows(QModelIndex(), sourceIndex, sourceIndex, QModelIndex(), qMax(0, targetIndex)); + } + + m_buttons.move(sourceIndex, qMax(0, targetIndex)); endMoveRows(); } From 4ca3d0d94370002430b5131520a11c06b23bdcaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Mon, 10 Apr 2017 06:52:44 +0200 Subject: [PATCH 3/3] [platforms/drm] Explicitly request event context version 2 Summary: Libdrm 2.4.78 introduces a version 2 and if KWin gets built against it our code would break. Given that this change is for Plasma/5.8 branch. Closes T5839 Reviewers: #kwin, #plasma Subscribers: plasma-devel, kwin Tags: #kwin Maniphest Tasks: T5839 Differential Revision: https://phabricator.kde.org/D5380 --- plugins/platforms/drm/drm_backend.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/platforms/drm/drm_backend.cpp b/plugins/platforms/drm/drm_backend.cpp index dc2b796965..9e9cb60e16 100644 --- a/plugins/platforms/drm/drm_backend.cpp +++ b/plugins/platforms/drm/drm_backend.cpp @@ -61,6 +61,8 @@ along with this program. If not, see . #define DRM_CAP_CURSOR_HEIGHT 0x9 #endif +#define KWIN_DRM_EVENT_CONTEXT_VERSION 2 + namespace KWin { @@ -240,7 +242,7 @@ void DrmBackend::openDrm() } drmEventContext e; memset(&e, 0, sizeof e); - e.version = DRM_EVENT_CONTEXT_VERSION; + e.version = KWIN_DRM_EVENT_CONTEXT_VERSION; e.page_flip_handler = pageFlipHandler; drmHandleEvent(m_fd, &e); }