Bug 470010 - Flatpak windows not maximized via "Placement=Maximizing"
Summary: Flatpak windows not maximized via "Placement=Maximizing"
Status: RESOLVED WORKSFORME
Alias: None
Product: kwin
Classification: Plasma
Component: general (show other bugs)
Version: 5.27.4
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-05-19 16:49 UTC by Plata
Modified: 2023-12-12 16:43 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Plata 2023-05-19 16:49:53 UTC
SUMMARY
The windows use the complete screen but are not maximized.


STEPS TO REPRODUCE
1. Add "Placement=Maximizing" in [Windows] section of kwinrc.
2. Reboot.
3. Open "native" app.
4. Open Flatpak app.

OBSERVED RESULT
The "native" app is maximized, the Flatpak app uses the complete screen but is not maximized. In combination with "BorderlessMaximizedWindows=true", this is more obvious because the Flatpak app still shows a border.

EXPECTED RESULT
"Native" and Flatpak apps behave the same.

SOFTWARE/OS VERSIONS
KDE Plasma Version: 5.27.4
KDE Frameworks Version: 5.105.0
Qt Version: 5.15.9

ADDITIONAL INFORMATION
Tested on Plasma Mobile. I only noticed it because the panels stayed transparent with the Flatpak app.
Comment 1 Nate Graham 2023-05-19 20:28:22 UTC
I suspect this is strongly related to Bug 469959, and fixing one may even fix the other.
Comment 2 Nate Graham 2023-05-22 18:51:33 UTC
This is on Wayland, right?
Comment 3 Plata 2023-05-22 19:08:41 UTC
Yes.
Comment 4 Nate Graham 2023-05-23 16:24:55 UTC
Just tried on X11 in Plasma 6, and it worked as expected for the Flatpak of Welcome Center that I had lying around, which I know does not do any window geometry saving/restoring.

What app are you testing with?

Does it happen on X11 too, or only Wayland?
Comment 5 Plata 2023-05-26 11:27:04 UTC
Tested again: it doesn't depend on Flatpak.

I initially thought that some apps (e.g. native Dolphin and Gwenview) were maximized correctly. However, that wasn't really the case. They had only saved their previous maximized state and opened maximized because of that. After resizing them, they show the same behavior as all other apps. I didn't realize this initially because I couldn't resize the apps on Plasma Mobile.

After switching back and forth between  Plasma (Wayland), Plasma (X11) and Plasma Mobile (Wayland), I cannot reproduce the behavior anymore. I have no explanation what might have changed.
Comment 6 Nate Graham 2023-05-26 13:27:11 UTC
Aha, I know what this is: Bug 437089.

It can either be fixed in every app to save its window state as "Maximized" rather than just saving its geometry, or it can be fixed in KWin to do the same thing on Wayland that it does on X11, which is to assume that when an app saves a window size that's identical to the screen geometry, this means "Maximized" and just automatically apply the Maximized state.

*** This bug has been marked as a duplicate of bug 437089 ***
Comment 7 Nate Graham 2023-12-12 16:43:07 UTC
Unfortunately I mis-triaged this bug report, and sadly these are all app-specific issues. The problem is that some apps, when they maximize themselves, they also inappropriately save the new size they have in their maximized state. As a result, when you quit and re-launch such apps, one of the following things happens:
- The window open in a non-maximized state with a window size equal to what it *would* have when maximized
- The window opens in a maximized state, but when you de-maximize it, it doesn't change its size at all

See Bug 478442 for an example affecting System Monitor.

So I'm afraid we need a bug report for each individual KDE app that's affected. And for non-KDE apps that are affected, they'll need their own bug reports too.