SUMMARY The windows position is reset to (0,0) in the state file in 9.0.0. STEPS TO REPRODUCE 1. Launch Digikam 9.0.0 from AppImage (either as-is, or extracted). 2. The main window behaves normally, that I can move or resize. 3. Exit the application. It creates a `digikamstaterc` file in the XDG state folder, where the XPosition and YPosition of all the sections are set to 0. 4. Launch Digikam again. OBSERVED RESULT The main window is moved to the top-left corner of the screen, with the title bar hidden above the screen, so I am unable to move the window by dragging the title bar. Manually changing the positions in the state file does not work. Removing the state file will make the window display normally (before it creates the state file again). EXPECTED RESULT The window is positioned at the same place before exitting. SOFTWARE/OS VERSIONS Linux/KDE Plasma: Debian Sid. KDE Plasma Version: None, I am using `ctwm` instead of a DE. KDE Frameworks Version: 6.20.0 Qt Version: 6.10.1 ADDITIONAL INFORMATION The issue does not happen in 8.8.0; it saves and restores the position normally. When launching 9.0.0 with a 8.8.0 state file, it is ignored and the window is set to the top-left corner.
The digikamstaterc file is not written directly by us; the KDE framework handles this in the background. Note that under Wayland, it's not possible for us to read or set the window position. This is a silly security feature that the Wayland developers think is cool. Under Wayland, we always get 0,0 as the position, regardless of where the user has moved the window. It's the window manager's job to center the application window on startup, for example, and it should have the necessary permissions to do so. Incidentally, the AppImage works perfectly fine under KWin with Wayland. Maik
Take a look at this KDE discussion. As I said, the Wayland Compositor must have this functionality. https://discuss.kde.org/t/wayland-remembering-window-position-size-and-location/27775/27 Use a compatible Wayland compositor. Maik
(In reply to Maik Qualmann from comment #1) > The digikamstaterc file is not written directly by us; the KDE framework > handles this in the background. > > Note that under Wayland, it's not possible for us to read or set the window > position. This is a silly security feature that the Wayland developers think > is cool. Under Wayland, we always get 0,0 as the position, regardless of > where the user has moved the window. > > It's the window manager's job to center the application window on startup, > for example, and it should have the necessary permissions to do so. > Incidentally, the AppImage works perfectly fine under KWin with Wayland. > > Maik I am not running it under Wayland. I am running it in plain X11 with a minimal WM (ctwm).
Here, the window position is saved in the digicamstaterc file using the digiKam AppImage. Maik
I confirm that it work also perfectly here under Plasma desktop.
(In reply to Maik Qualmann from comment #4) > Here, the window position is saved in the digicamstaterc file using the > digiKam AppImage. > > Maik Well, the position is saved in i3wm as well. I guess that version 9.0 used some new API that breaks compatibility with old/minimal WMs. Maybe Digikam can detect such environments (where it can't read the location) and do not attempt to create the state file to save/restore the window location (as the window works normally if the state file is deleted). Maybe add an option to disable it manually. I currently add a command to detele the state file in the AppRun script as a workaround, but I still hope that the detection can be added. Thanks.