Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DPI issues in a multi-monitor setup #1509

Open
rnhmjoj opened this issue Aug 24, 2024 · 6 comments
Open

DPI issues in a multi-monitor setup #1509

rnhmjoj opened this issue Aug 24, 2024 · 6 comments

Comments

@rnhmjoj
Copy link

rnhmjoj commented Aug 24, 2024

DPI is an area where bspwm could see some improvements, particularly when using a multi-monitor setup with different DPI values. For example:

  1. border_width and window_gap are globals and given in pixels. This means they can result in widely different physical sizes when using a typical 96dpi along side and a high DPI (say 200dpi) monitor. To achieve consistency, I can think of two options:

    • change the settings to use points instead of pixels and scale them based on the pixel-density,
    • make the settings per-monitor, allowing the user to specify different pixel sizes.
  2. similarly, bspc node commands --resize, --move are in pixels, so they are inconsistent across different monitors.

  3. when dragging or sending a window to another monitor the physical dimensions are not preserved. the window should be scaled.

@ortango
Copy link

ortango commented Sep 22, 2024

I'm curious if there is any status-quo for this, at least with X11 wm's that do not have a built-in compositor.
It doesn't seem like this should be bspwm's job; some issues i think would be a problem:

  • border_width would only scale after moving a window completely onto another monitor, which would be ugly (sudden)
  • bspwm monitors do not need to be tied to physical monitor geometry, x11 displays also do not. both can overlap as well.
  • scaling a window when it is moved to a new display will not scale the app contents. this will look ugly
  • resizing and moving based on some coordinate translation will "break" compatibility with X11 tools. 0,1600 could be two different places depending on if using bspwm, or a standalone tool.

@rnhmjoj
Copy link
Author

rnhmjoj commented Sep 22, 2024

border_width would only scale after moving a window completely onto another monitor, which would be ugly (sudden)

While not perfect, It would still be a significant improvement.

bspwm monitors do not need to be tied to physical monitor geometry, x11 displays also do not. both can overlap as well.

If so, I would go for the solution of dimensions specified in points.

scaling a window when it is moved to a new display will not scale the app contents. this will look ugly

Scaling the content of the window is the app job, though. Anything using GTK or Qt, even Tk, already does this, the WM only needs to resize the window appropriately.

resizing and moving based on some coordinate translation will "break" compatibility with X11 tools

I'm not sure what you mean. Are you talking about the bspc node commands?

@ortango
Copy link

ortango commented Sep 22, 2024

I'm not sure what you mean. Are you talking about the bspc node commands?

yeah. using wmutils/xdotool/etc will use actual X coordinates, and bspwm would use the translated ones for moving and resizing.

Scaling the content of the window is the app job, though. Anything using GTK or Qt, even Tk, already does this, the WM only needs to resize the window appropriately.

oh, ok. i have not seen this in action myself, so must be a configuration i have missed. that would make it worth it.

are there examples of other x11 wm's that implement this?

@rnhmjoj
Copy link
Author

rnhmjoj commented Sep 22, 2024

I don't know about pure WMs, but KDE or Gnome should handle dragging windows across displays with different DPIs.

@ortango
Copy link

ortango commented Sep 23, 2024

i scripted up a demo to test this out - but, not sure i have the best hardware to test it out...
the bigger issue is: i cannot find any reference to toolkit scaling.

Anything using GTK or Qt, even Tk, already does this, the WM only needs to resize the window appropriately.

can you provide any hints on this? all that i have seen is that toolkit scaling is whole "desktop" and doesn't support dynamic scaling on x11.

@rnhmjoj
Copy link
Author

rnhmjoj commented Sep 23, 2024

I tested this recently with a Qt 5 application, a typical 1920x1080 96 DPI display and a 4K 200dpi one.
Without a DE that automagically configures the scaling, you need to set this QT_SCREEN_SCALE_FACTORS (in my case it was '2;1'). By dragging a window across the screen you will see the content scaling.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants