[gedit/wip/timeout-scroll] more tests
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit/wip/timeout-scroll] more tests
- Date: Mon, 25 Jul 2022 20:12:43 +0000 (UTC)
commit bf8e5b069d38e5866581ed3954d23ff454b0c6f1
Author: Sébastien Wilmet <swilmet informatique-libre be>
Date: Mon Jul 25 22:02:07 2022 +0200
more tests
gedit/gedit-tab.c | 28 +++++++++++++++++++++++++---
1 file changed, 25 insertions(+), 3 deletions(-)
---
diff --git a/gedit/gedit-tab.c b/gedit/gedit-tab.c
index 6e7b06482..4896f92bf 100644
--- a/gedit/gedit-tab.c
+++ b/gedit/gedit-tab.c
@@ -61,6 +61,7 @@ struct _GeditTab
GtkSourceFileSaverFlags save_flags;
guint scroll_timeout;
+ guint scroll_idle;
gint auto_save_interval;
guint auto_save_timeout;
@@ -336,6 +337,12 @@ gedit_tab_dispose (GObject *object)
tab->scroll_timeout = 0;
}
+ if (tab->scroll_idle != 0)
+ {
+ g_source_remove (tab->scroll_idle);
+ tab->scroll_idle = 0;
+ }
+
if (tab->cancellable != NULL)
{
g_cancellable_cancel (tab->cancellable);
@@ -1031,15 +1038,26 @@ should_show_progress_info (GTimer **timer,
static gboolean
scroll_to_cursor (GeditTab *tab)
{
- GeditView *view;
+ //GeditView *view;
- view = gedit_tab_get_view (tab);
- tepl_view_scroll_to_cursor (TEPL_VIEW (view));
+ g_message ("%s()", G_STRFUNC);
+
+ //view = gedit_tab_get_view (tab);
+ //tepl_view_scroll_to_cursor (TEPL_VIEW (view));
tab->scroll_timeout = 0;
return G_SOURCE_REMOVE;
}
+static gboolean
+scroll_idle_cb (GeditTab *tab)
+{
+ g_message ("%s()", G_STRFUNC);
+
+ tab->scroll_idle = 0;
+ return G_SOURCE_REMOVE;
+}
+
static void
unrecoverable_saving_error_info_bar_response (GtkWidget *info_bar,
gint response_id,
@@ -1689,6 +1707,10 @@ goto_line (GTask *loading_task)
{
data->tab->scroll_timeout = g_timeout_add (250, (GSourceFunc)scroll_to_cursor, data->tab);
}
+ if (data->tab->scroll_idle == 0)
+ {
+ data->tab->scroll_idle = g_idle_add ((GSourceFunc)scroll_idle_cb, data->tab);
+ }
}
static gboolean
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]