fthx / babar

Task bar. GNOME Shell extension
GNU General Public License v3.0
41 stars 14 forks source link

GNOME 40 compatibility #3

Closed wooque closed 3 years ago

wooque commented 3 years ago

Error in gnome-shell log

JS ERROR: TypeError: Main.overview.viewSelector is undefined
_init/<@/home/vuk/.local/share/gnome-shell/extensions/babar@fthx/extension.js:46:66

Will try to fix it

fthx commented 3 years ago

I don't get this one. I get this one:

JS ERROR: TypeError: this.w_box.icon is undefined
_create_window_button@/usr/share/gnome-shell/extensions/babar@fthx/extension.js:220:5
_update_ws@/usr/share/gnome-shell/extensions/babar@fthx/extension.js:187:17

that I managed to handle by creating a fallback icon. I already have some surprises creating https://extensions.gnome.org/extension/3915/sticky-terminal/ : the window object may be created but not immediately accessible.

fthx commented 3 years ago

extension.js is modified in this repo to manage no-icon case, still not in GS ext website. Do you have a way to reproduce the viewSelector bug? I tried in many ways but did not succeed. :-) Please note I use Ubuntu 20.04, so GS 3.36. A simple workaround would be to check its existence before calling it, but anyway it's interesting to know why it happens.

wooque commented 3 years ago

Happens only in GNOME 40, that's why you can't reproduce it. Anyway GNOME 40 is still in alpha state so I revert back to 3.38 and will wait until it hits Arch official repos. Closing issue for now.

fthx commented 3 years ago

Just FYI: https://github.com/home-sweet-gnome/dash-to-panel/issues/1265 Same in DtDock too. No hurry, you're right.

fthx commented 3 years ago

If somebody can test the extension with GNOME 40 these coming weeks, I would be happy to have a feedback. Please check in logs too, searching for keyword "fthx" in "All". Thanks!

frandieguez commented 3 years ago

I have a couple of computers already in GNOME 40. I can help testing and providing feedback. Do not hesitate to contact me.

fthx commented 3 years ago

Oh yes it would be interesting to test it some hours and give me your feedback and the result of "fthx" in GNOME Logs ("All" tab). I think that the app grid button has to be turned off to avoid any error (but not sure of that). Thanks !

@wooque : I have to look longer your PR and I'll merge it soon.

frandieguez commented 3 years ago

Just point me to the branch and I will test it

frandieguez commented 3 years ago

For now I only get this error.

21:57:19 dbus-daemon: [session uid=60399 pid=248293] Activating service name='org.gnome.Shell.Extensions' requested by ':1.105' (uid=60399 pid=258260 comm="gnome-extensions enable babar@fthx ")
21:56:07 gnome-shell: JS ERROR: Could not load extension babar@fthx: Error: Missing metadata.json
createExtensionObject@resource:///org/gnome/shell/ui/extensionSystem.js:283:19
_loadExtensions/<@resource:///org/gnome/shell/ui/extensionSystem.js:583:34
collectFromDatadirs@resource:///org/gnome/shell/misc/fileUtils.js:27:28
_loadExtensions@resource:///org/gnome/shell/ui/extensionSystem.js:567:19
_enableAllExtensions@resource:///org/gnome/shell/ui/extensionSystem.js:597:18
_sessionUpdated@resource:///org/gnome/shell/ui/extensionSystem.js:628:18
init@resource:///org/gnome/shell/ui/extensionSystem.js:56:14
_initializeUI@resource:///org/gnome/shell/ui/main.js:279:22
start@resource:///org/gnome/shell/ui/main.js:169:5
@<main>:1:47
fthx commented 3 years ago

There is no specific GS 40 branch. How did you install the extension? Through GitHub or GS website? Could you check this: image Could you give the content of your metadata.json ? Did the extension run?

fthx commented 3 years ago

Ok I updated my Fedora VM to v34 with GS 40. Well, that's quite beta. I confirm that the dconf key was changed when upgrading, you have to set it to true again.

The extension works, at least for the favorites/workspaces/tasks part.

frandieguez commented 3 years ago

Installed via ➜ git clone https://github.com/fthx/babar.git ~/.local/share/gnome-shell/extensions/babar@fthx/

Here are the contents

➜ cat ~/.local/share/gnome-shell/extensions/babar@fthx/metadata.json                                  
{
  "_generated": "Generated by SweetTooth, do not edit", 
  "description": "Task bar. App grid & favorites & workspaces & tasks in panel. Light extension.\n\n Replace 'Activities' button by all current workspaces and apps buttons. Switch workspace/app or toggle overview by clicking on these buttons. Change 'Places' label to an icon. Some settings in preferences UI.\n\n You can use names for workspaces: there are two ways for that. 1) Edit the string array 'org.gnome.desktop.wm.preferences.workspace-names' gsettings key (through dconf editor, e.g.). 2) Use official GNOME extension Workspaces Indicator's settings. You don't have to write a long enough list: numbers are displayed if no workspace name is defined.\n\n Changelog: https://github.com/fthx/babar/issues/2", 
  "name": "BaBar", 
  "shell-version": ["3.36", "3.38", "3.40", "40.0"], 
  "url": "https://github.com/fthx/babar", 
  "uuid": "babar@fthx", 
  "version": 35
}

That key doesn't exist on my machine

frandieguez commented 3 years ago

Ok, I've done a git pull and now the bar loads

I had to add 40.beta to get the extension to load "shell-version": ["3.36", "3.38", "3.40", "40.beta", "40.0"],

As said, now the top bar loads but the preferences button raises an error. image

fthx commented 3 years ago

Well, I was writing to use "40.beta". Done! Yes, the prefs UI does not launch. I have to look at the Gtk 4 changes...

frandieguez commented 3 years ago

Note that gnome-shell 40 forces the usage of GTK4 for extensions dialogs.

fthx commented 3 years ago

https://developer.gnome.org/gtk4/unstable/gtk-migrating-3-to-4.html#id-1.7.4.3.11

Have to sleep now. ^_^

frandieguez commented 3 years ago

Check this please

https://github.com/fthx/babar/pull/12

fthx commented 3 years ago

TO TESTERS AND DEVS

PLEASE USE: https://github.com/fthx/babar/tree/GNOME40 FOR GNOME 40 TESTING AND PR

fthx commented 3 years ago

Ok, @frandieguez has made the prefs to work in GS 40. We have to check the extension itself, not clear if it does not make GS 40 buggy.

fthx commented 3 years ago

I think that the bug happens when pressing Windows key to enter overview. Or pressing any workspace button in BaBar... Unchecking Places-to-icon option seems to remove the crash.

I would be happy if you can report whatever is wrong with GS 40 here! Thanks again! (and thanks for the margin trick that I did not look, it saved me some time!)

fthx commented 3 years ago

Ok, in Looking Glass, I reproduced the crash, following the places-to-icon function. It crashes when I create the folder icon: places_icon = new St.Icon(...)

frandieguez commented 3 years ago

Let me check with master

frandieguez commented 3 years ago

Not sure how to reproduce the bug, but enabling Applications grid, if you click on it it doesnt raises de overview The overview is working as expected so far.

One question... is it posible to add an option to put favorites alongside open windows? without using a dropdown menu

fthx commented 3 years ago

Yes, that I know. The app grid command does not exist anymore. Or at least I have to find the new one (I searched this some days ago but failed).

fthx commented 3 years ago

What system/OS do you use? I do use Fedora 4 VM in Boxes.

fthx commented 3 years ago

One question... is it posible to add an option to put favorites alongside open windows? without using a dropdown menu

I tested this first but it takes a lot of space, too much space. The way this extension works (list active tasks, 1 icon per task) does not fit this Dash-to-Panel-like behaviour. But of course it could be an option.

frandieguez commented 3 years ago

I use archlinux with the fcgu repositoriy to get gnome-unstable https://gitlab.com/fabis_cafe/gnome-unstable

frandieguez commented 3 years ago

I tested this first but it takes a lot of space, too much space. The way this extension works (list active tasks, 1 icon per task) does not fit this Dash-to-Panel-like behaviour.

Dash to panel has too many options but I like the idea of replicating favorites + running apps in the panel, without loosing the dash in the overview. That would be a great idea for GNOME 40

fthx commented 3 years ago

Ok, for app grid button I think I found the correct new function, but maybe there's something fishy in GS: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3873

fthx commented 3 years ago

Ok. Florian Muellner has pushed the fix.

So, virtually, we will be able soon to enter app grid with: Main.overview.showApps() Just a GS version to check, because this function does not exist in GS < 40.

I'll look at the favorites-as-icons after GS 40 issues are solved.

fthx commented 3 years ago

Still have to investigate places-to-icon feature.

frandieguez commented 3 years ago

Thanks for your effort!

fthx commented 3 years ago

https://github.com/fthx/babar/commit/7a93aa271b57386fada8153eb98edaecfbd22115

What's remaining: Places-to-icon

fthx commented 3 years ago

Ok, runs fine in GS40 now, places-to-icon included. At least, it seems to. ^_^

@ all: I do not close this thread it until we have used BaBar in GS40 for some time without error. @frandieguez

I push it into GS extensions website, as it runs fine in my GS 3.36 too. And it cannot be worse than before in GS 40 ;-) .

frandieguez commented 3 years ago

Thanks for your work, this is such an achievement

I'm thinking about porting the prefs panel to glade so it is easier to work with. Let me know what you think and I will work on it if you agree.

Maybe using the new libhandy UI

fthx commented 3 years ago

I don't know much about glade, and I want to fully understand all the parts of the code. And from now I won't have a lot of time, for some weeks. BUT that's certainly a good idea! I'll can look at any PR when it will be possible. That's not that urgent.

To be honest, if you have some time, I think that the missing key feature is drag'n'drop between workspaces, instead of right-click-arrows workaround. Just drag an icon over a workspace area in panel and then drop it. The order could be the same as now (favorites if chosen, then creation time). I don't know if DND has changed during GS40 transition.

Please test BaBar in your GS40 (+ check "fthx" in Logs). Thanks!!

fthx commented 3 years ago

Oh, and the bug for Places in GS40 was due to drop down arrows removal in GS40. The 'places-menu' object is not the same and there is only one child, not 2 (label + arrow). Simple but I had to figure out if the problem was simple...

frandieguez commented 3 years ago

Guide to update extensions https://www.youtube.com/watch?v=ziRg2-M7NKU

fthx commented 3 years ago

Thanks! Text: https://gjs.guide/extensions/upgrading/gnome-shell-40.html

fthx commented 3 years ago

In GS40, hovering the task bar makes it hilighted. However, the active task white cap is out of hilight bounds. Not very pretty. This white line is just a top border frame, in css. ;-)

image

I did not look at a solution for GS40 at the moment.

fthx commented 3 years ago

https://blogs.gnome.org/shell-dev/2021/03/12/gnome-40-your-extension/

frandieguez commented 3 years ago

Maybe this issue should be closed