Skip to content
This repository has been archived by the owner on Dec 3, 2021. It is now read-only.

Overview when switching should contain display of workspace windows #4

Open
dickfeynman opened this issue Oct 29, 2014 · 24 comments
Open

Comments

@dickfeynman
Copy link

If one tries to switch workspaces using the Gnome "hot corner" then one can see all workspaces with all the windows respectively opened in them. I would like a similar display here, while switching workspaces, rather than just a grid of boxes (where it's not obvious whether the windows you want to see are actually on which workspace). I wonder if the code can just be copy-pasted from the hot-corner view codebase.

@zakkak
Copy link
Owner

zakkak commented Oct 29, 2014

That would be nice indeed.

@oblitum
Copy link

oblitum commented Nov 16, 2015

👍 I was used to this when using Unity on Ubuntu, the behavior there is like described here.

@sanderboom
Copy link

IMO the only thing missing from this extension. Maybe some inspiration can come from this other extension that shows workspace previews: https://github.com/passingthru67/workspaces-to-dock

@zakkak
Copy link
Owner

zakkak commented Dec 21, 2015

Nice reference @sanderboom, thanks!

@zakkak
Copy link
Owner

zakkak commented Dec 21, 2015

This one seems more related to what we want to achieve.

@zakkak
Copy link
Owner

zakkak commented Dec 21, 2015

I have tried implementing it but I don't know how to make it centre aligned. Anyone who wants to try and fix/improve it can find the code in https://github.com/zakkak/workspace-grid-gnome-shell-extension/tree/thumbnails. It currently displays both the switcher and the thumbnails for testing purposes.

@sanderboom
Copy link

@zakkak Do you have a short explanation on how to test?
BTW great that you've developed this this quick 👍

@zakkak
Copy link
Owner

zakkak commented Dec 22, 2015

@sanderboom You will need to clone the branch with
git clone -b thumbnails https://github.com/zakkak/workspace-grid-gnome-shell-extension.git

Then enter the directory and run
make zip

Finally, using gnome tweak tools install that zip (CAUTION: this will replace your current version of the extension)

@sanderboom
Copy link

@zakkak Thanks for the work on this! I'm on holiday now 😎 will check later

@sanderboom
Copy link

Finally got a chance to test, you are almost there! Nice work. If I find some time I can see if I can help.

Would it also be possible to scale down the previews? I'm using 2x5 and they dont fit on my screen.

@zakkak
Copy link
Owner

zakkak commented Jan 10, 2016

Would it also be possible to scale down the previews? I'm using 2x5 and they dont fit on my screen.

Is this specific to this issue or general? In the latter case, please create a new issue for it. Also, a screenshot would help me better understand the problem.

@sanderboom
Copy link

New issue with screenshot: #23

@stumpc5
Copy link

stumpc5 commented Oct 31, 2017

After upgrading to Ubuntu 17.10, I wanted to get the workspace grid as close to the Unity situation as possible. Your grid already does a great job, but I would also really appreciate to get thumbnails of the workspaces' contents as described in this issue.

Is there any hope to get this any time soon, or is this issue abandoned?

On the right side of the overview (when pressing <super>) I also get the grid as you explain in the description, while there I also see the content thumbnails appearing!

@zakkak
Copy link
Owner

zakkak commented Oct 31, 2017

AFAIK no one is working on it.

@Notgnoshi
Copy link

Notgnoshi commented Mar 18, 2018

@zakkak It looks like changing this._container.x to this.actor.x (y too) in myWorkspaceSwitcherPopup.js:231 has the desired effect.
workspace-popup

I'm not quite sure how to fix the uneven borders.

@zakkak
Copy link
Owner

zakkak commented Mar 19, 2018

Thanks @Notgnoshi.

I have cleaned up the code and added a new option to conditionally enable the thumbnails (it is disabled by default).

Note that currently there is no proper theme support (the thumbnails are displayed without any background).

@mhauru
Copy link

mhauru commented May 7, 2018

I checked out the thumbnails branch, ran make clean and make all, restarted with Alt+F2 and r, and flipped the switch on thumbnails in settings. Now the switcher doesn't appear at all. I ran journalctl /usr/bin/gnome-shell -f -o cat to check the logs, and found stuff like this:

Object St.Bin (0x55b05bc05a60), has been already deallocated - impossible to access to it. This might be caused by the fact that the object has been destroyed from C code using something such as destroy(), dispose(), or remove() vfuncs
== Stack trace for context 0x55b05a5854b0 ==
#0 0x55b05a92d1d0 i   /home/dada/.local/share/gnome-shell/extensions/workspace-grid@mathematical.coffee.gmail.com/extension.js:654 (0x7f4034ec39a0 @ 202)
#1 0x7ffcb9185120 I   resource:///org/gnome/gjs/modules/_legacy.js:82 (0x7f404c4b5de0 @ 71)
#2 0x7ffcb9185910 b   self-hosted:921 (0x7f404c4f12b8 @ 469)
#3 0x55b05a92d120 i   /home/dada/.local/share/gnome-shell/extensions/workspace-grid@mathematical.coffee.gmail.com/extension.js:429 (0x7f4034ec3450 @ 250)
#4 0x55b05a92d070 i   /home/dada/.local/share/gnome-shell/extensions/workspace-grid@mathematical.coffee.gmail.com/extension.js:378 (0x7f4034ec3340 @ 993)

-- CUT --

Object St.Bin (0x55b05bc05a60), has been already finalized. Impossible to get any property from it.

-- CUT --

JS ERROR: TypeError: this._indicator.allocation is undefined
ThumbnailsBox<._activeWorkspaceChanged@/home/dada/.local/share/gnome-shell/extensions/workspace-grid@mathematical.coffee.gmail.com/extension.js:657:9
wrapper@resource:///org/gnome/gjs/modules/_legacy.js:82:22
actionMoveWindow@/home/dada/.local/share/gnome-shell/extensions/workspace-grid@mathematical.coffee.gmail.com/extension.js:429:9
showWorkspaceSwitcher@/home/dada/.local/share/gnome-shell/extensions/workspace-grid@mathematical.coffee.gmail.com/extension.js:378:21

-- CUT --

st_widget_get_theme_node called on the widget [0x55b05c94bc60 StBin.workspace-thumbnail-indicator:first-child] which is not in the stage.

-- CUT --

st_widget_get_theme_node called on the widget [0x55b05e2984a0 ShellGenericContainer.workspace-switcher] which is not in the stage.

-- CUT --

JS ERROR: TypeError: this._porthole is undefined
ThumbnailsBox<._getPreferredHeight@/home/dada/.local/share/gnome-shell/extensions/workspace-grid@mathematical.coffee.gmail.com/extension.js:686:1
wrapper@resource:///org/gnome/gjs/modules/_legacy.js:82:22
myWorkspaceSwitcherPopup<._redisplay@/home/dada/.local/share/gnome-shell/extensions/workspace-grid@mathematical.coffee.gmail.com/myWorkspaceSwitcherPopup.js:203:17
wrapper@resource:///org/gnome/gjs/modules/_legacy.js:82:22
_init@resource:///org/gnome/shell/ui/workspaceSwitcherPopup.js:46:9
wrapper@resource:///org/gnome/gjs/modules/_legacy.js:82:22
_parent@resource:///org/gnome/gjs/modules/_legacy.js:39:12
myWorkspaceSwitcherPopup<._init@/home/dada/.local/share/gnome-shell/extensions/workspace-grid@mathematical.coffee.gmail.com/myWorkspaceSwitcherPopup.js:54:9
wrapper@resource:///org/gnome/gjs/modules/_legacy.js:82:22
_Base.prototype._construct@resource:///org/gnome/gjs/modules/_legacy.js:18:5
Class.prototype._construct/newClass@resource:///org/gnome/gjs/modules/_legacy.js:114:32
getWorkspaceSwitcherPopup@/home/dada/.local/share/gnome-shell/extensions/workspace-grid@mathematical.coffee.gmail.com/extension.js:246:13
showWorkspaceSwitcher@/home/dada/.local/share/gnome-shell/extensions/workspace-grid@mathematical.coffee.gmail.com/extension.js:384:9

where I've --CUT-- out the same stuff repeating over and over again.

Running Gnome 3.28.1 on Ubuntu 18.04. Let me know if I can help figure this out (I know no JS).

@RiseOoi
Copy link

RiseOoi commented Jul 30, 2018

I have encountered and reproduced @mhauru 's bug issue.

@erik-helmers
Copy link

I don't want to harass @zakkak but man.. You're so close to the perfection. Don't give up (freakin' love your extension) !

@grgitdev
Copy link

Hi,
Same issue as mhauru on Gnome 3.28.2, Ubuntu 18.04.1, with the same journalctl output.

I would be really grateful if this worked, it's my biggest blocking point with the Unity -> Gnome switch after upgrading to Ubuntu 18.04 from 16.04.

I gave the code a look, but didn't find anything obvious and failed to find good documentation for the Gnome API.

Thanks for your great work!

@mzur
Copy link

mzur commented Sep 13, 2018

I really would like to have this feature, too, so I had a look. I know JS but I know nothing about Gnome extension development. Here is what I found:

The relevant line in the error log seems to be this:

JS ERROR: TypeError: this._porthole is undefined
ThumbnailsBox<._getPreferredHeight@/home/m/.local/share/gnome-shell/extensions/workspace-grid@mathematical.coffee.gmail.com/extension.js:686:1

So _porthole is undefined, despite this._ensurePorthole() being called before. Apparently Main.overview.visible is false which lets _ensurePorthole() return without setting _porthole. If I manually set _porthole like this, the code continues to:

JS ERROR: TypeError: thumbnail is undefined
ThumbnailsBox<._activeWorkspaceChanged@/home/m/.local/share/gnome-shell/extensions/workspace-grid@mathematical.coffee.gmail.com/extension.js:660:28

thumbnail is undefined because this._thumbnails is empty. As I understand it, _thumbnails should be populated here. However, I found two issues with _createThumbnails. One, global.workspace_manager seems to be undefined. But since no error is thrown here, maybe I did not understand what's going on. The second issue is that addThumbnails also depends on _ensurePorthole which probably prevents the thumbnails from being created.

Having said all this, I found that I get these errors in the 3.28 branch as well when I switch to the overview (Super in Ubuntu). Main.overview.visible is still false in this case.

As I have no idea of Gnome extension development all this may be totally irrelevant. But I'm willing to do more work for this feature so I'd greatly appreciate if you could give me some advice or point me in the right direction to go forward.

@zakkak
Copy link
Owner

zakkak commented Sep 14, 2018

Hello @mzur,

I fixed the porthole issue by updating the sources to much those of gnome-3.28 (most of the code is copied from the original sources).

I have also rebased the thumbnails branch to the latest 3.28.

You are right that some errors are consistent in both branches, unfortunately I don't understand them that well either. Messages like

Object St.Bin (0x557ea875da40), has been already deallocated - impossible to access to it. This might be caused by the fact that the object has been destroyed from C code using something such as destroy(), dispose(), or remove() vfuncs

Show that somehow we mess with objects that have been already destroyed and this is a serious bug.

Now on the thumbnails issue, it used to show the thumbnails, so it looks like at some point gnome 3.28 got a patch that broke it for us.

Unfortunately I am not very familiar with JS nor with GJS so I don't think I can really direct you (if I could I would have probably fixed the issues as well :) ). What I have found handy is looking through the GJS sources, e.g., https://github.com/GNOME/gnome-shell/blob/gnome-3-28/js/ui/workspaceThumbnail.js and trying to figure out how things work.

@mzur
Copy link

mzur commented Oct 5, 2018

I couldn't wrap my head around all the code of this extension and the error messages it throws so I started to implement my own clone from scratch. It is very basic right now and does not support most of the features of Workspace Grid (including the workspace thumbnails) but I'm working on it. I don't intend to bring it to feature parity with Workspace Grid, though.

@mzur
Copy link

mzur commented Oct 11, 2018

I'm finished with my simple clone:

image

You can find the relevant changes for the switch to workspace thumbnails in this commit (in WorkspaceSwitcherPopup.js). I hope you find this useful for the implementation in Workspace Grid. I'm happy to answer any questions on implementation details.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests