Forum Discussion

christianfosli1's avatar
christianfosli1
Copper Contributor
Mar 04, 2024

How to set the ozone platform hint flag

I have a laptop with a high-res screen, running Ubuntu 22.04 and fractional scaling enabled at 175%. This works nicely for Wayland applications, but XWayland/Xorg applications become blurry.

 

In chrome and chromium I can make the browser use Wayland by setting the flag chrome://flags/#ozone-platform-hint to "auto", but this flag seems to be missing in Edge.

 

I noticed I can launch successfully edge from the terminal with --ozone-platform-hint=auto, and I played a bit with updating the .desktop file Exec command's to include this, but this would break PWA's I have installed such that they no longer appear as dedicated applications.

 

Any one know any good work-arounds? And if anyone from the Edge product/development team reads these discussions then please consider this a feature request to add the missing flag ðŸ˜„

  • alexfanqi's avatar
    alexfanqi
    Copper Contributor

    I second this. This is a very useful little feature that unfortunately is missing.

  • I've raised this issue internally and our team is currently investigating it. Hopefully, we can address this soon.
    • joelmurphy444's avatar
      joelmurphy444
      Copper Contributor
      pedrotorres there's another issue related to this (progressive web apps seem to ignore the flags in microsoft-edge-stable-flags.conf or the relevant flags config file for other edge builds) which I have detailed in a reply to this thread. Could you also raise this one internally?
    • bastecklein's avatar
      bastecklein
      Copper Contributor

      Wondering if any progress has been made on this?  The omission of this flag is why I need to install all PWA's using Google Chrome on Linux machines, even though I would much rather prefer to use Edge.  Really, Wayland is pretty much the standard on all major distros now, it should be the default ozone platform.

  • joelmurphy444, AFAIK reading flags from ~/.config/microsoft-edge-stable-flags.conf is an Arch-specific patch and is not supported upstream or in other distros. See https://aur.archlinux.org/cgit/aur.git/tree/microsoft-edge-stable.sh?h=microsoft-edge-stable-bin.

    The PWA problem should be addressed when edge://flags/#ozone-platform-hint becomes available by enabling that flag. For now, you could edit ~/.local/share/applications/msedge-*.desktop for each PWA and add the flag there. Another option would be to add the flag to /opt/microsoft/msedge/microsoft-edge, but that would be lost upon updating the browser.
    • joelmurphy444's avatar
      joelmurphy444
      Copper Contributor
      Oh yeah, I didn't notice it was part of the AUR package, thanks for the info!

      I've gotten so used to -flags.conf (chromium-flags.conf, electron-flags.conf) that I didn't realise until now after digging into the PKGBUILDs that all these files are Arch-specific.

      I indeed have been editing ~/.local/share/applications/msedge-*.desktop files, to varying degrees of success. Outlook PWA seems to overwrite its desktop file almost every time I try to use it. I went for the nuclear option in the end and set the immutable attribute on those desktop files. I'm sure this will come back to haunt me in the future.
  • joelmurphy444's avatar
    joelmurphy444
    Copper Contributor

    christianfosli1 

    So, you can set these flags without needing to edit desktop files if you create the file "~/.config/microsoft-edge-[stable/beta]-flags.conf" or something similar. You may need to name the file in accordance with the program name (the one you could type in the terminal to launch Edge).

     

    So for example for me on Arch Linux I have "~/.config/microsoft-edge-stable-flags.conf".

    You might have "~/.config/microsoft-edge-beta-flags.conf". Or maybe just "microsoft-edge-flags.conf" I'm not quite sure what all the possibilities are.

     

    In my microsoft-edge-stable-flags.conf I have:

    --password-store=gnome-libsecret
    --ozone-platform-hint=wayland
    --gtk-version=4
    --ignore-gpu-blocklist

    The important part is the ozone-platform-hint line, the rest is stuff you may or may not need. I would begin with:

    --ozone-platform-hint=wayland

    And you probably don't need any more than this.

     

    HOWEVER

    I've noticed these flags don't seem to apply to any progressive web apps (PWAs) that have been installed, so in this case to prevent PWAs from running in XWayland I had to edit their desktop files (msedge-.....[loads of stuff].desktop) and add "--ozone-platform=wayland" to the Exec line in those.

    I haven't found a fix for this, and it's quite annoying because the PWA desktop files seem to get overwritten periodically.

     

  • Disclaimer: I'm not a member of the Microsoft Edge team or a support engineer. I just happen to work at Microsoft and use Edge on Linux. Don't take anything I say as an official position or recommendation from the Microsoft Edge team.

Resources