Commit 6f3a72be authored by Marco Martin's avatar Marco Martin Committed by Vlad Zahorodnii
Browse files

Toggle all desktop on middle click

restores the behavior of the old desktop grid which toggled on all desktops on middle click

BUG:454001


(cherry picked from commit f6db8b11)
parent 07065e89
Pipeline #181386 passed with stage
in 21 minutes and 33 seconds
......@@ -105,6 +105,16 @@ DropArea {
~KWinComponents.ClientFilterModel.Notification;
}
onActivated: effect.deactivate(effect.animationDuration);
onWindowClicked: {
if (eventPoint.event.button !== Qt.MiddleButton) {
return;
}
if (window.desktop > -1) {
window.desktop = -1;
} else {
window.desktop = desktopView.desktop.x11DesktopNumber;
}
}
Behavior on x {
enabled: !dragHandler.active
XAnimator {
......
......@@ -190,6 +190,12 @@ FocusScope {
organized: container.organized
supportsCloseWindows: true
supportsDragUpGesture: true
onWindowClicked: {
if (eventPoint.event.button !== Qt.MiddleButton) {
return;
}
window.closeWindow();
}
model: KWinComponents.ClientFilterModel {
activity: KWinComponents.Workspace.currentActivity
desktop: KWinComponents.Workspace.currentVirtualDesktop
......
......@@ -41,6 +41,8 @@ FocusScope {
property bool dragActive: false
signal activated()
//TODO: for 5.26 the delegate will be a separate component instead
signal windowClicked(QtObject window, EventPoint eventPoint)
function activateIndex(index) {
KWinComponents.Workspace.activeClient = windowsRepeater.itemAt(index).client;
......@@ -327,10 +329,11 @@ FocusScope {
}
TapHandler {
enabled: heap.supportsCloseWindows
acceptedPointerTypes: PointerDevice.GenericPointer | PointerDevice.Pen
acceptedButtons: Qt.MiddleButton
onTapped: thumb.client.closeWindow()
acceptedButtons: Qt.LeftButton | Qt.MiddleButton | Qt.RightButton
onTapped: {
heap.windowClicked(thumb.client, eventPoint)
}
}
component DragManager : DragHandler {
......
......@@ -110,6 +110,12 @@ Item {
showOnly: container.effect.mode === WindowView.ModeWindowClass ? "activeClass" : selectedIds
layout: effect.layout
supportsCloseWindows: true
onWindowClicked: {
if (eventPoint.event.button !== Qt.MiddleButton) {
return;
}
window.closeWindow();
}
model: KWinComponents.ClientFilterModel {
activity: KWinComponents.Workspace.currentActivity
desktop: container.effect.mode == WindowView.ModeCurrentDesktop ? KWinComponents.Workspace.currentVirtualDesktop : undefined
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment