zeroxoneafour / polonium

Autotile manager for Plasma 6
https://zeroxoneafour.github.io/polonium/
MIT License
846 stars 21 forks source link

[Bug]: The maximized window remembers its state and it causes a problem. #102

Open yoonsangmin opened 5 months ago

yoonsangmin commented 5 months ago

Before you make the issue, confirm that

Describe the bug

Most KDE apps remember the maximized state. If you close the app while it's maximized, when you reopen it, it will tile in a maximized state. If you unmaximize it in that state, empty space appears in the tiled area. Even if you maximize it again, it stays tiled in the maximized state. The only solution is to either drag the window or use a shortcut to make it a floating window.

To reproduce

Close the window after maximizing it, and then reopen the application. Unmaximize the maximized window.

Expected behavior

A tiled window always opens in an unmaximized state, or if you cannot unmaximize it, a maximized window should avoid tiling.

Relevant log output

1월 14 20:57:11 archlinux kwin_wayland[15646]: qml: Polonium DBG: Adding and tiling org.kde.dolphin
 1월 14 20:57:11 archlinux kwin_wayland[15646]: qml: Polonium DBG: Adding org.kde.dolphin to desktop (0, d23c85aa-df6c-4815-92d8-aaa7d3d5ace9, 1)
 1월 14 20:57:11 archlinux kwin_wayland[15646]: qml: Polonium DBG: Building layout for desktop (0, d23c85aa-df6c-4815-92d8-aaa7d3d5ace9, 1)
 1월 14 20:57:11 archlinux kwin_wayland[15646]: qml: Polonium DBG: Placing clients for desktop (0, d23c85aa-df6c-4815-92d8-aaa7d3d5ace9, 1)
 1월 14 20:57:14 archlinux kwin_wayland[15646]: qml: Polonium DBG: Desktop, screen, or activity changed on org.kde.dolphin
 1월 14 20:57:14 archlinux kwin_wayland[15646]: qml: Polonium DBG: Updating desktop for client org.kde.dolphin
 1월 14 20:57:14 archlinux kwin_wayland[15646]: qml: Polonium DBG: Building layout for desktop (0, d23c85aa-df6c-4815-92d8-aaa7d3d5ace9, 1)
 1월 14 20:57:14 archlinux kwin_wayland[15646]: qml: Polonium DBG: Placing clients for desktop (0, d23c85aa-df6c-4815-92d8-aaa7d3d5ace9, 1)
 1월 14 20:57:14 archlinux kwin_wayland[15646]: qml: Polonium DBG: Maximize mode on org.kde.dolphin was changed to true
 1월 14 20:57:14 archlinux kwin_wayland[15646]: qml: Polonium DBG: Removing org.kde.dolphin from desktop (0, d23c85aa-df6c-4815-92d8-aaa7d3d5ace9, 1)
 1월 14 20:57:14 archlinux kwin_wayland[15646]: qml: Polonium DBG: Building layout for desktop (0, d23c85aa-df6c-4815-92d8-aaa7d3d5ace9, 1)
 1월 14 20:57:14 archlinux kwin_wayland[15646]: qml: Polonium DBG: Placing clients for desktop (0, d23c85aa-df6c-4815-92d8-aaa7d3d5ace9, 1)
 1월 14 20:57:17 archlinux kwin_wayland[15646]: qml: Polonium DBG: org.kde.dolphin was removed
 1월 14 20:57:17 archlinux kwin_wayland[15646]: qml: Polonium DBG: Removing org.kde.dolphin from desktop (0, d23c85aa-df6c-4815-92d8-aaa7d3d5ace9, 1)
 1월 14 20:57:17 archlinux kwin_wayland[15646]: qml: Polonium ERR: Client not found
 1월 14 20:57:17 archlinux kwin_wayland[15646]: qml: Polonium DBG: Building layout for desktop (0, d23c85aa-df6c-4815-92d8-aaa7d3d5ace9, 1)
 1월 14 20:57:17 archlinux kwin_wayland[15646]: qml: Polonium DBG: Placing clients for desktop (0, d23c85aa-df6c-4815-92d8-aaa7d3d5ace9, 1)
 1월 14 20:57:19 archlinux kwin_wayland[15646]: qml: Polonium DBG: Adding and tiling org.kde.dolphin
 1월 14 20:57:19 archlinux kwin_wayland[15646]: qml: Polonium DBG: Adding org.kde.dolphin to desktop (0, d23c85aa-df6c-4815-92d8-aaa7d3d5ace9, 1)
 1월 14 20:57:19 archlinux kwin_wayland[15646]: qml: Polonium DBG: Building layout for desktop (0, d23c85aa-df6c-4815-92d8-aaa7d3d5ace9, 1)
 1월 14 20:57:19 archlinux kwin_wayland[15646]: qml: Polonium DBG: Placing clients for desktop (0, d23c85aa-df6c-4815-92d8-aaa7d3d5ace9, 1)
 1월 14 20:57:22 archlinux kwin_wayland[15646]: qml: Polonium DBG: Desktop, screen, or activity changed on org.kde.dolphin
 1월 14 20:57:22 archlinux kwin_wayland[15646]: qml: Polonium DBG: Updating desktop for client org.kde.dolphin
 1월 14 20:57:22 archlinux kwin_wayland[15646]: qml: Polonium DBG: Building layout for desktop (0, d23c85aa-df6c-4815-92d8-aaa7d3d5ace9, 1)
 1월 14 20:57:22 archlinux kwin_wayland[15646]: qml: Polonium DBG: Placing clients for desktop (0, d23c85aa-df6c-4815-92d8-aaa7d3d5ace9, 1)
 1월 14 20:57:22 archlinux kwin_wayland[15646]: qml: Polonium DBG: Maximize mode on org.kde.dolphin was changed to false
 1월 14 20:57:22 archlinux kwin_wayland[15646]: qml: Polonium DBG: Placing org.kde.dolphin in QRectF(960, 0, 960, 1080) with direction (below, right, horizontal)
 1월 14 20:57:22 archlinux kwin_wayland[15646]: qml: Polonium DBG: Building layout for desktop (0, d23c85aa-df6c-4815-92d8-aaa7d3d5ace9, 1)
 1월 14 20:57:22 archlinux kwin_wayland[15646]: qml: Polonium DBG: Placing clients for desktop (0, d23c85aa-df6c-4815-92d8-aaa7d3d5ace9, 1)
 1월 14 20:57:28 archlinux kwin_wayland[15646]: qml: Polonium DBG: Desktop, screen, or activity changed on org.kde.dolphin
 1월 14 20:57:28 archlinux kwin_wayland[15646]: qml: Polonium DBG: Updating desktop for client org.kde.dolphin
 1월 14 20:57:28 archlinux kwin_wayland[15646]: qml: Polonium DBG: Building layout for desktop (0, d23c85aa-df6c-4815-92d8-aaa7d3d5ace9, 1)
 1월 14 20:57:28 archlinux kwin_wayland[15646]: qml: Polonium DBG: Placing clients for desktop (0, d23c85aa-df6c-4815-92d8-aaa7d3d5ace9, 1)
 1월 14 20:57:28 archlinux kwin_wayland[15646]: qml: Polonium DBG: Maximize mode on org.kde.dolphin was changed to true
 1월 14 20:57:28 archlinux kwin_wayland[15646]: qml: Polonium DBG: Removing org.kde.dolphin from desktop (0, d23c85aa-df6c-4815-92d8-aaa7d3d5ace9, 1)
 1월 14 20:57:28 archlinux kwin_wayland[15646]: qml: Polonium DBG: Building layout for desktop (0, d23c85aa-df6c-4815-92d8-aaa7d3d5ace9, 1)
 1월 14 20:57:28 archlinux kwin_wayland[15646]: qml: Polonium DBG: Placing clients for desktop (0, d23c85aa-df6c-4815-92d8-aaa7d3d5ace9, 1)
 1월 14 20:57:30 archlinux kwin_wayland[15646]: qml: Polonium DBG: Maximize mode on org.kde.dolphin was changed to false
 1월 14 20:57:30 archlinux kwin_wayland[15646]: qml: Polonium DBG: Placing org.kde.dolphin in QRectF(960, 0, 960, 1080) with direction (below, right, horizontal)
 1월 14 20:57:30 archlinux kwin_wayland[15646]: qml: Polonium DBG: Building layout for desktop (0, d23c85aa-df6c-4815-92d8-aaa7d3d5ace9, 1)
 1월 14 20:57:30 archlinux kwin_wayland[15646]: qml: Polonium DBG: Placing clients for desktop (0, d23c85aa-df6c-4815-92d8-aaa7d3d5ace9, 1)
 1월 14 20:57:33 archlinux kwin_wayland[15646]: qml: Polonium DBG: org.kde.dolphin was removed
 1월 14 20:57:33 archlinux kwin_wayland[15646]: qml: Polonium DBG: Removing org.kde.dolphin from desktop (0, d23c85aa-df6c-4815-92d8-aaa7d3d5ace9, 1)
 1월 14 20:57:33 archlinux kwin_wayland[15646]: qml: Polonium DBG: Building layout for desktop (0, d23c85aa-df6c-4815-92d8-aaa7d3d5ace9, 1)
 1월 14 20:57:33 archlinux kwin_wayland[15646]: qml: Polonium DBG: Placing clients for desktop (0, d23c85aa-df6c-4815-92d8-aaa7d3d5ace9, 1)

Screenshots and videos

https://github.com/zeroxoneafour/polonium/assets/26238363/0a323e84-dda6-4820-b890-130574cee450

Additional context

No response

yoonsangmin commented 5 months ago

I just found out that there is a latest version in the action. I confirmed that the issue of creating empty space is not present in the latest version. However, it still remembers the maximized state, and when reopened, it tiles in the maximized state.

It would be good if the application, when opened in a maximized state, does not tile, and stays maximized, or the application automatically unmaximizes when tiled.

FantasyPvP commented 3 months ago

can confirm I'm getting this behaviour too as of the latest commit

zeroxoneafour commented 3 months ago

I recommend adding a window rule to KWin that sets the maximized state to false for new windows. KWin doesn't actually have a property for whether a window is maximized or not, so it's hard to tell if a window is maximized when added.

yoonsangmin commented 1 month ago

@zeroxoneafour Thank you. I think it will be great to add that window rule automatically by Polonium.

Should I close this issue?