~canonical-dx-team/ubuntu/maverick/gtk+2.0/menuproxy

« back to all changes in this revision

Viewing changes to debian/patches/031_cursor-blinking-timeout.patch

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2007-05-04 12:24:25 UTC
  • mfrom: (1.1.21 upstream)
  • Revision ID: james.westby@ubuntu.com-20070504122425-0m8midgzrp40y8w2
Tags: 2.10.12-1ubuntu1
* Sync with Debian
* New upstream version:
  Fixed bugs:
  - 379414 file chooser warnings when changing path in the entry
  - 418585 GtkFileChooserDefault sizing code is not DPI independent
  - 419568 Crash in search if start with special letter
  - 435062 build dies with icon cache validation
  - 379399 Segfault to call gtk_print_operation_run twice.
  - 387889 cups backend has problems when there are too many printers
  - 418531 invalid read to gtkicontheme.c gtk_icon_theme_lookup_icon...
  - 423916 crash in color scheme code
  - 424042 Segmentation fault while quickly pressing Alt+arrows
  - 415260 Protect against negative indices when setting values in G...
  - 419171 XGetVisualInfo() may not set nxvisuals
  - 128852 Gdk cursors don't look good on win32
  - 344657 Ctrl-H doesn't toggle "Show Hidden Files" setting
  - 345345 PrintOperation::paginate is not emitted for class handler
  - 347567 GtkPrintOperation::end-print is not emitted if it's cance...
  - 369112 gtk_ui_manager_add_ui should accept unnamed separator
  - 392015 Selected menu item invisible on Windows Vista
  - 399253 MS-Windows Theme Bottom Tab placement rendering glitches
  - 399425 gtk_input_dialog_fill_axes() adds child to gtkscrolledwin...
  - 403251 [patch] little memory leak in GtkPrintJob
  - 403267 [patch] memory leak in GtkPageSetupUnixDialog
  - 403470 MS-Windows Theme tab placement other than on top leaks a ...
  - 404506 Windows system fonts that have multi-byte font names cann...
  - 405089 Incorrect window placement for GtkEventBox private window
  - 405515 Minor leak in gtkfilesystemmodel.c
  - 405539 gdk_pixbuf_save() for PNG saver can return FALSE without ...
  - 415681 gdk_window_clear_area includes an extra line and column o...
  - 418219 GtkRecentChooser should apply filter before sorting and c...
  - 418403 Scroll to printer after selecting it from settings
  - 421985 _gtk_print_operation_platform_backend_launch_preview
  - 421990 gtk_print_job_get_surface
  - 421993 gtk_print_operation_init
  - 423064 Conditional jump or move depends on uninitialised value(s...
  - 423722 Fix printing header in gtk-demo
  - 424168 gtk_print_operation_run on async preview
  - 425655 Don't install gtk+-unix-print-2.0.pc on non-UNIX platforms
  - 425786 GDK segfaults if XineramaQueryScreens fails
  - 428665 Lpr Backend gets stuck in infinite loop during gtk_enumer...
  - 429902 GtkPrintOperation leaks cairo contextes
  - 431997 First delay of GdkPixbufAnimationIter is wrong
  - 433242 Inconsistent scroll arrow position calculations
  - 433972 Placing gtk.Expander inside a gtk.TextView() changes gtk....
  - 434261 _gtk_toolbar_elide_underscores incorrectly handles some s...
  - 383354 ctrl-L should make 'Location' entry disappear
  - 418673 gtk_recent_manager_add_item
  - 429732 gtk_accel_group_finalize accesses invalid memory
  - 435028 WM_CLIENT_LEADER is wrong on the leader_window
  - 431067 Background of the header window is not updated
  - 338843 add recent files support inside the ui manager
  - 148535 add drop shadow to menus, tooltips, etc. under Windows XP
* debian/control.in:
  - Conflicts on ubuntulooks (<= 0.9.11-1)
* debian/patches/15_default-fallback-icon-theme.patch:
  - patch from Debian, fallback on gnome icon theme

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
From upstream SVN r16366 (trunk)
 
2
===================================================================
 
3
 
 
4
Stop cursor blinking after a configurable timeout.
 
5
(#353670, #352442, Arjan van de Ven, Manu Cornet)
 
6
 
 
7
* gtk/gtksettings.c (gtk_settings_class_init): Add a 
 
8
gtk-cursor-blink-timeout setting, which specifies the number
 
9
of seconds that the cursor should blink after a user interaction.
 
10
The default value is G_MAXINT to preserve the current behaviour.
 
11
 
 
12
* gtk/gtkentry.c (blink_cb): Stop blinking after blink-timeout
 
13
seconds.
 
14
 
 
15
* gtk/gtkentry.c (gtk_entry_completion_key_press) 
 
16
(gtk_entry_button_press, gtk_entry_focus_in): Reset the
 
17
blink timer.
 
18
 
 
19
* gtk/gtktextview.c (blink_cb): Stop blinking after blink-timeout
 
20
seconds. 
 
21
 
 
22
* gtk/gtktextview.c (gtk_text_view_key_press_event) 
 
23
(gtk_text_view_button_press_event, gtk_text_view_focus_in_event): 
 
24
Reset the blink timer.
 
25
 
 
26
Index: gtk+2.0-2.10.10/gtk/gtkentry.c
 
27
===================================================================
 
28
--- gtk+2.0-2.10.10.orig/gtk/gtkentry.c 2007-03-13 14:10:39.000000000 +0100
 
29
+++ gtk+2.0-2.10.10/gtk/gtkentry.c      2007-03-13 14:10:42.000000000 +0100
 
30
@@ -82,6 +82,7 @@
 
31
 {
 
32
   gfloat xalign;
 
33
   gint insert_pos;
 
34
+  guint blink_time;  /* time in msec the cursor has blinked since last user event */
 
35
   guint real_changed : 1;
 
36
   guint change_count : 8;
 
37
 };
 
38
@@ -334,6 +335,7 @@
 
39
                                                        GtkStateType    previous_state);
 
40
 static void         gtk_entry_check_cursor_blink       (GtkEntry       *entry);
 
41
 static void         gtk_entry_pend_cursor_blink        (GtkEntry       *entry);
 
42
+static void         gtk_entry_reset_blink_time         (GtkEntry       *entry);
 
43
 static void         get_text_area_size                 (GtkEntry       *entry,
 
44
                                                        gint           *x,
 
45
                                                        gint           *y,
 
46
@@ -1654,6 +1656,8 @@
 
47
       (entry->button && event->button != entry->button))
 
48
     return FALSE;
 
49
 
 
50
+  gtk_entry_reset_blink_time (entry);
 
51
+
 
52
   entry->button = event->button;
 
53
   
 
54
   if (!GTK_WIDGET_HAS_FOCUS (widget))
 
55
@@ -1744,7 +1748,7 @@
 
56
              entry->drag_start_y = event->y;
 
57
            }
 
58
          else
 
59
-           gtk_editable_set_position (editable, tmp_pos);
 
60
+            gtk_editable_set_position (editable, tmp_pos);
 
61
          break;
 
62
  
 
63
        case GDK_2BUTTON_PRESS:
 
64
@@ -2006,6 +2010,7 @@
 
65
 {
 
66
   GtkEntry *entry = GTK_ENTRY (widget);
 
67
 
 
68
+  gtk_entry_reset_blink_time (entry);
 
69
   gtk_entry_pend_cursor_blink (entry);
 
70
 
 
71
   if (entry->editable)
 
72
@@ -2078,6 +2083,7 @@
 
73
                    "direction_changed",
 
74
                    G_CALLBACK (gtk_entry_keymap_direction_changed), entry);
 
75
 
 
76
+  gtk_entry_reset_blink_time (entry);
 
77
   gtk_entry_check_cursor_blink (entry);
 
78
 
 
79
   return FALSE;
 
80
@@ -5281,9 +5287,10 @@
 
81
  *  - the widget has focus
 
82
  */
 
83
 
 
84
-#define CURSOR_ON_MULTIPLIER 0.66
 
85
-#define CURSOR_OFF_MULTIPLIER 0.34
 
86
-#define CURSOR_PEND_MULTIPLIER 1.0
 
87
+#define CURSOR_ON_MULTIPLIER 2
 
88
+#define CURSOR_OFF_MULTIPLIER 1
 
89
+#define CURSOR_PEND_MULTIPLIER 3
 
90
+#define CURSOR_DIVIDER 3
 
91
 
 
92
 static gboolean
 
93
 cursor_blinks (GtkEntry *entry)
 
94
@@ -5315,6 +5322,17 @@
 
95
   return time;
 
96
 }
 
97
 
 
98
+static gint
 
99
+get_cursor_blink_timeout (GtkEntry *entry)
 
100
+{
 
101
+  GtkSettings *settings = gtk_widget_get_settings (GTK_WIDGET (entry));
 
102
+  gint timeout;
 
103
+
 
104
+  g_object_get (settings, "gtk-cursor-blink-timeout", &timeout, NULL);
 
105
+
 
106
+  return timeout;
 
107
+}
 
108
+
 
109
 static void
 
110
 show_cursor (GtkEntry *entry)
 
111
 {
 
112
@@ -5346,11 +5364,14 @@
 
113
 blink_cb (gpointer data)
 
114
 {
 
115
   GtkEntry *entry;
 
116
+  GtkEntryPrivate *priv; 
 
117
+  gint blink_timeout;
 
118
 
 
119
   GDK_THREADS_ENTER ();
 
120
 
 
121
   entry = GTK_ENTRY (data);
 
122
-
 
123
+  priv = GTK_ENTRY_GET_PRIVATE (entry);
 
124
 
125
   if (!GTK_WIDGET_HAS_FOCUS (entry))
 
126
     {
 
127
       g_warning ("GtkEntry - did not receive focus-out-event. If you\n"
 
128
@@ -5363,18 +5384,27 @@
 
129
     }
 
130
   
 
131
   g_assert (entry->selection_bound == entry->current_pos);
 
132
-
 
133
-  if (entry->cursor_visible)
 
134
+  
 
135
+  blink_timeout = get_cursor_blink_timeout (entry);
 
136
+  if (priv->blink_time > 1000 * blink_timeout && 
 
137
+      blink_timeout < G_MAXINT/1000) 
 
138
+    {
 
139
+      /* we've blinked enough without the user doing anything, stop blinking */
 
140
+      show_cursor (entry);
 
141
+      entry->blink_timeout = 0;
 
142
+    } 
 
143
+  else if (entry->cursor_visible)
 
144
     {
 
145
       hide_cursor (entry);
 
146
-      entry->blink_timeout = g_timeout_add (get_cursor_time (entry) * CURSOR_OFF_MULTIPLIER,
 
147
+      entry->blink_timeout = g_timeout_add (get_cursor_time (entry) * CURSOR_OFF_MULTIPLIER / CURSOR_DIVIDER,
 
148
                                            blink_cb,
 
149
                                            entry);
 
150
     }
 
151
   else
 
152
     {
 
153
       show_cursor (entry);
 
154
-      entry->blink_timeout = g_timeout_add (get_cursor_time (entry) * CURSOR_ON_MULTIPLIER,
 
155
+      priv->blink_time += get_cursor_time (entry);
 
156
+      entry->blink_timeout = g_timeout_add (get_cursor_time (entry) * CURSOR_ON_MULTIPLIER / CURSOR_DIVIDER,
 
157
                                            blink_cb,
 
158
                                            entry);
 
159
     }
 
160
@@ -5388,14 +5418,18 @@
 
161
 static void
 
162
 gtk_entry_check_cursor_blink (GtkEntry *entry)
 
163
 {
 
164
+  GtkEntryPrivate *priv; 
 
165
+  
 
166
+  priv = GTK_ENTRY_GET_PRIVATE (entry);
 
167
+
 
168
   if (cursor_blinks (entry))
 
169
     {
 
170
       if (!entry->blink_timeout)
 
171
        {
 
172
-         entry->blink_timeout = g_timeout_add (get_cursor_time (entry) * CURSOR_ON_MULTIPLIER,
 
173
+         show_cursor (entry);
 
174
+         entry->blink_timeout = g_timeout_add (get_cursor_time (entry) * CURSOR_ON_MULTIPLIER / CURSOR_DIVIDER,
 
175
                                                blink_cb,
 
176
                                                entry);
 
177
-         show_cursor (entry);
 
178
        }
 
179
     }
 
180
   else
 
181
@@ -5419,13 +5453,24 @@
 
182
       if (entry->blink_timeout != 0)
 
183
        g_source_remove (entry->blink_timeout);
 
184
       
 
185
-      entry->blink_timeout = g_timeout_add (get_cursor_time (entry) * CURSOR_PEND_MULTIPLIER,
 
186
+      entry->blink_timeout = g_timeout_add (get_cursor_time (entry) * CURSOR_PEND_MULTIPLIER / CURSOR_DIVIDER,
 
187
                                            blink_cb,
 
188
                                            entry);
 
189
       show_cursor (entry);
 
190
     }
 
191
 }
 
192
 
 
193
+static void
 
194
+gtk_entry_reset_blink_time (GtkEntry *entry)
 
195
+{
 
196
+  GtkEntryPrivate *priv; 
 
197
+  
 
198
+  priv = GTK_ENTRY_GET_PRIVATE (entry);
 
199
+  
 
200
+  priv->blink_time = 0;
 
201
+}
 
202
+
 
203
+
 
204
 /* completion */
 
205
 static gint
 
206
 gtk_entry_completion_timeout (gpointer data)
 
207
Index: gtk+2.0-2.10.10/gtk/gtksettings.c
 
208
===================================================================
 
209
--- gtk+2.0-2.10.10.orig/gtk/gtksettings.c      2007-03-12 14:50:58.000000000 +0100
 
210
+++ gtk+2.0-2.10.10/gtk/gtksettings.c   2007-03-13 14:10:42.000000000 +0100
 
211
@@ -64,6 +64,7 @@
 
212
   PROP_DOUBLE_CLICK_DISTANCE,
 
213
   PROP_CURSOR_BLINK,
 
214
   PROP_CURSOR_BLINK_TIME,
 
215
+  PROP_CURSOR_BLINK_TIMEOUT,
 
216
   PROP_SPLIT_CURSOR,
 
217
   PROP_THEME_NAME,
 
218
   PROP_ICON_THEME_NAME,
 
219
@@ -201,6 +202,15 @@
 
220
                                                                GTK_PARAM_READWRITE),
 
221
                                              NULL);
 
222
   g_assert (result == PROP_DOUBLE_CLICK_DISTANCE);
 
223
+
 
224
+  /**
 
225
+   * GtkSettings:gtk-cursor-blink:
 
226
+   *
 
227
+   * Whether the cursor should blink. 
 
228
+   *
 
229
+   * Also see the gtk-cursor-blink-timeout setting, which allows 
 
230
+   * more flexible control over cursor blinking.
 
231
+   */
 
232
   result = settings_install_property_parser (class,
 
233
                                              g_param_spec_boolean ("gtk-cursor-blink",
 
234
                                                                   P_("Cursor Blink"),
 
235
@@ -212,11 +222,31 @@
 
236
   result = settings_install_property_parser (class,
 
237
                                              g_param_spec_int ("gtk-cursor-blink-time",
 
238
                                                                P_("Cursor Blink Time"),
 
239
-                                                               P_("Length of the cursor blink cycle, in milleseconds"),
 
240
+                                                               P_("Length of the cursor blink cycle, in milliseconds"),
 
241
                                                                100, G_MAXINT, 1200,
 
242
                                                                GTK_PARAM_READWRITE),
 
243
                                              NULL);
 
244
   g_assert (result == PROP_CURSOR_BLINK_TIME);
 
245
 
246
+  /**
 
247
+   * GtkSettings:gtk-cursor-blink-timeout:
 
248
+   *
 
249
+   * Time after which the cursor stops blinking, in seconds.
 
250
+   * The timer is reset after each user interaction.
 
251
+   *
 
252
+   * Setting this to zero has the same effect as setting
 
253
+   * gtk-cursor-blinks to %FALSE. 
 
254
+   *
 
255
+   * Since: 2.12
 
256
+   */
 
257
+  result = settings_install_property_parser (class,
 
258
+                                             g_param_spec_int ("gtk-cursor-blink-timeout",
 
259
+                                                               P_("Cursor Blink Timeout"),
 
260
+                                                               P_("Time after which the cursor stops blinking, in seconds"),
 
261
+                                                               1, G_MAXINT, G_MAXINT,
 
262
+                                                               GTK_PARAM_READWRITE),
 
263
+                                             NULL);
 
264
+  g_assert (result == PROP_CURSOR_BLINK_TIMEOUT);
 
265
   result = settings_install_property_parser (class,
 
266
                                              g_param_spec_boolean ("gtk-split-cursor",
 
267
                                                                   P_("Split Cursor"),
 
268
Index: gtk+2.0-2.10.10/gtk/gtktextview.c
 
269
===================================================================
 
270
--- gtk+2.0-2.10.10.orig/gtk/gtktextview.c      2007-03-12 14:50:26.000000000 +0100
 
271
+++ gtk+2.0-2.10.10/gtk/gtktextview.c   2007-03-13 14:10:42.000000000 +0100
 
272
@@ -99,6 +99,16 @@
 
273
 
 
274
 #define SPACE_FOR_CURSOR 1
 
275
 
 
276
+typedef struct _GtkTextViewPrivate GtkTextViewPrivate;
 
277
+
 
278
+#define GTK_TEXT_VIEW_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GTK_TYPE_TEXT_VIEW, GtkTextViewPrivate))
 
279
+
 
280
+struct _GtkTextViewPrivate 
 
281
+{
 
282
+  guint blink_time;  /* time in msec the cursor has blinked since last user event */
 
283
+};
 
284
+
 
285
+
 
286
 struct _GtkTextPendingScroll
 
287
 {
 
288
   GtkTextMark   *mark;
 
289
@@ -290,6 +300,7 @@
 
290
 static void     gtk_text_view_check_cursor_blink     (GtkTextView        *text_view);
 
291
 static void     gtk_text_view_pend_cursor_blink      (GtkTextView        *text_view);
 
292
 static void     gtk_text_view_stop_cursor_blink      (GtkTextView        *text_view);
 
293
+static void     gtk_text_view_reset_blink_time       (GtkTextView        *text_view);
 
294
 
 
295
 static void     gtk_text_view_value_changed                (GtkAdjustment *adj,
 
296
                                                            GtkTextView   *view);
 
297
@@ -1007,6 +1018,8 @@
 
298
   gtk_binding_entry_add_signal (binding_set, GDK_KP_Tab, GDK_SHIFT_MASK | GDK_CONTROL_MASK,
 
299
                                "move_focus", 1,
 
300
                                GTK_TYPE_DIRECTION_TYPE, GTK_DIR_TAB_BACKWARD);
 
301
+
 
302
+  g_type_class_add_private (gobject_class, sizeof (GtkTextViewPrivate));
 
303
 }
 
304
 
 
305
 static void
 
306
@@ -3920,6 +3933,7 @@
 
307
   if (obscure)
 
308
     gtk_text_view_obscure_mouse_cursor (text_view);
 
309
   
 
310
+  gtk_text_view_reset_blink_time (text_view);
 
311
   gtk_text_view_pend_cursor_blink (text_view);
 
312
 
 
313
   return retval;
 
314
@@ -3963,6 +3977,8 @@
 
315
       return FALSE;
 
316
     }
 
317
 
 
318
+  gtk_text_view_reset_blink_time (text_view);
 
319
+
 
320
 #if 0
 
321
   /* debug hack */
 
322
   if (event->button == 3 && (event->state & GDK_CONTROL_MASK) != 0)
 
323
@@ -4104,7 +4120,9 @@
 
324
   gtk_widget_queue_draw (widget);
 
325
 
 
326
   DV(g_print (G_STRLOC": focus_in_event\n"));
 
327
-  
 
328
+
 
329
+  gtk_text_view_reset_blink_time (text_view);
 
330
+
 
331
   if (text_view->cursor_visible && text_view->layout)
 
332
     {
 
333
       gtk_text_layout_set_cursor_visible (text_view->layout, TRUE);
 
334
@@ -4437,9 +4455,10 @@
 
335
   g_slist_free (copy);
 
336
 }
 
337
 
 
338
-#define CURSOR_ON_MULTIPLIER 0.66
 
339
-#define CURSOR_OFF_MULTIPLIER 0.34
 
340
-#define CURSOR_PEND_MULTIPLIER 1.0
 
341
+#define CURSOR_ON_MULTIPLIER 2
 
342
+#define CURSOR_OFF_MULTIPLIER 1
 
343
+#define CURSOR_PEND_MULTIPLIER 3
 
344
+#define CURSOR_DIVIDER 3
 
345
 
 
346
 static gboolean
 
347
 cursor_blinks (GtkTextView *text_view)
 
348
@@ -4484,6 +4503,18 @@
 
349
   return time;
 
350
 }
 
351
 
 
352
+static gint
 
353
+get_cursor_blink_timeout (GtkTextView *text_view)
 
354
+{
 
355
+  GtkSettings *settings = gtk_widget_get_settings (GTK_WIDGET (text_view));
 
356
+  gint time;
 
357
+
 
358
+  g_object_get (settings, "gtk-cursor-blink-timeout", &time, NULL);
 
359
+
 
360
+  return time;
 
361
+}
 
362
+
 
363
+
 
364
 /*
 
365
  * Blink!
 
366
  */
 
367
@@ -4492,12 +4523,15 @@
 
368
 blink_cb (gpointer data)
 
369
 {
 
370
   GtkTextView *text_view;
 
371
+  GtkTextViewPrivate *priv;
 
372
   gboolean visible;
 
373
+  gint blink_timeout;
 
374
 
 
375
   GDK_THREADS_ENTER ();
 
376
 
 
377
   text_view = GTK_TEXT_VIEW (data);
 
378
-  
 
379
+  priv = GTK_TEXT_VIEW_GET_PRIVATE (text_view);
 
380
+
 
381
   if (!GTK_WIDGET_HAS_FOCUS (text_view))
 
382
     {
 
383
       g_warning ("GtkTextView - did not receive focus-out-event. If you\n"
 
384
@@ -4514,14 +4548,25 @@
 
385
 
 
386
   visible = gtk_text_layout_get_cursor_visible (text_view->layout);
 
387
 
 
388
-  if (visible)
 
389
-    text_view->blink_timeout = g_timeout_add (get_cursor_time (text_view) * CURSOR_OFF_MULTIPLIER,
 
390
-                                             blink_cb,
 
391
-                                             text_view);
 
392
-  else
 
393
-    text_view->blink_timeout = g_timeout_add (get_cursor_time (text_view) * CURSOR_ON_MULTIPLIER,
 
394
+  blink_timeout = get_cursor_blink_timeout (text_view);
 
395
+  if (priv->blink_time > 1000 * blink_timeout &&
 
396
+      blink_timeout < G_MAXINT/1000) 
 
397
+    {
 
398
+      /* we've blinked enough without the user doing anything, stop blinking */
 
399
+      visible = 0;
 
400
+      text_view->blink_timeout = 0;
 
401
+    } 
 
402
+  else if (visible)
 
403
+    text_view->blink_timeout = g_timeout_add (get_cursor_time (text_view) * CURSOR_OFF_MULTIPLIER / CURSOR_DIVIDER,
 
404
                                              blink_cb,
 
405
                                              text_view);
 
406
+  else 
 
407
+    {
 
408
+      text_view->blink_timeout = g_timeout_add (get_cursor_time (text_view) * CURSOR_ON_MULTIPLIER / CURSOR_DIVIDER,
 
409
+                                               blink_cb,
 
410
+                                               text_view);
 
411
+      priv->blink_time += get_cursor_time (text_view);
 
412
+    }
 
413
 
 
414
   /* Block changed_handler while changing the layout's cursor visibility
 
415
    * because it would expose the whole paragraph. Instead, we expose
 
416
@@ -4567,7 +4612,7 @@
 
417
            {
 
418
              gtk_text_layout_set_cursor_visible (text_view->layout, TRUE);
 
419
              
 
420
-             text_view->blink_timeout = g_timeout_add (get_cursor_time (text_view) * CURSOR_OFF_MULTIPLIER,
 
421
+             text_view->blink_timeout = g_timeout_add (get_cursor_time (text_view) * CURSOR_OFF_MULTIPLIER / CURSOR_DIVIDER,
 
422
                                                        blink_cb,
 
423
                                                        text_view);
 
424
            }
 
425
@@ -4596,12 +4641,22 @@
 
426
       gtk_text_view_stop_cursor_blink (text_view);
 
427
       gtk_text_layout_set_cursor_visible (text_view->layout, TRUE);
 
428
       
 
429
-      text_view->blink_timeout = g_timeout_add (get_cursor_time (text_view) * CURSOR_PEND_MULTIPLIER,
 
430
+      text_view->blink_timeout = g_timeout_add (get_cursor_time (text_view) * CURSOR_PEND_MULTIPLIER / CURSOR_DIVIDER,
 
431
                                                blink_cb,
 
432
                                                text_view);
 
433
     }
 
434
 }
 
435
 
 
436
+static void
 
437
+gtk_text_view_reset_blink_time (GtkTextView *text_view)
 
438
+{
 
439
+  GtkTextViewPrivate *priv;
 
440
+
 
441
+  priv = GTK_TEXT_VIEW_GET_PRIVATE (text_view);
 
442
+
 
443
+  priv->blink_time = 0;
 
444
+}
 
445
+
 
446
 
 
447
 /*
 
448
  * Key binding handlers