Bug 374783 - Window location is not restored correctly after restart
Summary: Window location is not restored correctly after restart
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Usability-Ergonomy (show other bugs)
Version: 7.7.0
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-01-08 20:47 UTC by Bill Goodman
Modified: 2024-01-30 11:31 UTC (History)
6 users (show)

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


Attachments
Screenshots of window positions before and after restart (1.68 MB, application/zip)
2017-01-08 20:47 UTC, Bill Goodman
Details
Digikam 6.6.0-beta3 Window positioned correctly (1.22 MB, image/png)
2019-01-20 11:44 UTC, Steve Franks
Details
attachment-19346-0.html (1.46 KB, text/html)
2019-01-20 11:47 UTC, Steve Franks
Details
Video showing problem. (3.39 MB, video/mp4)
2019-03-09 10:20 UTC, hardy.public
Details
pEpkey.asc (1.75 KB, application/pgp-keys)
2020-01-12 19:09 UTC, Reinhold Graf
Details
Video of 7.3.0 Behaviour (3.13 MB, video/mp4)
2021-04-02 11:39 UTC, hardy.public
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bill Goodman 2017-01-08 20:47:38 UTC
Created attachment 103294 [details]
Screenshots of window positions before and after restart

After resizing and repositioning the main window, when digiKam is restarted, the window size is remembered correctly, but the window position is wrong.

Attached screenshots show:
   WindowLoc1.png = window position before Exit
   WindowLoc2.png = window position after restart
Comment 1 foss 2017-03-17 13:12:24 UTC
If I understand 'the problem' correctly, you want the window to be opened at the left side of the screen, right? If yes, then you can change the position where on the screen should windows be placed. Go to System settings >Window management >Window behavior >Advanced and in <Placement> choose the position. "Zero-Cornered" will open all windows on the left upper side of the screen.
Comment 2 Bill Goodman 2017-03-17 14:41:34 UTC
(In reply to devnul from comment #1)
> If I understand 'the problem' correctly, you want the window to be opened at
> the left side of the screen, right? If yes, then you can change the position
> where on the screen should windows be placed. Go to System settings >Window
> management >Window behavior >Advanced and in <Placement> choose the
> position. "Zero-Cornered" will open all windows on the left upper side of
> the screen.

I'm assuming you didn't notice this is for Windows. It is the application's responsibility to place the window correctly.
Comment 3 foss 2017-04-14 13:19:30 UTC
(In reply to Bill Goodman from comment #2)

> I'm assuming you didn't notice this is for Windows. It is the application's
> responsibility to place the window correctly.

You are right, I didn't notice it was 'Windows', too similar (there are some themes that makes plasma desktop look like Windows...). Never mind sorry.
Comment 4 caulier.gilles 2017-06-03 06:45:30 UTC
This problem is reproducible with current 5.6.0 pre release installer for Windows ?

https://drive.google.com/drive/folders/0BzeiVr-byqt5Y0tIRWVWelRJenM

Gilles Caulier
Comment 5 Bill Goodman 2017-06-03 17:31:21 UTC
(In reply to caulier.gilles from comment #4)
> This problem is reproducible with current 5.6.0 pre release installer for
> Windows ?
> 
> https://drive.google.com/drive/folders/0BzeiVr-byqt5Y0tIRWVWelRJenM

I just installed the 5.6.0 pre release and tested on Windows 7. The behavior is the same.

On launch, the size of the window is remembered correctly, but the position of the upper left corner seems to always be the same. In my case, on a 1980x1200 screen the upper left corner is always placed at [x=630, y=315].
Comment 6 caulier.gilles 2017-12-09 17:23:27 UTC
This problem still reproducible with current 5.8.0 - pre-release Windows bundle
available here :

https://files.kde.org/digikam/

Gilles Caulier
Comment 7 hardy.public 2017-12-14 11:26:03 UTC
(In reply to caulier.gilles from comment #6)
> This problem still reproducible with current 5.8.0 - pre-release Windows
> bundle
> available here :
> 
> https://files.kde.org/digikam/
> 
> Gilles Caulier

Yes, problem still exists on 12-Dec build of 5.8.0.
Comment 8 Maik Qualmann 2019-01-18 20:42:49 UTC
*** Bug 403349 has been marked as a duplicate of this bug. ***
Comment 9 Steve Franks 2019-01-20 11:39:16 UTC
Bizarrely the problem has disappeared. When I started Digikam this morning the window filled the screen.
Comment 10 Steve Franks 2019-01-20 11:44:23 UTC
Created attachment 117567 [details]
Digikam 6.6.0-beta3 Window positioned correctly

Digikam immediately after starting, after PC restarted.
Comment 11 Steve Franks 2019-01-20 11:47:08 UTC
Created attachment 117568 [details]
attachment-19346-0.html

I did search for existing bugs, but my search didn't return bug 403349.
Today the bug has disappeared, which is good but worrying, what changed
overnight?
Regards
Steve

On Fri, 18 Jan 2019 at 20:42, Maik Qualmann <bugzilla_noreply@kde.org>
wrote:

> https://bugs.kde.org/show_bug.cgi?id=374783
>
> Maik Qualmann <metzpinguin@gmail.com> changed:
>
>            What    |Removed                     |Added
>
> ----------------------------------------------------------------------------
>                  CC|                            |stevef48@gmail.com
>
> --- Comment #8 from Maik Qualmann <metzpinguin@gmail.com> ---
> *** Bug 403349 has been marked as a duplicate of this bug. ***
>
> --
> You are receiving this mail because:
> You are on the CC list for the bug.
Comment 12 caulier.gilles 2019-03-09 08:08:13 UTC
Hi all,

The problem still reproducible using current 6.1.0 pre-release installer for Windows available here :

https://files.kde.org/digikam/

Thanks in advance

Gilles Caulier
Comment 13 hardy.public 2019-03-09 10:20:51 UTC
Created attachment 118661 [details]
Video showing problem.

Unfortunately it's not fixed on Win64. There are two slightly different problems:

1) On my main Monitor 1, when the window is maximised, restoration after restart is always correct. When the window is normal, the restoration is incorrect and offset, but the behaviour is always the same and not random.

2) When the window is maximised on Monitor 2 and then restarted it restores maximised to Monitor 1.

Main Monitor 1 is on the right. Extended Monitor 2 is on the left. See attached video.
Comment 14 hardy.public 2019-03-09 10:44:49 UTC
I just checked i386 AppImage and it has a slightly different problem.

Maximised works fine.

When not maximised, the window is restored to the correct size as per OP, but bottom RH corner of digiKam is aligned with the bottom RH screen corner. In other words, it snaps to the bottom RH screen position.

The similarity between Linux and Windows is that both try to offset the window to the right. The effect is limited by Linux but not limited by Windows such that the latter goes off screen.
Comment 15 Bill Goodman 2019-03-09 22:00:53 UTC
I see no change. The problem remains.
Comment 16 Steve Franks 2019-03-10 11:25:26 UTC
I agree, the digikam window is still displayed incorrectly.
Comment 17 Maik Qualmann 2019-11-06 18:56:58 UTC
*** Bug 413884 has been marked as a duplicate of this bug. ***
Comment 18 caulier.gilles 2020-01-12 16:58:24 UTC
We have updated whole Qt to last 5.14 and KF5 to 5.65. Both are responsible of application windows positioning.

Can you reproduce the problem with digiKam 7.0.0-beta2 pre release ?

https://files.kde.org/digikam/

Thanks in advance

Gilles Caulier
Comment 19 hardy.public 2020-01-12 17:30:10 UTC
(In reply to caulier.gilles from comment #18)
> We have updated whole Qt to last 5.14 and KF5 to 5.65. Both are responsible
> of application windows positioning.
> 
> Can you reproduce the problem with digiKam 7.0.0-beta2 pre release ?
> 
> https://files.kde.org/digikam/
> 
> Thanks in advance
> 
> Gilles Caulier

Yes, the problem is still there. If the window was maximised when closed it will re-open correctly maximised. A non-maximised window's position is lost and another position is used although this other position is always the same, not random.
Comment 20 Reinhold Graf 2020-01-12 19:09:10 UTC
Created attachment 125069 [details]
pEpkey.asc

   Hi,

   tested it with the latest beta - digiKam 7.0.0-beta2.

   I see still the same behaviour.

   Steps to reproduce:

     * Open application

     * Move application window to where you want it to be

     * Close application

     * Open application

     * Application starts again in the lower right quadrantof the screen
       (left upper corner of application is in screen center), but not
       where is was placed before


   Hope this helps
   Reinhold



   Am 12.01.2020 um 18:30 schrieb bugzilla_noreply@kde.org[1]:

     https://bugs.kde.org/show_bug.cgi?id=374783          
     --- Comment #19 from      hardy.public@gmail.com [2]      ---
     (In reply to caulier.gilles from comment #18)

       We have updated whole Qt to last 5.14 and KF5 to 5.65. Both are responsible
       of application windows positioning.
       
       Can you reproduce the problem with digiKam 7.0.0-beta2 pre release ?
              https://files.kde.org/digikam/       
       Thanks in advance
       
       Gilles Caulier

     Yes, the problem is still there. If the window was maximised when closed it
     will re-open correctly maximised. A non-maximised window's position is lost and
     another position is used although this other position is always the same, not
     random.
   

   

   1. mailto:bugzilla_noreply@kde.org
   2. mailto:hardy.public@gmail.com
Comment 21 Bill Goodman 2020-01-13 02:23:23 UTC
I really think this is a digiKam bug.

On Linux, the windowing system is responsible for positioning windows, but that is not the case with Windows. In Windows, it is the application's responsibility to remember and set the window position.

If digiKam doesn't remember and set the position, it will probably not be restored properly. At least this is my experience as a Windows software developer.
Comment 22 caulier.gilles 2020-08-22 10:48:08 UTC
See point #1

https://www.reddit.com/r/kde/comments/iecm0s/this_week_in_kde_better_samba_sharing_and/

unfortunately, this improvement only concern the Linux version of KF5 API used by digiKam. Why the Windows port do not take a consideration from developers, as we have more and more KDE application available on Microspft store.

Gilles Caulier
Comment 23 Christoph Feck 2020-08-22 10:53:12 UTC
Remember that the developer who added the feature to remember window positions does not use a Windows system. If you know of a developer that knows Windows development internals, the feature can be extended.
Comment 24 caulier.gilles 2020-08-22 10:57:01 UTC
To all in this room, 

This is the original report from KF5:KXmlGui framework used by digiKam, where the improvements have been introduced about main window positions:

https://bugs.kde.org/show_bug.cgi?id=415150

Look like it's a report for Linux. I recommend to comment on this file about the Windows support...

Thanks in advance

Gilles Caulier
Comment 25 Maik Qualmann 2020-08-22 11:00:55 UTC
I think it will fix the problem in Windows too.

Maik
Comment 26 caulier.gilles 2020-08-22 11:03:04 UTC
We will see with KF5 5.74 where this fix have been introduced...

Gilles
Comment 27 caulier.gilles 2020-08-22 11:05:27 UTC
KF5 5.74 will be certainly released in September. One month, one release...

Gilles Caulier
Comment 28 caulier.gilles 2020-09-06 12:57:14 UTC
KF5.74 framework will be release next saturday...
Comment 29 caulier.gilles 2020-09-12 12:19:27 UTC
KF5 5.74 is out with these fixes:

* Allow opting out of remembering window positions on X11 (bug 415150)
* Save and restore position of main window (bug 415150)

Gilles Caulier
Comment 30 caulier.gilles 2020-09-12 12:28:56 UTC
Git commit 77d9a8a3432737d20774c3ec08129d68da6aad3d by Gilles Caulier.
Committed on 12/09/2020 at 12:27.
Pushed by cgilles into branch 'master'.

All bundles: update KF5 framework to last stable 5.74
Related: bug 413884
FIXED-IN: 7.2.0

M  +5    -1    NEWS
M  +3    -3    project/bundles/3rdparty/ext_kf5_frameworks/CMakeLists.txt
M  +1    -1    project/bundles/3rdparty/ext_libksane/CMakeLists.txt
M  +1    -1    project/bundles/3rdparty/ext_marble/CMakeLists.txt

https://invent.kde.org/graphics/digikam/commit/77d9a8a3432737d20774c3ec08129d68da6aad3d
Comment 31 hardy.public 2021-04-02 08:56:01 UTC
This isn't fixed as far as I can tell.
Comment 32 caulier.gilles 2021-04-02 08:58:57 UTC
Please test with current digiKam pre-lease 7.3.0 which is based on KF5 framework 5.80 :

https://files.kde.org/digikam/

Thanks in advance

Gilles Caulier
Comment 33 Reinhold Graf 2021-04-02 09:32:57 UTC
First test with V 7.3.0 done and ... it seems to work now :)
Thank you!
Reinhold
Comment 34 caulier.gilles 2021-04-02 09:36:19 UTC
Ah great. I close this file now. Don't hesitate to re-open if necessary.

Gilles Caulier
Comment 35 hardy.public 2021-04-02 10:57:37 UTC
This seems to be much improved in the 7.3.0 pre-release, thank you, but it's not 100% robust. However this time I know how to to trigger the faulty behaviour.

A non-maximised window is now remembered correctly if I allow the Find New Items to complete which is approx 15s in my case because my collections are on a NAS. However if I close DK before Find New Items has completed then the non-maximised window position is overwritten by the default position.

The default position can be described as displacing the top left corner of DK 640 pixels horizontally and 250 pixels vertically from the top left corner of the screen.

So it looks like the non-max window position is wiped if Find New Items does not complete or some other similar timer has elapsed or some other condition not met. Admittedly the quick closing of DK soon after opening it is unusual but still possible.

At your invitation Gilles, I reopen the ticket.
Comment 36 hardy.public 2021-04-02 11:39:50 UTC
Created attachment 137265 [details]
Video of 7.3.0 Behaviour

I attach a video of 5 restarts where I do not allow Find New Items to complete or 15s to elapse. The video starts maximised.

Restart 1 (6s): Window is restored maximised. Window is then adjusted non-maximised.

Restart 2 (20s): NOK, window defaults to position 640H x 250V. Window is then re-adjusted non-maximised.

Restart 3 (33s) : NOK. Window is restored to the position re-adjusted after Restart 1 position not the expected re-adjusted position after Restart 2.

Restart 4 (43s) : NOK, window defaults to position 640H x 250V. Window is just closed.

Restart 5 (53s) : NOK, window defaults to position 640H x 250V.
Comment 37 caulier.gilles 2022-01-13 07:52:25 UTC
Hi all in this room and happy new year,

With the current 7.5.0 pre-release Windows installer, we updated again the KF5 library in charge of save and restore windows size between session.
We use now the frameworks KF5 5.89 stable version.

As usual, a Windows installer including this change is available to test here :

https://files.kde.org/digikam/

Please, check if problem remain.

Thanks in advance

Gilles Caulier
Comment 38 hardy.public 2022-01-16 18:20:03 UTC
(In reply to caulier.gilles from comment #37)
> Hi all in this room and happy new year,
> 
> With the current 7.5.0 pre-release Windows installer, we updated again the
> KF5 library in charge of save and restore windows size between session.
> We use now the frameworks KF5 5.89 stable version.
> 
> As usual, a Windows installer including this change is available to test
> here :
> 
> https://files.kde.org/digikam/
> 
> Please, check if problem remain.
> 
> Thanks in advance
> 
> Gilles Caulier

Yes, the problem remains.
Maximised windows seems to always maximise albeit sometimes on the wrong monitor.
Non-maximised windows are still random.
Comment 39 Steve Franks 2022-04-09 18:30:00 UTC
This happened today with 7.7.0
Comment 40 Maik Qualmann 2022-12-25 15:20:28 UTC
Git commit 413dbe28f7431d7b26059685a352d76c3aab01d2 by Maik Qualmann.
Committed on 25/12/2022 at 15:12.
Pushed by mqualmann into branch 'master'.

fix default dialog size if config is broken
Related: bug 407468
FIXED-IN: 8.0.0

M  +1    -1    NEWS
M  +4    -29   core/libs/dplugins/widgets/dplugindialog.cpp
M  +11   -0    core/libs/widgets/mainview/dxmlguiwindow.cpp
M  +1    -0    core/libs/widgets/mainview/dxmlguiwindow.h
M  +4    -0    core/libs/widgets/mainview/dxmlguiwindow_p.h
M  +4    -29   core/showfoto/setup/showfotosetup.cpp
M  +4    -29   core/utilities/setup/setup.cpp

https://invent.kde.org/graphics/digikam/commit/413dbe28f7431d7b26059685a352d76c3aab01d2
Comment 41 hardy.public 2024-01-30 11:31:50 UTC
I don't think this is fixed. The original bug text is still valid:

"After resizing and repositioning the main window, when digiKam is restarted, the window size is remembered correctly, but the window position is wrong."

The issue is masked beause DK always opens maximised on the correct screen. I can't remember if it always did this. Regardless, clicking 'Restore Down' restores only the size correctly, not the position.