Bug 481852 - qt QScreen::availiableSize will return fullscreen size
Summary: qt QScreen::availiableSize will return fullscreen size
Status: RESOLVED UPSTREAM
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (show other bugs)
Version: unspecified
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-02-26 09:59 UTC by uniqueding
Modified: 2024-02-28 16:48 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description uniqueding 2024-02-26 09:59:34 UTC
SUMMARY
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***
QScreen::availiableSize api on x11 environment will return rect without dock, but on wayland environment will return fullscreen size

STEPS TO REPRODUCE
use QScreen::availiableSize to get screen availiable size

OBSERVED RESULT
show fullscreen size with dock region

EXPECTED RESULT
show region except such as dock panel

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 5.27.10
(available in About System)
KDE Plasma Version: 5.27.10
KDE Frameworks Version: 
Qt Version: 5.12

ADDITIONAL INFORMATION
Comment 1 Vlad Zahorodnii 2024-02-27 12:43:53 UTC
Can you explain why you need that information?
Comment 2 Nate Graham 2024-02-27 18:32:45 UTC
Regardless, since this is Qt API, isn't this a Qt bug?
Comment 3 uniqueding 2024-02-28 02:19:03 UTC
(In reply to Vlad Zahorodnii from comment #1)
> Can you explain why you need that information?

I want my window to not extend onto the dock, so I want get availiableSize to limit my window geometry like x11
Comment 4 uniqueding 2024-02-28 02:23:26 UTC
(In reply to Nate Graham from comment #2)
> Regardless, since this is Qt API, isn't this a Qt bug?

Although this is a Qt API, there is no related protocol on Wayland to pass this geometry.
Comment 5 Vlad Zahorodnii 2024-02-28 08:36:56 UTC
(In reply to uniqueding from comment #3)
> (In reply to Vlad Zahorodnii from comment #1)
> > Can you explain why you need that information?
> 
> I want my window to not extend onto the dock, so I want get availiableSize
> to limit my window geometry like x11

It works slightly different on wayland. There's xdg_toplevel.configure_bounds https://wayland.app/protocols/xdg-shell#xdg_toplevel:event:configure_bounds

kwin and qt support it. although I believe they are available only in plasma 6.
Comment 6 Vlad Zahorodnii 2024-02-28 08:37:32 UTC
note that qt will take care of honoring xdg_toplevel.configure_bounds
Comment 7 David Edmundson 2024-02-28 12:26:28 UTC
To rephrase Vlad's comment, it means the window will be resized automatically, but you don't get this ahead of time in a useful way.

It's a broken design, but we're limited within the scope of Wayland. Anything else needs to be taken up on the wayland-protocols repository.