Skip to content

Instantly share code, notes, and snippets.

@DL6AKU
Last active December 10, 2018 18:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DL6AKU/e5cc0e47b61ae0f87171d64fd2dba49d to your computer and use it in GitHub Desktop.
Save DL6AKU/e5cc0e47b61ae0f87171d64fd2dba49d to your computer and use it in GitHub Desktop.
diff -p -u10 --recursive kwin-5.14.4_original/effects/presentwindows/presentwindows.cpp kwin-5.14.4/effects/presentwindows/presentwindows.cpp
--- kwin-5.14.4_original/effects/presentwindows/presentwindows.cpp 2018-11-27 17:10:13.000000000 +0100
+++ kwin-5.14.4/effects/presentwindows/presentwindows.cpp 2018-12-10 19:32:01.109492815 +0100
@@ -712,20 +712,25 @@ void PresentWindowsEffect::mouseActionWi
}
break;
case WindowMinimizeAction:
if (m_highlightedWindow) {
if (m_highlightedWindow->isMinimized())
m_highlightedWindow->unminimize();
else
m_highlightedWindow->minimize();
}
break;
+ case WindowCloseAction:
+ if (m_highlightedWindow) {
+ m_highlightedWindow->closeWindow();
+ }
+ break;
default:
break;
}
}
void PresentWindowsEffect::mouseActionDesktop(DesktopMouseAction& action)
{
switch(action) {
case DesktopActivateAction:
if (m_highlightedWindow)
diff -p -u10 --recursive kwin-5.14.4_original/effects/presentwindows/presentwindows.h kwin-5.14.4/effects/presentwindows/presentwindows.h
--- kwin-5.14.4_original/effects/presentwindows/presentwindows.h 2018-11-27 17:10:13.000000000 +0100
+++ kwin-5.14.4/effects/presentwindows/presentwindows.h 2018-12-10 19:36:41.465956143 +0100
@@ -142,21 +142,22 @@ public:
ModeSelectedDesktop, // Shows windows of selected desktop via property (m_desktop)
ModeWindowGroup, // Shows windows selected via property
ModeWindowClass // Shows all windows of same class as selected class
};
enum WindowMouseAction {
WindowNoAction = 0, // Nothing
WindowActivateAction = 1, // Activates the window and deactivates the effect
WindowExitAction = 2, // Deactivates the effect without activating new window
WindowToCurrentDesktopAction = 3, // Brings window to current desktop
WindowToAllDesktopsAction = 4, // Brings window to all desktops
- WindowMinimizeAction = 5 // Minimize the window
+ WindowMinimizeAction = 5, // Minimize the window
+ WindowCloseAction = 6 // Close the window
};
enum DesktopMouseAction {
DesktopNoAction = 0, // nothing
DesktopActivateAction = 1, // Activates the window and deactivates the effect
DesktopExitAction = 2, // Deactivates the effect without activating new window
DesktopShowDesktopAction = 3 // Minimizes all windows
};
// for properties
int layoutMode() const {
diff -p -u10 --recursive kwin-5.14.4_original/effects/presentwindows/presentwindows_config.ui kwin-5.14.4/effects/presentwindows/presentwindows_config.ui
--- kwin-5.14.4_original/effects/presentwindows/presentwindows_config.ui 2018-11-27 17:10:13.000000000 +0100
+++ kwin-5.14.4/effects/presentwindows/presentwindows_config.ui 2018-12-10 19:34:44.065888887 +0100
@@ -157,20 +157,25 @@
<item>
<property name="text">
<string>Send window to all desktops</string>
</property>
</item>
<item>
<property name="text">
<string>(Un-)Minimize window</string>
</property>
</item>
+ <item>
+ <property name="text">
+ <string>Close Window</string>
+ </property>
+ </item>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Middle button:</string>
</property>
<property name="buddy">
<cstring>kcfg_MiddleButtonWindow</cstring>
</property>
@@ -201,20 +206,25 @@
<item>
<property name="text">
<string>Send window to all desktops</string>
</property>
</item>
<item>
<property name="text">
<string>(Un-)Minimize window</string>
</property>
</item>
+ <item>
+ <property name="text">
+ <string>Close Window</string>
+ </property>
+ </item>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>Right button:</string>
</property>
<property name="buddy">
<cstring>kcfg_RightButtonWindow</cstring>
</property>
@@ -245,20 +255,25 @@
<item>
<property name="text">
<string>Send window to all desktops</string>
</property>
</item>
<item>
<property name="text">
<string>(Un-)Minimize window</string>
</property>
</item>
+ <item>
+ <property name="text">
+ <string>Close Window</string>
+ </property>
+ </item>
</widget>
</item>
</layout>
</widget>
</item>
<item row="1" column="1">
<widget class="QGroupBox" name="groupBox_5">
<property name="title">
<string comment="@title:group actions when clicking on desktop">Desktop</string>
</property>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment