Delay disk file checks when switching between documents a little bit to avoid fast, unintentional page switching in some cases.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3646 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Enrico Tröger 2009-03-24 18:12:39 +00:00
parent 9318d1def6
commit 97a90efb8b
2 changed files with 18 additions and 1 deletions

View File

@ -1,3 +1,10 @@
2009-03-24 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
* src/callbacks.c:
Delay disk file checks when switching between documents a little
bit to avoid fast, unintentional page switching in some cases.
2009-03-22 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de> 2009-03-22 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
* tagmanager/css.c: * tagmanager/css.c:

View File

@ -682,6 +682,13 @@ on_toolbutton_preferences_clicked (GtkAction *action,
} }
static gboolean delayed_check_disk_status(gpointer data)
{
document_check_disk_status(data, FALSE);
return FALSE;
}
/* Changes window-title after switching tabs and lots of other things. /* Changes window-title after switching tabs and lots of other things.
* note: using 'after' makes Scintilla redraw before the UI, appearing more responsive */ * note: using 'after' makes Scintilla redraw before the UI, appearing more responsive */
void void
@ -709,7 +716,10 @@ on_notebook1_switch_page_after (GtkNotebook *notebook,
build_menu_update(doc); build_menu_update(doc);
treeviews_update_tag_list(doc, FALSE); treeviews_update_tag_list(doc, FALSE);
document_check_disk_status(doc, FALSE); /* We delay the check to avoid weird fast, unintended switching of notebook pages when
* the 'file has changed' dialog is shown while the switch event is not yet completely
* finished. So, we check after the switch has been performed to be safe. */
g_idle_add(delayed_check_disk_status, doc);
#ifdef HAVE_VTE #ifdef HAVE_VTE
vte_cwd((doc->real_path != NULL) ? doc->real_path : doc->file_name, FALSE); vte_cwd((doc->real_path != NULL) ? doc->real_path : doc->file_name, FALSE);