hyprwm / Hyprland

Hyprland is an independent, highly customizable, dynamic tiling Wayland compositor that doesn't sacrifice on its looks.
https://hyprland.org
BSD 3-Clause "New" or "Revised" License
21.07k stars 881 forks source link

Scaling issues with chromium based browsers #2588

Open mke21 opened 1 year ago

mke21 commented 1 year ago

Version: 0.25.0-1 (on Manjaro Linux)

Running brave or chromium in wayland mode messes up the scaling, makes it display unsharp and messes up links. Links can only be clicked by clicking slightly above the links instead of directly on the links themselves like what is normal. The top of the browser tabs run slightly out of the 'window' at the top. The browser has a slightly out-of-focus look. See screenshot.

This usually happens after I have started the browser once and closed it. If I start it again, this happens. So usually not the first time I start the browser and in XWayland it works fine.

Switching to fullscreen mode and back to tiled mode (Master-stack) fixes the problem.

It does not happen with Firefox, nor does it happen on other compositors like Sway. Scaling is set to 1 and the screen is a normal laptop screen 1920x1080@60hz with Intel graphics.

In order to start brave or chromium in wayland modus I use --enable-features=UseOzonePlatform --ozone-platform=wayland or set the flag 'Preferred Ozone platform' to wayland.

20230626_18h51m15s_grim

vaxerski commented 1 year ago

I've never seen this happen

mke21 commented 1 year ago

Strange, I have it all the time. I'm just not sure what is going on. Here is a screen recording of the event. See how the mousepointer changes when hovering above the link and how everything restores after toggeling fullscreen.

https://github.com/hyprwm/Hyprland/assets/4930603/07314050-d0b1-4128-9854-523efd2635ca

erikkallen commented 1 year ago

I have the same issue, also I noticed that the top bar is smaller and close button is rendered at the wrong position (also slightly off), the problem also goes away when initiating a window move, I have a 4K screen and scaling 1

panchoh commented 1 year ago

Same issue here. My system is not yet ready to take videos, so I kept postponing reporting it (thanks to the OP for doing it!).

Also, I use the same workaround, that is, to force a redraw, either activating a full-screen, or launching a terminal emulator.

Note that it does not happen all the time, either!

I use NixOS, BTW.

In case it helps debug this, here is my flake.

It is deployed on a pair of 8th gen Intel NUC, each sporting integrated Intel Iris GPU:

vars1ty commented 1 year ago

Happens on Brave when you launch it via Wayland, only application that I have (so far) encountered this issue w/

mke21 commented 1 year ago

One adjustment: I just tested, Vivaldi does not seem to have the problem. So far I’ve only had this problem with Brave and Chromium.

kooskaspers commented 1 year ago

Same problem here on chrome based browsers (encountering with Edge).

chris-av commented 1 year ago

The folks on the subreddit caught this too. In the comments, these two weird (hacky) solutions worked for me.

  1. Drag the browser window (to make it floating) and release and the resolution magically snaps back into place.
  2. Modifying the Chrome browser settings where you toggle "use system title and borders" to active slightly improves the resolution.
revuwa commented 1 year ago

Thanks, activating "system title and borders" fixed it for me. Never hat that issue before chromium ~v114, while using the same settings for years, now.

mke21 commented 1 year ago

"Use system title and border" fixed this problem for me with Brave as well. For the ones reading this, you can set in Brave this by right clicking next to the tabs and turn it on in the context menu.

panchoh commented 1 year ago

The folks on the subreddit caught this too. In the comments, these two weird (hacky) solutions worked for me.

[...]

  1. Modifying the Chrome browser settings where you toggle "use system title and borders" to active slightly improves the resolution.

This helps a lot, thanks! I just made the change in both chrome and chromium, and in these few minutes since I made the change, the problem is yet to occur.

It seems that this setting is controlled by a boolean custom_chrome_frame in ~/.config/google-chrome/Default/Preferences.

Still trying to figure out how tweak that boolean with Home Manager, though.

panchoh commented 1 year ago

The workaround for chrome and chromium on NixOS (unstable), (also tracking Hyprland flake), has been working reliably for me, not a single glitch in two weeks of usage.

woojiq commented 1 year ago

@panchoh have you found a simple solution to change this flag declaratively (in nix configs)? I tried to do it with gojq, but then I realized that it's better to click it once and forget it than to waste half a day :smiley:

panchoh commented 1 year ago

@panchoh have you found a simple solution to change this flag declaratively (in nix configs)? I tried to do it with gojq, but then I realized that it's better to click it once and forget it than to waste half a day smiley

I have not, to my chagrin. But you speak The Truth™, it's a simple enough tweak to perform by hand.

Nevertheless, if I ever were to find a simple declarative way to tweak it, I'll share it here for the benefit of future time travellers.

Anex007 commented 1 year ago

I fixed the issue by setting the ozone feature to wayland in brave://flags. Also im using brave nightly

If you are on chromium running chromium --ozone-platform-hint=wayland works

Zedo9 commented 11 months ago

This was fixed in the past, and now there is a new variant of the bug: it starts up with messed scaling but the window fixes itself automatically (without me having to re-adjust it)

If you are on chromium running chromium --ozone-platform-hint=wayland works

No longer works unfortunately.

https://i.imgur.com/7j3yGAD.mp4

Happens with brave and chromium.

nyawox commented 11 months ago

Now I'm having same issue as @Zedo9 Starting with 0.32.0, chromium based browsers including electron starts with proper scaling(atleast for me) and adjusts to native resolution, which is very tiny for me. I know it may be unsupported but I use 0.75 scaling on 1080p monitor which simulates WQHD resolution. imo native 1080p makes everything too large that it's simply unusable nowadays. I can't avoid using 0.75 scaling because #1882 is not implemented. screenshot_2023-11-10-123308 If I launch with xwayland, everything just becomes blurry which is also unreadable. I guess I have to stick with 0.31.0 for now because everything was working fine. I'm reading Hyprland box commit code currently but I don't know cpp enough to get what is making this behaviour.

lebao3105 commented 10 months ago

I fixed the issue by setting the ozone feature to wayland in brave://flags. Also im using brave nightly

If you are on chromium running chromium --ozone-platform-hint=wayland works

It works for me, using Chrome Dev 122

sahil-tgs commented 9 months ago

For Microsoft edge users u can do this to set the ozone --ozone-platform-hint=wayland

screenshot :

If someone is using microsoft-edge-stabe I didn't find the --ozone-platform-hint=wayland flag, so what I did was changed the exce command in the microsoft-edge.desktop file linking it to a launch script which says microsoft-edge-stabele --ozone-platform-hint=wayland written this way when launching the application using dmenu or rofi or any gui tool to launch the application u will be able to fix the blurry issue.

read the detailed solution here: https://www.reddit.com/r/hyprland/comments/19crkzq/solved_microsoft_edge_blurry_displayscaling_issue/?utm_source=share&utm_medium=web2x&context=3

sahil-tgs commented 8 months ago

This issue is not just on chromium-based browsers, but anything that doesn't run natively on Wayland and utilizes Xwayland service. most of the legacy software doesn't even starts up, and when they do, they are all lo res.

I have seen this issue with the following programs:

AndreasYNY commented 6 months ago

recently i bought a new display and got the same issue as @nyawox, almost every single chromium based apps (like brave, vesktop, spotify, github-desktop) just shrink to native resolution when scaling to <1 (0.83).

i kinda "fixed" it by passing --disable-features=WaylandFractionalScaleV1 (thanks https://github.com/hyprwm/Hyprland/issues/1462#issuecomment-2009547039), but using this kinda tanks my fps on some application like spotify and some apps like vesktop and tutanota ignores this parameter.

abiriadev commented 1 month ago

i kinda "fixed" it by passing --disable-features=WaylandFractionalScaleV1 (thanks #1462 (comment))

This one actually works for me. It is the only workaround as of now I guess?