SF.net SVN: geany: [963] trunk/src/notebook.c

ntrel at users.sourceforge.net ntrel at xxxxx
Fri Nov 3 15:04:00 UTC 2006


Revision: 963
          http://svn.sourceforge.net/geany/?rev=963&view=rev
Author:   ntrel
Date:     2006-11-03 07:03:57 -0800 (Fri, 03 Nov 2006)

Log Message:
-----------
Focus the current document after clicking on a tab.

Modified Paths:
--------------
    trunk/src/notebook.c

Modified: trunk/src/notebook.c
===================================================================
--- trunk/src/notebook.c	2006-11-03 12:21:12 UTC (rev 962)
+++ trunk/src/notebook.c	2006-11-03 15:03:57 UTC (rev 963)
@@ -58,8 +58,22 @@
 static void setup_tab_dnd();
 
 
+static void focus_sci(GtkWidget *widget, gpointer user_data)
+{
+	gint idx = document_get_cur_idx();
+
+	if (! DOC_IDX_VALID(idx)) return;
+
+	gtk_widget_grab_focus(GTK_WIDGET(doc_list[idx].sci));
+}
+
+
 void notebook_init()
 {
+	// focus the current document after clicking on a tab
+	g_signal_connect_after(G_OBJECT(app->notebook), "button-release-event",
+		G_CALLBACK(focus_sci), NULL);
+
 	setup_tab_dnd();
 }
 


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