|
|
|
|
@ -1,37 +1,8 @@ |
|
|
|
|
From a782b7db8d28bf67650458356507a09698c0098f Mon Sep 17 00:00:00 2001
|
|
|
|
|
From 1b0db2a7d0600ac1f1b33437fd43934133477b0e Mon Sep 17 00:00:00 2001
|
|
|
|
|
From: Jacopo De Simoi <wilderjds@protonmail.com>
|
|
|
|
|
Date: Mon, 21 Nov 2022 15:31:57 -0500
|
|
|
|
|
Subject: [PATCH 10/20] Implement core panning methods
|
|
|
|
|
Date: Mon, 19 Jan 2026 10:22:58 -0500
|
|
|
|
|
Subject: [PATCH 10/21] Implement core panning methods
|
|
|
|
|
|
|
|
|
|
Introduce methods used to pan windows horizontally by a certain pixel
|
|
|
|
|
amount. Panning applies to all windows which belong to a specified
|
|
|
|
|
screen:
|
|
|
|
|
|
|
|
|
|
- the main method is ~panWindows~, which iterates on all windows and
|
|
|
|
|
pans those that belong to the specified screen of the required amount.
|
|
|
|
|
|
|
|
|
|
- there are 4 slots used to pan all windows on the current screen by
|
|
|
|
|
1/2 and 1/3 of its size left or right. These slots are accessible via
|
|
|
|
|
user actions
|
|
|
|
|
|
|
|
|
|
- Finally, there is a method to ensure a given window is visible (this
|
|
|
|
|
slot is called upon client activation)
|
|
|
|
|
|
|
|
|
|
Fix compilation
|
|
|
|
|
|
|
|
|
|
screen() has been removed and replaced by some method that returns a pointer to a KWin::output; this may lead to some trouble
|
|
|
|
|
|
|
|
|
|
Prevent focused panel to move everything
|
|
|
|
|
|
|
|
|
|
[hyper-wide] Ensure selected window is visible
|
|
|
|
|
|
|
|
|
|
this is weird; it should not be necessary
|
|
|
|
|
|
|
|
|
|
stash with definition of panWindows
|
|
|
|
|
|
|
|
|
|
[hyper-wide] Fix pan windows with fractional scaling
|
|
|
|
|
|
|
|
|
|
Fix ensureVisible
|
|
|
|
|
---
|
|
|
|
|
src/effect/effecthandler.cpp | 1 +
|
|
|
|
|
src/placement.cpp | 75 ++++++++++++++++++++++++++++++++++++
|
|
|
|
|
@ -41,10 +12,10 @@ Fix ensureVisible |
|
|
|
|
5 files changed, 92 insertions(+)
|
|
|
|
|
|
|
|
|
|
diff --git a/src/effect/effecthandler.cpp b/src/effect/effecthandler.cpp
|
|
|
|
|
index 84c45f62cf..2492f7ba22 100644
|
|
|
|
|
index f592a27cde..41f27d9793 100644
|
|
|
|
|
--- a/src/effect/effecthandler.cpp
|
|
|
|
|
+++ b/src/effect/effecthandler.cpp
|
|
|
|
|
@@ -779,6 +779,7 @@ void EffectsHandler::activateWindow(EffectWindow *effectWindow)
|
|
|
|
|
@@ -785,6 +785,7 @@ void EffectsHandler::activateWindow(EffectWindow *effectWindow)
|
|
|
|
|
auto window = effectWindow->window();
|
|
|
|
|
if (window->isClient()) {
|
|
|
|
|
Workspace::self()->activateWindow(window, true);
|
|
|
|
|
@ -53,20 +24,19 @@ index 84c45f62cf..2492f7ba22 100644 |
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
diff --git a/src/placement.cpp b/src/placement.cpp
|
|
|
|
|
index 6c984282e5..7e68c8e108 100644
|
|
|
|
|
index eeae4fc93b..820a9c9a59 100644
|
|
|
|
|
--- a/src/placement.cpp
|
|
|
|
|
+++ b/src/placement.cpp
|
|
|
|
|
@@ -13,7 +13,9 @@
|
|
|
|
|
@@ -11,6 +11,8 @@
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "placement.h"
|
|
|
|
|
+#include "core/output.h"
|
|
|
|
|
+#include "core/outputbackend.h"
|
|
|
|
|
#include "cursor.h"
|
|
|
|
|
#include "options.h"
|
|
|
|
|
+#include "core/outputbackend.h"
|
|
|
|
|
#include "rules.h"
|
|
|
|
|
+#include "core/output.h"
|
|
|
|
|
#include "virtualdesktops.h"
|
|
|
|
|
#include "window.h"
|
|
|
|
|
#include "workspace.h"
|
|
|
|
|
@@ -741,6 +743,79 @@ void Window::shrinkVertical()
|
|
|
|
|
@@ -772,6 +774,79 @@ void Window::shrinkVertical()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -81,20 +51,20 @@ index 6c984282e5..7e68c8e108 100644 |
|
|
|
|
+ if ((!client->isOnCurrentDesktop()) || (client->isMinimized()) || (client->isOnAllDesktops()) || (!client->isMovable()) || (client->output() != output))
|
|
|
|
|
+ continue;
|
|
|
|
|
+ // refactor usind client->isOnOutput
|
|
|
|
|
+ client->moveRelative(QPointF(pixels, 0 ));
|
|
|
|
|
+ client->moveRelative(QPointF(pixels, 0));
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+ // TODO:
|
|
|
|
|
+ // find current screen with screens()->current()
|
|
|
|
|
+ // move only clients on current screen
|
|
|
|
|
+ // refactor this in a generic method and make the slots call it;
|
|
|
|
|
+ // genericmethod should look like
|
|
|
|
|
+ //
|
|
|
|
|
+ // slotPanWindows( int screen, int pixels, bool shiftActive)
|
|
|
|
|
+// TODO:
|
|
|
|
|
+// find current screen with screens()->current()
|
|
|
|
|
+// move only clients on current screen
|
|
|
|
|
+// refactor this in a generic method and make the slots call it;
|
|
|
|
|
+// genericmethod should look like
|
|
|
|
|
+//
|
|
|
|
|
+// slotPanWindows( int screen, int pixels, bool shiftActive)
|
|
|
|
|
+
|
|
|
|
|
+ // The shift amount is given by the size of the window + 2*gapSize
|
|
|
|
|
+ // The size of the window + 2*gapsize should be the (width of the screen - 2*screenBorder - 2*gapSize)/2
|
|
|
|
|
+// The shift amount is given by the size of the window + 2*gapSize
|
|
|
|
|
+// The size of the window + 2*gapsize should be the (width of the screen - 2*screenBorder - 2*gapSize)/2
|
|
|
|
|
+
|
|
|
|
|
+void Workspace::slotPanWindowsHalfScreenRight()
|
|
|
|
|
+{
|
|
|
|
|
@ -128,7 +98,7 @@ index 6c984282e5..7e68c8e108 100644 |
|
|
|
|
+ panWindows(currentOutput, -thirdWidth, false);
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+void Workspace::slotEnsureClientVisible( KWin::Window* activatedClient )
|
|
|
|
|
+void Workspace::slotEnsureClientVisible(KWin::Window *activatedClient)
|
|
|
|
|
+{
|
|
|
|
|
+ // This also should be made screen-aware
|
|
|
|
|
+ if ((!activatedClient) || activatedClient->isDesktop() || activatedClient->isDock())
|
|
|
|
|
@ -147,29 +117,29 @@ index 6c984282e5..7e68c8e108 100644 |
|
|
|
|
{
|
|
|
|
|
if (!m_activeWindow) {
|
|
|
|
|
diff --git a/src/useractions.cpp b/src/useractions.cpp
|
|
|
|
|
index 6e841d96cd..f60ec14a0d 100644
|
|
|
|
|
index e49135c097..1de2f6a64e 100644
|
|
|
|
|
--- a/src/useractions.cpp
|
|
|
|
|
+++ b/src/useractions.cpp
|
|
|
|
|
@@ -952,6 +952,14 @@ void Workspace::initShortcuts()
|
|
|
|
|
0, std::bind(&Workspace::quickTileWindow, this, QuickTileFlag::Third2));
|
|
|
|
|
@@ -881,6 +881,14 @@ void Workspace::initShortcuts()
|
|
|
|
|
0, std::bind(&Workspace::quickTileWindow, this, QuickTileFlag::Third2), true);
|
|
|
|
|
initShortcut("Window Quick Tile Right Third", i18n("Quick Tile Window to the Right Third"),
|
|
|
|
|
0, std::bind(&Workspace::quickTileWindow, this, QuickTileFlag::Third3));
|
|
|
|
|
0, std::bind(&Workspace::quickTileWindow, this, QuickTileFlag::Third3), true);
|
|
|
|
|
+ initShortcut("Pan Windows Right Half", i18n("Pan Windows to the right by half the screen"),
|
|
|
|
|
+ 0, &Workspace::slotPanWindowsHalfScreenRight);
|
|
|
|
|
+ 0, &Workspace::slotPanWindowsHalfScreenRight, true);
|
|
|
|
|
+ initShortcut("Pan Windows Left Half", i18n("Pan Windows to the left by half the screen"),
|
|
|
|
|
+ 0, &Workspace::slotPanWindowsHalfScreenLeft);
|
|
|
|
|
+ 0, &Workspace::slotPanWindowsHalfScreenLeft, true);
|
|
|
|
|
+ initShortcut("Pan Windows Right Third", i18n("Pan Windows to the right by third the screen"),
|
|
|
|
|
+ 0, &Workspace::slotPanWindowsThirdScreenRight);
|
|
|
|
|
+ 0, &Workspace::slotPanWindowsThirdScreenRight, true);
|
|
|
|
|
+ initShortcut("Pan Windows Left Third", i18n("Pan Windows to the left by third the screen"),
|
|
|
|
|
+ 0, &Workspace::slotPanWindowsThirdScreenLeft);
|
|
|
|
|
+ 0, &Workspace::slotPanWindowsThirdScreenLeft, true);
|
|
|
|
|
initShortcut("Window Quick Tile Top", i18n("Quick Tile Window to the Top"),
|
|
|
|
|
Qt::META | Qt::Key_Up, std::bind(&Workspace::quickTileWindow, this, QuickTileFlag::Top));
|
|
|
|
|
Qt::META | Qt::Key_Up, std::bind(&Workspace::quickTileWindow, this, QuickTileFlag::Top), true);
|
|
|
|
|
initShortcut("Window Quick Tile Bottom", i18n("Quick Tile Window to the Bottom"),
|
|
|
|
|
diff --git a/src/workspace.cpp b/src/workspace.cpp
|
|
|
|
|
index bd64f4f248..6f0d1ff3e8 100644
|
|
|
|
|
index 37f3ece9c0..28a6a33265 100644
|
|
|
|
|
--- a/src/workspace.cpp
|
|
|
|
|
+++ b/src/workspace.cpp
|
|
|
|
|
@@ -177,6 +177,7 @@ void Workspace::init()
|
|
|
|
|
@@ -179,6 +179,7 @@ void Workspace::init()
|
|
|
|
|
connect(options, &Options::configChanged, m_screenEdges.get(), &ScreenEdges::reconfigure);
|
|
|
|
|
connect(VirtualDesktopManager::self(), &VirtualDesktopManager::layoutChanged, m_screenEdges.get(), &ScreenEdges::updateLayout);
|
|
|
|
|
connect(this, &Workspace::windowActivated, m_screenEdges.get(), &ScreenEdges::checkBlocking);
|
|
|
|
|
@ -178,10 +148,10 @@ index bd64f4f248..6f0d1ff3e8 100644 |
|
|
|
|
connect(this, &Workspace::windowRemoved, m_focusChain.get(), &FocusChain::remove);
|
|
|
|
|
connect(this, &Workspace::windowActivated, m_focusChain.get(), &FocusChain::setActiveWindow);
|
|
|
|
|
diff --git a/src/workspace.h b/src/workspace.h
|
|
|
|
|
index 04fe2e0864..2f41dc8302 100644
|
|
|
|
|
index 3cb421b1a6..fdbfd21c10 100644
|
|
|
|
|
--- a/src/workspace.h
|
|
|
|
|
+++ b/src/workspace.h
|
|
|
|
|
@@ -522,6 +522,13 @@ public Q_SLOTS:
|
|
|
|
|
@@ -485,6 +485,13 @@ public Q_SLOTS:
|
|
|
|
|
void slotWindowShrinkHorizontal();
|
|
|
|
|
void slotWindowShrinkVertical();
|
|
|
|
|
|
|
|
|
|
@ -190,11 +160,11 @@ index 04fe2e0864..2f41dc8302 100644 |
|
|
|
|
+ void slotPanWindowsHalfScreenLeft();
|
|
|
|
|
+ void slotPanWindowsThirdScreenRight();
|
|
|
|
|
+ void slotPanWindowsThirdScreenLeft();
|
|
|
|
|
+ void slotEnsureClientVisible( KWin::Window* );
|
|
|
|
|
+ void slotEnsureClientVisible(KWin::Window *);
|
|
|
|
|
+
|
|
|
|
|
void slotIncreaseWindowOpacity();
|
|
|
|
|
void slotLowerWindowOpacity();
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
2.49.1
|
|
|
|
|
2.51.2
|
|
|
|
|
|
|
|
|
|
|