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

"Add HighDPI support for Wayland" breaks fullscreen #329

Open
andreadaoud opened this issue Feb 18, 2023 · 2 comments
Open

"Add HighDPI support for Wayland" breaks fullscreen #329

andreadaoud opened this issue Feb 18, 2023 · 2 comments
Labels
bug Something isn't working wayland Topics of Wayland

Comments

@andreadaoud
Copy link
Contributor

d88c3c5

Hello @vially ,

In my use case, my app is put into a kiosk weston compositor to be launched in fullscreen mode, and with scale factor is overrode (./app --bundle=. --fullscreen --force-scale-factor=1.3). My intention of the scale factor is only to scale UI elements. The screen size is 800x480. However, when this patch is applied, the screen is scaled to bigger than normal screen size. From the log, you can see that it is actually 1040x624, so some portion of the UI is displayed outside of the screen. When I revert this patch, all things works normally. Could you please propose a fix for my use case? I'm willing to test your solution.

# ./app --bundle=. --fullscreen --force-scale-factor=1.3
[TRACE][operator()(171)] presentation info: clk_id = 1
[INFO][operator()(606)] Display scale for output(8): 1
[INFO][operator()(573)] Display output info: width = 800, height = 480, refresh = 62413
[TRACE][CreateRenderSurface(1149)] Created the Wayland surface: 1040x624
[TRACE][operator()(143)] window entered output 8
@vially
Copy link
Contributor

vially commented Feb 18, 2023

Unfortunately I will not have access to a development machine for the next couple of weeks so I will not be able to investigate and debug this issue. This means I can only try to provide some context for what that commit did and what I think might be required to fix this.

My intention of the scale factor is only to scale UI elements

I think this is the root of the issue. The changes from #314 assumed the --force-scale-factor flag to mean forcing the Wayland output scale factor but I see now that it's meant to be an additional scaling factor that's independent of the Wayland's output/surface scale.

I guess the fix would involve changing all calculations on Wayland from the current form of:

xy_coordinate_in_px = xy_coordinate_in_dp * output_scale

to something like:

xy_coordinate_in_px = xy_coordinate_in_dp * output_scale * forced_scale

Of course, the hard part would be identifying all the places where this change is needed and plubming it through.

@HidenoriMatsubayashi HidenoriMatsubayashi added the wayland Topics of Wayland label Feb 19, 2023
@HidenoriMatsubayashi HidenoriMatsubayashi added the bug Something isn't working label Aug 10, 2023
@HidenoriMatsubayashi
Copy link
Contributor

Currently, it looks like even mouse cursor (click) doesn't work correctly when using --force-scale-factor.

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

No branches or pull requests

3 participants