furnace icon indicating copy to clipboard operation
furnace copied to clipboard

Wayland & HiDPI / scaling

Open OPNA2608 opened this issue 3 years ago • 1 comments

This problem is being worked around in the code by defaulting to X11 if no specific video driver was requested (which is broken for Haiku, see #590), but it's not fixed. This problem was originally filed and worked around under #153, but no follow-up was opened to properly track fixing of this problem. So here we are. :duck:


XWayland w/ scaling: All good.

$ env SDL_VIDEODRIVER=x11 /path/to/furnace

20220714_21h26m12s_grim

Native Wayland w/ scaling: Not all good.

$ env SDL_VIDEODRIVER=wayland /path/to/furnace

20220714_21h02m12s_grim

Native Wayland w/o scaling: Looks correct but too small to be usable.

$ wlr-randr --output DSI-1 --scale 1.0
$ env SDL_VIDEODRIVER=wayland /path/to/furnace

20220714_21h37m34s_grim

$ neofetch --off
OS: postmarketOS v21.06.4 aarch64
Host: Pine64 PinePhone (1.2)
[...]
Resolution: 720x1440
DE: GNOME 40.1
WM: weston
$ wlr-randr
DSI-1 "<Unknown> <Unknown>  (DSI-1)"
  Physical size: 68x136 mm
  Enabled: yes
  Modes:
    720x1440 px, 60.006001 Hz (preferred, current)
  Position: 0,0
  Transform: 270
  Scale: 1.750000

Wayland scaling can be adjusted with

$ wlr-randr --output DSI-1 --scale 2.0

Phosh starts with a scaling of 2.0, I prefer 1.75 for personal use.

OPNA2608 avatar Jul 14 '22 19:07 OPNA2608

So it appears that SDL Wayland is going the macOS way regarding HiDPI scaling - pixel sizes are logical... This won't be easy to fix.

tildearrow avatar Jul 15 '22 03:07 tildearrow

Progress Report: (scaling branch)

  • Wayland HiDPI works
  • ~~input positions are still wrong~~ new commit fixes this

Furnace on Weston

tildearrow avatar Oct 20 '22 07:10 tildearrow

Please test with git scaling:

  1. Make sure scaling factor is auto-detected properly
  2. Try resizing Furnace
  3. Make sure the Choose a System window (new) and the built-in file picker is centered
  4. Make sure input doesn't go weird after resizing

tildearrow avatar Oct 20 '22 07:10 tildearrow

Posting here since reporter is unable to reply.

Resize: partially working

  • Modals stay centered correctly
  • Input not tested

Rotate (on rotation-capable device): not working

  • Furnace displays at the wrong size, even on startup

tildearrow avatar Oct 21 '22 20:10 tildearrow

scaling branch merged.

tildearrow avatar Oct 21 '22 22:10 tildearrow

On 0.6pre3 (didn't test master yet), scaling goes wack on Miriway compositor and Lomiri DE.

  1. Launch windowed 20230124_01h03m00s_grim

  2. Make maximised 20230124_01h03m14s_grim

  3. Close so maximised setting is saved

  4. Launch maximised 20230124_01h03m50s_grim

  5. Make windowed again 20230124_01h04m47s_grim


Additionally furnace doesn't respond to the mouse (hovering, clicking, scrolling) in windowed mode, seems to work fine when maximised however.

OPNA2608 avatar Jan 24 '23 01:01 OPNA2608

Finally testing Wayland again.

On master, with kwin_wayland on X11:

~~Help! I cannot close the window after maximizing it!~~

Furnace fails to remember its maximized status. It also fails to remember its size after going full-screen.

tildearrow avatar Jun 12 '23 04:06 tildearrow

However Furnace does respond to mouse input on Weston and kwin_wayland. Oh no Mir bug? :<

tildearrow avatar Jun 12 '23 04:06 tildearrow

Yeah OK I see a problem. Pushed a change which makes Furnace remember its windowed size after being full-screen. Apparently yes, Furnace does change the scaling factor to an inappropriate value when started in full-screen. I can conclude that at least the faulty scaling factor detection is not a Miriway bug.

tildearrow avatar Jun 12 '23 05:06 tildearrow

Pushed a fix. It shouldn't change the scaling factor anymore.

tildearrow avatar Jun 12 '23 05:06 tildearrow

Analysis complete - it appears there is a bug in Mir and/or SDL. Once we update to 2.28, the issue will be closed.

tildearrow avatar Jun 16 '23 18:06 tildearrow

For reference, observations under Mir seem similar to upstream issue: https://github.com/MirServer/mir/issues/2841

OPNA2608 avatar Jun 18 '23 07:06 OPNA2608

SDL 2.28 is out. Will try to upgrade.

tildearrow avatar Jun 20 '23 19:06 tildearrow

Build successful. Closing.

tildearrow avatar Jun 20 '23 21:06 tildearrow