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 688656 - key-model: Also hide subkeys on key-released
key-model: Also hide subkeys on key-released
Status: RESOLVED FIXED
Product: caribou
Classification: Applications
Component: default
git master
Other All
: Normal normal
: ---
Assigned To: caribou-maint
caribou-maint
Depends on:
Blocks:
 
 
Reported: 2012-11-19 16:30 UTC by Rui Matos
Modified: 2012-11-26 10:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
key-model: Also hide subkeys on key-released (1.25 KB, patch)
2012-11-19 16:30 UTC, Rui Matos
none Details | Review
key-model: Don't emit key-clicked both on the main key and the subkey (1.07 KB, patch)
2012-11-20 17:47 UTC, Rui Matos
none Details | Review
key-model: Also hide subkeys on key-released (909 bytes, patch)
2012-11-20 17:49 UTC, Rui Matos
none Details | Review
key-model: Use key-released instead of key-clicked to hide subkeys (1.29 KB, patch)
2012-11-23 14:11 UTC, Rui Matos
committed Details | Review

Description Rui Matos 2012-11-19 16:30:20 UTC
See patch.
Comment 1 Rui Matos 2012-11-19 16:30:22 UTC
Created attachment 229382 [details] [review]
key-model: Also hide subkeys on key-released

This allows users to insert subkeys with a single button press/release
pair by pressing on the main key, then moving and releasing while
hovering the subkey.
Comment 2 Daiki Ueno 2012-11-20 08:44:45 UTC
Review of attachment 229382 [details] [review]:

Looks good to me.

::: libcaribou/key-model.vala
@@ +125,2 @@
         internal void add_subkey (KeyModel key) {
             key.key_clicked.connect(on_subkey_clicked);

Perhaps icbw, is on_subkey_clicked still needed?  While it emits "key-clicked" on the main key, I think it is not so useful.
Comment 3 Rui Matos 2012-11-20 17:47:52 UTC
Created attachment 229493 [details] [review]
key-model: Don't emit key-clicked both on the main key and the subkey

As it is the subkey that's being clicked we shouldn't emit key-clicked
on the main key too.
--

(In reply to comment #2)
> Perhaps icbw, is on_subkey_clicked still needed?  While it emits "key-clicked"
> on the main key, I think it is not so useful.

I also think it's not needed but had decided to go the safest way as
I'm not 100% sure if this breaks something elsewhere. It certainly
makes more sense and doesn't break anything on my own testing
though. So here it is.
Comment 4 Rui Matos 2012-11-20 17:49:07 UTC
Created attachment 229495 [details] [review]
key-model: Also hide subkeys on key-released

--

If we go with the previous patch then the original isn't needed and
instead we should go with this.
Comment 5 Daiki Ueno 2012-11-23 13:21:33 UTC
> (In reply to comment #2)
> > Perhaps icbw, is on_subkey_clicked still needed?  While it emits "key-clicked"
> > on the main key, I think it is not so useful.
> 
> I also think it's not needed but had decided to go the safest way as
> I'm not 100% sure if this breaks something elsewhere. It certainly
> makes more sense and doesn't break anything on my own testing
> though. So here it is.

I thought that those events (key-pressed, key-released, key-clicked) are analogues to GtkButton's (i.e. button-press-event, button-release-event, and clicked (activate)).  If so, only key-clicked is meaningless and the main key should still emit key-pressed/key-released event, just IMHO.
Comment 6 Rui Matos 2012-11-23 13:38:06 UTC
(In reply to comment #5)
> I thought that those events (key-pressed, key-released, key-clicked) are
> analogues to GtkButton's (i.e. button-press-event, button-release-event, and
> clicked (activate)).  If so, only key-clicked is meaningless and the main key
> should still emit key-pressed/key-released event, just IMHO.

I'm puzzled now. Do you agree with the patch?
Comment 7 Rui Matos 2012-11-23 14:11:29 UTC
Created attachment 229725 [details] [review]
key-model: Use key-released instead of key-clicked to hide subkeys

This allows users to insert subkeys with a single button press/release
pair by pressing on the main key, then moving and releasing while
hovering the subkey.

Also, emit key-released instead of key-clicked on the main key since
that is a better model what is really happening.
--

Ok, if I understand you correctly, this also fixes things nicely.
Comment 8 Daiki Ueno 2012-11-23 21:33:16 UTC
Review of attachment 229725 [details] [review]:

Looks good to me.
Comment 9 Rui Matos 2012-11-26 10:20:47 UTC
Attachment 229725 [details] pushed as 134f3c3 - key-model: Use key-released instead of key-clicked to hide subkeys