docklike-plugin icon indicating copy to clipboard operation
docklike-plugin copied to clipboard

Chrome apps grouped with Chrome, should be separate window

Open RichJack7613 opened this issue 4 years ago • 15 comments

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...

RichJack7613 avatar May 28 '20 19:05 RichJack7613

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

nsz32 avatar May 28 '20 20:05 nsz32

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 :)

RichJack7613 avatar May 28 '20 20:05 RichJack7613

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).

nsz32 avatar May 28 '20 21:05 nsz32

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

RichJack7613 avatar May 28 '20 21:05 RichJack7613

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.

nsz32 avatar May 28 '20 21:05 nsz32

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

RichJack7613 avatar May 29 '20 09:05 RichJack7613

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

nsz32 avatar May 29 '20 12:05 nsz32

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.

nsz32 avatar May 29 '20 19:05 nsz32

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 [email protected] 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/[email protected]/1?redirect=https%3A%2F%2Fgithub.com%2Fnsz32%2Fdocklike-plugin%2Fissues%2F14%23issuecomment-636136540&recipient=cmVwbHkrQVBZR1hPS1JJSVVOTDVSNjZDV0FZNkY0M1U2WUxFVkJOSEhDS1czSlhZQHJlcGx5LmdpdGh1Yi5jb20%3D), or unsubscribe (https://link.getmailspring.com/link/[email protected]/2?redirect=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAPYGXOMYRHPE6KIMVHAVTKLRUABILANCNFSM4NNLKQEQ&recipient=cmVwbHkrQVBZR1hPS1JJSVVOTDVSNjZDV0FZNkY0M1U2WUxFVkJOSEhDS1czSlhZQHJlcGx5LmdpdGh1Yi5jb20%3D).

RichJack7613 avatar May 29 '20 19:05 RichJack7613

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

julien-maurel avatar Jun 16 '21 11:06 julien-maurel

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

agamoaltrove avatar Aug 09 '23 11:08 agamoaltrove

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.

Hesbadami avatar Dec 07 '23 02:12 Hesbadami

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.

eekhof avatar Jan 23 '24 18:01 eekhof

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

jisana avatar Feb 14 '24 23:02 jisana

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

tux-ware avatar May 08 '24 22:05 tux-ware