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

Scaling issue in simulation UI R2022b #5024

Closed
FrederikBark opened this issue Aug 8, 2022 · 15 comments
Closed

Scaling issue in simulation UI R2022b #5024

FrederikBark opened this issue Aug 8, 2022 · 15 comments

Comments

@FrederikBark
Copy link
Contributor

Describe the Bug
I hope this isn't a duplication, but I didn't find a fix or something related. It might also be an issue with 4k displays.
Since the update to R2022b, the simulation window fills only a quarter of the given screen space.

The mouse movements and clicks are measured at the whole screen though, making it additionally hard to click on objects.

Steps to Reproduce

  1. Installing webots from source origin/master (make -j8)
  2. Launching with ./webots

Expected behavior
Normal screen scaling as seen in 2nd Screenshot

Screenshots
R2022b
webots r2022b

R2022a
webots

System

  • Operating System: Ubuntu 20.04
  • Graphics Card: Intel HD Graphics & Rtx 3070 (only tested on intel currently though)
  • Display Settings: 4k (3840x2160)
  • Window-Manager: i3

Additional context
Add any other context about the problem here.

@omichel
Copy link
Member

omichel commented Aug 8, 2022

That's is strange... Can you try to to set export QT_USE_PHYSICAL_DPI=1 and run Webots again?
Alternatively, can you also try export QT_SCALE_FACTOR=2?
Also can you try to remove QT_ENABLE_HIGHDPI_SCALING from https://github.com/cyberbotics/webots/blob/master/src/webots/launcher/webots-linux.sh#L74?

Let me know your findings.

@FrederikBark
Copy link
Contributor Author

Okay so the 1st and 3rd option didn't change anything, but the 2nd option looked like that
option2
.
Also it seems like this bug doesn't happen in Gnome for me and only i3, but i3 was working correctly with R2022a. Maybe some variable is incorrectly provided by the X-Server?

@omichel
Copy link
Member

omichel commented Aug 8, 2022

Maybe this one broke it? Can you try to revert it?

@FrederikBark
Copy link
Contributor Author

Sadly this doesn't seem to change it.

@omichel
Copy link
Member

omichel commented Aug 8, 2022

Or removing these lines?

@FrederikBark
Copy link
Contributor Author

Sadly nothing as well.

@omichel
Copy link
Member

omichel commented Aug 8, 2022

Unfortunately, I am running out of ideas... That's strange the bug doesn't show up with R2022a...
A big change we did between R2022a and R2022b is the upgrade to Qt6.
To find the problem, we could revert back in the github history to some commit before the upgrade to Qt6 and rebuild Webots to try to identify if problem was introduced here...

@FrederikBark
Copy link
Contributor Author

Thank you very much for your help. Maybe there is a general change in how qt6 handles scaling and that makes problems with my display config. I'll check it and if I find a solution, I'll post an update.

@FrederikBark
Copy link
Contributor Author

Interestingly using a QT_SCALE_FACTOR of 0.5 fixes the screen scaling, although the rest of the ui is pretty small.
Is there a way to increase the ui size (other than with QT_SCALE_FACTOR)?
Screenshot_20220809_100026

@omichel
Copy link
Member

omichel commented Aug 9, 2022

We are progressing... Did you check all the different environment variables documented here: https://doc.qt.io/qt-6/highdpi.html#environment-variable-reference?

@omichel
Copy link
Member

omichel commented Aug 9, 2022

Alternatively, you may want to try to change the font sizes in the styling sheet: https://github.com/cyberbotics/webots/blob/master/resources/stylesheet.linux.qss

@FrederikBark
Copy link
Contributor Author

Explicitely disabling the QT_ENABLE_HIGHDPI_SCALING with QT_ENABLE_HIGHDPI_SCALING=0 makes the Ui small, but working. I somehow forgot to check disabling it yesterday and tried just not to enable it.
In combination with a SCALE_FACTOR of 2 and a FONT_DPI of 80 it looks good again.

Thank you very much for your help!
Screenshot_20220809_101423

@omichel
Copy link
Member

omichel commented Aug 9, 2022

Could we integrate this in https://github.com/cyberbotics/webots/blob/master/src/webots/launcher/webots-linux.sh?
If we can detect that we are in a high DPI i3wm environment, the launcher script could set these environment variables automatically?

@FrederikBark
Copy link
Contributor Author

That sounds like a good option.
I used the parameters

export QT_ENABLE_HIGHDPI_SCALING=0
export QT_SCALE_FACTOR=2
export QT_FONT_DPI=80

to fix my scaling. The Environment variable $XDG_CURRENT_DESKTOP returns i3 for me.
I might be able to adapt the script later today and test it.

@omichel
Copy link
Member

omichel commented Aug 9, 2022

That would be great.

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

No branches or pull requests

2 participants