After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 673078 - unmaximize has two bindings by default, but only one can be edited
unmaximize has two bindings by default, but only one can be edited
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: Keyboard
3.0.x
Other Linux
: Normal normal
: ---
Assigned To: Control-Center Maintainers
Control-Center Maintainers
3.10
: 701324 710245 712228 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2012-03-29 14:02 UTC by Dan Winship
Modified: 2017-07-10 17:43 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
keyboard: Clear additional bindings when changing a shortcut (1.94 KB, patch)
2013-08-26 22:48 UTC, Florian Müllner
none Details | Review
keyboard: Clear additional bindings when changing a shortcut (1.95 KB, patch)
2017-07-08 23:35 UTC, Florian Müllner
committed Details | Review
keyboard: Add dedicated key combo type (25.37 KB, patch)
2017-07-08 23:35 UTC, Florian Müllner
committed Details | Review
keyboard: Track all key combos (4.54 KB, patch)
2017-07-08 23:36 UTC, Florian Müllner
committed Details | Review
keyboard: Refactor finding of conflicting items (2.88 KB, patch)
2017-07-08 23:36 UTC, Florian Müllner
committed Details | Review
keyboard: Don't handle mask separately from "rest" binding (1.78 KB, patch)
2017-07-08 23:36 UTC, Florian Müllner
committed Details | Review
keyboard: Consider additional bindings in uniqueness checks (1.88 KB, patch)
2017-07-08 23:36 UTC, Florian Müllner
committed Details | Review
keyboard: Consider multiple bindings when resetting (2.70 KB, patch)
2017-07-08 23:36 UTC, Florian Müllner
committed Details | Review

Description Dan Winship 2012-03-29 14:02:39 UTC
in 3.4, unmaximize has two bindings by default, <Super>Down and <Alt>F5.

However, the control panel only shows the first, and gives no indication that the second is there at all. If you delete the <Super>Down binding, the control panel then claims that the function is disabled, when in reality, it's still bound to <Alt>F5.
Comment 1 Bastien Nocera 2012-03-29 14:06:36 UTC
I don't see a way around that. Florian?
Comment 2 Dan Winship 2012-03-29 14:40:59 UTC
(In reply to comment #1)
> I don't see a way around that. Florian?

uh, well, if we're going to have functions bound to multiple keys by default, then the bindings panel should have a UI that can represent that, right?


At the very least, it's clearly a bug that when you delete the visible binding, g-c-c changes the setting from:

  [ '<Super>Down', '<Alt>F5' ]

to:

  [ '', '<Alt>F5' ]

It should remove the first item entirely, not change it to ''.


Oh, and noticed belatedly that this applies to toggle-maximized too (<Super>Up and <Alt>F10).
Comment 3 Bastien Nocera 2013-04-19 08:04:39 UTC
I don't want to display 2 shortcuts in the list. In that particular case, I'd remove the 2nd binding when deleting the binding, or changing it from the default.
Comment 4 Dan Winship 2013-07-01 17:15:46 UTC
In 3.8, switch-applications is bound to [ '<Super>Tab', '<Alt>Tab' ], and there's no way to get rid of the '<Alt>Tab' binding from the control center, or even to see that it's there. The control center will let you bind '<Alt>Tab' to switch-windows, but it doesn't actually work, because it's really secretly still bound to switch-applications.
Comment 5 Darren Hart 2013-08-26 15:54:56 UTC
I had opened bug 703977 reporting the toggle-maximized issue Dan reported in comment 2. For some users, this is a significant hassle. I have been using the top four function keys (alt+F9-12) for various shortcuts for a decade now. This forces me to stop using alt+F10 for the terminal because I can't unbind it from maximize.

Generally speaking, if we intend to allow multiple shortcuts for the same action, then the UI should reflect that. Personally, I think wiping out multiple bindings when the user only changes one as suggested above is cruel and unusual and will only lead to more bugs.
Comment 6 Darren Hart 2013-08-26 15:59:25 UTC
Where are these defaults defined? I've searched the values in gconf and dconf and do not find F10 anywhere but menubar accelerator and my old terminal command. The window maximize only lists my setting of Alt+PageUp.
Comment 7 Florian Müllner 2013-08-26 22:48:56 UTC
Created attachment 253199 [details] [review]
keyboard: Clear additional bindings when changing a shortcut

Some shortcuts allow multiple bindings for the same actions, which
we mainly use to keep supporting old settings when changing defaults.
Multiple bindings are not exposed in the interface though, so when
changing a shortcut with multiple bindings, we previously only updated
the first one and left additional bindings untouched. This is confusing
however, precisely because additional bindings are not shown in the
UI - for instance, this makes it impossible to actually disable
such a shortcut completely. The less confusing option is to clear
any additional bindings when changing a shortcut.
Comment 8 Bastien Nocera 2013-09-05 17:57:58 UTC
Review of attachment 253199 [details] [review]:

I think we should make it popup the conflict dialogue before actually removing the extra keybindings. The patch in itself looks good.
Comment 9 Florian Müllner 2013-09-05 18:02:23 UTC
Yes, I've some WIP patches locally for doing this (and generally including hidden keybindings in conflict resolution). I also managed to speak with Allan about the desired behavior before he went on vacation, so I should be able to attach something in the next couple of days ...
Comment 10 Bastien Nocera 2013-09-05 19:38:51 UTC
*** Bug 701324 has been marked as a duplicate of this bug. ***
Comment 11 Florian Müllner 2013-10-16 08:33:10 UTC
*** Bug 710245 has been marked as a duplicate of this bug. ***
Comment 12 Florian Müllner 2013-11-13 16:11:24 UTC
*** Bug 712228 has been marked as a duplicate of this bug. ***
Comment 13 Jeremy Nickurak 2013-11-13 21:40:31 UTC
What about deleting doubly-bound shortcuts from the default config? If you can make a change with the UI and not get back to the default, that's confusing and frustrating.
Comment 14 Jasper St. Pierre (not reading bugmail) 2014-12-29 02:38:00 UTC
I assume no work has been done on this at all?
Comment 15 Bastien Nocera 2015-01-05 23:31:46 UTC
(In reply to comment #14)
> I assume no work has been done on this at all?

Nope. We need to re-do the UI, and there were a bunch of related fixes going in last cycle, which is why it didn't move forward.
Comment 16 Bastien Nocera 2016-09-08 15:54:19 UTC
Thanks for taking the time to report this.
This particular bug has already been reported into our bug tracking system, but please feel free to report any further bugs you find.

*** This bug has been marked as a duplicate of bug 373934 ***
Comment 17 Florian Müllner 2017-07-08 23:35:02 UTC
I'll reopen the bug to attach updated patches I picked up from my old local branch. Bug 373934 is clearly related, but:

 - handling existing actions with multiple shortcuts
   more gracefully doesn't imply exposing those shortcuts
   in the UI

 - the current handling is pretty broken and needs fixing,
   while it's still unclear whether we want the feature
   proposed in the other bug

 - fixing this bug still leaves plenty of work on the other
   bug (UI changes, settings migration)
Comment 18 Florian Müllner 2017-07-08 23:35:47 UTC
Created attachment 355187 [details] [review]
keyboard: Clear additional bindings when changing a shortcut

Some shortcuts allow multiple bindings for the same actions, which
we mainly use to keep supporting old settings when changing defaults.
Multiple bindings are not exposed in the interface though, so when
changing a shortcut with multiple bindings, we previously only updated
the first one and left additional bindings untouched. This is confusing
however, precisely because additional bindings are not shown in the
UI - for instance, this makes it impossible to actually disable
such a shortcut completely. The less confusing option is to clear
any additional bindings when changing a shortcut.
Comment 19 Florian Müllner 2017-07-08 23:35:57 UTC
Created attachment 355188 [details] [review]
keyboard: Add dedicated key combo type

We currently store keyval, keycode and mask that make up a particular
key combo separately. However as we want to consider multiple bindings
for a single item, it makes more sense to combine them in a dedicated
struct type.
Comment 20 Florian Müllner 2017-07-08 23:36:04 UTC
Created attachment 355189 [details] [review]
keyboard: Track all key combos

For shortcuts that support more than one binding, we currently simply
ignore all but the first. This makes some sense as we only expose a
single binding in the UI anyway, however it means that any extra
bindings are not taken into account for conflict resolution. In order
to address this in the future, start tracking all bindings of an item.
Comment 21 Florian Müllner 2017-07-08 23:36:12 UTC
Created attachment 355190 [details] [review]
keyboard: Refactor finding of conflicting items

When comparing keys for uniqueness, we currently apply various tests to
check whether shortcuts are different, until we decide that we found a
conflict if none of the tests passed. That approach is a bit weird for
shortcuts that have a reverse item - when comparing a binding to two
different shortcuts, it should always be different from at least one of
them, so there should never be a conflict for any reversible shortcuts.
The reason it does work anyway is that reverse items usually only differ
in modifiers, which is_shortcut_different() currently doesn't consider at
all. We are about to change that however, so refactor the code to set the
conflicting item as soon as we find a match rather than as fall-through.
Comment 22 Florian Müllner 2017-07-08 23:36:20 UTC
Created attachment 355191 [details] [review]
keyboard: Don't handle mask separately from "rest" binding

Comparing masks is currently part of the early checks we perform to
determine that two bindings are different. There's some convenience
in that, however logically the mask is part of the binding, and
separating the mask check from comparing the "rest" of the binding
makes it harder to extend the comparison to consider multiple bindings.
Comment 23 Florian Müllner 2017-07-08 23:36:28 UTC
Created attachment 355192 [details] [review]
keyboard: Consider additional bindings in uniqueness checks

We now have everything in place to extend the uniqueness check to
consider all bindings of an item rather than just the first one.
With this it is finally possible to set Alt+Tab as binding for
"Switch windows" without keeping the hidden Alt+Tab binding of the
"Switch applications" shortcut ...
Comment 24 Florian Müllner 2017-07-08 23:36:35 UTC
Created attachment 355193 [details] [review]
keyboard: Consider multiple bindings when resetting

While we are now able to find conflicts for a particular key combo in
non-primary bindings, in the case of resetting a shortcut we need to
check all key combos in case the shortcut itself has multiple bindings
by default.
Comment 25 Rui Matos 2017-07-10 16:42:17 UTC
Review of attachment 355187 [details] [review]:

this means that we might lose some user configuration (manually set with gsettings/dconf) but I agree that this is the lesser of the two evils
Comment 26 Rui Matos 2017-07-10 16:49:38 UTC
Review of attachment 355188 [details] [review]:

looks good
Comment 27 Rui Matos 2017-07-10 16:56:59 UTC
Review of attachment 355189 [details] [review]:

ok
Comment 28 Rui Matos 2017-07-10 17:05:31 UTC
Review of attachment 355190 [details] [review]:

lgtm
Comment 29 Rui Matos 2017-07-10 17:08:53 UTC
Review of attachment 355191 [details] [review]:

code looks good

summary: ... from _the_ "rest" of the binding? or just drop everything after 'separately'
Comment 30 Rui Matos 2017-07-10 17:11:07 UTC
Review of attachment 355192 [details] [review]:

++
Comment 31 Rui Matos 2017-07-10 17:19:16 UTC
Review of attachment 355193 [details] [review]:

this looks fine

shouldn't cc_keyboard_item_is_value_default() be changed to compare all combos too?
Comment 32 Florian Müllner 2017-07-10 17:40:15 UTC
(In reply to Rui Matos from comment #25)
> this means that we might lose some user configuration (manually set with
> gsettings/dconf)

Right, that's why the current behavior was chosen originally. Of course that was when multiple bindings were just a hidden feature that users had to set manually rather than something we'd use in default shortcuts ...


(In reply to Rui Matos from comment #31)
> shouldn't cc_keyboard_item_is_value_default() be changed to compare all
> combos too?

I'm not sure. I have a local commit that does that (and with +1/-21 it's quite a nice cleanup), but it is a bit confusing that the reset button may behave differently from setting the value to the (visible part of the) default shortcut. So my conclusion was to leave it out of the patch series, and put it up for discussion afterwards (also gave me an excuse to leave out the commit message for now :-) )
Comment 33 Florian Müllner 2017-07-10 17:42:29 UTC
Attachment 355187 [details] pushed as bd54cd1 - keyboard: Clear additional bindings when changing a shortcut
Attachment 355188 [details] pushed as dccf794 - keyboard: Add dedicated key combo type
Attachment 355189 [details] pushed as 5e4fa7b - keyboard: Track all key combos
Attachment 355190 [details] pushed as ab35359 - keyboard: Refactor finding of conflicting items
Attachment 355192 [details] pushed as dd024ae - keyboard: Consider additional bindings in uniqueness checks
Attachment 355193 [details] pushed as 30c36d4 - keyboard: Consider multiple bindings when resetting