Skip to content

WSLg incorrectly registers application .desktop entry which appId contain dot(s) #1401

@suiryc

Description

@suiryc

Windows build number:

10.0.19045.6691

Your Distribution version:

ArchLinux

Your WSL versions:

Version WSL : 2.7.0.0
Version du noyau : 6.6.114.1-1
Version WSLg : 1.0.71
Version MSRDC : 1.2.6676
Version direct3D : 1.611.1-81528511
Version de DXCore : 10.0.26100.1-240331-1435.ge-release
Version de Windows : 10.0.19045.6691

Steps to reproduce:

  1. Copy the .desktop file of an application with proper icon, e.g. sublime text, for a fictive appId test_1
# cd /usr/share/applications/
# cp sublime_text.desktop test_1.desktop

Observe (weston.log) that the entry is properly discovered, with appId: test_1.

  1. Launch any program which allows you to set the appId, e.g. alacritty.
    Prefer a wayland one, since X11 may expose its icon (_NET_WM_ICON) explicitly.
$ alacritty --class test_1

Observe that the running program window has a proper icon (the copied desktop entry icon), with penguin overlay.
Image
Observe (weston.log) that the appId was properly recognised, and desktop entry found with associated icon.

  1. Do the same as 1., but with appId test.2
# cd /usr/share/applications/
# cp sublime_text.desktop test.2.desktop

Observe (weston.log) that the entry is wrongly discovered with appId: 2 instead of test.2.

  1. Same as 2., with new appId.
$ alacritty --class test.2

Observe that the running program window has the plain penguin.
Image
Observe (weston.log) that the window appId (test.2) is not recognised: no desktop entry found.

  1. Again, but with the wrong appId 2
$ alacritty --class 2

Observe that the running program window has the proper icon, with penguin overlay.
Image
Observe (weston.log) that the appId (2) was properly recognised, and desktop entry found with associated icon.

  1. Do the same test with multiple dots in the appId, e.g. test.3.4.
    Observe that the entry is wrongly discovered with appId: 4.
    Deduce that the appId is split on dots, and only the last element is remembered.

WSL logs:

When test_1.desktop is created:

[22:24:31.600] app_list_monitor_thread: file created/updated (test_1.desktop)
[22:24:31.601] desktop file: /usr/share/applications/test_1.desktop
[22:24:31.601]     Name[fr_FR]:Sublime Text (ArchLinux)
[22:24:31.601]     Exec:/opt/sublime_text/sublime_text
[22:24:31.601]     TryExec:(null)
[22:24:31.601]     WorkingDir:(null)
[22:24:31.601]     Icon name:sublime-text
[22:24:31.601]     Icon SVG :0
[22:24:31.601]     Icon file:/usr/share/icons/hicolor/128x128/apps/sublime-text.png
[22:24:31.601]     Icon image:0x7760ac047980
[22:24:31.601] app list entry updated: Key:test_1, Name:Sublime Text (ArchLinux)
[22:24:31.601] rdp_rail_notify_app_list(): rdp_peer 0x5cb7e4c2a880
[22:24:31.601]     inSync: 0
[22:24:31.601]     syncStart: 0
[22:24:31.601]     syncEnd: 0
[22:24:31.601]     newAppId: 1
[22:24:31.601]     deleteAppId: 0
[22:24:31.601]     deleteAppProvider: 0
[22:24:31.601]     associateWindowId: 0
[22:24:31.601]     appId: test_1
[22:24:31.601]     appGroup: (null)
[22:24:31.601]     appExecPath: /opt/sublime_text/sublime_text
[22:24:31.601]     appWorkingDir: (null)
[22:24:31.601]     appDesc: Sublime Text (ArchLinux)
[22:24:31.601]     appIcon: 0x7760ac047980
[22:24:31.601]     appProvider: (null)
[22:24:31.601]     appWindowId: 0x0
[22:24:31.601] app_list_monitor_thread: file created/updated (test_1.desktop)
[22:24:31.602] desktop file: /usr/share/applications/test_1.desktop
[22:24:31.602]     Name[fr_FR]:Sublime Text (ArchLinux)
[22:24:31.602]     Exec:/opt/sublime_text/sublime_text
[22:24:31.602]     TryExec:(null)
[22:24:31.602]     WorkingDir:(null)
[22:24:31.602]     Icon name:sublime-text
[22:24:31.602]     Icon SVG :0
[22:24:31.602]     Icon file:/usr/share/icons/hicolor/128x128/apps/sublime-text.png
[22:24:31.602]     Icon image:0x7760ac0419b0
[22:24:31.602] app list entry updated: Key:test_1, Name:Sublime Text (ArchLinux)
[22:24:31.602] free_app_entry(): Sublime Text (ArchLinux): /usr/share/applications/test_1.desktop
[22:24:31.602] rdp_rail_notify_app_list(): rdp_peer 0x5cb7e4c2a880
[22:24:31.602]     inSync: 0
[22:24:31.602]     syncStart: 0
[22:24:31.602]     syncEnd: 0
[22:24:31.602]     newAppId: 0
[22:24:31.602]     deleteAppId: 0
[22:24:31.602]     deleteAppProvider: 0
[22:24:31.602]     associateWindowId: 0
[22:24:31.602]     appId: test_1
[22:24:31.602]     appGroup: (null)
[22:24:31.602]     appExecPath: /opt/sublime_text/sublime_text
[22:24:31.602]     appWorkingDir: (null)
[22:24:31.602]     appDesc: Sublime Text (ArchLinux)
[22:24:31.602]     appIcon: 0x7760ac0419b0
[22:24:31.602]     appProvider: (null)
[22:24:31.602]     appWindowId: 0x0

When application with appId test_1 is running:

[22:25:54.587] rdp_rail_wake_handler is called on peer_ctx:0x5cb7e4c2a880
[22:25:54.587] launching '/usr/libexec/weston-rdprail-shell'
[22:25:55.279] app_list_monitor_thread: loadIconEvent is signalled. test_1
[22:25:55.279] app_list_monitor_thread: entry 0x7760ac00c2d0, image 0x7760ac0419b0
[22:25:55.280] rdp_rail_notify_app_list(): rdp_peer 0x5cb7e4c2a880
[22:25:55.280]     inSync: 0
[22:25:55.280]     syncStart: 0
[22:25:55.280]     syncEnd: 0
[22:25:55.280]     newAppId: 0
[22:25:55.280]     deleteAppId: 0
[22:25:55.280]     deleteAppProvider: 0
[22:25:55.280]     associateWindowId: 1
[22:25:55.280]     appId: test_1
[22:25:55.280]     appGroup: (null)
[22:25:55.280]     appExecPath: /opt/sublime_text/sublime_text
[22:25:55.280]     appWorkingDir: (null)
[22:25:55.280]     appDesc: Sublime Text (ArchLinux)
[22:25:55.280]     appIcon: (nil)
[22:25:55.280]     appProvider: (null)
[22:25:55.280]     appWindowId: 0x3
[22:25:55.280] Client: ClientGetAppidReq: pid:656 appId:test_1 WindowId:0x3

When test.2.desktop is created:

[22:27:25.849] app_list_monitor_thread: file created/updated (test.2.desktop)
[22:27:25.849] desktop file: /usr/share/applications/test.2.desktop
[22:27:25.849]     Name[fr_FR]:Sublime Text (ArchLinux)
[22:27:25.849]     Exec:/opt/sublime_text/sublime_text
[22:27:25.849]     TryExec:(null)
[22:27:25.849]     WorkingDir:(null)
[22:27:25.849]     Icon name:sublime-text
[22:27:25.849]     Icon SVG :0
[22:27:25.849]     Icon file:/usr/share/icons/hicolor/128x128/apps/sublime-text.png
[22:27:25.850]     Icon image:0x7760ac047980
[22:27:25.850] app list entry updated: Key:2, Name:Sublime Text (ArchLinux)
[22:27:25.850] rdp_rail_notify_app_list(): rdp_peer 0x5cb7e4c2a880
[22:27:25.850]     inSync: 0
[22:27:25.850]     syncStart: 0
[22:27:25.850]     syncEnd: 0
[22:27:25.850]     newAppId: 1
[22:27:25.850]     deleteAppId: 0
[22:27:25.850]     deleteAppProvider: 0
[22:27:25.850]     associateWindowId: 0
[22:27:25.850]     appId: 2
[22:27:25.850]     appGroup: (null)
[22:27:25.850]     appExecPath: /opt/sublime_text/sublime_text
[22:27:25.850]     appWorkingDir: (null)
[22:27:25.850]     appDesc: Sublime Text (ArchLinux)
[22:27:25.850]     appIcon: 0x7760ac047980
[22:27:25.850]     appProvider: (null)
[22:27:25.850]     appWindowId: 0x0
[22:27:25.850] app_list_monitor_thread: file created/updated (test.2.desktop)
[22:27:25.850] desktop file: /usr/share/applications/test.2.desktop
[22:27:25.850]     Name[fr_FR]:Sublime Text (ArchLinux)
[22:27:25.850]     Exec:/opt/sublime_text/sublime_text
[22:27:25.850]     TryExec:(null)
[22:27:25.850]     WorkingDir:(null)
[22:27:25.850]     Icon name:sublime-text
[22:27:25.850]     Icon SVG :0
[22:27:25.850]     Icon file:/usr/share/icons/hicolor/128x128/apps/sublime-text.png
[22:27:25.850]     Icon image:0x7760ac045f00
[22:27:25.850] app list entry updated: Key:2, Name:Sublime Text (ArchLinux)
[22:27:25.850] free_app_entry(): Sublime Text (ArchLinux): /usr/share/applications/test.2.desktop
[22:27:25.850] rdp_rail_notify_app_list(): rdp_peer 0x5cb7e4c2a880
[22:27:25.850]     inSync: 0
[22:27:25.850]     syncStart: 0
[22:27:25.850]     syncEnd: 0
[22:27:25.850]     newAppId: 0
[22:27:25.850]     deleteAppId: 0
[22:27:25.850]     deleteAppProvider: 0
[22:27:25.851]     associateWindowId: 0
[22:27:25.851]     appId: 2
[22:27:25.851]     appGroup: (null)
[22:27:25.851]     appExecPath: /opt/sublime_text/sublime_text
[22:27:25.851]     appWorkingDir: (null)
[22:27:25.851]     appDesc: Sublime Text (ArchLinux)
[22:27:25.851]     appIcon: 0x7760ac045f00
[22:27:25.851]     appProvider: (null)
[22:27:25.851]     appWindowId: 0x0

When application with appId test.2 is running:

[22:29:12.131] rdp_rail_wake_handler is called on peer_ctx:0x5eb5b3d7f890
[22:29:12.131] launching '/usr/libexec/weston-rdprail-shell'
[22:29:12.364] app_list_monitor_thread: loadIconEvent is signalled. test.2
[22:29:12.364] app_list_monitor_thread: entry (nil), image (nil)
[22:29:12.365] rdp_rail_notify_app_list(): rdp_peer 0x5eb5b3d7f890
[22:29:12.365]     inSync: 0
[22:29:12.365]     syncStart: 0
[22:29:12.365]     syncEnd: 0
[22:29:12.365]     newAppId: 0
[22:29:12.365]     deleteAppId: 0
[22:29:12.365]     deleteAppProvider: 0
[22:29:12.365]     associateWindowId: 1
[22:29:12.365]     appId: test.2
[22:29:12.365]     appGroup: (null)
[22:29:12.365]     appExecPath: (null)
[22:29:12.365]     appWorkingDir: (null)
[22:29:12.365]     appDesc: test.2
[22:29:12.365]     appIcon: (nil)
[22:29:12.365]     appProvider: (null)
[22:29:12.365]     appWindowId: 0x2

When application with appId 2 is running:

[22:30:59.415] rdp_rail_wake_handler is called on peer_ctx:0x5f56e89cd8a0
[22:30:59.415] launching '/usr/libexec/weston-rdprail-shell'
[22:30:59.682] app_list_monitor_thread: loadIconEvent is signalled. 2
[22:30:59.682] app_list_monitor_thread: entry 0x7c8d84037580, image 0x7c8d84026f70
[22:30:59.683] rdp_rail_notify_app_list(): rdp_peer 0x5f56e89cd8a0
[22:30:59.683]     inSync: 0
[22:30:59.683]     syncStart: 0
[22:30:59.683]     syncEnd: 0
[22:30:59.683]     newAppId: 0
[22:30:59.683]     deleteAppId: 0
[22:30:59.683]     deleteAppProvider: 0
[22:30:59.683]     associateWindowId: 1
[22:30:59.683]     appId: 2
[22:30:59.683]     appGroup: (null)
[22:30:59.683]     appExecPath: /opt/sublime_text/sublime_text
[22:30:59.683]     appWorkingDir: (null)
[22:30:59.683]     appDesc: Sublime Text (ArchLinux)
[22:30:59.683]     appIcon: (nil)
[22:30:59.683]     appProvider: (null)
[22:30:59.683]     appWindowId: 0x2

WSL dumps:

No response

Expected behavior:

When an application, with a proper appId.desktop file and handled icon (e.g. PNG format), is running, it should have its proper icon in the taskbar, determined by the application appId.

Actual behavior:

The icon is not correct (only plain penguin) if the appId contains dot(s).
Apparently the appId is split on dots, and only the last part is remembered.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions