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

Mouse clicks are far from target location at 150% display scaling #3744

Open
MDSchechtman opened this issue May 14, 2024 · 12 comments
Open

Mouse clicks are far from target location at 150% display scaling #3744

MDSchechtman opened this issue May 14, 2024 · 12 comments
Labels
bug Something likely wrong in the code hw: hdpi Specific issues for HPDI-devices importance: medium A bit annoying, minor miscalculation, but no crash subsystem: gui The issue is related to GUI subsystem of planetarium...

Comments

@MDSchechtman
Copy link

MDSchechtman commented May 14, 2024

Expected Behaviour

Clicking an object, such as a star, selects that object.

Actual Behaviour

Clicking appears to be offset by a large amount, resulting in distant objects being selected when trying to select a specific target such as a star.

Steps to reproduce

Click a large bright star. Notice that it does not select, and some other star might have been selected instead.

Video: https://www.youtube.com/watch?v=JFXye0eKMHw

I assume this is related to the combination of Arch+KDE+wayland on a 4k monitor with display scaling, and if anyone has advice I would appreciate it.

System

  • Stellarium version: 24.1 (flatpak version)
  • Operating system: EndeaouvorOS (arch based)
  • Graphics Card: Radeon 7900XTX
  • Screen type (if applicable): 4k @ 150% scaling, wayland under KDE 6

Logfile

log.txt

@gzotti
Copy link
Member

gzotti commented May 14, 2024

Duplicate of #3733

@gzotti gzotti marked this as a duplicate of #3733 May 14, 2024
Copy link

This issue already exists.

@MDSchechtman
Copy link
Author

MDSchechtman commented May 14, 2024

@gzotti This issue is not a duplicate of #3733.

My issue does not only occur at high zoom, but at any zoom. We're not talking about nearby stars being selected, but stars roughly three to five inches away on my screen.

Please see the linked video.

@gzotti gzotti reopened this May 14, 2024
@gzotti gzotti removed the duplicate label May 14, 2024
@alex-w
Copy link
Member

alex-w commented May 16, 2024

@MDSchechtman could you’re checking the behavior with 100% and 200% scaling of the screen?

@MDSchechtman
Copy link
Author

MDSchechtman commented May 17, 2024

@alex-w No issue at 100% or 200% display scaling.

I did find something else interesting though: initially when Stellarium opens at 150% display scaling, clicking will be accurate but only as long as the window is not resized. After resizing (or going into full screen), clicking is wildly off again and will remain so until the application is restarted.

Resizing the window at 100% and 200% scaling were still fine.

Updated the title.

@MDSchechtman MDSchechtman changed the title Mouse clicks are far from target location Mouse clicks are far from target location at 150% display scaling May 22, 2024
@alex-w alex-w added the bug Something likely wrong in the code label Jun 4, 2024
@alex-w alex-w added the importance: medium A bit annoying, minor miscalculation, but no crash label Jul 6, 2024
@Carz10
Copy link

Carz10 commented Aug 1, 2024

I can confirm the same behaviour in my Windows 10 set up:

  • Monitor 1
  • UW screen ProLiteUB3493WQSU (3440x1440)
  • Scale is 125%
  • Monitor 2
  • Dell 2709W (1920x1080)
  • Scale is regular at 100%
  • Stellarium
  • 24.2 for Windows 10, 64bit
  • Primary desktop is Monitor 1 (start menu, etc.)
  • Stellarium opens in Monitor 2 with mentioned behaviour, regardless if it is in full screen or custom window size opened
  • Once I ove the app window to the Monitor 1, the click behaves as expcted, where the mouse points
  • For some obscure reason, Stellarioum only opens itself on Monitor 2 (regardless in which mon I close the app)
  • 23.3 was working (my last version I just updated to 24.2)

I hope this adds any value to the bugfixer.

Carsten

@alex-w
Copy link
Member

alex-w commented Dec 27, 2024

@Carz10 @MDSchechtman please check version 24.4 of Stellarium

@MDSchechtman
Copy link
Author

@Carz10 @MDSchechtman please check version 24.4 of Stellarium

Just a reminder I'm on a 4k monitor with 150% display scaling (or 1.5) using Arch, KDE Plasma, and Wayland. I tested the following with Stellarium 24.4:

AppImage

  • Mouse behavior works correctly
  • Scaling half works

UI widgets are scaled correctly however fonts are small, which isn't really an issue since they can be adjust in the UI.

Flatpak

  • Mouse clicks do not work correctly out of the box
  • Scaling does not work correctly

Disabling Wayland for the flatpak (via flatseal) fixed the mouse click behavior, which was promising.

I could not get the flatpak to respect any display scaling and so it was mostly unusable. Both UI widgets and fonts were much too large. I wonder if fixing the scaling would then break mouse clicks again

Native install (built from source via AUR)

  • Mouse clicks do not work correctly
  • Scaling does not work correctly

Similar to the flatpak, thought I didn't tweak any environment variables.


I've just been using the appImage which does work for the most part.

@alex-w
Copy link
Member

alex-w commented Dec 28, 2024

WOW! Very interesting and strange results… Thanks for report!

@alex-w alex-w added hw: hdpi Specific issues for HPDI-devices subsystem: gui The issue is related to GUI subsystem of planetarium... labels Dec 28, 2024
@10110111
Copy link
Contributor

This may be a bug in Qt Wayland platform support. Generally, high-DPI scaling as implemented in Qt is a kludge that I aim to get rid of eventually, doing all the necessary scaling relative to the chosen font size. Much of this has already been done, except the panels and some additional quirks like line widths of the grids.

Meanwhile, you can try

  • Switching to X11, or
  • Increasing font size in Stellarium settings and running Stellarium with an environment variable added: QT_SCREEN_SCALE_FACTORS=1.

@MDSchechtman
Copy link
Author

MDSchechtman commented Dec 29, 2024

While QT_SCREEN_SCALE_FACTORS=1 did not work, it lead to be a workaround that does:

  • Install flatpak stellarium
  • Set QT_SCALE_FACTOR=1 (not QT_SCREEN_SCALE_FACTORS)
  • Launch with --nosocket=wayland to disable wayland

The above is much easier using Flatseal if anyone else is trying to replicate the workaround. This probably works for the non-flatpak version though you'll have to lookup how to disable wayland for a specific application.

@MDSchechtman
Copy link
Author

Adding to my previous comment, QT_SCALE_FACTOR=1 actually results in the font and UI scaling being correct, instead of being too small. It's as if the display scaling was being applied twice, maybe even multiplied resulting in 3x scaling instead of 1.5x.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something likely wrong in the code hw: hdpi Specific issues for HPDI-devices importance: medium A bit annoying, minor miscalculation, but no crash subsystem: gui The issue is related to GUI subsystem of planetarium...
Development

No branches or pull requests

5 participants