Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Distortions to remote windows after update #4243

Closed
nikolaof opened this issue May 30, 2024 · 19 comments
Closed

Distortions to remote windows after update #4243

nikolaof opened this issue May 30, 2024 · 19 comments
Labels
bug Something isn't working

Comments

@nikolaof
Copy link

Describe the bug
After the last update from 4.4.5-2 to 6.0-1, whatever application I'm running at server side, displays some distortions, like parts of the windows are blinking, or change colors on their own. Also when scrolling for example in vscode the whole content is messed up (see screenshot).

To Reproduce
Steps to reproduce the behavior:

  1. server command: /usr/bin/xpra --no-daemon start ${%i}
  2. client command: xpra attach ssh://user@host/display --tray=no; && xpra control ssh://user@host/display start-child "'"${cmd}"'";
  3. specific action to trigger the bug: Move around to the remote window

System Information:

  • Server OS: Arch Linux
  • Client OS: Arch Linux
  • Xpra Server Version 6.0-1
  • Xpra Client Version 6.0-1

Additional context
2024-05-30-151442_836x489_scrot

xpraconf.txt

@nikolaof nikolaof added the bug Something isn't working label May 30, 2024
@totaam
Copy link
Collaborator

totaam commented May 30, 2024

Likely fixed in 6.0.1, which has been released

@nikolaof
Copy link
Author

Hey, I'm trying to update the arch linux package, but for some reason the new release is not listed under https://www.xpra.org/src/. Is there any reason for that?

@totaam
Copy link
Collaborator

totaam commented May 31, 2024

@nikolaof there is, I forgot! (it's just a copy of the one from pypi)
Done now.

@totaam
Copy link
Collaborator

totaam commented May 31, 2024

I am closing this ticket as a duplicate of #4201 (comment)

Feel free to re-open if you can reproduce with 6.0.1

@totaam totaam closed this as completed May 31, 2024
@nikolaof
Copy link
Author

nikolaof commented May 31, 2024

Ok. After updating, seems to be better but not perfect. The lines are fine when scrolling but still for some reason I'm experiencing some color changing when moving the mouse around the window.

2024-05-31-114636_1301x515_scrot

for example the code panel in the image switch from darker to lighter and vice versa. Somthing like flickering.

@totaam
Copy link
Collaborator

totaam commented May 31, 2024

That's likely to be a colourspace issue (#3837), but I have no idea which codecs Arch enables.
Having the server's -d compress output corresponding to the problematic screen updates would help us narrow it down. (also knowing whether the window uses opengl rendering or not - and whether using --opengl=no / --opengl=force changes anything).

@nikolaof
Copy link
Author

Enabling debug for compress I'm getting a huge such a list. Personally I cannot debug this :) What should we look for? I mean how the distortions/flickering will look like ?

May 31 09:10:17 vscode xpra[2230]: 2024-05-31 09:10:17,237 compress:  13.7ms for  912x955  pixels at   48,82   for wid=1     using      webp with ratio   1.5%  ( 3403KB to    50KB), sequence   643, client_options={'rgb_format': 'BGRX', 'subsampling': 'YUV420P', 'quality': 69, 'csc-type': 'none', 'encoder': 'webp', 'flush': 0}, options={'quality': 69, 'speed': 33, 'rgb_formats': ('YUV420P', 'YUV422P', 'YUV444P', 'NV12', 'GBRP', 'BGRX', 'RGBX', 'RGB', 'BGR'), 'lz4': True, 'alpha': False, 'content-type': 'browser', 'av-delay': 0, 'window-size': (960, 1059)}
May 31 09:10:17 vscode xpra[2230]: 2024-05-31 09:10:17,253 compress:  13.5ms for  912x955  pixels at   48,82   for wid=1     using      webp with ratio   1.5%  ( 3403KB to    50KB), sequence   644, client_options={'rgb_format': 'BGRX', 'subsampling': 'YUV420P', 'quality': 69, 'csc-type': 'none', 'encoder': 'webp', 'flush': 0}, options={'quality': 69, 'speed': 33, 'rgb_formats': ('YUV420P', 'YUV422P', 'YUV444P', 'NV12', 'GBRP', 'BGRX', 'RGBX', 'RGB', 'BGR'), 'lz4': True, 'alpha': False, 'content-type': 'browser', 'av-delay': 0, 'window-size': (960, 1059)}
May 31 09:10:17 vscode xpra[2230]: 2024-05-31 09:10:17,270 compress:  13.6ms for  912x955  pixels at   48,82   for wid=1     using      webp with ratio   1.5%  ( 3403KB to    50KB), sequence   645, client_options={'rgb_format': 'BGRX', 'subsampling': 'YUV420P', 'quality': 69, 'csc-type': 'none', 'encoder': 'webp', 'flush': 0}, options={'quality': 69, 'speed': 33, 'rgb_formats': ('YUV420P', 'YUV422P', 'YUV444P', 'NV12', 'GBRP', 'BGRX', 'RGBX', 'RGB', 'BGR'), 'lz4': True, 'alpha': False, 'content-type': 'browser', 'av-delay': 0, 'window-size': (960, 1059)}
May 31 09:10:17 vscode xpra[2230]: 2024-05-31 09:10:17,288 compress:  14.6ms for  912x955  pixels at   48,82   for wid=1     using      webp with ratio   1.5%  ( 3403KB to    50KB), sequence   646, client_options={'rgb_format': 'BGRX', 'subsampling': 'YUV420P', 'quality': 69, 'csc-type': 'none', 'encoder': 'webp', 'flush': 0}, options={'quality': 69, 'speed': 33, 'rgb_formats': ('YUV420P', 'YUV422P', 'YUV444P', 'NV12', 'GBRP', 'BGRX', 'RGBX', 'RGB', 'BGR'), 'lz4': True, 'alpha': False, 'content-type': 'browser', 'av-delay': 0, 'window-size': (960, 1059)}
May 31 09:10:17 vscode xpra[2230]: 2024-05-31 09:10:17,305 compress:  15.1ms for  912x955  pixels at   48,82   for wid=1     using      webp with ratio   1.5%  ( 3403KB to    50KB), sequence   647, client_options={'rgb_format': 'BGRX', 'subsampling': 'YUV420P', 'quality': 69, 'csc-type': 'none', 'encoder': 'webp', 'flush': 0}, options={'quality': 69, 'speed': 33, 'rgb_formats': ('YUV420P', 'YUV422P', 'YUV444P', 'NV12', 'GBRP', 'BGRX', 'RGBX', 'RGB', 'BGR'), 'lz4': True, 'alpha': False, 'content-type': 'browser', 'av-delay': 0, 'window-size': (960, 1059)}
May 31 09:10:17 vscode xpra[2230]: 2024-05-31 09:10:17,322 compress:  15.5ms for  912x955  pixels at   48,82   for wid=1     using      webp with ratio   1.5%  ( 3403KB to    50KB), sequence   648, client_options={'rgb_format': 'BGRX', 'subsampling': 'YUV420P', 'quality': 69, 'csc-type': 'none', 'encoder': 'webp', 'flush': 0}, options={'quality': 69, 'speed': 33, 'rgb_formats': ('YUV420P', 'YUV422P', 'YUV444P', 'NV12', 'GBRP', 'BGRX', 'RGBX', 'RGB', 'BGR'), 'lz4': True, 'alpha': False, 'content-type': 'browser', 'av-delay': 0, 'window-size': (960, 1059)}
May 31 09:10:17 vscode xpra[2230]: 2024-05-31 09:10:17,338 compress:  14.2ms for  912x955  pixels at   48,82   for wid=1     using      webp with ratio   1.5%  ( 3403KB to    50KB), sequence   649, client_options={'rgb_format': 'BGRX', 'subsampling': 'YUV420P', 'quality': 69, 'csc-type': 'none', 'encoder': 'webp', 'flush': 0}, options={'quality': 69, 'speed': 33, 'rgb_formats': ('YUV420P', 'YUV422P', 'YUV444P', 'NV12', 'GBRP', 'BGRX', 'RGBX', 'RGB', 'BGR'), 'lz4': True, 'alpha': False, 'content-type': 'browser', 'av-delay': 0, 'window-size': (960, 1059)}
May 31 09:10:17 vscode xpra[2230]: 2024-05-31 09:10:17,353 compress:  13.2ms for  912x955  pixels at   48,82   for wid=1     using      webp with ratio   1.5%  ( 3403KB to    50KB), sequence   650, client_options={'rgb_format': 'BGRX', 'subsampling': 'YUV420P', 'quality': 69, 'csc-type': 'none', 'encoder': 'webp', 'flush': 0}, options={'quality': 69, 'speed': 33, 'rgb_formats': ('YUV420P', 'YUV422P', 'YUV444P', 'NV12', 'GBRP', 'BGRX', 'RGBX', 'RGB', 'BGR'), 'lz4': True, 'alpha': False, 'content-type': 'browser', 'av-delay': 0, 'window-size': (960, 1059)}
May 31 09:10:17 vscode xpra[2230]: 2024-05-31 09:10:17,372 compress:  14.7ms for  912x955  pixels at   48,82   for wid=1     using      webp with ratio   1.5%  ( 3403KB to    50KB), sequence   651, client_options={'rgb_format': 'BGRX', 'subsampling': 'YUV420P', 'quality': 69, 'csc-type': 'none', 'encoder': 'webp', 'flush': 0}, options={'quality': 69, 'speed': 33, 'rgb_formats': ('YUV420P', 'YUV422P', 'YUV444P', 'NV12', 'GBRP', 'BGRX', 'RGBX', 'RGB', 'BGR'), 'lz4': True, 'alpha': False, 'content-type': 'browser', 'av-delay': 0, 'window-size': (960, 1059)}
May 31 09:10:17 vscode xpra[2230]: 2024-05-31 09:10:17,387 compress:  13.1ms for  912x955  pixels at   48,82   for wid=1     using      webp with ratio   1.5%  ( 3403KB to    50KB), sequence   652, client_options={'rgb_format': 'BGRX', 'subsampling': 'YUV420P', 'quality': 69, 'csc-type': 'none', 'encoder': 'webp', 'flush': 0}, options={'quality': 69, 'speed': 33, 'rgb_formats': ('YUV420P', 'YUV422P', 'YUV444P', 'NV12', 'GBRP', 'BGRX', 'RGBX', 'RGB', 'BGR'), 'lz4': True, 'alpha': False, 'content-type': 'browser', 'av-delay': 0, 'window-size': (960, 1059)}
May 31 09:10:17 vscode xpra[2230]: 2024-05-31 09:10:17,455 compress:   0.1ms for    2x19   pixels at  118,309  for wid=1     using     rgb24 with ratio 100.0%  (    1KB to     1KB), sequence   653, client_options={'rgb_format': 'BGRX', 'encoder': 'argb', 'flush': 0}, options={'quality': 100, 'speed': 33, 'rgb_formats': ('YUV420P', 'YUV422P', 'YUV444P', 'NV12', 'GBRP', 'BGRX', 'RGBX', 'RGB', 'BGR'), 'lz4': True, 'alpha': False, 'content-type': 'browser', 'window-size': (960, 1059)}
May 31 09:10:17 vscode xpra[2230]: 2024-05-31 09:10:17,606 compress:   3.0ms for  960x34   pixels at    0,25   for wid=1     using      webp with ratio  10.8%  (  128KB to    14KB), sequence   654, client_options={'rgb_format': 'BGRX', 'quality': 100, 'encoder': 'webp', 'flush': 0}, options={'optimize': False, 'auto_refresh': True, 'quality': 100, 'speed': 50, 'rgb_formats': ('YUV420P', 'YUV422P', 'YUV444P', 'NV12', 'GBRP', 'BGRX', 'RGBX', 'RGB', 'BGR'), 'lz4': True, 'alpha': False, 'content-type': 'browser', 'window-size': (960, 1059)}
May 31 09:10:17 vscode xpra[2230]: 2024-05-31 09:10:17,955 compress:   0.1ms for    2x19   pixels at  118,309  for wid=1     using     rgb24 with ratio 100.0%  (    1KB to     1KB), sequence   655, client_options={'rgb_format': 'BGRX', 'encoder': 'argb', 'flush': 0}, options={'quality': 100, 'speed': 39, 'rgb_formats': ('YUV420P', 'YUV422P', 'YUV444P', 'NV12', 'GBRP', 'BGRX', 'RGBX', 'RGB', 'BGR'), 'lz4': True, 'alpha': False, 'content-type': 'browser', 'window-size': (960, 1059)}

Also, I tried to use both of the --opengl flags you mentioned in the client side and didn't change anything.

@totaam
Copy link
Collaborator

totaam commented May 31, 2024

These 912x955 pixel screen updates seem to be updating almost the entire window since 'window-size': (960, 1059)
Every single one of them is using webp with the exact same key settings: 'quality': 69, 'speed': 33
Except for this one which is the auto-refresh:

options={'optimize': False, 'auto_refresh': True, 'quality': 100, 'speed': 50, ... 'alpha': False, 'content-type': 'browser', 'window-size': (960, 1059)}

My guess is that xpra should be sending only lossless screen updates, but it is sending lossy subsampled (YUV420P) screen updates instead because your application is detected as: 'content-type': 'browser' - for whatever reason.
Raising the min-quality is a bad workaround (a band aid that will affect all applications), a better one is to ensure that your application is correctly detected as text content type.

@nikolaof
Copy link
Author

Is there a way to modify how the application is detected? I mean the actual application is the Visual Studio Code. As far as I know is based on web technologies like electron. Maybe it makes sense that it detects it as web browser.

@nikolaof
Copy link
Author

Thanks a lot for the links. So according to the xprop results of the window (see bellow) I've modified the following files.

_XPRA_WID(CARDINAL) = 2
_NET_WM_DESKTOP(CARDINAL) = 1
_NET_WM_STATE(ATOM) =
WM_STATE(WM_STATE):
                window state: Normal
                icon window: 0x0
WM_HINTS(WM_HINTS):
                Client accepts input or input focus: True
                Initial state is Normal State.
                window id # of group leader: 0x1200012
_GTK_THEME_VARIANT(UTF8_STRING) =
_NET_FRAME_EXTENTS(CARDINAL) = 0, 0, 20, 0
WM_COMMAND(STRING) = { "/opt/visual-studio-code-insiders/code-insiders --disable-gpu --no-sandbox" }
_NET_WM_BYPASS_COMPOSITOR(CARDINAL) = 2
XID(CARDINAL) = 68764424
XdndAware(ATOM) = BITMAP
WM_WINDOW_ROLE(STRING) = "browser-window"
_NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_NORMAL
_NET_WM_SYNC_REQUEST_COUNTER(CARDINAL) = 18874504, 18874505
_NET_WM_USER_TIME(CARDINAL) = 3797242
_NET_WM_USER_TIME_WINDOW(WINDOW): window id # 0x1200087
WM_CLIENT_LEADER(WINDOW): window id # 0x1200001
_NET_WM_PID(CARDINAL) = 37433
WM_LOCALE_NAME(STRING) = "en_US.UTF-8"
WM_CLIENT_MACHINE(STRING) = "thinkpad"
WM_NORMAL_HINTS(WM_SIZE_HINTS):
                program specified location: 0, 0
                program specified minimum size: 400 by 270
                program specified maximum size: 32767 by 32767
                program specified base size: 400 by 270
                window gravity: NorthWest
WM_PROTOCOLS(ATOM): protocols  WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_SYNC_REQUEST
WM_CLASS(STRING) = "code - insiders", "Code - Insiders"
WM_ICON_NAME(STRING) = "dependency_track.py - Untitled (Workspace) - Visual Studio Code - Insiders on vscode"
_NET_WM_ICON_NAME(UTF8_STRING) = "dependency_track.py - Untitled (Workspace) - Visual Studio Code - Insiders on vscode"
WM_NAME(STRING) = "dependency_track.py - Untitled (Workspace) - Visual Studio Code - Insiders on vscode"
_NET_WM_NAME(UTF8_STRING) = "dependency_track.py - Untitled (Workspace) - Visual Studio Code - Insiders on vscode"
$ cat 50_class.conf

################################################################################
# Match window class-instance
# aka WM_CLASS

...
...
class-instance:Code - Insiders=text

$ cat 70_commands.conf
################################################################################
# Match window command
# aka WM_COMMAND

command:/opt/visual-studio-code-insiders/code-insiders --disable-gpu --no-sandbox=text

After saving them, I restarted the server, but still it recognize it as browser in the logs.

May 31 10:41:31 vscode xpra[5604]: 2024-05-31 10:41:31,769 compress:  23.9ms for  960x1059 pixels at    0,0    for wid=1     using      webp with ratio   1.7%  ( 3972KB to    70KB), sequence   304, client_options={'rgb_format': 'BGRX', 'subsampling': 'YUV420P', 'quality': 61, 'csc-type': 'none', 'encoder': 'webp', 'flush': 0}, options={'quality': 61, 'speed': 41, 'rgb_formats': ('YUV420P', 'YUV422P', 'YUV444P', 'NV12', 'GBRP', 'BGRX', 'RGBX', 'RGB', 'BGR'), 'lz4': True, 'alpha': False, 'content-type': 'browser', 'av-delay': 0, 'window-size': (960, 1059)}
May 31 10:41:31 vscode xpra[5604]: 2024-05-31 10:41:31,772 compress:   0.1ms for   18x18   pixels at  345,1039 for wid=1     using     rgb24 with ratio  46.1%  (    2KB to     1KB), sequence   305, client_options={'rgb_format': 'BGRX', 'lz4': 2, 'encoder': 'argb', 'flush': 0}, options={'quality': 100, 'speed': 41, 'rgb_formats': ('YUV420P', 'YUV422P', 'YUV444P', 'NV12', 'GBRP', 'BGRX', 'RGBX', 'RGB', 'BGR'), 'lz4': True, 'alpha': False, 'content-type': 'browser', 'window-size': (960, 1059)}
May 31 10:41:31 vscode xpra[5604]: 2024-05-31 10:41:31,807 compress:  15.5ms for  960x1059 pixels at    0,0    for wid=1     using      webp with ratio   1.8%  ( 3972KB to    70KB), sequence   306, client_options={'rgb_format': 'BGRX', 'subsampling': 'YUV420P', 'quality': 61, 'csc-type': 'none', 'encoder': 'webp', 'flush': 0}, options={'quality': 61, 'speed': 41, 'rgb_formats': ('YUV420P', 'YUV422P', 'YUV444P', 'NV12', 'GBRP', 'BGRX', 'RGBX', 'RGB', 'BGR'), 'lz4': True, 'alpha': False, 'content-type': 'browser', 'av-delay': 0, 'window-size': (960, 1059)}
May 31 10:41:31 vscode xpra[5604]: 2024-05-31 10:41:31,809 compress:   0.1ms for  603x3    pixels at   48,57   for wid=1     using     rgb24 with ratio   1.3%  (    8KB to     1KB), sequence   307, client_options={'rgb_format': 'BGRX', 'lz4': 5, 'encoder': 'argb', 'flush': 0}, options={'quality': 100, 'speed': 41, 'rgb_formats': ('YUV420P', 'YUV422P', 'YUV444P', 'NV12', 'GBRP', 'BGRX', 'RGBX', 'RGB', 'BGR'), 'lz4': True, 'alpha': False, 'content-type': 'browser', 'window-size': (960, 1059)}
May 31 10:41:31 vscode xpra[5604]: 2024-05-31 10:41:31,825 compress:   0.1ms for  603x3    pixels at   48,57   for wid=1     using     rgb24 with ratio   1.3%  (    8KB to     1KB), sequence   308, client_options={'rgb_format': 'BGRX', 'lz4': 5, 'encoder': 'argb', 'flush': 0}, options={'quality': 100, 'speed': 41, 'rgb_formats': ('YUV420P', 'YUV422P', 'YUV444P', 'NV12', 'GBRP', 'BGRX', 'RGBX', 'RGB', 'BGR'), 'lz4': True, 'alpha': False, 'content-type': 'browser', 'window-size': (960, 1059)}
May 31 10:41:31 vscode xpra[5604]: 2024-05-31 10:41:31,842 compress:   0.1ms for  603x3    pixels at   48,57   for wid=1     using     rgb24 with ratio   1.3%  (    8KB to     1KB), sequence   309, client_options={'rgb_format': 'BGRX', 'lz4': 5, 'encoder': 'argb', 'flush': 0}, options={'quality': 100, 'speed': 41, 'rgb_formats': ('YUV420P', 'YUV422P', 'YUV444P', 'NV12', 'GBRP', 'BGRX', 'RGBX', 'RGB', 'BGR'), 'lz4': True, 'alpha': False, 'content-type': 'browser', 'window-size': (960, 1059)}
May 31 10:41:31 vscode xpra[5604]: 2024-05-31 10:41:31,859 compress:   0.1ms for  912x3    pixels at   48,57   for wid=1     using     rgb24 with ratio   2.4%  (   11KB to     1KB), sequence   310, client_options={'rgb_format': 'BGRX', 'lz4': 5, 'encoder': 'argb', 'flush': 0}, options={'quality': 100, 'speed': 41, 'rgb_formats': ('YUV420P', 'YUV422P', 'YUV444P', 'NV12', 'GBRP', 'BGRX', 'RGBX', 'RGB', 'BGR'), 'lz4': True, 'alpha': False, 'content-type': 'browser', 'window-size': (960, 1059)}
May 31 10:41:32 vscode xpra[5604]: 2024-05-31 10:41:32,005 compress:   1.5ms for  897x35   pixels at   48,25   for wid=1     using      webp with ratio  11.1%  (  123KB to    14KB), sequence   311, client_options={'rgb_format': 'BGRX', 'quality': 100, 'encoder': 'webp', 'flush': 0}, options={'quality': 100, 'speed': 41, 'rgb_formats': ('YUV420P', 'YUV422P', 'YUV444P', 'NV12', 'GBRP', 'BGRX', 'RGBX', 'RGB', 'BGR'), 'lz4': True, 'alpha': False, 'content-type': 'browser', 'window-size': (960, 1059)}
May 31 10:41:32 vscode xpra[5604]: 2024-05-31 10:41:32,099 compress:   1.1ms for  842x19   pixels at  118,500  for wid=1     using      webp with ratio  10.0%  (   63KB to     7KB), sequence   312, client_options={'rgb_format': 'BGRX', 'quality': 100, 'encoder': 'webp', 'flush': 0}, options={'quality': 100, 'speed': 41, 'rgb_formats': ('YUV420P', 'YUV422P', 'YUV444P', 'NV12', 'GBRP', 'BGRX', 'RGBX', 'RGB', 'BGR'), 'lz4': True, 'alpha': False, 'content-type': 'browser', 'window-size': (960, 1059)}
May 31 10:41:32 vscode xpra[5604]: 2024-05-31 10:41:32,144 compress:  17.7ms for  960x1059 pixels at    0,0    for wid=1     using      webp with ratio   1.8%  ( 3972KB to    71KB), sequence   313, client_options={'rgb_format': 'BGRX', 'subsampling': 'YUV420P', 'quality': 61, 'csc-type': 'none', 'encoder': 'webp', 'flush': 0}, options={'quality': 61, 'speed': 41, 'rgb_formats': ('YUV420P', 'YUV422P', 'YUV444P', 'NV12', 'GBRP', 'BGRX', 'RGBX', 'RGB', 'BGR'), 'lz4': True, 'alpha': False, 'content-type': 'browser', 'av-delay': 0, 'window-size': (960, 1059)}
May 31 10:41:32 vscode xpra[5604]: 2024-05-31 10:41:32,322 compress:  25.1ms for  960x1059 pixels at    0,0    for wid=1     using      webp with ratio   6.7%  ( 3972KB to   268KB), sequence   314, client_options={'rgb_format': 'BGRX', 'quality': 100, 'encoder': 'webp', 'flush': 0}, options={'optimize': False, 'auto_refresh': True, 'quality': 100, 'speed': 50, 'rgb_formats': ('YUV420P', 'YUV422P', 'YUV444P', 'NV12', 'GBRP', 'BGRX', 'RGBX', 'RGB', 'BGR'), 'lz4': True, 'alpha': False, 'content-type': 'browser', 'window-size': (960, 1059)}
May 31 10:41:32 vscode xpra[5604]: 2024-05-31 10:41:32,325 compress:   0.1ms for   25x16   pixels at  320,34   for wid=1     using     rgb24 with ratio  33.1%  (    2KB to     1KB), sequence   315, client_options={'rgb_format': 'BGRX', 'lz4': 2, 'encoder': 'argb', 'flush': 0}, options={'quality': 100, 'speed': 41, 'rgb_formats': ('YUV420P', 'YUV422P', 'YUV444P', 'NV12', 'GBRP', 'BGRX', 'RGBX', 'RGB', 'BGR'), 'lz4': True, 'alpha': False, 'content-type': 'browser', 'window-size': (960, 1059)}

@totaam
Copy link
Collaborator

totaam commented May 31, 2024

That should have worked.
This is where we update the content-type attribute:

def _content_type_related_property_change(self, *_args) -> None:
self._update_content_type()
def _handle_xpra_content_type_change(self) -> None:
self._update_content_type()
def _update_content_type(self) -> None:
# watch for changes to properties that are used to derive the content-type:
content_type = self.prop_get("_XPRA_CONTENT_TYPE", "latin1", True) or ""
# the _XPRA_CONTENT_TYPE property takes precedence
if not content_type and GUESS_CONTENT:
# guess_content_type can take a while as it will load the xdg menu data
# so call it as a work item.
# multiple callers can be added to the sequential work queue,
# the menu loader also has a lock.
add_work_item(self.guess_content_type)
metalog("_update_content_type() %s", content_type)
self._updateprop("content-type", content_type)
def guess_content_type(self) -> None:
content_type = guess_content_type(self)
if not content_type and self.is_tray():
content_type = "picture"
metalog(f"guess_content_type() {content_type=}")
self._updateprop("content-type", content_type)

And this should end up calling: guess_content_type

The server debug switch for this module is -d util+window.
This is what I see for --start=xterm:

_load_dict_file()
guess_content_type_from_defs(WindowModel(400012)) prop(role)=None
guess_content_type_from_defs(WindowModel(400012)) prop(title)=antoine@fedora:~/projects/xpra
guess_content_type_from_defs(WindowModel(400012)) prop(class-instance)=('xterm', 'XTerm')
guess_content_type(WindowModel(400012)) found match: property=class-instance, regex=xterm, content-type=text

@nikolaof
Copy link
Author

Here is what I'm getting if I enable the debug flags you mentioned:

May 31 16:01:24 vscode xpra[7214]: 2024-05-31 16:01:24,338   class-instance matching 'oleview.*' is text
May 31 16:01:24 vscode xpra[7214]: 2024-05-31 16:01:24,338   class-instance matching 'winecfg.*' is text
May 31 16:01:24 vscode xpra[7214]: 2024-05-31 16:01:24,339   class-instance matching 'regedit.*' is text
May 31 16:01:24 vscode xpra[7214]: 2024-05-31 16:01:24,339   class-instance matching 'zenity' is text
May 31 16:01:24 vscode xpra[7214]: 2024-05-31 16:01:24,339   class-instance matching 'winemine.*' is picture
May 31 16:01:24 vscode xpra[7214]: 2024-05-31 16:01:24,339   class-instance matching 'winefile.*' is text
May 31 16:01:24 vscode xpra[7214]: 2024-05-31 16:01:24,339   class-instance matching 'winhlp.*' is text
May 31 16:01:24 vscode xpra[7214]: 2024-05-31 16:01:24,339   class-instance matching 'wordpad.*' is text
May 31 16:01:24 vscode xpra[7214]: 2024-05-31 16:01:24,339   class-instance matching 'wireshark.*' is text
May 31 16:01:24 vscode xpra[7214]: 2024-05-31 16:01:24,339   class-instance matching 'xfce4-terminal' is text
May 31 16:01:24 vscode xpra[7214]: 2024-05-31 16:01:24,339   class-instance matching 'xxdiff' is text
May 31 16:01:24 vscode xpra[7214]: 2024-05-31 16:01:24,339   class-instance matching 'xpra-sessions-gui' is text
May 31 16:01:24 vscode xpra[7214]: 2024-05-31 16:01:24,339   class-instance matching 'xpra-toolbox' is text
May 31 16:01:24 vscode xpra[7214]: 2024-05-31 16:01:24,339   class-instance matching 'xpra-gui' is text
May 31 16:01:24 vscode xpra[7214]: 2024-05-31 16:01:24,339   class-instance matching 'xpra-launcher-gui' is text
May 31 16:01:24 vscode xpra[7214]: 2024-05-31 16:01:24,339   class-instance matching 'yelp' is text
May 31 16:01:24 vscode xpra[7214]: 2024-05-31 16:01:24,339 _load_dict_file(/etc/xpra/content-type/70_commands.conf)=['command:/opt/visual-studio-code-insiders/code-insiders --disable-gpu --no-sandbox=text']
May 31 16:01:24 vscode xpra[7214]: 2024-05-31 16:01:24,340          command matching '/opt/visual-studio-code-insiders/code-insiders --disable-gpu --no-sandbox' is text
May 31 16:01:24 vscode xpra[7214]: 2024-05-31 16:01:24,340 _load_dict_dir(/etc/xpra/content-type)={'role': {re.compile('gimp-dock'): ('gimp-dock', 'text'), re.compile('gimp-toolbox'): ('gimp-toolbox', 'text'), re.compile('gimp-image-window'): ('gimp-image-window', 'picture'), re.compile('vlc-playlist'): ('vlc-playlist', 'text'), re.compile('vlc-main'): ('vlc-main', 'audio+video'), re.compile('browser'): ('browser', 'browser')}, 'title': {re.compile('- Gmail -'): ('- Gmail -', 'text'), re.compile('- YouTube -'): ('- YouTube -', 'audio+video'), re.compile(' on Vimeo -'): (' on Vimeo -', 'audio+video'), re.compile(' Instagram photos and videos -'): (' Instagram photos and videos -', 'audio+picture'), re.compile('- Wikipedia -'): ('- Wikipedia -', 'text'), re.compile('^Amazon.com: '): ('^Amazon.com: ', 'text'), re.compile(' - Facebook -'): (' - Facebook -', 'picture'), re.compile(' - Twitter -'): (' - Twitter -', 'text'), re.compile(' - LinkedIn -'): (' - LinkedIn -', 'text'), re.compile(' - Pinterest -'): (' - Pinterest -', 'picture'), re.compile(' Apple -'): (' Apple -', 'text'), re.compile(' - Adobe -'): (' - Adobe -', 'text'), re.compile(' - Flickr -'): (' - Flickr -', 'picture'), re.compile(' Microsoft -'): (' Microsoft -', 'text'), re.compile(' Yahoo -'): (' Yahoo -', 'text'), re.compile(' - Qq -'): (' - Qq -', 'text'), re.compile('glxgears'): ('glxgears', 'video'), re.compile('GLX Spheres'): ('GLX Spheres', 'video'), re.compile('IcedTea-Web Control Panel'): ('IcedTea-Web Control Panel', 'text'), re.compile('Java Monitoring & Management Console'): ('Java Monitoring & Management Console', 'text'), re.compile('Python .* Shell'): ('Python .* Shell', 'text'), re.compile('NetBeans IDE'): ('NetBeans IDE', 'text')}, 'class-instance': {re.compile('xterm'): ('xterm', 'text'), re.compile('.*terminal.*'): ('.*terminal.*', 'text'), re.compile('abiword'): ('abiword', 'text'), re.compile('atom'): ('atom', 'text'), re.compile('avahi-discover'): ('avahi-discover', 'text'), re.compile('baobab'): ('baobab', 'picture'), re.compile('bluetooth-sendto'): ('bluetooth-sendto', 'text'), re.compile('bssh'): ('bssh', 'text'), re.compile('bvnc'): ('bvnc', 'desktop'), re.compile('camorama'): ('camorama', 'video'), re.compile('cheese'): ('cheese', 'video'), re.compile('chromium-browser'): ('chromium-browser', 'browser'), re.compile('clipit'): ('clipit', 'text'), re.compile('code'): ('code', 'text'), re.compile('Code - Insiders'): ('Code - Insiders', 'text'), re.compile('dde-file-manager'): ('dde-file-manager', 'text'), re.compile('dde-desktop'): ('dde-desktop', 'picture'), re.compile('deepin-movie'): ('deepin-movie', 'audio+video'), re.compile('deepin-music'): ('deepin-music', 'text'), re.compile('deepin-system-monitor'): ('deepin-system-monitor', 'picture'), re.compile('deepin-terminal'): ('deepin-terminal', 'text'), re.compile('dolphin'): ('dolphin', 'browser'), re.compile('d-feet'): ('d-feet', 'text'), re.compile('Eclipse'): ('Eclipse', 'text'), re.compile('emacs'): ('emacs', 'text'), re.compile('eog'): ('eog', 'picture'), re.compile('evince.*'): ('evince.*', 'text'), re.compile('evolution'): ('evolution', 'text'), re.compile('Firefox'): ('Firefox', 'browser'), re.compile('file-roller'): ('file-roller', 'text'), re.compile('ffplay'): ('ffplay', 'video'), re.compile('geany'): ('geany', 'text'), re.compile('gcm-picker'): ('gcm-picker', 'picture'), re.compile('gcm-import'): ('gcm-import', 'text'), re.compile('gcm-viewer'): ('gcm-viewer', 'text'), re.compile('gedit'): ('gedit', 'text'), re.compile('gimp'): ('gimp', 'picture'), re.compile('git-gui'): ('git-gui', 'text'), re.compile('gitk'): ('gitk', 'text'), re.compile('gkbd-keyboard-display'): ('gkbd-keyboard-display', 'text'), re.compile('gnome-about'): ('gnome-about', 'text'), re.compile('gnome-abrt'): ('gnome-abrt', 'text'), re.compile('gnome-boxes'): ('gnome-boxes', 'browser'), re.compile('gnome-calculator'): ('gnome-calculator', 'text'), re.compile('gnome-calendar'): ('gnome-calendar', 'text'), re.compile('gnome-clocks'): ('gnome-clocks', 'text'), re.compile('gnome-contacts'): ('gnome-contacts', 'text'), re.compile('gnome-disks'): ('gnome-disks', 'text'), re.compile('gnome-disk-image-mounter'): ('gnome-disk-image-mounter', 'text'), re.compile('gnome-font-viewer'): ('gnome-font-viewer', 'picture'), re.compile('gnome-logs'): ('gnome-logs', 'text'), re.compile('gnome-screenshot'): ('gnome-screenshot', 'text'), re.compile('gnome-shell-portal-helper'): ('gnome-shell-portal-helper', 'browser'), re.compile('gnome-software'): ('gnome-software', 'browser'), re.compile('gnome-system-monitor'): ('gnome-system-monitor', 'text'), re.compile('gnome-terminal.*'): ('gnome-terminal.*', 'text'), re.compile('gnome-tweaks'): ('gnome-tweaks', 'text'), re.compile('google-chrome.*'): ('google-chrome.*', 'browser'), re.compile('gpartedbin'): ('gpartedbin', 'text'), re.compile('gst'): ('gst', 'text'), re.compile('gtk3-demo.*'): ('gtk3-demo.*', 'text'), re.compile('gtk3-widget-factory'): ('gtk3-widget-factory', 'text'), re.compile('gupnp-av-cp'): ('gupnp-av-cp', 'text'), re.compile('gupnp-universal-cp'): ('gupnp-universal-cp', 'text'), re.compile('gvim'): ('gvim', 'text'), re.compile('ibus.*'): ('ibus.*', 'text'), re.compile('IBus Panel'): ('IBus Panel', 'picture'), re.compile('ibus-ui-emojier'): ('ibus-ui-emojier', 'picture'), re.compile('jetbrains.*'): ('jetbrains.*', 'text'), re.compile('konsole'): ('konsole', 'text'), re.compile('sun-tools-jconsole-JConsole'): ('sun-tools-jconsole-JConsole', 'text'), re.compile('sun-security-tools-policytool-PolicyTool'): ('sun-security-tools-policytool-PolicyTool', 'text'), re.compile('libfm-pref-apps'): ('libfm-pref-apps', 'text'), re.compile('libreoffice.*'): ('libreoffice.*', 'text'), re.compile('LYNE.*'): ('LYNE.*', 'video'), re.compile('Mail'): ('Mail', 'text'), re.compile('mate-terminal'): ('mate-terminal', 'text'), re.compile('net-sourceforge-jnlp-security-policyeditor-PolicyEditor'): ('net-sourceforge-jnlp-security-policyeditor-PolicyEditor', 'text'), re.compile('mousepad'): ('mousepad', 'text'), re.compile('notepad.exe'): ('notepad.exe', 'text'), re.compile('mpv'): ('mpv', 'audio+video'), re.compile('Navigator'): ('Navigator', 'browser'), re.compile('nm-connection-editor'): ('nm-connection-editor', 'text'), re.compile('Nsight'): ('Nsight', 'text'), re.compile('nv-nsight-cu.bin'): ('nv-nsight-cu.bin', 'text'), re.compile('nvidia-settings'): ('nvidia-settings', 'picture'), re.compile('NVIDIA Visual Profiler'): ('NVIDIA Visual Profiler', 'text'), re.compile('okular'): ('okular', 'text'), re.compile('onboard.*'): ('onboard.*', 'text'), re.compile('org.inkscape.Inkscape'): ('org.inkscape.Inkscape', 'text'), re.compile('org.gnome.Characters'): ('org.gnome.Characters', 'picture'), re.compile('org.gnome.Maps'): ('org.gnome.Maps', 'picture'), re.compile('org.gnome.meld'): ('org.gnome.meld', 'text'), re.compile('org.gnome.Nautilus'): ('org.gnome.Nautilus', 'picture'), re.compile('org.gnome.Photos'): ('org.gnome.Photos', 'browser'), re.compile('org.gnome.Weather'): ('org.gnome.Weather', 'picture'), re.compile('pavucontrol'): ('pavucontrol', 'picture'), re.compile('pcmanfm'): ('pcmanfm', 'browser'), re.compile('projectM-pulseaudio'): ('projectM-pulseaudio', 'audio'), re.compile('qemu'): ('qemu', 'browser'), re.compile('setroubleshoot'): ('setroubleshoot', 'text'), re.compile('scribus'): ('scribus', 'text'), re.compile('simple-scan'): ('simple-scan', 'picture'), re.compile('Steam'): ('Steam', 'browser'), re.compile('system-config-printer'): ('system-config-printer', 'text'), re.compile('terminator'): ('terminator', 'text'), re.compile('tkdiff'): ('tkdiff', 'text'), re.compile('Thunderbird'): ('Thunderbird', 'browser'), re.compile('totem'): ('totem', 'audio+video'), re.compile('transmission.*'): ('transmission.*', 'text'), re.compile('usbview.*'): ('usbview.*', 'text'), re.compile('unityhub.*'): ('unityhub.*', 'browser'), re.compile('VirtualBox Manager'): ('VirtualBox Manager', 'text'), re.compile('VirtualBox Machine'): ('VirtualBox Machine', 'picture'), re.compile('vlc'): ('vlc', 'audio+video'), re.compile('vncviewer'): ('vncviewer', 'desktop'), re.compile('wineboot.*'): ('wineboot.*', 'text'), re.compile('wineconsole.*'): ('wineconsole.*', 'text'), re.compile('oleview.*'): ('oleview.*', 'text'), re.compile('winecfg.*'): ('winecfg.*', 'text'), re.compile('regedit.*'): ('regedit.*', 'text'), re.compile('zenity'): ('zenity', 'text'), re.compile('winemine.*'): ('winemine.*', 'picture'), re.compile('winefile.*'): ('winefile.*', 'text'), re.compile('winhlp.*'): ('winhlp.*', 'text'), re.compile('wordpad.*'): ('wordpad.*', 'text'), re.compile('wireshark.*'): ('wireshark.*', 'text'), re.compile('xfce4-terminal'): ('xfce4-terminal', 'text'), re.compile('xxdiff'): ('xxdiff', 'text'), re.compile('xpra-sessions-gui'): ('xpra-sessions-gui', 'text'), re.compile('xpra-toolbox'): ('xpra-toolbox', 'text'), re.compile('xpra-gui'): ('xpra-gui', 'text'), re.compile('xpra-launcher-gui'): ('xpra-launcher-gui', 'text'), re.compile('yelp'): ('yelp', 'text')}, 'command': {re.compile('/opt/visual-studio-code-insiders/code-insiders --disable-gpu --no-sandbox'): ('/opt/visual-studio-code-insiders/code-insiders --disable-gpu --no-sandbox', 'text')}}
May 31 16:01:24 vscode xpra[7214]: 2024-05-31 16:01:24,340 load_content_categories_dir(/usr/local/etc/xpra/content-type) directory not found
May 31 16:01:24 vscode xpra[7214]: 2024-05-31 16:01:24,340 load_content_categories_dir(/etc/xdg/xpra/content-type) directory not found
May 31 16:01:24 vscode xpra[7214]: 2024-05-31 16:01:24,340 load_content_categories_dir(~/.config/xpra/content-type) directory not found
May 31 16:01:24 vscode xpra[7214]: 2024-05-31 16:01:24,340 load_content_categories_dir(~/.xpra/content-type) directory not found
May 31 16:01:24 vscode xpra[7214]: 2024-05-31 16:01:24,342 guess_content_type_from_defs(WindowModel(400004)) prop(role)=browser-window
May 31 16:01:24 vscode xpra[7214]: 2024-05-31 16:01:24,352 guess_content_type(WindowModel(400004)) found match: property=role, regex=browser, content-type=browser
May 31 16:01:24 vscode xpra[7214]: 2024-05-31 16:01:24,352 guess_content_type_from_defs(WindowModel(400004)) prop(role)=browser-window
May 31 16:01:24 vscode xpra[7214]: 2024-05-31 16:01:24,352 guess_content_type(WindowModel(400004)) found match: property=role, regex=browser, content-type=browser
May 31 16:01:24 vscode xpra[7214]: 2024-05-31 16:01:24,900 guess_content_type_from_defs(WindowModel(400004)) prop(role)=browser-window
May 31 16:01:24 vscode xpra[7214]: 2024-05-31 16:01:24,900 guess_content_type(WindowModel(400004)) found match: property=role, regex=browser, content-type=browser

Seems that it doesn't see any window class or title as it does in xterm example of yours.

@totaam
Copy link
Collaborator

totaam commented May 31, 2024

Got it:

guess_content_type(WindowModel(400004)) found match: property=role, regex=browser, content-type=browser

It stops as soon as it finds a match, and your application sets the window role to browser-window which matches browser.
You should be able to temporarily workaround this by renaming /etc/xpra/content-type/10_role.conf to /etc/xpra/content-type/99_role.conf so that it is processed after the other ones which you have modified.

Another workaround would be to remove this line:

role:browser=browser

@totaam
Copy link
Collaborator

totaam commented May 31, 2024

I am reasonably confident that the two commits above are correct.
Please confirm that this works for you so that I can backport this to the stable branches.

@nikolaof
Copy link
Author

To me seems that still identifies it as browser

May 31 18:08:37 vscode xpra[8323]: 2024-05-31 18:08:37,239   class-instance matching 'xpra-launcher-gui' is text
May 31 18:08:37 vscode xpra[8323]: 2024-05-31 18:08:37,239   class-instance matching 'yelp' is text
May 31 18:08:37 vscode xpra[8323]: 2024-05-31 18:08:37,239   class-instance matching 'Code - Insiders' is text
May 31 18:08:37 vscode xpra[8323]: 2024-05-31 18:08:37,239 _load_dict_file(/etc/xpra/content-type/70_commands.conf)=['command:/opt/visual-studio-code-insiders/code-insiders --disable-gpu --no-sandbox=text']
May 31 18:08:37 vscode xpra[8323]: 2024-05-31 18:08:37,240          command matching '/opt/visual-studio-code-insiders/code-insiders --disable-gpu --no-sandbox' is text
May 31 18:08:37 vscode xpra[8323]: 2024-05-31 18:08:37,240 _load_dict_file(/etc/xpra/content-type/90_fallback.conf)=['role:browser=browser']
May 31 18:08:37 vscode xpra[8323]: 2024-05-31 18:08:37,240             role matching 'browser' is browser
May 31 18:08:37 vscode xpra[8323]: 2024-05-31 18:08:37,240 _load_dict_dir(/etc/xpra/content-type)={'role': {re.compile('browser'): ('browser', 'browser')}, 'title': {re.compile('- Gmail -'): ('- Gmail -', 'text'), re.compile('- YouTube -'): ('- YouTube -', 'audio+video'), re.compile(' on Vimeo -'): (' on Vimeo -', 'audio+video'), re.compile(' Instagram photos and videos -'): (' Instagram photos and videos -', 'audio+picture'), re.compile('- Wikipedia -'): ('- Wikipedia -', 'text'), re.compile('^Amazon.com: '): ('^Amazon.com: ', 'text'), re.compile(' - Facebook -'): (' - Facebook -', 'picture'), re.compile(' - Twitter -'): (' - Twitter -', 'text'), re.compile(' - LinkedIn -'): (' - LinkedIn -', 'text'), re.compile(' - Pinterest -'): (' - Pinterest -', 'picture'), re.compile(' Apple -'): (' Apple -', 'text'), re.compile(' - Adobe -'): (' - Adobe -', 'text'), re.compile(' - Flickr -'): (' - Flickr -', 'picture'), re.compile(' Microsoft -'): (' Microsoft -', 'text'), re.compile(' Yahoo -'): (' Yahoo -', 'text'), re.compile(' - Qq -'): (' - Qq -', 'text'), re.compile('glxgears'): ('glxgears', 'video'), re.compile('GLX Spheres'): ('GLX Spheres', 'video'), re.compile('IcedTea-Web Control Panel'): ('IcedTea-Web Control Panel', 'text'), re.compile('Java Monitoring & Management Console'): ('Java Monitoring & Management Console', 'text'), re.compile('Python .* Shell'): ('Python .* Shell', 'text'), re.compile('NetBeans IDE'): ('NetBeans IDE', 'text')}, 'class-instance': {re.compile('xterm'): ('xterm', 'text'), re.compile('.*terminal.*'): ('.*terminal.*', 'text'), re.compile('abiword'): ('abiword', 'text'), re.compile('atom'): ('atom', 'text'), re.compile('avahi-discover'): ('avahi-discover', 'text'), re.compile('baobab'): ('baobab', 'picture'), re.compile('bluetooth-sendto'): ('bluetooth-sendto', 'text'), re.compile('bssh'): ('bssh', 'text'), re.compile('bvnc'): ('bvnc', 'desktop'), re.compile('camorama'): ('camorama', 'video'), re.compile('cheese'): ('cheese', 'video'), re.compile('chromium-browser'): ('chromium-browser', 'browser'), re.compile('clipit'): ('clipit', 'text'), re.compile('code'): ('code', 'text'), re.compile('Code - Insiders'): ('Code - Insiders', 'text'), re.compile('dde-file-manager'): ('dde-file-manager', 'text'), re.compile('dde-desktop'): ('dde-desktop', 'picture'), re.compile('deepin-movie'): ('deepin-movie', 'audio+video'), re.compile('deepin-music'): ('deepin-music', 'text'), re.compile('deepin-system-monitor'): ('deepin-system-monitor', 'picture'), re.compile('deepin-terminal'): ('deepin-terminal', 'text'), re.compile('dolphin'): ('dolphin', 'browser'), re.compile('d-feet'): ('d-feet', 'text'), re.compile('Eclipse'): ('Eclipse', 'text'), re.compile('emacs'): ('emacs', 'text'), re.compile('eog'): ('eog', 'picture'), re.compile('evince.*'): ('evince.*', 'text'), re.compile('evolution'): ('evolution', 'text'), re.compile('Firefox'): ('Firefox', 'browser'), re.compile('file-roller'): ('file-roller', 'text'), re.compile('ffplay'): ('ffplay', 'video'), re.compile('geany'): ('geany', 'text'), re.compile('gcm-picker'): ('gcm-picker', 'picture'), re.compile('gcm-import'): ('gcm-import', 'text'), re.compile('gcm-viewer'): ('gcm-viewer', 'text'), re.compile('gedit'): ('gedit', 'text'), re.compile('gimp'): ('gimp', 'picture'), re.compile('git-gui'): ('git-gui', 'text'), re.compile('gitk'): ('gitk', 'text'), re.compile('gkbd-keyboard-display'): ('gkbd-keyboard-display', 'text'), re.compile('gnome-about'): ('gnome-about', 'text'), re.compile('gnome-abrt'): ('gnome-abrt', 'text'), re.compile('gnome-boxes'): ('gnome-boxes', 'browser'), re.compile('gnome-calculator'): ('gnome-calculator', 'text'), re.compile('gnome-calendar'): ('gnome-calendar', 'text'), re.compile('gnome-clocks'): ('gnome-clocks', 'text'), re.compile('gnome-contacts'): ('gnome-contacts', 'text'), re.compile('gnome-disks'): ('gnome-disks', 'text'), re.compile('gnome-disk-image-mounter'): ('gnome-disk-image-mounter', 'text'), re.compile('gnome-font-viewer'): ('gnome-font-viewer', 'picture'), re.compile('gnome-logs'): ('gnome-logs', 'text'), re.compile('gnome-screenshot'): ('gnome-screenshot', 'text'), re.compile('gnome-shell-portal-helper'): ('gnome-shell-portal-helper', 'browser'), re.compile('gnome-software'): ('gnome-software', 'browser'), re.compile('gnome-system-monitor'): ('gnome-system-monitor', 'text'), re.compile('gnome-terminal.*'): ('gnome-terminal.*', 'text'), re.compile('gnome-tweaks'): ('gnome-tweaks', 'text'), re.compile('google-chrome.*'): ('google-chrome.*', 'browser'), re.compile('gpartedbin'): ('gpartedbin', 'text'), re.compile('gst'): ('gst', 'text'), re.compile('gtk3-demo.*'): ('gtk3-demo.*', 'text'), re.compile('gtk3-widget-factory'): ('gtk3-widget-factory', 'text'), re.compile('gupnp-av-cp'): ('gupnp-av-cp', 'text'), re.compile('gupnp-universal-cp'): ('gupnp-universal-cp', 'text'), re.compile('gvim'): ('gvim', 'text'), re.compile('ibus.*'): ('ibus.*', 'text'), re.compile('IBus Panel'): ('IBus Panel', 'picture'), re.compile('ibus-ui-emojier'): ('ibus-ui-emojier', 'picture'), re.compile('jetbrains.*'): ('jetbrains.*', 'text'), re.compile('konsole'): ('konsole', 'text'), re.compile('sun-tools-jconsole-JConsole'): ('sun-tools-jconsole-JConsole', 'text'), re.compile('sun-security-tools-policytool-PolicyTool'): ('sun-security-tools-policytool-PolicyTool', 'text'), re.compile('libfm-pref-apps'): ('libfm-pref-apps', 'text'), re.compile('libreoffice.*'): ('libreoffice.*', 'text'), re.compile('LYNE.*'): ('LYNE.*', 'video'), re.compile('Mail'): ('Mail', 'text'), re.compile('mate-terminal'): ('mate-terminal', 'text'), re.compile('net-sourceforge-jnlp-security-policyeditor-PolicyEditor'): ('net-sourceforge-jnlp-security-policyeditor-PolicyEditor', 'text'), re.compile('mousepad'): ('mousepad', 'text'), re.compile('notepad.exe'): ('notepad.exe', 'text'), re.compile('mpv'): ('mpv', 'audio+video'), re.compile('Navigator'): ('Navigator', 'browser'), re.compile('nm-connection-editor'): ('nm-connection-editor', 'text'), re.compile('Nsight'): ('Nsight', 'text'), re.compile('nv-nsight-cu.bin'): ('nv-nsight-cu.bin', 'text'), re.compile('nvidia-settings'): ('nvidia-settings', 'picture'), re.compile('NVIDIA Visual Profiler'): ('NVIDIA Visual Profiler', 'text'), re.compile('okular'): ('okular', 'text'), re.compile('onboard.*'): ('onboard.*', 'text'), re.compile('org.inkscape.Inkscape'): ('org.inkscape.Inkscape', 'text'), re.compile('org.gnome.Characters'): ('org.gnome.Characters', 'picture'), re.compile('org.gnome.Maps'): ('org.gnome.Maps', 'picture'), re.compile('org.gnome.meld'): ('org.gnome.meld', 'text'), re.compile('org.gnome.Nautilus'): ('org.gnome.Nautilus', 'picture'), re.compile('org.gnome.Photos'): ('org.gnome.Photos', 'browser'), re.compile('org.gnome.Weather'): ('org.gnome.Weather', 'picture'), re.compile('pavucontrol'): ('pavucontrol', 'picture'), re.compile('pcmanfm'): ('pcmanfm', 'browser'), re.compile('projectM-pulseaudio'): ('projectM-pulseaudio', 'audio'), re.compile('qemu'): ('qemu', 'browser'), re.compile('setroubleshoot'): ('setroubleshoot', 'text'), re.compile('scribus'): ('scribus', 'text'), re.compile('simple-scan'): ('simple-scan', 'picture'), re.compile('Steam'): ('Steam', 'browser'), re.compile('system-config-printer'): ('system-config-printer', 'text'), re.compile('terminator'): ('terminator', 'text'), re.compile('tkdiff'): ('tkdiff', 'text'), re.compile('Thunderbird'): ('Thunderbird', 'browser'), re.compile('totem'): ('totem', 'audio+video'), re.compile('transmission.*'): ('transmission.*', 'text'), re.compile('usbview.*'): ('usbview.*', 'text'), re.compile('unityhub.*'): ('unityhub.*', 'browser'), re.compile('VirtualBox Manager'): ('VirtualBox Manager', 'text'), re.compile('VirtualBox Machine'): ('VirtualBox Machine', 'picture'), re.compile('vlc'): ('vlc', 'audio+video'), re.compile('vncviewer'): ('vncviewer', 'desktop'), re.compile('wineboot.*'): ('wineboot.*', 'text'), re.compile('wineconsole.*'): ('wineconsole.*', 'text'), re.compile('oleview.*'): ('oleview.*', 'text'), re.compile('winecfg.*'): ('winecfg.*', 'text'), re.compile('regedit.*'): ('regedit.*', 'text'), re.compile('zenity'): ('zenity', 'text'), re.compile('winemine.*'): ('winemine.*', 'picture'), re.compile('winefile.*'): ('winefile.*', 'text'), re.compile('winhlp.*'): ('winhlp.*', 'text'), re.compile('wordpad.*'): ('wordpad.*', 'text'), re.compile('wireshark.*'): ('wireshark.*', 'text'), re.compile('xfce4-terminal'): ('xfce4-terminal', 'text'), re.compile('xxdiff'): ('xxdiff', 'text'), re.compile('xpra-sessions-gui'): ('xpra-sessions-gui', 'text'), re.compile('xpra-toolbox'): ('xpra-toolbox', 'text'), re.compile('xpra-gui'): ('xpra-gui', 'text'), re.compile('xpra-launcher-gui'): ('xpra-launcher-gui', 'text'), re.compile('yelp'): ('yelp', 'text')}, 'command': {re.compile('/opt/visual-studio-code-insiders/code-insiders --disable-gpu --no-sandbox'): ('/opt/visual-studio-code-insiders/code-insiders --disable-gpu --no-sandbox', 'text')}}
May 31 18:08:37 vscode xpra[8323]: 2024-05-31 18:08:37,240 load_content_categories_dir(/usr/local/etc/xpra/content-type) directory not found
May 31 18:08:37 vscode xpra[8323]: 2024-05-31 18:08:37,240 load_content_categories_dir(/etc/xdg/xpra/content-type) directory not found
May 31 18:08:37 vscode xpra[8323]: 2024-05-31 18:08:37,240 load_content_categories_dir(~/.config/xpra/content-type) directory not found
May 31 18:08:37 vscode xpra[8323]: 2024-05-31 18:08:37,240 load_content_categories_dir(~/.xpra/content-type) directory not found
May 31 18:08:37 vscode xpra[8323]: 2024-05-31 18:08:37,243 guess_content_type_from_defs(WindowModel(400004)) prop(role)=browser-window
May 31 18:08:37 vscode xpra[8323]: 2024-05-31 18:08:37,243 guess_content_type(WindowModel(400004)) found match: property=role, regex=browser, content-type=browser
May 31 18:08:37 vscode xpra[8323]: 2024-05-31 18:08:37,253 guess_content_type_from_defs(WindowModel(400004)) prop(role)=browser-window
May 31 18:08:37 vscode xpra[8323]: 2024-05-31 18:08:37,253 guess_content_type(WindowModel(400004)) found match: property=role, regex=browser, content-type=browser
May 31 18:08:37 vscode xpra[8323]: 2024-05-31 18:08:37,811 guess_content_type_from_defs(WindowModel(400004)) prop(role)=browser-window
May 31 18:08:37 vscode xpra[8323]: 2024-05-31 18:08:37,811 guess_content_type(WindowModel(400004)) found match: property=role, regex=browser, content-type=browser
May 31 18:08:37 vscode xpra[8323]: 2024-05-31 18:08:37,866 child 'code-insiders --disable-gpu --no-sandbox' with pid 8436 has terminated

@nikolaof
Copy link
Author

So what make it work properly was to change your fallback file into smth like

################################################################################
# since this file will be parsed late,
# we can include more generic patterns here:

role:browser=text

But obviously this is not correct

@totaam
Copy link
Collaborator

totaam commented Jun 1, 2024

Yes, I realized later on that f0431b1 was wrong: the files are all loaded and placed in the same data structure, so the later files can only override previous settings.
The matching order is not determined by the order of the files.
Let me think about this one.

@totaam
Copy link
Collaborator

totaam commented Jun 4, 2024

@nikolaof I am moving this issue to #4248 as the current issue is closed and you have a valid - if less than ideal - workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants