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

X11 shell does not handle DPI scaling. #939

Closed
luleyleo opened this issue May 15, 2020 · 5 comments · Fixed by #1389 or #1751
Closed

X11 shell does not handle DPI scaling. #939

luleyleo opened this issue May 15, 2020 · 5 comments · Fixed by #1389 or #1751
Labels
help wanted has no one working on it yet missing a feature is missing on a specific platform shell/x11 concerns the X11 backend

Comments

@luleyleo
Copy link
Collaborator

This should be done after #904 is merged.

@luleyleo luleyleo added help wanted has no one working on it yet shell/x11 concerns the X11 backend missing a feature is missing on a specific platform labels May 15, 2020
@crsaracco
Copy link
Contributor

Note: from further experimentation, we've come up with these two functions, which works well at least on my system. Feel free to re-use if it's useful.

@dhardy
Copy link
Contributor

dhardy commented Nov 10, 2020

It appears to me that the window gets created with the correct (scaled) size and contents are scaled correctly, yet the draw buffer is not scaled (with scale factor 2, only the top-left quarter gets drawn).

Given a couple of hints I could probably make a PR.

@jneem
Copy link
Collaborator

jneem commented Nov 10, 2020

Probably the invalidation/presentation region is not being scaled. Look at the PresentData::present function: the region it gets is in druid coordinates, and you'll need to put the x_rects in pixel coordinates. You'll also need to handle the scaling for the expose event in handle_expose (that one at least has a TODO comment).

Note that we also have a fallback drawing method in case the present extension isn't available; that one will need to handle scaling too, and the relevant code is near the end of Window::render. To test that fallback code, set the DRUID_SHELL_DISABLE_X11_PRESENT environment variable.

@dhardy
Copy link
Contributor

dhardy commented Nov 11, 2020

I was wrong: the behaviour mentioned happens with the GTK backend; with X11 there is no scaling. I have a fix that seems to work for GTK.

@jneem
Copy link
Collaborator

jneem commented Nov 18, 2020

No github, this isn't fixed yet.

@jneem jneem reopened this Nov 18, 2020
@maan2003 maan2003 mentioned this issue May 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted has no one working on it yet missing a feature is missing on a specific platform shell/x11 concerns the X11 backend
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants