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

Heterogeneous DPI Incompatibility #167

Open
Queuecumber opened this issue Aug 31, 2022 · 6 comments
Open

Heterogeneous DPI Incompatibility #167

Queuecumber opened this issue Aug 31, 2022 · 6 comments
Labels
bug Something isn't working

Comments

@Queuecumber
Copy link

When using ddterm with wayland heterogeneous DPI, the window can be the wrong size.

I have a 4k laptop monitor and 1440p external monitor. I keep the laptop monitor at 200% scaling and the external monitor at 100% scaling. When I initially open ddterm on the external monitor it correctly display at the full width, on subsequent openings it is only about half the width (see screenshot)

Screenshot from 2022-08-31 12-10-11

amezin added a commit that referenced this issue Aug 31, 2022
@amezin
Copy link
Member

amezin commented Aug 31, 2022

Could you test this change? f400e96

You could use a pre-built package: https://github.com/ddterm/gnome-shell-extension-ddterm/suites/8074180755/artifacts/348094355 (unzip pack.zip, then run gnome-extensions install -f ddterm@amezin.github.com.shell-extension.zip - yes, it's zip inside of zip, and you need to manually unzip only top-level one).

After installing, don't forget to log out and log in or reboot.

@Queuecumber
Copy link
Author

Same behavior with that zip file

@amezin
Copy link
Member

amezin commented Sep 2, 2022

Ok, I've been able to reproduce the issue.

Window manager decides to place the window on the primary monitor, no matter what the extension does. And it happens only when monitors have different scaling. The extension moves the window to the correct monitor a bit later. But because the window is maximized horizontally - it can't be resized horizontally. Actually, window manager itself should resize maximized windows - but fails to do it in this case.

I'm not sure if I'll be able to fix this.

@Queuecumber
Copy link
Author

Do you know whose bug it is and where I can file it?

amezin added a commit that referenced this issue Sep 3, 2022
Known issue: window may render with wrong DPI (not matching its monitor)

#167
amezin added a commit that referenced this issue Sep 3, 2022
amezin added a commit that referenced this issue Sep 3, 2022
Known issue: window may render with wrong DPI (not matching its monitor)

#167
amezin added a commit that referenced this issue Sep 3, 2022
@amezin
Copy link
Member

amezin commented Sep 4, 2022

It's all related to async resize handling in GNOME window manager on Wayland: https://gitlab.gnome.org/GNOME/mutter/-/issues/1627
As you can see, I've tried to fix that issue once... And failed (and others too).

Also, ddterm is doing things that aren't supported by GNOME Shell/window manager, and aren't intended to be possible.

Probably the proper way to fix this is to ask for new API in the window manager. And I should have done it already - but previously various workarounds allowed me to solve the problem without it. New API will only be available in GNOME 44 (if it will be accepted - which isn't guaranteed).

I've achieved something "almost acceptable" (especially if window animations are enabled) with various hacks - but there are multiple issues: the window flashes on a wrong monitor, sometimes renders with wrong scaling factor.

amezin added a commit that referenced this issue Sep 4, 2022
Known issue: window may render with wrong DPI (not matching its monitor)

#167
amezin added a commit that referenced this issue Sep 4, 2022
amezin added a commit that referenced this issue Sep 6, 2022
Known issue: window may render with wrong DPI (not matching its monitor)

#167
amezin added a commit that referenced this issue Sep 6, 2022
amezin added a commit that referenced this issue Sep 6, 2022
@amezin amezin added the bug Something isn't working label Nov 16, 2022
amezin added a commit that referenced this issue Nov 29, 2022
amezin added a commit that referenced this issue Nov 29, 2022
amezin added a commit that referenced this issue Nov 29, 2022
amezin added a commit that referenced this issue Nov 29, 2022
amezin added a commit that referenced this issue Nov 29, 2022
amezin added a commit that referenced this issue Nov 30, 2022
amezin added a commit that referenced this issue Nov 30, 2022
amezin added a commit that referenced this issue Nov 30, 2022
amezin added a commit that referenced this issue Nov 30, 2022
amezin added a commit that referenced this issue Nov 30, 2022
amezin added a commit that referenced this issue Nov 30, 2022
amezin added a commit that referenced this issue Nov 30, 2022
amezin added a commit that referenced this issue Nov 30, 2022
amezin added a commit that referenced this issue Nov 30, 2022
amezin added a commit that referenced this issue Nov 30, 2022
@amezin
Copy link
Member

amezin commented Dec 13, 2022

I have plans to write an xterm.js-based terminal emulator using GNOME Shell's UI (instead of the current implementation with a separate Gtk application). It should solve all window management issues, like this one.

However, it won't happen soon, as it will likely be a separate project, written (almost) from scratch.

#269

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants