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

The wallpaper goes off screen in labwc Wayland sessions #1974

Open
Reiddragon opened this issue Nov 15, 2024 · 9 comments · May be fixed by #1975
Open

The wallpaper goes off screen in labwc Wayland sessions #1974

Reiddragon opened this issue Nov 15, 2024 · 9 comments · May be fixed by #1975

Comments

@Reiddragon
Copy link

Expected Behavior
Current Behavior

Setting the wallpaper causes the wallpaper to be set as if the screen is larger than it really is, eg: stretch/zoom to fill will cause the wallpaper to go off-screen to the right and bottom of the screen, or centering a small image would have it offset to the right/down of where it should be.

This only happens when setting the wallpaper mid-session, upon logging in, or after killing pcmanfm-qt (causing it to be restarted by LXQt) the wallpaper is set properly.

Possible Solution
Steps to Reproduce (for bugs)
Context
System Information
  • Distribution & Version: Arch Linux
  • Kernel: 6.11.7-arch1-1
  • Qt Version: 6.8.0
  • liblxqt Version: 2.1.0
  • Package version:

Note: using a Wayland session with labwc 0.8.1, scaling set to 1.5 using kanshi and left to 1.0 in LXQt settings

@tsujan
Copy link
Member

tsujan commented Nov 15, 2024

Do you mean that, with a scaling factor of 1.5 set by kanshi, it happens only when you change the wallpaper?

or centering a small image would have it offset to the right/down of where it should be.

As if the scaling factor was 2, instead of 1.5?

@Reiddragon
Copy link
Author

Reiddragon commented Nov 15, 2024

Do you mean that, with a scaling factor of 1.5 set by kanshi, it happens only when you change the wallpaper?

yes

As if the scaling factor was 2, instead of 1.5?

also yes

@tsujan
Copy link
Member

tsujan commented Nov 15, 2024

Thanks. I'll check whether the problem is in the code — although if it was, it should have happened in the other 2 cases too.

@stefonarch
Copy link
Member

stefonarch commented Nov 15, 2024

If you restart the desktop module in "Session Settings" will the wallpaper be correct?

EDIT: answered, didn't read well. I noticed this before too.

@tsujan
Copy link
Member

tsujan commented Nov 15, 2024

I noticed this before too.

It's very strange because the same functions are called in all cases, and if they work fine at the startup, they should work fine in the middle of a session. However, I should find time and re-read the code...

@stefonarch
Copy link
Member

The same happens changing scale factor on the fly, the desktop has to be restarted afterwards to show the wallpaper correctly.
Move this issue to pcmanfm-qt?

@tsujan
Copy link
Member

tsujan commented Nov 15, 2024

Move this issue to pcmanfm-qt?

The problem can't be in pcmanfm-qt; I checked its code.

@tsujan
Copy link
Member

tsujan commented Nov 16, 2024

I think a workaround is possible. Moving the report to pcmanfm-qt's tracker....

@tsujan tsujan transferred this issue from lxqt/lxqt Nov 16, 2024
tsujan added a commit that referenced this issue Nov 16, 2024
Due to a bug in Qt, `QScreen::devicePixelRatio()` may give a rounded (ceiling?) integer on Wayland, while `QWindow::devicePixelRatio()` always gives the correct ratio.

Closes #1974

NOTE: This also works with an on-the-fly change of the scaling with kanshi.
@tsujan
Copy link
Member

tsujan commented Nov 16, 2024

The workaround is here: #1975. It passed my tests under Labwc.

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

Successfully merging a pull request may close this issue.

3 participants