From 2cdd97c68544eac83c95936aa0a2f0a3eb2b7938 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Wed, 24 May 2017 18:03:19 +0200 Subject: [PATCH] wire up requestToggleKeepAbove/below Summary: cobbect requestToggleKeepAbove and below with libtaskmanager Test Plan: setting keep above from taskbar works Reviewers: #plasma, hein, graesslin, #plasma_on_wayland Reviewed By: #plasma, hein, graesslin Subscribers: graesslin, plasma-devel Tags: #plasma Differential Revision: https://phabricator.kde.org/D5758 --- libtaskmanager/waylandtasksmodel.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/libtaskmanager/waylandtasksmodel.cpp b/libtaskmanager/waylandtasksmodel.cpp index c1e2172c2..78e07fa6a 100644 --- a/libtaskmanager/waylandtasksmodel.cpp +++ b/libtaskmanager/waylandtasksmodel.cpp @@ -530,16 +530,20 @@ void WaylandTasksModel::requestToggleMaximized(const QModelIndex &index) void WaylandTasksModel::requestToggleKeepAbove(const QModelIndex &index) { - Q_UNUSED(index) + if (!index.isValid() || index.model() != this || index.row() < 0 || index.row() >= d->windows.count()) { + return; + } - // FIXME Implement. + d->windows.at(index.row())->requestToggleKeepAbove(); } void WaylandTasksModel::requestToggleKeepBelow(const QModelIndex &index) { - Q_UNUSED(index) + if (!index.isValid() || index.model() != this || index.row() < 0 || index.row() >= d->windows.count()) { + return; + } - // FIXME Implement. + d->windows.at(index.row())->requestToggleKeepBelow(); } void WaylandTasksModel::requestToggleFullScreen(const QModelIndex &index)