nsz32 / docklike-plugin

A Dock-like Taskbar Plugin for XFCE
GNU General Public License v3.0
333 stars 44 forks source link

Chrome apps grouped with Chrome, should be separate window #14

Open RichJack7613 opened 4 years ago

RichJack7613 commented 4 years ago

Hi, first off thanks for a great plugin, just what XFCE panel needs :)

I use Chrome apps a lot in windowed mode (From Chrome customize menu - more tools - create shortcut). This generates a launcher on the desktop and at ~/.local/share/applications. Each launcher is allocated a unique StartupWMClass which is used to determine that it is a separate window to the main Chrome browser window (albeit still running in google-chrome).

Plank dock respects the wmclass property and pins each app icon separately. It would be nice to have this in docklike-plugin especially with the rise of PWAs. Also affects Chromium, new Microsoft Edge, Brave...

nsz32 commented 4 years ago

Thanks for your appreciation.

It might be an association algorithm mistake. I will not install Google Chrome here, and Chromium doesn't offer the possibility you talk about.

Please send me the content of a .desktop file and the corresponding xprop output (without icons) of the window it launch. Ty

RichJack7613 commented 4 years ago

Sure. This example is for StackEdit:

~/.local/share/applications/chrome-olheigmnhdlofgjiponfkcnofipcljko-Default.desktop

#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Terminal=false
Type=Application
Name=StackEdit
Exec=/opt/google/chrome/google-chrome --profile-directory=Default --app-id=olheigmnhdlofgjiponfkcnofipcljko
Icon=chrome-olheigmnhdlofgjiponfkcnofipcljko-Default
StartupWMClass=crx_olheigmnhdlofgjiponfkcnofipcljko

The icon would be saved at ~/.local/share/icons/hicolor/[size]/apps/chrome-olheigmnhdlofgjiponfkcnofipcljko-Default.png

And looks like this: chrome-olheigmnhdlofgjiponfkcnofipcljko-Default

Hope this helps :)

nsz32 commented 4 years ago

It won't help without the xprop output. It's a command line utility which makes you point and click on a window and output all the WM informations about it. Please install xprop, launch it and give me output about the StackEdit window (without the large icons outputs).

RichJack7613 commented 4 years ago

Sorry, thought that would be enough. Here you are:

_NET_WM_ICON_GEOMETRY(CARDINAL) = 918, 735, 47, 33
_NET_FRAME_EXTENTS(CARDINAL) = 0, 0, 0, 0
_NET_WM_ALLOWED_ACTIONS(ATOM) = _NET_WM_ACTION_CLOSE, _NET_WM_ACTION_ABOVE, _NET_WM_ACTION_BELOW, _NET_WM_ACTION_FULLSCREEN, _NET_WM_ACTION_MOVE, _NET_WM_ACTION_MAXIMIZE_HORZ, _NET_WM_ACTION_MAXIMIZE_VERT, _NET_WM_ACTION_MINIMIZE, _NET_WM_ACTION_CHANGE_DESKTOP, _NET_WM_ACTION_STICK
WM_STATE(WM_STATE):
        window state: Normal
        icon window: 0xce165600
_NET_WM_DESKTOP(CARDINAL) = 0
_NET_WM_STATE(ATOM) = _NET_WM_STATE_MAXIMIZED_HORZ, _NET_WM_STATE_MAXIMIZED_VERT
_NET_WM_USER_TIME(CARDINAL) = 955010
WM_NORMAL_HINTS(WM_SIZE_HINTS):
        program specified location: 0, 0
        program specified minimum size: 231 by 33
WM_NAME(UTF8_STRING) = "StackEdit"
_NET_WM_NAME(UTF8_STRING) = "StackEdit"
XdndAware(ATOM) = BITMAP
_MOTIF_WM_HINTS(_MOTIF_WM_HINTS) = 0x2, 0x0, 0x0, 0x0, 0x0
_NET_WM_ICON(CARDINAL) =    Icon (32 x 32):

                               ░    
       ░                       ░░   
     ░░░                        ░░░ 
     ░░                          ░░ 
    ░░░     ▒▒  ▒▒               ░░░
    ░░░     ▒░  ░▒               ░░░
    ░░░   ░▒▒▒▒▒▒▒▒░             ░░░
    ░░░   ░▒▒▒▒▒▒▒▒░             ░░░
    ░░░     ▒░  ░▒               ░░░
    ░░░     ▒░  ░▒               ░░░
    ░░░     ▒░  ░▒               ░░░
    ░░░   ░▒▒▒▒▒▒▒▒░             ░░░
    ░░░   ░▒▒▒▒▒▒▒▒░             ░░░
    ░░░     ▒░  ░▒               ░░░
    ░░░     ▒▒  ▒▒               ░░░
    ░░░     ░    ░               ░░░
    ░░░                          ░░░
    ░░░                          ░░░
    ░░░                          ░░░
    ░░░                          ░░░
    ░░░                          ░░░
    ░░░                          ░░░
    ░░░                          ░░░
    ░░░                          ░░░
     ░░░                        ░░░ 
     ░░░░                      ░░░░ 
      ░░░░░                  ░░░░░  
      ░░░░░░░░░░░░░░░░░░░░░░░░░░░░  
        ░░░░░░░░░░░░░░░░░░░░░░░░    
          ░░░░░░░░░░░░░░░░░░░░      

    Icon (32 x 32):

                               ░    
       ░                       ░░   
     ░░░                        ░░░ 
     ░░                          ░░ 
    ░░░     ▒▒  ▒▒               ░░░
    ░░░     ▒░  ░▒               ░░░
    ░░░   ░▒▒▒▒▒▒▒▒░             ░░░
    ░░░   ░▒▒▒▒▒▒▒▒░             ░░░
    ░░░     ▒░  ░▒               ░░░
    ░░░     ▒░  ░▒               ░░░
    ░░░     ▒░  ░▒               ░░░
    ░░░   ░▒▒▒▒▒▒▒▒░             ░░░
    ░░░   ░▒▒▒▒▒▒▒▒░             ░░░
    ░░░     ▒░  ░▒               ░░░
    ░░░     ▒▒  ▒▒               ░░░
    ░░░     ░    ░               ░░░
    ░░░                          ░░░
    ░░░                          ░░░
    ░░░                          ░░░
    ░░░                          ░░░
    ░░░                          ░░░
    ░░░                          ░░░
    ░░░                          ░░░
    ░░░                          ░░░
     ░░░                        ░░░ 
     ░░░░                      ░░░░ 
      ░░░░░                  ░░░░░  
      ░░░░░░░░░░░░░░░░░░░░░░░░░░░░  
        ░░░░░░░░░░░░░░░░░░░░░░░░    
          ░░░░░░░░░░░░░░░░░░░░      

_NET_WM_BYPASS_COMPOSITOR(CARDINAL) = 2
_NET_WM_SYNC_REQUEST_COUNTER(CARDINAL) = 60817445, 60817446
_GTK_HIDE_TITLEBAR_WHEN_MAXIMIZED(CARDINAL) = 1
WM_WINDOW_ROLE(STRING) = "pop-up"
WM_CLASS(STRING) = "crx_olheigmnhdlofgjiponfkcnofipcljko", "Google-chrome"
_NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_NORMAL
_NET_WM_PID(CARDINAL) = 6932
WM_LOCALE_NAME(STRING) = "en_GB.UTF-8"
WM_CLIENT_MACHINE(STRING) = "ASUS"
WM_PROTOCOLS(ATOM): protocols  WM_DELETE_WINDOW, _NET_WM_PING, _NET_WM_SYNC_REQUEST
nsz32 commented 4 years ago

This will be fixed this week-end (very small change but it's late here). Ty as your request will probably improves the apps compatibility.

RichJack7613 commented 4 years ago

Thanks for the speedy response! I will happily recompile next week once you have pushed the changes and report back.

nsz32 commented 4 years ago

2db95521ed10ac1aeab82c83692ec1e0fef7bf22 should solve your pb Edit: nope, need more investigations

nsz32 commented 4 years ago

WM_CLASS(STRING) = "crx_olheigmnhdlofgjiponfkcnofipcljko", "Google-chrome" Here is the problem : WNCK, the lib used to get windows informations will return only the second string "Google-chrome". Plank uses another lib to do associations (BAMF, which i did not know about). I need to integrate this lib in order to solve your request. This is more works as firstly assessed. I will probably do this when I have time. I'm sorry to tell to count in weeks/months.

RichJack7613 commented 4 years ago

Hey, no problem. I will keep an eye out for the fix in due course. Thanks for the consideration :)

On May 29 2020, at 8:03 pm, nsz32 notifications@github.com wrote:

WM_CLASS(STRING) = "crx_olheigmnhdlofgjiponfkcnofipcljko", "Google-chrome" Here is the problem : WNCK, the lib used to get windows informations will return only the second string "Google-chrome". Plank uses another lib to do associations (BAMF, which i did not know about). I need to integrate this lib in order to solve your request. This is more works as firstly assessed. I will probably do this when I have time. I'm sorry to tell to count in weeks/months.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub (https://link.getmailspring.com/link/3857ACE5-26F2-4B51-B21A-DCDAFE424EAE@getmailspring.com/1?redirect=https%3A%2F%2Fgithub.com%2Fnsz32%2Fdocklike-plugin%2Fissues%2F14%23issuecomment-636136540&recipient=cmVwbHkrQVBZR1hPS1JJSVVOTDVSNjZDV0FZNkY0M1U2WUxFVkJOSEhDS1czSlhZQHJlcGx5LmdpdGh1Yi5jb20%3D), or unsubscribe (https://link.getmailspring.com/link/3857ACE5-26F2-4B51-B21A-DCDAFE424EAE@getmailspring.com/2?redirect=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAPYGXOMYRHPE6KIMVHAVTKLRUABILANCNFSM4NNLKQEQ&recipient=cmVwbHkrQVBZR1hPS1JJSVVOTDVSNjZDV0FZNkY0M1U2WUxFVkJOSEhDS1czSlhZQHJlcGx5LmdpdGh1Yi5jb20%3D).

julien-maurel commented 3 years ago

Hi, Do you have a vision of changes about that? I'm working on and with some PWA and this bug is painful, so I just remove xdocklike for the moment but I'm so frustrated ;) Thx

agamoaltrove commented 1 year ago

PWAs have gradually gained fame, this development would really help a lot. I still prefer docklike as my dock application, I've found alternative methods like managing these apps with webapp managers, but it's not quite the same. I look forward to developments on this issue :) Thx

Hesbadami commented 9 months ago

Having this would be really great. I'm still waiting for a patch for this. So far I have switched to using electron wrappers instead of chrome shortcuts, but google OAUTH no longer allows electon, and the chrome shortcuts are far more prefered because they are protected from security vulnerabilities by the browser's self updating mechanism.

eekhof commented 8 months ago

The same problem occurs with Firefox windows marked to a different StartupWMClass than the Firefox browser, I do not know if I should open another issue for this.

jisana commented 7 months ago

Hello, after much looking at the code, I have come up with a possible solution, I do not know if it can be a final fix to the problem but it is working correctly for me. When creating the groups, I look at the title and class and based on that, if I detect that it has a webapp structure, I force the group to have the name of the title of the window.

https://github.com/jisana/xfce4-docklike-plugin/commit/52983930a5317ffb45c747567164fe19176614db

Before:: image

After the fix:: image

tux-ware commented 4 months ago

Thanks for the possible fix @jisana. I've mentioned it in the main xfce4-docklike-plugin gitlab repo: https://gitlab.xfce.org/panel-plugins/xfce4-docklike-plugin/-/issues/21