Bug 414117

Summary: Full screen cannot close Image Editor by clicking Close Editor
Product: [Applications] digikam Reporter: Geoff King <gsking1>
Component: Usability-FullScreenAssignee: Digikam Developers <digikam-bugs-null>
Status: CONFIRMED ---    
Severity: normal CC: caulier.gilles, donb.hussey, ivan.maio.a, jo.y.venn, metzpinguin, queenbee4ever
Priority: NOR    
Version: 8.2.0   
Target Milestone: ---   
Platform: macOS (DMG)   
OS: macOS   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: transparent window after closing

Description Geoff King 2019-11-13 23:50:26 UTC
I am having issues with the 6.4 on Mac Mojave when switching to "Full-Screen" mode. If once in full-screen AND enter another feature such as Image Editor, it can be hard to get back to thumbnail view.  It is not clear how to close the Image Editor because clicking the Close Editor so does not bring you back to the Thumbnail view.   

STEPS TO REPRODUCE
1. Within Normal Thumbnail view, click Full Screen.  App enters full-screen as expected.
2. Select an image and click Image Editor.  This is okay.  This is where different closing options have different outcomes. 
3A. Click Exit Full Screen - This outcome gives you back the two windows in a tabbed interface.  You can then close the tab for Image Editor -- This works okay. So option 3A is the workaround. 
3B.  This is where the issues are.  From the Full-screen of step 2.  Click Close Editor button.
4. This closes full-screen but gives you only one Image Editor Window.  The Thumbnail view is not found.  
5. Click Close Editor and nothing happens. 
6. Click the close button on the window and Digikam Closes.  
So by following path 3B, it is not easy to get back to the Thumbnail view without restarting the program. 

So to recap, there is something going wrong about step 3B when clicking Close Editor.  Doing so doesn't work and doesn't bring you back to the Thumbnail view.  

This also affects the BQM and Light Table

SOFTWARE/OS VERSIONS
macOS: Mojave
Comment 1 Maik Qualmann 2019-11-14 07:11:45 UTC
Git commit 4f4e17d18c8ef561677cfc39e749634a879b4880 by Maik Qualmann.
Committed on 14/11/2019 at 07:10.
Pushed by mqualmann into branch 'master'.

add process events after closing fullscreen
The problem is not to reproduce on Linux or Windows.

M  +3    -0    core/libs/widgets/mainview/dxmlguiwindow.cpp

https://invent.kde.org/kde/digikam/commit/4f4e17d18c8ef561677cfc39e749634a879b4880
Comment 2 Maik Qualmann 2019-11-19 08:19:57 UTC
New packages are available. Is there an improvement when closing the Image Editor in fullscreen mode?

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

Maik
Comment 3 Geoff King 2019-11-20 22:27:15 UTC
Didn't help.  
Now after clicking Close Editor in Step #3B it results in #4 coming out of full-screen and all of the window is transparent except for the top tab and the editor operation on the right side.  see screenshot
Comment 4 Geoff King 2019-11-20 22:30:34 UTC
Created attachment 124036 [details]
transparent window after closing
Comment 5 caulier.gilles 2020-01-19 12:10:25 UTC
This is reproducible using current digiKam 7.0.0-beta2 pre-release AppImage based on Qt5.14 and KF5 5.56 ?

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

Gilles Caulier
Comment 6 Geoff King 2020-01-20 19:09:01 UTC
Hi . Yes I'm still having problems with this. It is difficult to work in Full-Screen mode when going into and out of Image Editor.

Trying this with the latest package "digiKam-7.0.0-beta2-20200120T075420-MacOS-x86-64"
I have not seen the transparent window with this version, but I still do get stuck in the image editor and cannot intuitively close it.

How to get out of Full-Screen Image Editor un-successfully: From Image Editor, click the Close Editor button.  The window minimizes, but stays on the image editor and the Close Editor button does nothing.  Then must close Digikam since no other options work. Similar scenario if click the large tab at the top right that corresponds do the Image Editor.  If click the large tab at the top left that corresponds do the Thumbnail view, then all Digikam quits. 

The only way to get out of Full-Screen Image Editor successfully is to first close full-screen:  From Image Editor, Exit Fullscreen button,  Close Editor Button.
Comment 7 queenbee4ever 2020-02-26 16:48:05 UTC
I'm having the same issue with DigiKam 6.4.0 on MacBook Air Catalina 10.15.3
Comment 8 caulier.gilles 2020-08-01 08:10:05 UTC
digiKam 7.0.0 stable release is now published:

https://www.digikam.org/news/2020-07-19-7.0.0_release_announcement/

We need a fresh feedback on this file using this version.

Thanks in advance

Gilles Caulier
Comment 9 Geoff King 2020-08-02 15:14:29 UTC
Hello. Tested on macOS Catalina 10.15.6 and Digikam 7.0.0.  
This is the same as originally reported.  
Maybe one minor difference is that to close I had to go to the Dock and right click to close it once it became unresponsive.  
Thanks, G
Comment 10 Maik Qualmann 2020-08-13 15:29:03 UTC
*** Bug 425304 has been marked as a duplicate of this bug. ***
Comment 11 caulier.gilles 2020-12-18 11:52:14 UTC
Hi,

digiKam 7.2.0-beta2 pre-release PKG installer now support BigSur and is compiled with last stable Qt 5.15.2.

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

Problem still reproducible with this version.

Thanks and happy Christmas in advance

Best Regards

Gilles Caulier
Comment 12 Geoff King 2020-12-19 16:27:35 UTC
I've tried this on digiKam-7.2.0-beta2-20201219T112949-MacOS-x86-64 on Catalina 10.15.7. 

I can still get to a point where I cannot close the editor easily.  It seems that something has improved and can explain the problem better below.  

I think there were also complications related to using an external monitor and my inexperience using Apples' Mission Control, which I'm learning better now.  

To hone in on the issue further 
1 - start digikam
3 - click Image Editor, and load selected image. 
4 - Maximize Image Editor using Apple Green maximize button. note I'm using multi-monitor and this image is on the second monitor as I like it. 
5 - click Close Editor from Full Screen Image Editor.  The Image Editor then returns back to normal image windowed size, rather than closing [should have closed].  Additionally, the Exit Full Screen button and Close Editor buttons are both inoperable and do nothing when clicked, but the Close Editor button is highlighted like it is selected. The Exit Full Screen button should not be shown at this point since it returned to windowed size. 
6 - I can exit from this inoperable state by reloading the image from the Thumbnail screen.  Once that is reloaded, the Close Editor button works and the Exit Full Screen button vanishes [as expected]. 

Thoughts/Solutions:
- There is something going wrong when clicking the Close Editor button when in Full Screen.  it comes out of full screen and becomes windowed, but still thinks it's full screen. 
- Do not show "Close Editor" button when in full screen mode.  Enforce that full screen is exited before closing editor.  

Hope that helps you understand the issue better.   

Thanks and Merry Christmas to you also. 
Regards, Geoff
Comment 13 caulier.gilles 2022-01-13 16:11:42 UTC
This dysfunction is fully reproducible under MacOS, but not under Linux. In fact with Linux the behavior is right : the editor is not open in full screen if album view is already in full screen.

Why the Editor view inherit of full screen properties ?

Gilles Caulier
Comment 14 caulier.gilles 2022-01-13 16:14:03 UTC
This dysfunction only occurs under MacOS. Windows is not affected and work as under Linux.

Gilles
Comment 15 caulier.gilles 2022-01-13 16:22:24 UTC
This dysfunction under MacOS is also reproducible with Light Table as with Image Editor.

Gilles Caulier
Comment 16 caulier.gilles 2022-01-14 08:52:00 UTC
Hi Maik,

After investiguations, i conclude to the fact that the problem is located in KF5 framework as the code is called here :

https://invent.kde.org/graphics/digikam/-/blob/master/core/libs/widgets/mainview/dxmlguiwindow_fullscreen.cpp#L71

The rest of the code in digiKam core allow to customized the widgets visibility while full-screen.

Gilles
Comment 17 caulier.gilles 2022-01-14 09:01:45 UTC
Code in KF5 framework is this one :

https://invent.kde.org/frameworks/kwidgetsaddons/-/blob/master/src/ktogglefullscreenaction.cpp#L111

We call directly in digiKam a static method : setFullScreen().

Gilles
Comment 18 Maik Qualmann 2022-01-14 09:02:02 UTC
I also read the problem on Qt-Bugs a long time ago, I'm trying to find it again. So off the top of my head, the problem on MacOS is that Qt opens a second window that we have no control over and doesn't close correctly.

Maik
Comment 19 Maik Qualmann 2022-01-14 09:04:13 UTC
Closed for Qt-6.2.0-Beta4

https://bugreports.qt.io/browse/QTBUG-46701

Maik
Comment 20 caulier.gilles 2022-01-14 09:09:34 UTC
Perhaps this rule is necessary under MacOS :

https://stackoverflow.com/a/26320013

Gilles
Comment 21 caulier.gilles 2022-01-14 09:10:50 UTC
Oh, yes, it's a Qt bug :

https://bugreports.qt.io/browse/QTBUG-52450

Gilles
Comment 22 Maik Qualmann 2022-01-14 09:16:23 UTC
It's possible that the trick of setting the parent to a null pointer will help as a workaround.

Maik
Comment 23 caulier.gilles 2022-01-14 09:17:42 UTC
Ok, i will take a look this morning.

Gilles
Comment 24 caulier.gilles 2022-01-14 09:36:01 UTC
Git commit f605782bb4ba3b674b319dbd82ffd8e18c604903 by Gilles Caulier.
Committed on 14/01/2022 at 09:27.
Pushed by cgilles into branch 'master'.

First try to work around Qt bug https://bugreports.qt.io/browse/QTBUG-52450

M  +22   -0    core/libs/widgets/mainview/dxmlguiwindow_fullscreen.cpp
M  +6    -0    core/libs/widgets/mainview/dxmlguiwindow_p.h

https://invent.kde.org/graphics/digikam/commit/f605782bb4ba3b674b319dbd82ffd8e18c604903
Comment 25 caulier.gilles 2022-01-14 12:07:01 UTC
No. This do not fix the problem.

The problem is also reproducible with this way :

1/ Open digiKam. Do not switch Album view to full screen mode.
2/ Open one item in editor.
3/ switch editor to full screen mode
4/ switch editor to normal mode.

Et voilĂ  the editor go back in normal mode, but the event loop is like blocked. The canvas is frozen, the menu item can be actived but don't have any effect.

Gilles
Comment 26 caulier.gilles 2022-01-14 12:08:40 UTC
This problem cannot be reproduced with only album gui.

1/ Open digiKam album gui
2/ switch to full screen mode
3/ switch to normal mode.

All is fine here...

Gilles
Comment 27 caulier.gilles 2022-01-14 12:09:24 UTC
Problem not reproducible too with Light Table...

Gilles
Comment 28 caulier.gilles 2022-01-14 12:10:13 UTC
Problem not reproducible also with BQM.

So the problem is only relevant for Image Editor.

Gilles
Comment 29 caulier.gilles 2022-01-14 12:11:43 UTC
Oh, Showfoto work well also when it switch from full-screen mode to normal mode. No problem as with Image Editor.

Very strange

Gilles
Comment 30 caulier.gilles 2022-01-14 14:24:37 UTC
Git commit 598e8850f01e762347e97e032defad2795ca5f09 by Gilles Caulier.
Committed on 14/01/2022 at 14:21.
Pushed by cgilles into branch 'master'.

Perform same tests about fullscreen mode when close slot close() than closeEvent().
Code is now factored. A new slotClose() must be called instead close().

M  +8    -5    core/libs/widgets/mainview/dxmlguiwindow.cpp
M  +9    -0    core/libs/widgets/mainview/dxmlguiwindow.h
M  +13   -0    core/libs/widgets/mainview/dxmlguiwindow_fullscreen.cpp
M  +1    -1    core/utilities/imageeditor/editor/editorwindow.cpp
M  +1    -1    core/utilities/import/main/importui.cpp
M  +1    -1    core/utilities/lighttable/lighttablewindow_setup.cpp
M  +1    -1    core/utilities/queuemanager/main/queuemgrwindow.cpp

https://invent.kde.org/graphics/digikam/commit/598e8850f01e762347e97e032defad2795ca5f09
Comment 31 caulier.gilles 2022-01-14 17:50:27 UTC
Maik,

My last commit do not change anything... I'm lost... but i suspect now a race condition:

* First sequence :

1 / opening editor and switch to full screen.
2 / closing editor from File/Close or Close Editor button from toolbar or close button from window manager ==> dysfunction

Now if i do the second sequence :

1 / opening editor and switch to full screen.
2 / Exit full screen
3 / close editor from menu or button or window manager ==> all work fine.

Important with the last stage 2/, when exit full screen is do, this take around 1-2 seconds, the time to the MacOS windows manager to rearrange the editor windows to the right size. So i suspect that the stage 2/ from the first sequence fail due to a too fast request to back in normal mode and to close the windows editor.

Gilles
Comment 32 Maik Qualmann 2022-01-14 20:16:40 UTC
Hmm, maybe it needs process events between disable full screen and close. Execute any qApp->processEvents() or a 0 timer.

Maik
Comment 33 caulier.gilles 2022-01-14 21:25:26 UTC
Git commit 2d24762883e1441e2225760e6d199cc5bd460a0a by Gilles Caulier.
Committed on 14/01/2022 at 21:20.
Pushed by cgilles into branch 'master'.

add process events before to close window

M  +2    -0    core/libs/widgets/mainview/dxmlguiwindow_fullscreen.cpp

https://invent.kde.org/graphics/digikam/commit/2d24762883e1441e2225760e6d199cc5bd460a0a
Comment 34 caulier.gilles 2022-01-15 12:35:02 UTC
Maik,

My last commit do not change anything. Again, i suspect that event loop is blocked somewhere.

I record a screencast of my macbook pro reproducing the dysfunction:

https://i.imgur.com/BFINcAb.mp4

If you have an idea...

Best

Gilles
Comment 35 caulier.gilles 2022-01-15 12:40:20 UTC
As you can see in the video, when editor is back in normal mode, it's impossible to go back in albumview. The main widows disappear and not accessible, even if i go to task bar where the context menu is able to show all application windows.

The most strange :

The main menu from editor still available, 
The context menu too,
The canvas selection do not work,
The toolbar button are inactive,
The thumbbar cannot be refresh,
Look the action on top of context menu which allow to switch in screen mode, it back in fullscreen mode as expected. 

Gilles
Comment 36 caulier.gilles 2023-01-07 13:01:06 UTC
Still present in version 7.9.0 on MacOS Ventura 13.0.1
Comment 37 caulier.gilles 2023-05-02 17:21:45 UTC
Not yet fixed with current 8.1.0 DMG package generated with Macports based on Qt 5.15.8
Comment 38 caulier.gilles 2023-05-12 15:45:34 UTC
*** Bug 469671 has been marked as a duplicate of this bug. ***
Comment 39 Maik Qualmann 2023-05-18 08:03:20 UTC
Git commit d7083cbf060d43832b6737df810c16813903d258 by Maik Qualmann.
Committed on 18/05/2023 at 08:02.
Pushed by mqualmann into branch 'master'.

a new try to fix the fullscreen bug on macOS

M  +2    -22   core/libs/widgets/mainview/dxmlguiwindow_fullscreen.cpp
M  +0    -6    core/libs/widgets/mainview/dxmlguiwindow_p.h

https://invent.kde.org/graphics/digikam/commit/d7083cbf060d43832b6737df810c16813903d258
Comment 40 caulier.gilles 2023-05-19 07:22:43 UTC
Maik,

Your last commit do not work. Editor go out full screen as expected but window still active as reduced and not responding anymore.

Gilles
Comment 41 caulier.gilles 2023-05-19 07:25:21 UTC
Note : only the editor Window is not responding. The Album View can be used and digiKam can be closed properly, from album view, including Image Editor. No crash at end. I use "digiKam/Close digiKam" from MacOS main menu.

Gilles
Comment 42 caulier.gilles 2023-05-19 07:28:26 UTC
Work around : Whe editor is in full screen mode, to close the window properly:

1 Go out out full screen mode first. this take one second more and less. Window is resized.
2 Close editor.

Gilles
Comment 43 caulier.gilles 2023-10-21 08:59:36 UTC
The dysfunction still the same in 8.2.0 using Qt 5.15.11. Sounds like Qt team do not backport yet the fix applied in Qt 6.2 in Qt5.

Gilles Caulier
Comment 44 caulier.gilles 2024-09-14 21:07:09 UTC
Maik,

The problem still the same with digiKam 8.5.0 and the Arm64 macOS bundle compiled with Qt 6.7.2 and KF 6.5.0.

Do we expect to see the problem fixed with Qt 6 ?

Gilles