GNOME Bugzilla – Bug 352442
Support for cursor blinking timeout
Last modified: 2007-04-29 01:20:11 UTC
This has been first developed as an enhancement for the "One Laptop Per Child" project. The attached patch adds an XSetting for the cursor blinking lifetime (default: 5 seconds). Once this delay has elapsed, the cursor stays visible. This affects GtktextView as well as GtkEntry. (CCing Federico)
Created attachment 71398 [details] [review] Patch for this feature
Please add a setting to enable this feature and make happy both children with laptops and people using GTK text editors.
presumably, there is a special value like 0 meaning "blink forever" - and that would be the default...
*** Bug 353670 has been marked as a duplicate of this bug. ***
Arjan van de Ven has alternative patch in 353670. His patch contains small other fixes to the timeout too.
My second patch is inspired on Manu's patch's idea; the main difference is that Manu adds a second timer to stop blinking, while my patch just adds up the time the cursor has been blinking while doing the blinking, and stops when going over the threshold. Personally I like the simplicity of that approach (but then again I made the aptch so I'm supposed to like it...)
(In reply to comment #6) > My second patch is inspired on Manu's patch's idea; the main difference is that > Manu adds a second timer to stop blinking, while my patch just adds up the time > the cursor has been blinking while doing the blinking, and stops when going > over the threshold. Personally I like the simplicity of that approach (but then > again I made the aptch so I'm supposed to like it...) I agree. Just counting down in the blinking timer or like you did... A second timer is not needed.
Created attachment 71976 [details] [review] patch using timeout accumulation updated version fo the patch; now treats settings of MAXINT/1000 and higher as "inifinite"; this was needed to handle overflow anyway and it now allows to just turn off this behavior entirely.
Committed to HEAD, with slight edits, and a default value of MAXINT. I'll consider backporting to 2.10 once the Gnome 2.16 code freeze lifts. 2006-08-31 Matthias Clasen <mclasen@redhat.com> Stop cursor blinking after a configurable timeout. (#353670, #352442, Arjan van de Ven, Manu Cornet) * gtk/gtksettings.c (gtk_settings_class_init): Add a gtk-cursor-blink-timeout setting, which specifies the number of seconds that the cursor should blink after a user interaction. The default value is G_MAXINT to preserve the current behaviour. * gtk/gtkentry.c (blink_cb): Stop blinking after blink-timeout seconds. * gtk/gtkentry.c (gtk_entry_completion_key_press) (gtk_entry_button_press, gtk_entry_focus_in): Reset the blink timer. * gtk/gtktextview.c (blink_cb): Stop blinking after blink-timeout seconds. * gtk/gtktextview.c (gtk_text_view_key_press_event) (gtk_text_view_button_press_event, gtk_text_view_focus_in_event): Reset the blink timer.
So, no "0 means blink forever"? User should set G_MAXINT for that? And, can't we set a shorter default value? Say, an hour?
MAXINT means blink forever. 0 means no blink. I didn't want to change the default behaviour, at least not now.
I think we can close this now.