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 352442 - Support for cursor blinking timeout
Support for cursor blinking timeout
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkTextView
2.8.x
Other All
: Normal enhancement
: ---
Assigned To: gtk-bugs
gtk-bugs
: 353670 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2006-08-22 19:16 UTC by Manu Cornet
Modified: 2007-04-29 01:20 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
Patch for this feature (9.03 KB, patch)
2006-08-22 19:17 UTC, Manu Cornet
none Details | Review
patch using timeout accumulation (8.32 KB, patch)
2006-08-31 19:18 UTC, Arjan van de Ven
none Details | Review

Description Manu Cornet 2006-08-22 19:16:32 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)
Comment 1 Manu Cornet 2006-08-22 19:17:23 UTC
Created attachment 71398 [details] [review]
Patch for this feature
Comment 2 Yevgen Muntyan 2006-08-22 19:44:49 UTC
Please add a setting to enable this feature and make happy both children with laptops and people using GTK text editors.
Comment 3 Matthias Clasen 2006-08-22 22:06:10 UTC
presumably, there is a special value like 0 meaning "blink forever" - and that would be the default...
Comment 4 Behdad Esfahbod 2006-08-31 15:39:43 UTC
*** Bug 353670 has been marked as a duplicate of this bug. ***
Comment 5 Behdad Esfahbod 2006-08-31 15:40:48 UTC
Arjan van de Ven has alternative patch in 353670.  His patch contains small other fixes to the timeout too.
Comment 6 Arjan van de Ven 2006-08-31 18:51:14 UTC
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...)

 
Comment 7 Behdad Esfahbod 2006-08-31 19:09:13 UTC
(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.

Comment 8 Arjan van de Ven 2006-08-31 19:18:34 UTC
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.
Comment 9 Matthias Clasen 2006-09-01 02:15:26 UTC
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.
Comment 10 Behdad Esfahbod 2006-09-01 03:20:27 UTC
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?
Comment 11 Matthias Clasen 2006-09-01 03:37:01 UTC
MAXINT means blink forever. 0 means no blink.

I didn't want to change the default behaviour, at least not now.
Comment 12 Matthias Clasen 2007-04-29 01:20:11 UTC
I think we can close this now.