flathub / com.microsoft.Edge

https://flathub.org/apps/details/com.microsoft.Edge
51 stars 9 forks source link

All Web Apps Starting in Single Window #486

Open erhangk opened 2 months ago

erhangk commented 2 months ago

installed WhatsApp and Teams through Microsoft Edge. In order to use pinch zoom gesture i passed --ozone-platform=wayland and --enable-features=UseOzonePlatform to ~/.var/app/com.microsoft.Edge/config/edge-flags.conf. When i start any installed app with the .desktop file, they all open in the same window. This problem started to occur after adding these lines to .conf file. How can i solve this problem?

image

Mikaela commented 2 months ago

Maybe you should add --new-window to the file too? I don't know if that will have any weird side effects though.

evan-a-a commented 2 months ago

This is a known issue. Chromium uses a different WM class name when using Wayland. Instead of crx__appid, it uses execname-_appid-profileid. The workaround is to edit StartupWMClass in the application desktop files ~/.local/share/applications to read msedge-_appid-Default (assuming no second profile), where appid is the identifier that comes after crx__.

We will need to update flextop to handle this properly.

erhangk commented 2 months ago

@Mikaela i tried adding it to both .desktop files of apps and config file but it does not seem to work. @evan-a-a here is the .desktop file of the application:

#!/usr/bin/env xdg-open

[Desktop Entry]
Version=1.0
Terminal=false
Type=Application
Name=WhatsApp Web
Exec=flatpak 'run' '--command=/app/bin/edge' 'com.microsoft.Edge' '--profile-directory=Default' '--app-id=hnpfjngllnobngcgfapefoaidbinmjnm' '--app-url=https://web.whatsapp.com/'
Icon=msedge-hnpfjngllnobngcgfapefoaidbinmjnm-Default
StartupWMClass=crx__hnpfjngllnobngcgfapefoaidbinmjnm
X-Flatpak-Part-Of=com.microsoft.Edge
TryExec=/var/lib/flatpak/exports/bin/com.microsoft.Edge

What should i write to StartupWMClass?

erhangk commented 2 months ago

@evan-a-a when i tried to set WMClass like this it did not work StartupWMClass=msedge-hnpfjngllnobngcgfapefoaidbinmjnm-Default but adding _ before the appid solved the problem. Thank you!

Here is the last state of the .desktop file, maybe it helps someone.

#!/usr/bin/env xdg-open

[Desktop Entry]
Version=1.0
Terminal=false
Type=Application
Name=WhatsApp Web
Exec=flatpak 'run' '--command=/app/bin/edge' 'com.microsoft.Edge' '--profile-directory=Default' '--app-id=hnpfjngllnobngcgfapefoaidbinmjnm' '--app-url=https://web.whatsapp.com/'
Icon=msedge-_hnpfjngllnobngcgfapefoaidbinmjnm-Default
StartupWMClass=msedge-_hnpfjngllnobngcgfapefoaidbinmjnm-Default
X-Flatpak-Part-Of=com.microsoft.Edge
TryExec=/var/lib/flatpak/exports/bin/com.microsoft.Edge