l300lvl / Show-Desktop-Button

Places a button to the left of the Window List to hide all windows and show the current desktop, the original function was pulled from MGSE's Window List and has since been updated and patched many times as they are no longer running gnome-shell upstream.
https://extensions.gnome.org/extension/64/show-desktop-button/
GNU General Public License v2.0
11 stars 7 forks source link

Doesn't work with Gnome 3.30+ (Ubuntu 18.10) #10

Open Destroy666x opened 5 years ago

Destroy666x commented 5 years ago

Nothing happens when clicking the button. I found that global.screen needs to change to global.workspace_manager, but that wasn't enough, any other idea?

l300lvl commented 5 years ago

Will look into it, since the API became stable I haven't been watching this as often and don't have a current gs install, so it might be a while but I will get to it.

juhaerk commented 5 years ago

This patch fixes the problem for gnome 3.30.2, at least in my experience.

diff -ruN show-desktop@l300lvl.tk.orig/extension.js show-desktop@l300lvl.tk/extension.js
--- show-desktop@l300lvl.tk.orig/extension.js   2019-04-23 10:26:54.999883140 +0300
+++ show-desktop@l300lvl.tk/extension.js    2019-04-23 14:53:19.743227295 +0300
@@ -40,7 +40,7 @@
     //get currently focused window this was pulled from https://github.com/mathematicalcoffee/Gnome-Shell-Window-Buttons-Extension
 function _getWindowToControl () {
     let win = global.display.focus_window,
-    workspace = global.screen.get_active_workspace(),
+    workspace = global.workspace_manager.get_active_workspace(),
     windows = workspace.list_windows().filter(function (w) {
         return w.get_window_type() !== Meta.WindowType.DESKTOP;
     });
@@ -61,7 +61,7 @@
 }
     //toggles the desktop and icon when clicked
 function _showDesktop() {
-    let metaWorkspace = global.screen.get_active_workspace();
+    let metaWorkspace = global.workspace_manager.get_active_workspace();
     let windows = metaWorkspace.list_windows();

     if (_desktopShown) {