solus-project / budgie-desktop

I Tawt I Taw A Purdy Desktop
https://solus-project.com/
2.33k stars 158 forks source link

Icon Task list applet couldn't distinguish between chrome-apps #1425

Closed bmorashad closed 5 years ago

bmorashad commented 6 years ago

Operating System: Solus 3 Budgie version: Budgie 10.4-70-g15c960cc

The issue encountered

Icon Task list applet couldn't distinguish between chrome-apps(including google-chrome) when window grouping is enabled, it is almost as if it can't distinguish between say Google+ and Google Photos. If you open Google+ first and Google Photos second both act as one(u can access both Google+ and photos from google+ icon), even if u have closed one, both the icons would be still there until u close it all.

Steps to reproduce the issue

enable window grouping, open two or more chrome-apps

oakbrad commented 6 years ago

I am having the same issue. I use the Chrome Hangouts app.

If I open Chrome and Hangouts, closing Chrome will close both applications.

If I open both and close Hangouts, the Hangouts icon remains but it shows the window grouping and options for Chrome.

flvrone commented 6 years ago

This issue becomes even more annoying when you're screen sharing through Hangouts, and eventually you cannot access your normal chrome window via task list applet. :c

dan-dr commented 6 years ago

Same here. screenshot from 2018-08-23 01-06-00

clicking on either Chrome or Videostream (the orange icon) minimizes both windows.

felschr commented 5 years ago

With the update today on the stable channel my Chrome + PWAs still behaves incorrectly (with window grouping enabled): budgie-chrome-issue

They selection indicators is shown for all all apps when one is selected. This also means when clicking a different Chrome app than the actually currently selected one all windows will be minimised instead. And e.g. when I use the scroll wheel while hovering over one of the apps it toggles between all the Chrome windows including the apps.

The only thing that has changed with the update is that it doesn't show multiple window indicators for each Chrome app & Chrome itself anymore.

felschr commented 5 years ago

Other Chromium-based browsers like Brave still have the original issue. The recent code changes seems to be specific to Chrome. And even with Chrome it's not working for me properly.

@JoshStrobl could you reopen the issue and perhaps have a look at this again?

felschr commented 5 years ago

@JoshStrobl any update?

felschr commented 5 years ago

I just noticed that the same problem appears when I have multiple wine applications open (started via Lutris). budgie-wine-bug

DonatCallens commented 5 years ago

Same here. When I save a web page as a shortcut in Google Chrome, I cannot pin the icon in the task bar, unless I enable windows grouping in the panel first. (latest version of Solus 4 freshly installed)

dan-dr commented 5 years ago

Still not working for me. While the apps have separate icons, clicking the icon minimizes all the chrome windows + all the chrome apps. My bet is that https://github.com/solus-project/budgie-desktop/blob/d80b745bd25489751b0290050566b388598b4271/src/applets/icon-tasklist/IconButton.vala#L882 returns all the Chrome windows. Which probably means they all share the same class group?

Maybe this returns the same group name for all chrome windows and apps? https://github.com/solus-project/budgie-desktop/blob/846c9334aa22394f5f3e24c0e6f6aa062122ebc5/src/appsys/AppSystem.vala#L156

Looks like this commit is related: https://github.com/solus-project/budgie-desktop/commit/32bc83acc455a726ab36fe3fe5c35b70a9a0323d

xprop WM_CLASS - For apps: WM_CLASS(STRING) = "crx_cnciopoikihiagdjbjpnocolokfelagl", "Google-chrome" For actual chrome: WM_CLASS(STRING) = "google-chrome", "Google-chrome"

Not sure what window.get_class_group_name(); returns for the above (my guess is only the latter), but it seems to me the fix can come in one of two ways:

  1. in IconButton fetch the windows and check for the classname and not the class (https://askubuntu.com/a/1060233)
  2. Abomination/IconButton should use classname instead or in addition to class?

Changes would be necessary here https://github.com/solus-project/budgie-desktop/blob/846c9334aa22394f5f3e24c0e6f6aa062122ebc5/src/abomination/abomination.vala#L286 and/or here https://github.com/solus-project/budgie-desktop/blob/414508adcfa7916358f60786e3e4fcd507e7966a/src/applets/icon-tasklist/IconTasklistApplet.vala#L385

Related Chromium bugs: https://bugs.chromium.org/p/chromium/issues/detail?id=394037 https://bugs.chromium.org/p/chromium/issues/detail?id=118613

Help us lord @JoshStrobl

dan-dr commented 5 years ago

FYI Gnome Web works well with "Web sites as apps" so if you have chrome apps which are simple wrappers around websites it's a good solution until this is fixed.

https://www.makeuseof.com/tag/epiphany-web-apps-integrate-web-desktop/

dan-dr commented 5 years ago

We probably need this in https://github.com/solus-project/budgie-desktop/blob/master/src/applets/icon-tasklist/DesktopHelper.vala:

public GLib.List<unowned Wnck.Window> get_stacked_for_classname(string class_name)
{
    GLib.List<unowned Wnck.Window> list = new GLib.List<unowned Wnck.Window>();
    screen.get_windows_stacked().foreach((window) => {
        if (window.get_class_group_name() == class_name && !window.is_skip_tasklist()) {
            var workspace = window.get_workspace();
            if (workspace == null) {
                return;
            }
            if (workspace == get_active_workspace()) {
                list.append(window);
            }
        }
    });

    return list.copy();
}

Then in https://github.com/solus-project/budgie-desktop/blob/d80b745bd25489751b0290050566b388598b4271/src/applets/icon-tasklist/IconButton.vala#L882

Replace with

GLib.List<unowned Wnck.Window> list;

if (this.first_app.group.has_prefix("chrome-") || this.first_app.group.has_prefix("google-chrome")) // is chrome or chrome app
{
    list = this.desktop_helper.get_stacked_for_classname(this.class_group.get_name());
}
else {
    list = this.desktop_helper.get_stacked_for_classgroup(this.class_group);
}

@JoshStrobl Happy to test and PR but I have no idea how to set up a dev env.

bmorashad commented 4 years ago

Unfortunately even after the commit 84a672b, this issue still exists :|

Poltergeisen commented 1 year ago

Can we re-open this? I'm still having this issue

@JoshStrobl

image