Skip to content

Commit b2ba481

Browse files
authored
[DesktopCube@yare] Version 2.0.2 (#796)
- Add APIs used by the "Smart Panel" applet so it can use Desktop Cube in more cases - Fix a case where the Cube was used under the Expo (using the Left/Right arrow keys when the Expo was open). Using the Cube in this case was visually awkward and unnecessary so I disabled using Cube for this scenario - Fix issues when attempting to move a window to an adjacent workspace (Shift+Ctrl+Alt+Left/Right) for a window that is visible on all workspaces
1 parent 4a08b0a commit b2ba481

22 files changed

+198
-24
lines changed

DesktopCube@yare/CHANGELOG.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Changelog
22

3+
## 2.0.2
4+
5+
- Added APIs used by the "Smart Panel" applet so it can use Desktop Cube in more cases
6+
- Fixed a case where the Cube was used under the Expo (using the Left/Right arrow keys when the Expo was open). Using the Cube in this case was visually awkward and unnecessary so I disabled using Cube for this scenario
7+
- Fixes issues when attempting to move a window to an adjacent workspace (Shift+Ctrl+Alt+Left/Right) for a window that is visible on all workspaces
8+
9+
## 2.0.1
10+
11+
- Allow Desktop Cube to work with the "Smart Panel" applet
12+
313
## 2.0.0
414

515
* Added ability to use Cube effect when changing the workspace via the "Workspace Switcher" applet
@@ -23,7 +33,7 @@
2333
## 1.0.2
2434

2535
* Added an option to remove the panels from the animation effect
26-
* Fix the Effect Setting options that were broken when the "tween" option widget was removed starting with cinnamon 5.4
36+
* Fix the Effect Setting options that were broken when the "tween" option widget was removed starting with cinnamon 5.4
2737
* Allow Cinnamon to play the workspace switch sound if it is enabled
2838
* Note: All changed from here on will only be for the Cinnamon 5.4+ version
2939
* Change info.json author to me, since there is currently no maintainer

DesktopCube@yare/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ There are a number of ways to switch the current workspace, all of following wil
2828

2929
5. When changing the focus to a window on another workspace by using the Window-List or Alt-Tab when they are configured to show windows from other workspaces. (can be disabled in the configuration)
3030

31+
6. When using the "Smart Panel" Applet features that change the workspace (Also plan to change "Desktop Scroller" to use Flipper as well in the near future)
32+
3133
When switching the current workspace using Expo ("workspace selection screen" Default hotkey: Ctrl + Alt + Up_Arrow_Key) by clicking on a different workspace, the Desktop Cube effect will not be used. Since the Expo is not really a "face" on the cube it would break the Cube concept a bit, therefore I left it as is since I felt it was more logical that way.
3234

3335
If you know of other methods of switching the workspace where the Desktop Cube effect is not currently used, please let me know so I can see if I can find a way to enable the Desktop Cube for that path as well.

DesktopCube@yare/files/DesktopCube@yare/5.4/extension.js

Lines changed: 46 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ let bindings = [
2727
let original_mw_moveToWorkspace;
2828
let original_main_activateWindow;
2929

30+
let curDesktopCube;
31+
3032
const isFinalized = function(obj) {
3133
return obj && GObject.Object.prototype.toString.call(obj).indexOf('FINALIZED') > -1;
3234
}
@@ -193,7 +195,7 @@ Cube.prototype = {
193195
},
194196

195197
moveWindow: function(window, direction) {
196-
if (!window || window.get_window_type() === Meta.WindowType.DESKTOP) {
198+
if (!window || window.is_on_all_workspaces() === true || window.get_window_type() === Meta.WindowType.DESKTOP) {
197199
return false;
198200
}
199201

@@ -888,9 +890,13 @@ function switchToWorkspace(display, window, binding) {
888890
// Our version of moveToWorkspace() which will be Monkey Patched over the Cinnamon version
889891
// This is how we handle the workspace switching initiated by the "Workspace Switcher" applet
890892
function moveToWorkspace(workspace, direction_hint) {
891-
let [transitions_needed, direction] = getTransitionsAndDirection(workspace);
892-
if (transitions_needed)
893-
new Cube(null, null, null, transitions_needed, direction);
893+
if (Main.expo._shown) {
894+
original_mw_moveToWorkspace(workspace, direction_hint);
895+
} else {
896+
let [transitions_needed, direction] = getTransitionsAndDirection(workspace);
897+
if (transitions_needed)
898+
new Cube(null, null, null, transitions_needed, direction);
899+
}
894900
}
895901

896902
// Our version of activateWindow which will be Monkey Patched over the cinnamon version
@@ -910,6 +916,42 @@ function activateWindow(window, time, workspaceNum) {
910916
original_main_activateWindow(window, time, workspaceNum);
911917
}
912918
}
919+
// Extension Workspace Switching API
920+
// This function can be used by other programs to initiate a workspace change using the Cube effect
921+
// The direction argument must be Meta.MotionDirection.RIGHT or Meta.MotionDirection.LEFT
922+
// The window argument (optional) is a Meta.Window that will follow the workspace switch
923+
function ExtSwitchWorkspace(direction, window) {
924+
if (direction !== Meta.MotionDirection.RIGHT && direction !== Meta.MotionDirection.LEFT)
925+
return;
926+
if (window & !(window instanceof Meta.Window))
927+
window = null;
928+
let new_workspace = global.screen.get_active_workspace().get_neighbor(direction);
929+
if (curDesktopCube && curDesktopCube.is_animating) {
930+
curDesktopCube.transitions.push(direction);
931+
} else {
932+
curDesktopCube = new Cube(null, null, null, 1, direction);
933+
if (window)
934+
curDesktopCube.moveWindow(window, direction);
935+
}
936+
}
937+
938+
// Extension Workspace Switching API
939+
// This function can be used by other programs to initiate a workspace change using the Cube effect
940+
// The workspace argument must be a Meta.Workspace instance
941+
function ExtSwitchToWorkspace(workspace) {
942+
if (workspace instanceof Meta.Workspace) {
943+
let [transitions_needed, direction] = getTransitionsAndDirection(workspace);
944+
if (transitions_needed) {
945+
if (curDesktopCube && curDesktopCube.is_animating) {
946+
for (let i=0 ; i<transitions_needed ; i++) {
947+
curDesktopCube.transitions.push(direction);
948+
}
949+
} else {
950+
curDesktopCube = new Cube(null, null, null, transitions_needed, direction);
951+
}
952+
}
953+
}
954+
}
913955

914956
function CubeSettings(uuid) {
915957
this._init(uuid);

DesktopCube@yare/files/DesktopCube@yare/5.4/settings-schema.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"includePanels": {
2323
"type": "checkbox",
2424
"description": "Include Panels",
25+
"tooltip": "Include the panels while animating. In most cases the panels are not properly painted or completely invisible anyhow, so it's best to leave this disabled",
2526
"default": false
2627
},
2728
"patchmoveToWorkspace": {

DesktopCube@yare/files/DesktopCube@yare/metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"4.6",
1717
"5.4"
1818
],
19-
"version": "2.0.1",
19+
"version": "2.0.2",
2020
"uuid": "DesktopCube@yare",
2121
"name": "Desktop Cube",
2222
"description": "Compiz Cube-like animation for workspace switching",

DesktopCube@yare/files/DesktopCube@yare/po/DesktopCube@yare.pot

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
#, fuzzy
66
msgid ""
77
msgstr ""
8-
"Project-Id-Version: DesktopCube@yare 2.0.0\n"
8+
"Project-Id-Version: DesktopCube@yare 2.0.2\n"
99
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-"
1010
"extensions/issues\n"
11-
"POT-Creation-Date: 2024-11-20 10:20-0500\n"
11+
"POT-Creation-Date: 2024-12-21 14:16-0500\n"
1212
"PO-Revision-Date: \n"
1313
"Last-Translator: \n"
1414
"Language-Team: \n"
@@ -80,6 +80,13 @@ msgstr ""
8080
msgid "Include Panels"
8181
msgstr ""
8282

83+
#. 5.4->settings-schema.json->includePanels->tooltip
84+
msgid ""
85+
"Include the panels while animating. In most cases the panels are not "
86+
"properly painted or completely invisible anyhow, so it's best to leave this "
87+
"disabled"
88+
msgstr ""
89+
8390
#. 5.4->settings-schema.json->patchmoveToWorkspace->description
8491
msgid "Use Cube effect with the Workspace Switcher applet"
8592
msgstr ""

DesktopCube@yare/files/DesktopCube@yare/po/ca.po

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ msgstr ""
99
"Project-Id-Version: \n"
1010
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-"
1111
"extensions/issues\n"
12-
"POT-Creation-Date: 2024-11-20 10:20-0500\n"
12+
"POT-Creation-Date: 2024-12-21 14:16-0500\n"
1313
"PO-Revision-Date: 2024-08-25 22:27+0200\n"
1414
"Last-Translator: \n"
1515
"Language-Team: Odyssey <odysseyhyd@gmail.com>\n"
@@ -83,6 +83,13 @@ msgstr ""
8383
msgid "Include Panels"
8484
msgstr "Incloure els taulers"
8585

86+
#. 5.4->settings-schema.json->includePanels->tooltip
87+
msgid ""
88+
"Include the panels while animating. In most cases the panels are not "
89+
"properly painted or completely invisible anyhow, so it's best to leave this "
90+
"disabled"
91+
msgstr ""
92+
8693
#. 5.4->settings-schema.json->patchmoveToWorkspace->description
8794
msgid "Use Cube effect with the Workspace Switcher applet"
8895
msgstr ""

DesktopCube@yare/files/DesktopCube@yare/po/da.po

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgstr ""
88
"Project-Id-Version: \n"
99
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-"
1010
"extensions/issues\n"
11-
"POT-Creation-Date: 2024-11-20 10:20-0500\n"
11+
"POT-Creation-Date: 2024-12-21 14:16-0500\n"
1212
"PO-Revision-Date: 2022-08-07 15:06+0200\n"
1313
"Last-Translator: Alan Mortensen <alanmortensen.am@gmail.com>\n"
1414
"Language-Team: \n"
@@ -83,6 +83,13 @@ msgstr ""
8383
msgid "Include Panels"
8484
msgstr ""
8585

86+
#. 5.4->settings-schema.json->includePanels->tooltip
87+
msgid ""
88+
"Include the panels while animating. In most cases the panels are not "
89+
"properly painted or completely invisible anyhow, so it's best to leave this "
90+
"disabled"
91+
msgstr ""
92+
8693
#. 5.4->settings-schema.json->patchmoveToWorkspace->description
8794
msgid "Use Cube effect with the Workspace Switcher applet"
8895
msgstr ""

DesktopCube@yare/files/DesktopCube@yare/po/de.po

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgstr ""
88
"Project-Id-Version: \n"
99
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-"
1010
"extensions/issues\n"
11-
"POT-Creation-Date: 2024-11-20 10:20-0500\n"
11+
"POT-Creation-Date: 2024-12-21 14:16-0500\n"
1212
"PO-Revision-Date: 2021-03-02 22:50+0100\n"
1313
"Last-Translator: \n"
1414
"Language-Team: \n"
@@ -83,6 +83,13 @@ msgstr ""
8383
msgid "Include Panels"
8484
msgstr ""
8585

86+
#. 5.4->settings-schema.json->includePanels->tooltip
87+
msgid ""
88+
"Include the panels while animating. In most cases the panels are not "
89+
"properly painted or completely invisible anyhow, so it's best to leave this "
90+
"disabled"
91+
msgstr ""
92+
8693
#. 5.4->settings-schema.json->patchmoveToWorkspace->description
8794
msgid "Use Cube effect with the Workspace Switcher applet"
8895
msgstr ""

DesktopCube@yare/files/DesktopCube@yare/po/es.po

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgstr ""
88
"Project-Id-Version: \n"
99
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-"
1010
"extensions/issues\n"
11-
"POT-Creation-Date: 2024-11-20 10:20-0500\n"
11+
"POT-Creation-Date: 2024-12-21 14:16-0500\n"
1212
"PO-Revision-Date: 2024-11-20 18:29-0300\n"
1313
"Last-Translator: \n"
1414
"Language-Team: \n"
@@ -82,6 +82,13 @@ msgstr "Tamaño del cubo (porcentaje del tamaño de la pantalla)"
8282
msgid "Include Panels"
8383
msgstr "Incluir paneles"
8484

85+
#. 5.4->settings-schema.json->includePanels->tooltip
86+
msgid ""
87+
"Include the panels while animating. In most cases the panels are not "
88+
"properly painted or completely invisible anyhow, so it's best to leave this "
89+
"disabled"
90+
msgstr ""
91+
8592
#. 5.4->settings-schema.json->patchmoveToWorkspace->description
8693
msgid "Use Cube effect with the Workspace Switcher applet"
8794
msgstr "Utilizar el efecto Cubo con el applet de cambio de espacio de trabajo"

DesktopCube@yare/files/DesktopCube@yare/po/eu.po

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgstr ""
88
"Project-Id-Version: \n"
99
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-"
1010
"extensions/issues\n"
11-
"POT-Creation-Date: 2024-11-20 10:20-0500\n"
11+
"POT-Creation-Date: 2024-12-21 14:16-0500\n"
1212
"PO-Revision-Date: 2024-05-30 10:18+0200\n"
1313
"Last-Translator: Muxutruk <muxutruk2@users.noreply.github.com>\n"
1414
"Language-Team: Basque <muxutruk2@users.noreply.github.com>\n"
@@ -82,6 +82,13 @@ msgstr ""
8282
msgid "Include Panels"
8383
msgstr ""
8484

85+
#. 5.4->settings-schema.json->includePanels->tooltip
86+
msgid ""
87+
"Include the panels while animating. In most cases the panels are not "
88+
"properly painted or completely invisible anyhow, so it's best to leave this "
89+
"disabled"
90+
msgstr ""
91+
8592
#. 5.4->settings-schema.json->patchmoveToWorkspace->description
8693
msgid "Use Cube effect with the Workspace Switcher applet"
8794
msgstr ""

DesktopCube@yare/files/DesktopCube@yare/po/fi.po

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ msgstr ""
77
"Project-Id-Version: DesktopCube@yare 1.1.0\n"
88
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-"
99
"extensions/issues\n"
10-
"POT-Creation-Date: 2024-11-20 10:20-0500\n"
10+
"POT-Creation-Date: 2024-12-21 14:16-0500\n"
1111
"PO-Revision-Date: \n"
1212
"Last-Translator: Kimmo Kujansuu <mrkujansuu@gmail.com>\n"
1313
"Language-Team: \n"
@@ -82,6 +82,13 @@ msgstr ""
8282
msgid "Include Panels"
8383
msgstr "Sisältää paneelit"
8484

85+
#. 5.4->settings-schema.json->includePanels->tooltip
86+
msgid ""
87+
"Include the panels while animating. In most cases the panels are not "
88+
"properly painted or completely invisible anyhow, so it's best to leave this "
89+
"disabled"
90+
msgstr ""
91+
8592
#. 5.4->settings-schema.json->patchmoveToWorkspace->description
8693
msgid "Use Cube effect with the Workspace Switcher applet"
8794
msgstr ""

DesktopCube@yare/files/DesktopCube@yare/po/fr.po

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgstr ""
88
"Project-Id-Version: \n"
99
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-"
1010
"extensions/issues\n"
11-
"POT-Creation-Date: 2024-11-20 10:20-0500\n"
11+
"POT-Creation-Date: 2024-12-21 14:16-0500\n"
1212
"PO-Revision-Date: 2019-02-13 16:49+0100\n"
1313
"Last-Translator: Claudiux <claude.clerc@gmail.com>\n"
1414
"Language-Team: \n"
@@ -83,6 +83,13 @@ msgstr ""
8383
msgid "Include Panels"
8484
msgstr ""
8585

86+
#. 5.4->settings-schema.json->includePanels->tooltip
87+
msgid ""
88+
"Include the panels while animating. In most cases the panels are not "
89+
"properly painted or completely invisible anyhow, so it's best to leave this "
90+
"disabled"
91+
msgstr ""
92+
8693
#. 5.4->settings-schema.json->patchmoveToWorkspace->description
8794
msgid "Use Cube effect with the Workspace Switcher applet"
8895
msgstr ""

DesktopCube@yare/files/DesktopCube@yare/po/hr.po

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgstr ""
88
"Project-Id-Version: DesktopCube@yare\n"
99
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-"
1010
"extensions/issues\n"
11-
"POT-Creation-Date: 2024-11-20 10:20-0500\n"
11+
"POT-Creation-Date: 2024-12-21 14:16-0500\n"
1212
"PO-Revision-Date: 2017-04-30 16:57+0200\n"
1313
"Last-Translator: gogo <trebelnik2@gmail.com>\n"
1414
"Language-Team: \n"
@@ -84,6 +84,13 @@ msgstr ""
8484
msgid "Include Panels"
8585
msgstr ""
8686

87+
#. 5.4->settings-schema.json->includePanels->tooltip
88+
msgid ""
89+
"Include the panels while animating. In most cases the panels are not "
90+
"properly painted or completely invisible anyhow, so it's best to leave this "
91+
"disabled"
92+
msgstr ""
93+
8794
#. 5.4->settings-schema.json->patchmoveToWorkspace->description
8895
msgid "Use Cube effect with the Workspace Switcher applet"
8996
msgstr ""

DesktopCube@yare/files/DesktopCube@yare/po/hu.po

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgstr ""
88
"Project-Id-Version: \n"
99
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-"
1010
"extensions/issues\n"
11-
"POT-Creation-Date: 2024-11-20 10:20-0500\n"
11+
"POT-Creation-Date: 2024-12-21 14:16-0500\n"
1212
"PO-Revision-Date: 2024-11-25 13:45+0100\n"
1313
"Last-Translator: Kálmán „KAMI” Szalai <kami911@gmail.com>\n"
1414
"Language-Team: \n"
@@ -81,6 +81,13 @@ msgstr "Kocka mérete (a képernyő méretének százalékában)"
8181
msgid "Include Panels"
8282
msgstr "Tartalmazza a paneleket"
8383

84+
#. 5.4->settings-schema.json->includePanels->tooltip
85+
msgid ""
86+
"Include the panels while animating. In most cases the panels are not "
87+
"properly painted or completely invisible anyhow, so it's best to leave this "
88+
"disabled"
89+
msgstr ""
90+
8491
#. 5.4->settings-schema.json->patchmoveToWorkspace->description
8592
msgid "Use Cube effect with the Workspace Switcher applet"
8693
msgstr "Használja a Kocka effektust a Munkaterület-váltó kisalkalmazással"

DesktopCube@yare/files/DesktopCube@yare/po/it.po

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgstr ""
88
"Project-Id-Version: \n"
99
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-"
1010
"extensions/issues\n"
11-
"POT-Creation-Date: 2024-11-20 10:20-0500\n"
11+
"POT-Creation-Date: 2024-12-21 14:16-0500\n"
1212
"PO-Revision-Date: 2022-06-03 10:52+0200\n"
1313
"Last-Translator: Dragone2 <dragone2@risposteinformatiche.it>\n"
1414
"Language-Team: \n"
@@ -84,6 +84,13 @@ msgstr ""
8484
msgid "Include Panels"
8585
msgstr ""
8686

87+
#. 5.4->settings-schema.json->includePanels->tooltip
88+
msgid ""
89+
"Include the panels while animating. In most cases the panels are not "
90+
"properly painted or completely invisible anyhow, so it's best to leave this "
91+
"disabled"
92+
msgstr ""
93+
8794
#. 5.4->settings-schema.json->patchmoveToWorkspace->description
8895
msgid "Use Cube effect with the Workspace Switcher applet"
8996
msgstr ""

0 commit comments

Comments
 (0)