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

[Bug] Geometry issues with Qt6 #1080

Closed
letsfindaway opened this issue Sep 6, 2024 · 5 comments
Closed

[Bug] Geometry issues with Qt6 #1080

letsfindaway opened this issue Sep 6, 2024 · 5 comments
Labels

Comments

@letsfindaway
Copy link
Collaborator

letsfindaway commented Sep 6, 2024

Describe the bug

When starting OpenBoard, the icons in the toolbar are too narrow spaced. The right sidebar (palette) does not have its previous size, but is smaller. When opening a document, it is not centered.

To Reproduce

  1. Build OpenBoard with Qt6. I'm using Qt 6.6.3 on openSUSE Leap 15.6.
  2. Start OpenBoard. The upper right corner looks as follows:

grafik

  1. The icons in the title bar are too narrow, the right palette has not the previous size.
  2. Resize the right palette, close and reopen OpenBoard. It is again smaller.
  3. Switch to Document mode and back to Board: the toolbar icons are correctly spaced.
  4. Open a document. The lower right corner of the page size indicator rectangle is in the center of the screen. I had this only with dev, not with master.
  5. Enable and disable multiscreen mode: the document is then correctly centered.

I also had a situation where control screen and display screen where shown on the same monitor, but cannot reproduce this.

Context

  • reproducibility : systematic, but I'm not sure
  • OpenBoard version :
    • bug happens with : current dev, master
    • didn't check : others
  • OS :
    • bug happens with : Linux
    • didn't check : Windows macOS
  • Installation source : own build
  • If you built OpenBoard from source, please provide the branch you're working on : dev, master

Additional context

  • OS(es) detailed version (for the ones you reproduced the bug on) :
    • Linux : Description: openSUSE Leap 15.6, KDE, X11
  • number and resolution of monitors : 2 (1680x1050 and 1920x1080)

My assumption is that some screen geometry information is not available at the right time.

Edit: The issue does not occur when I disconnect my second monitor.

@letsfindaway
Copy link
Collaborator Author

Some more investigations:

The issue occurs also with Qt 6.7.2 as we have on Tumbleweed.

The geometry is written to the log file. When I use a single monitor I get

control geometry QRect(1680,0 1920x1080)

This is correct, the right monitor is my primary monitor and is used as control screen. When I switch to multi monitor mode I get

control geometry QRect(1680,0 1920x1080)
display geometry QRect(0,0 1680x1050)

This is also correct, but in fact control and display screen are now shown on the left monitor and also with the size of that monitor! So it's not the geometry information which is wrong, but setGeometry() seems not to have the desired effect.

If I ask for the geometry immediately after setting it i get

Code:
        qDebug() << "control geometry" << geometry;
        controlWidget->setGeometry(geometry);
        qDebug() << "control geometry1" << controlWidget->geometry();

Log output:
control geometry QRect(1680,0 1920x1080)
control geometry1 QRect(0,0 400x163)

@letsfindaway
Copy link
Collaborator Author

And here my solution. UBDisplayManager:382:

        qDebug() << "control geometry" << geometry;
        controlWidget->setGeometry(geometry);
        // with Qt6, setGeometry has not the desired effect so we additionally use move and resize
        controlWidget->move(geometry.topLeft());
        controlWidget->resize(geometry.size());
        UBPlatformUtils::showFullScreen(controlWidget);

Adding the move() and resize() calls solves the problem for me. In fact, setGeometry() could then even be omitted.

Before creating a PR with this workaround I would like to get more feedback on this problem.

@letsfindaway
Copy link
Collaborator Author

@jbruechert: On my system this also happens with the current Flatpak, which uses Qt6 under the hood. Jonah, have you observed something like this?

@Vekhir: You also work a lot with Qt6: what are your observations? Did you have this issue?

Note: Two monitors must be connected in order to evoke this issue.

@Vekhir
Copy link
Contributor

Vekhir commented Sep 16, 2024

I usually work with a single monitor, though I sometimes test with virtual monitors created via

$ xrandr --addmode DisplayPort-0 1920x1080
$ xrandr --output DisplayPort-0 --mode 1920x1080 --right-of HDMI-A-0

and destroyed via xrandr --output DisplayPort-0 --off.

With this setup, your issue does not occur on my system with Qt 6.7.2. The text in the top right corner is fully visible for every icon. I'm running from the dev branch with my PRs applied, in case it matters. I also tested with the 1.7.1 release version on Arch, also no issue.

@letsfindaway
Copy link
Collaborator Author

Closed as #1095 was merged

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

No branches or pull requests

2 participants