Bug 305659

Summary: Esc key does not exit full screen mode by default
Product: [Applications] gwenview Reporter: grglsn765
Component: generalAssignee: Gwenview Bugs <gwenview-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: bugseforuns, devel, grglsn765, nate, null, pancho.s
Priority: NOR Keywords: junior-jobs, regression, usability
Version: 17.04.1   
Target Milestone: ---   
Platform: OpenSUSE   
OS: Linux   
URL: https://cgit.kde.org/gwenview.git/commit/?id=f2a611e0c184dc30b66102c51c3bac71653af224
Latest Commit: Version Fixed In:

Description grglsn765 2012-08-23 12:02:53 UTC
After upgrading to KDE 4.9, gwenview upgraded to version 2.9.0. All of a sudden the esc key would no longer exit full screen mode. Checked settings and verified that the esc key was set for exiting full screen mode. Downgraded back to an earlier version and the esc key regained its functionality.

Reproducible: Always

Steps to Reproduce:
1. upgrade to gwenview 2.9.0
2. open a picture in full screen mode in gwenview
3. hit the esc key and watch how nothing happens
Actual Results:  
the esc key still failed to work

Expected Results:  
the esc key should cause gwenview to exit full screen mode
Comment 1 Jekyll Wu 2012-08-23 13:02:31 UTC
See https://bugs.kde.org/show_bug.cgi?id=302898#c1

Anyway, Esc is the default shortcut for "Leaving fullsreen mode" and it works fine for me. Check how   the shortcuts are configured in your system.
Comment 2 grglsn765 2012-08-24 05:23:55 UTC
I checked before I made the bug report, as noted above. Yet even after a restart esc would not leave the full screen mode. I have downgraded now to an earlier version of gwenview because I use this feature all the time and cannot get the functionality I need if the esc key does not work. However I can try to reinstall 2.9 and see if it is still doing the same thing, and I will report back.
Comment 3 Bernd Oliver Sünderhauf 2012-11-08 11:48:07 UTC
This is weird. I can't reproduce this bug with Gwenview, but with Okular.
Esc doesn't bring me back, Ctrl+Shift+F does the thing though.
(KDE 4.9.2 on Chakra)
Comment 4 Nate Graham 2017-11-05 14:41:25 UTC
This was fixed since the bug was reported, but seems to have been broken again with https://cgit.kde.org/gwenview.git/commit/?id=f2a611e0c184dc30b66102c51c3bac71653af224
Comment 5 null 2017-11-05 22:50:13 UTC
Had a short look, I think there are two issues which should not be mixed up:

1. f2a611e0c184 broke setting Esc as a custom shortcut to leave Fullscreen. Let's track this in bug 385242, as this has better steps to reproduce.

2. By default, Esc should leave Fullscreen when in Browse mode (it currently just switches from View to Browse, which should be kept, but does nothing once Browse mode is reached). Let's track this here.

Note that F11 is always available to toggle Fullscreen.
Comment 6 Nate Graham 2017-11-06 00:27:02 UTC
Ah good point.
Comment 7 null 2018-01-20 23:26:53 UTC
Continuing the discussion from https://phabricator.kde.org/D9943#193322:

> What's the desired behavior? Should ⎋ always exit fullscreen browse mode,
> i.e. removing the shortcut config? This should be possible with the
> ShortcutOverride event.
Setting a shortcut for "Full Screen Mode" acts as a toggle, so that we probably don't need to have a separate configurable shortcut for the "Leave Fullscreen Mode" action and maybe we could remove it from the shortcut config dialog? I don't understand why we have this action, as even the context menu in Fullscreen says "Exit Fullscreen Mode" and has said toggle shortcut. "Leave Fullscreen Mode" is only used in the top right corner, we could try to change that to the normal "Exit Fullscreen Mode" action.

> As far as I see, it's not possible to have two actions in the
> KActionCollection with the same shortcut, even if they only trigger in
> different situations.
That's my understanding, too.

> Ok, I'll try to do it this way:
> - fullscreen view mode →fullscreen browse mode with ⎋ or whatever
>   configured shortcut
> - fullscreen browse mode → windowed browse mode with ⎋
Yup, exactly like I would imagine how this should work.

(Thinking more about that, in addition we could make ⎋ switch from (normal) Browse mode to the "Start Page", then it would be symmetrical to the Enter key, which cycles "Start Page" → Browse → View. Currently you have a hard time going back to Start, even though there are useful links to your tags, bookmarks and devices there…)
Comment 8 null 2018-01-21 23:49:13 UTC
> in addition we could make ⎋ switch from (normal) Browse mode
> to the "Start Page"
Alternatively, this could clear the selection (just like in Dolphin).
Comment 9 Peter Mühlenpfordt 2018-01-29 16:45:34 UTC
Added a patch for this here: https://phabricator.kde.org/D10182

I don't think Escape should go back to start page. But what about setting a  default shortcut, e.g. Ctrl+Home?

Clearing the selection in browse mode would be a possibility.
Unlike dolphin, gwenview has a default shortcut for Escape and the unselect should only trigger if the shortcut action does nothing (like goto browse mode in browse mode). I don't see any general way to solve this.
Dolphin does not clear the selection if any action uses shortcut Escape.
Comment 10 null 2018-01-30 23:51:48 UTC
> I don't think Escape should go back to start page.
> But what about setting a  default shortcut, e.g. Ctrl+Home?
In "kcmshell5 standard_actions" there already is a standard action with an associated shortcut for "Home". Perhaps we could just port the "Start Page" action to that?

It's still a bit hard to reach, preventing frequent usage. More ideas:
- When going up in "/", instead of doing nothing switch to the Start page (a bit weird, though).
- Implement proper navigation history (maybe there's already some support in KF5, still not trivially done I guess).
Comment 11 Peter Mühlenpfordt 2018-02-02 08:09:06 UTC
Git commit 1e9a4482d9007991730f18aa95735563038be84e by Peter Mühlenpfordt.
Committed on 02/02/2018 at 08:03.
Pushed by muhlenpfordt into branch 'master'.

Exit fullscreen browse mode with Escape

Summary:
Previous versions of gwenview used {key Esc} to exit fullscreen mode.
By changing shortcut handling of {key Esc} this does not work anymore.
This patch adds an `eventFilter()` to leave fullscreen from browse
mode with {key Esc}.

Test Plan:
1. Open gwenview in browse mode
2. Switch to fullscreen mode (e.g. {key F11})
3. Press {key Esc}
-> Should switch back to windowed browse mode

Reviewers: ngraham, rkflx

Reviewed By: rkflx

Differential Revision: https://phabricator.kde.org/D10182

M  +18   -0    app/browsemainpage.cpp
M  +3    -0    app/browsemainpage.h

https://commits.kde.org/gwenview/1e9a4482d9007991730f18aa95735563038be84e