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 59707 - Need keynav for selectable labels.
Need keynav for selectable labels.
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
1.3.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
AP3
: 132878 133981 (view as bug list)
Depends on:
Blocks: 70270
 
 
Reported: 2001-08-28 23:06 UTC by Alexander Larsson
Modified: 2011-02-04 16:16 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Alexander Larsson 2001-08-28 23:06:22 UTC
There must be a way to focus and select text in selectable labels.
Comment 1 Owen Taylor 2001-11-02 03:48:35 UTC
Selecting text is done, focusing still remains.
Comment 2 Luis Villa 2002-01-22 21:30:15 UTC
Adding GNOME2 keyword to all keynav bugs per sander's request. You can filter on
the phrase 'luis doing GNOME2 work' to catch all instances of this so that you
can ignore them.
Comment 3 Owen Taylor 2002-01-23 20:38:43 UTC
I have no idea how focus for selectable labels should work...
should they just be in the focus tab chain.. might be pretty
confusing.
Comment 4 Calum Benson 2002-02-05 13:19:27 UTC
I don't think they should be in the regular tab chain, unless they're
only used in a very few places.  A couple of options that I mentioned
on gtk-devel are below... they're not great, but apart from "put them
in the tab chain", they're the only ones I've seen so far :)

1. Only allow keyboard selection of labels that have an access key,
and have a 'special' access key mechanism for focusing them, e.g.
Ctlr+Alt+mnemonic rather than the usual Alt+menmonic (which would
normally focus the control the label referred to, if it had one). 
Once such a label had focus, pressing Tab/Shift+Tab would just move
focus to the next/previous control as usual.

Unfortunately, the most useful labels to select are usually messages
in alert boxes and suchlike, which would probably look odd with an
underlined letter in them, so another alternative could be:

2. Have Tab cycle through every control in a dialog except selectable
labels (as it does right now), and Ctrl+Alt+Tab (or something, but
there aren't many unused combinations left that include Tab) cycle
through everything in a dialog *including* selectable labels.
Comment 5 Matthias Clasen 2002-04-05 13:33:38 UTC
Move open bugs from milestones 2.0.[012] -- > 2.0.3, since 2.0.2 is already out.
Comment 6 Owen Taylor 2002-05-01 23:14:40 UTC
the control-alt-tab suggestion is easy enough to implement messily,
hard-coding the modifer (just check the modifier state, in
gtk_label_focus()), but quite a pain to implement  cleanly.  
Comment 7 Calum Benson 2002-07-17 10:56:43 UTC
Unfortunately Ctrl-Alt-Tab is now used for cycling between panels, so
we'd need to think up another shortcut for this...
Comment 8 Calum Benson 2003-04-03 14:55:28 UTC
Updating status_whiteboard field to reflect A11Y team's assessment 
of accessibility impact.
Comment 9 Calum Benson 2003-08-07 16:15:21 UTC
Apologies for spam... marking as GNOMEVER2.3 so it appears on the official GNOME
bug list :)
Comment 10 Federico Mena Quintero 2004-01-22 18:17:17 UTC
Any word on which shortcut to use for this?
Comment 11 Federico Mena Quintero 2004-01-29 17:37:38 UTC
*** Bug 132878 has been marked as a duplicate of this bug. ***
Comment 12 Calum Benson 2004-01-30 17:26:18 UTC
Hrmm, I'm convinced I added a comment to this last week :/

Anyway, all the sensible <modifier>+Tab combinations are now taken, so
despite my previous reservations I'd be inclined to say that just
putting them in the regular tab chain might well be the best bet
now... selectable labels should be pretty rare in most regular
dialogs, so any negative impact ought to be negligible.
Comment 13 Bryan W Clark 2004-02-04 17:04:13 UTC
I'd agree that just putting them in the regular tab chain could work.
 Before this is commited I think a separate bug needs to be filed with
the HIG that has a section warning against using these often, or at
least in situations where they become confusing.  Ugh, that's such a
general statement; confusing as discussed above.
Comment 14 Federico Mena Quintero 2004-02-04 18:29:07 UTC
See bug #133423 for the HIG.
Comment 15 Federico Mena Quintero 2004-02-04 21:55:51 UTC
Fixed on CVS.

2004-02-04  Federico Mena Quintero  <federico@ximian.com>

	Fix #59707.

	* gtk/gtklabel.c (gtk_label_focus): Removed, so we don't ignore
	the focus chain.
	(gtk_label_button_press): Fix prototype.
	(gtk_label_button_release): Likewise.
	(gtk_label_motion): Likewise.

	* tests/testgtk.c (create_message_dialog): For the dialog with
	only GTK_BUTTONS_CLOSE, make GTK_RESPONSE_CLOSE the default.
Comment 16 spark 2004-02-05 19:06:04 UTC
This checkin is going to break A LOT of apps. The HIG currently 
recommends making the text in error/alert/info dialogs selectable (so
the user can copy and paste the msg). 

With this change, the default focused item will be the first selectable
text item whereas before it would be the default button at the bottom
(like OK or whatever). This is not good.

I think this change should be delayed until after branch for gnome 2.4
to give maintainers a good chance to catch up.
Comment 17 Calum Benson 2004-02-06 14:21:46 UTC
Fair point, the intention for alerts would still be to have the
default button be the first control focused.  Unless there's a way to
patch GtkMessageDialog itself to ensure this always happens (and
presumably even that wouldn't catch everything), I'd agree it might be
worth delaying.
Comment 18 Richard Hult 2004-02-07 21:50:53 UTC
All gtkmessagedialogs in existing apps are broken now, since the label
is selectable by default in those. Other dialogs like gnomeabout is
broken as well. Plus a lot of custom dialogs in apps everywhere I'm
sure. Shouldn't this be reopened?
Comment 19 Alexander Larsson 2004-02-09 12:23:11 UTC
Yeah. This sounds pretty damn bad.
Comment 20 Calum Benson 2004-02-09 13:46:14 UTC
Reopening as suggested, sounds like we might want to revert this one
for a while.
Comment 21 Matthias Clasen 2004-02-10 09:19:59 UTC
I think using a different tab-combination would be much nicer than 
just dumping the labels in the regular focus chain. If the clash with 
pane switching is really a problem, we could provide an alternative 
key combination not involving tab (we do something similar for 
Ctrl-PgUp which also has some conflicts). 


Calum, do you have an "inverted keybindings table", ie one mapping key 
combinations to their uses ?


Another (worse) alternative would be to make this a mode.
Comment 22 Calum Benson 2004-02-10 14:13:59 UTC
There really is no sensible Tab combination left:

[Shift]-Tab: moves focus between controls
[Shift]-Alt-Tab: moves focus between windows
[Shift]-Ctrl-Tab: moves focus between controls that eat Tab
[Shift]-Ctrl-Alt-Tab: moves focus between panels/desktop

So we're really only left with Hyper/Super/Meta, which I think would
be a bad idea :/

99% of selectable labels will be in alert boxes, where focus should
initially be on the default button anyway.  So in theory I don't think
there should be a problem with them in the tab chain, and it's
certainly the most discoverable option for the user.  It does mean
fixing all existing alert boxes somehow as Richard pointed out, but
IMHO we shouldn't use that as an excuse to invent yet another obscure
keybinding :/
Comment 23 Matthias Clasen 2004-02-10 14:19:24 UTC
Would there really be a conflict with reusing Ctrl-Tab ? 


Seems to be almost explainable: Use Tab to move the focus, if you get 
stuck, or if the focus doesn't want to move to a label, use Ctrl to 
make GTK+ try harder...
Comment 24 Owen Taylor 2004-02-10 15:34:01 UTC
Using Control-Tab sounds plausible to me, but making alert boxes
automatically fixed without application writer intervention
is not hard, if quite hacky, just in gtk_dialog_map() extend 
the logic to never leave a label focused. (With care not to infinite 
loop if there are no focusable widgets other than labels.) 
Comment 25 padraig.obriain 2004-02-10 16:09:28 UTC
*** Bug 133981 has been marked as a duplicate of this bug. ***
Comment 26 Calum Benson 2004-02-10 18:16:55 UTC
Hmm, okay, I agree that the Ctrl-Tab suggestion doesn't conflict with
its existing use, but it would place two fairly different interaction
models onto the same shortcut.  Also there would be no way to tell
which labels were focusable unless you used Ctrl-Tab to move focus all
round any particular window.  Even assuming that's currently possible
(does Ctrl-Tab always move the focus when Tab would?), if you're going
to have to do that anyway, wouldn't it be easier just to use Tab? :)
Comment 27 spark 2004-02-21 14:09:46 UTC
Can this be added to the willfix list for 2.4?

If not, i suppose the original patch should be backed out.
Comment 28 Owen Taylor 2004-02-21 15:04:36 UTC
Note that GnomeAbout is an example of a case where the 
MessageDialog specific fix doesn't help and a label
ends up focused.
Comment 29 Richard Hult 2004-03-09 13:50:22 UTC
Did we reach consensus on this? I.e. should we start fixing things
like GnomeAbout? It's getting dangerously close to release now.
Comment 30 Owen Taylor 2004-03-11 19:13:54 UTC
Far too many apps are ending up with the wrong widgets focused
in dialogs; I've backed out the previous changes and instead
made a (slightly hacky but functional) change so that GtkLabel
is in the tab chain only when 

Thu Mar 11 13:58:24 2004  Owen Taylor  <otaylor@redhat.com>
                                                                     
          
        * gtk/gtkmessagedialog.c gtk/gtklabel.c: Back out the
        put-labels-into-the-standard-focus-chain patches
        from bug #59707.
                                                                     
          
        * gtk/gtklabel.c (gtk_label_focus): Only put the
        label in the tab chain when the control key is pressed.
Comment 31 bill.haneman 2004-03-11 22:00:26 UTC
does this conflict with the existing behavior of Control-TAB? I though
control TAB was reserved for moving focus out of TAB-grabbing contexts.
Comment 32 Owen Taylor 2004-03-11 23:55:27 UTC
See discussion above; basically Control-Tab can be interpreted
as "focus harder". This is far from perfect; you can get problems
like where escaping from a control ends you up on a selectable
label. But the alternative was causing a lot of problems in
GNOME dialogs; this at least gives *some* way of focusing
the selectable label in the GNOME-2.6 timeframe.
Comment 33 bill.haneman 2004-03-12 09:59:20 UTC
thanks Owen; sounds good, though I haven't tested it yet.  I'll leave
the conclusions to Calum.  Thanks for having a go at this for 2.6,
it's very helpful.