SF.net SVN: geany:[5013] branches/unstable

ntrel at users.sourceforge.net ntrel at xxxxx
Thu Jun 10 11:37:40 UTC 2010


Revision: 5013
          http://geany.svn.sourceforge.net/geany/?rev=5013&view=rev
Author:   ntrel
Date:     2010-06-10 11:37:39 +0000 (Thu, 10 Jun 2010)

Log Message:
-----------
Fix the wrong file being put on top of the stack when switching tabs
too quickly (patch from Ji?\197?\153?\195?\173 Techet, thanks).

Modified Paths:
--------------
    branches/unstable/ChangeLog
    branches/unstable/THANKS
    branches/unstable/src/about.c
    branches/unstable/src/keybindings.c

Modified: branches/unstable/ChangeLog
===================================================================
--- branches/unstable/ChangeLog	2010-06-09 12:27:58 UTC (rev 5012)
+++ branches/unstable/ChangeLog	2010-06-10 11:37:39 UTC (rev 5013)
@@ -1,3 +1,10 @@
+2010-06-10  Nick Treleaven  <nick(dot)treleaven(at)btinternet(dot)com>
+
+ * src/keybindings.c, src/about.c, THANKS:
+   Fix the wrong file being put on top of the stack when switching tabs
+   too quickly (patch from Jiří Techet, thanks).
+
+
 2010-06-09  Nick Treleaven  <nick(dot)treleaven(at)btinternet(dot)com>
 
  * src/templates.c, data/templates/gpl, data/templates/function,

Modified: branches/unstable/THANKS
===================================================================
--- branches/unstable/THANKS	2010-06-09 12:27:58 UTC (rev 5012)
+++ branches/unstable/THANKS	2010-06-10 11:37:39 UTC (rev 5013)
@@ -7,7 +7,8 @@
 Testers and contributors:
 -------------------------
 These people have contributed to Geany by testing the software,
-reporting problems, sending patches and making useful suggestions.
+reporting problems, sending patches and making useful suggestions:
+
 Frank Lanitz <frank(at)frank(dot)uvena(dot)de> - heavy testing
 Christoph Berg <Christoph(dot)Berg(at)kpm-sport(dot)de> - testing and patch for filetype D
 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com> - many patches
@@ -79,10 +80,12 @@
 Dimitar Zhekov <hamster(at)mbox(dot)contact(dot)bg> - matching brace improvements patch
 Ondrej Donek <ondrejd(at)gmail(dot)com> - Support for creating PHP classes with the classbuilder plugin
 Daniel Marjamaki <danielm77(at)spray(dot)se> - Small improvements
+Jiří Techet <techet(at)gmail(dot)com> - Fix switch to last used tab ordering bug
 
 Translators:
 ------------
-These people have translated Geany to foreign languages.
+These people have translated Geany to foreign languages:
+
 Marcos Costales <marcoscostales(at)gmail(dot)com - ast
 Yura Siamashka <yurand2(at)gmail(dot)com> - be_BY
 Dilyan Rusev <dilyanrusev(at)gmail(dot)com> - bg

Modified: branches/unstable/src/about.c
===================================================================
--- branches/unstable/src/about.c	2010-06-09 12:27:58 UTC (rev 5012)
+++ branches/unstable/src/about.c	2010-06-10 11:37:39 UTC (rev 5013)
@@ -89,7 +89,8 @@
 "Daniel Marjamaki, Dave Moore, "
 "Dimitar Zhekov, Dirk Weber, Elias Pschernig, Eric Forgeot, Eugene Arshinov, Felipe Pena, François Cami, "
 "Giuseppe Torelli, Guillaume de Rorthais, Guillaume Hoffmann, Herbert Voss, Jason Oster, "
-"Jean-François Wauthy, Jeff Pohlmeyer, Jesse Mayes, John Gabriele, Jon Senior, Jon Strait, Josef Whiter, "
+"Jean-François Wauthy, Jeff Pohlmeyer, Jesse Mayes, Jiří Techet, "
+"John Gabriele, Jon Senior, Jon Strait, Josef Whiter, "
 "Jörn Reder, Kelvin Gardiner, Kevin Ellwood, Kristoffer A. Tjernås, Lex Trotman, Marko Peric, Matti Mårds, "
 "Moritz Barsnick, Ondrej Donek, Peter Strand, Philipp Gildein, Pierre Joye, Rob van der Linde, "
 "Robert McGinley, Roland Baudin, Ross McKay, S Jagannathan, Saleem Abdulrasool, "

Modified: branches/unstable/src/keybindings.c
===================================================================
--- branches/unstable/src/keybindings.c	2010-06-09 12:27:58 UTC (rev 5012)
+++ branches/unstable/src/keybindings.c	2010-06-10 11:37:39 UTC (rev 5013)
@@ -71,7 +71,7 @@
 static GQueue *mru_docs = NULL;
 static guint mru_pos = 0;
 
-static gboolean switch_dialog_cancelled = TRUE;
+static gboolean switch_in_progress = FALSE;
 static GtkWidget *switch_dialog = NULL;
 static GtkWidget *switch_dialog_label = NULL;
 
@@ -576,7 +576,7 @@
 
 	/* when closing current doc, old is NULL.
 	 * Don't add to the mru list when switch dialog is visible. */
-	if (old && switch_dialog_cancelled)
+	if (old && !switch_in_progress)
 	{
 		g_queue_remove(mru_docs, old);
 		g_queue_push_head(mru_docs, old);
@@ -879,7 +879,7 @@
 	gtk_tree_view_append_column(GTK_TREE_VIEW(tree), column);
 
 	text_renderer = gtk_cell_renderer_text_new();
-    column = gtk_tree_view_column_new_with_attributes(NULL, text_renderer, "text", 1, NULL);
+	column = gtk_tree_view_column_new_with_attributes(NULL, text_renderer, "text", 1, NULL);
 	gtk_tree_view_append_column(GTK_TREE_VIEW(tree), column);
 
 	fill_shortcut_labels_treeview(tree);
@@ -1751,12 +1751,15 @@
 static gboolean on_key_release_event(GtkWidget *widget, GdkEventKey *ev, gpointer user_data)
 {
 	/* user may have rebound keybinding to a different modifier than Ctrl, so check all */
-	if (!switch_dialog_cancelled && is_modifier_key(ev->keyval))
+	if (switch_in_progress && is_modifier_key(ev->keyval))
 	{
-		switch_dialog_cancelled = TRUE;
+		switch_in_progress = FALSE;
 
-		if (switch_dialog && GTK_WIDGET_VISIBLE(switch_dialog))
-			gtk_widget_hide(switch_dialog);
+		if (switch_dialog)
+		{
+			gtk_widget_destroy(switch_dialog);
+			switch_dialog = NULL;
+		}
 
 		mru_pos = 0;
 	}
@@ -1809,23 +1812,27 @@
 }
 
 
+static void update_filename_label()
+{
+	if (!switch_dialog)
+	{
+		switch_dialog = create_switch_dialog();
+		gtk_widget_show_all(switch_dialog);
+	}
+
+	geany_wrap_label_set_text(GTK_LABEL(switch_dialog_label),
+		DOC_FILENAME(document_get_current()));
+}
+
+
 static gboolean on_switch_timeout(G_GNUC_UNUSED gpointer data)
 {
-	if (switch_dialog_cancelled)
+	if (!switch_in_progress || switch_dialog)
 	{
 		return FALSE;
 	}
-	if (! switch_dialog || !GTK_WIDGET_VISIBLE(switch_dialog))
-		mru_pos = 2;	/* skip past the previous document */
-	else
-		mru_pos += 1;
 
-	if (! switch_dialog)
-		switch_dialog = create_switch_dialog();
-
-	geany_wrap_label_set_text(GTK_LABEL(switch_dialog_label),
-		DOC_FILENAME(document_get_current()));
-	gtk_widget_show_all(switch_dialog);
+	update_filename_label();
 	return FALSE;
 }
 
@@ -1848,19 +1855,25 @@
 
 	/* if there's a modifier key, we can switch back in MRU order each time unless
 	 * the key is released */
-	if (! switch_dialog_cancelled)
+	if (!switch_in_progress)
 	{
-		on_switch_timeout(NULL);	/* update filename label */
-	}
-	else
-	if (keybindings_lookup_item(GEANY_KEY_GROUP_NOTEBOOK,
-		GEANY_KEYS_NOTEBOOK_SWITCHTABLASTUSED)->mods)
-	{
-		switch_dialog_cancelled = FALSE;
+		switch_in_progress = TRUE;
 
+		/* because switch_in_progress was not set when we called
+		 * gtk_notebook_set_current_page() above, this function inserted last_doc
+		 * into the queue => on mru_pos = 0 there is last_doc, on mru_pos = 1
+		 * there is the currently displayed doc, so we want to continue from 2
+		 * next time this function is called */
+		mru_pos = 2;
+
 		/* delay showing dialog to give user time to let go of any modifier keys */
 		g_timeout_add(600, on_switch_timeout, NULL);
 	}
+	else
+	{
+		update_filename_label();	/* update filename label */
+		mru_pos += 1;
+	}
 }
 
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Commits mailing list