[geany/geany] 5cc8a9: Do not show document change notification dialog when MRU switch is in progress

Jiří Techet git-noreply at xxxxx
Thu Jul 26 00:02:58 UTC 2012


Branch:      refs/heads/document-messages
Author:      Jiří Techet <techet at gmail.com>
Committer:   Jiří Techet <techet at gmail.com>
Date:        Wed, 11 Jan 2012 23:33:50
Commit:      5cc8a96d440274c15f50228ee55461fb557cee3e
             https://github.com/geany/geany/commit/5cc8a96d440274c15f50228ee55461fb557cee3e

Log Message:
-----------
Do not show document change notification dialog when MRU switch is in progress

When switching between MRU documents, Geany pops up a dialog about
document change even for the intermediate non-final documents.
This leads to both reload dialog and document switch dialog displayed
at the same time and termination of document switching because the
newly displayed dialog takes focus.

This patch disables reload checks for the intermediate documents and
forces reload check for the final document.


Modified Paths:
--------------
    src/document.c
    src/notebook.c
    src/notebook.h

Modified: src/document.c
3 files changed, 2 insertions(+), 1 deletions(-)
===================================================================
@@ -2891,7 +2891,8 @@ gboolean document_check_disk_status(GeanyDocument *doc, gboolean force)
 	g_return_val_if_fail(doc != NULL, FALSE);
 
 	/* ignore remote files and documents that have never been saved to disk */
-	if (file_prefs.disk_check_timeout == 0 || doc->real_path == NULL || doc->priv->is_remote)
+	if (notebook_switch_in_progress() || file_prefs.disk_check_timeout == 0 
+			|| doc->real_path == NULL || doc->priv->is_remote)
 		return FALSE;
 
 	use_gio_filemon = (doc->priv->monitor != NULL);


Modified: src/notebook.c
12 files changed, 11 insertions(+), 1 deletions(-)
===================================================================
@@ -169,6 +169,8 @@ static gboolean on_key_release_event(GtkWidget *widget, GdkEventKey *ev, gpointe
 	/* user may have rebound keybinding to a different modifier than Ctrl, so check all */
 	if (switch_in_progress && is_modifier_key(ev->keyval))
 	{
+		GeanyDocument *doc;
+
 		switch_in_progress = FALSE;
 
 		if (switch_dialog)
@@ -177,8 +179,10 @@ static gboolean on_key_release_event(GtkWidget *widget, GdkEventKey *ev, gpointe
 			switch_dialog = NULL;
 		}
 
-		update_mru_docs_head(document_get_current());
+		doc = document_get_current();
+		update_mru_docs_head(doc);
 		mru_pos = 0;
+		document_check_disk_status(doc, TRUE);
 	}
 	return FALSE;
 }
@@ -289,6 +293,12 @@ void notebook_switch_tablastused(void)
 }
 
 
+gboolean notebook_switch_in_progress(void)
+{
+	return switch_in_progress;
+}
+
+
 static gboolean focus_sci(GtkWidget *widget, GdkEventButton *event, gpointer user_data)
 {
 	GeanyDocument *doc = document_get_current();


Modified: src/notebook.h
4 files changed, 4 insertions(+), 0 deletions(-)
===================================================================
@@ -36,4 +36,8 @@
  * previous tabs. */
 void notebook_switch_tablastused(void);
 
+/* Returns TRUE when MRU tab switch is in progress (i.e. not at the final 
+ * document yet). */
+gboolean notebook_switch_in_progress(void);
+
 #endif


@@ Diff output truncated at 100000 characters. @@


--------------
This E-Mail was brought to you by github_commit_mail.py (Source: TBD).



More information about the Commits mailing list