[geany/geany] 2e1dc7: Don't use expose-event/draw signals of the menu

Jiří Techet git-noreply at xxxxx
Wed Mar 4 11:40:45 UTC 2015

Branch:      refs/heads/master
Author:      Jiří Techet <techet at gmail.com>
Committer:   Jiří Techet <techet at gmail.com>
Date:        Wed, 04 Mar 2015 11:40:45 UTC
Commit:      2e1dc7aebac720f58c71bb2decee9421713cf883

Log Message:
Don't use expose-event/draw signals of the menu

The expose-event/draw signals were used to reenable the menu
after it has been disabled when VTE overrides the given keybinding.
This doesn't work on OS X where GtkMenuBar isn't displayed
(there may be a similar problem with the global menubar on

The reason why these signals were used was probably slight
flickering of the menubar when using ordinary g_idle_add() to
reenable the menu (the dimmed menu gets drawn after which
it gets reenabled and redrawn non-dimmed). It is however possible
to use idle function with higher than redraw priority in which case
the menu is enabled before the redraw so the dimmed menu
isn't drawn at all.

Fixes https://sourceforge.net/p/geany/bugs/1081/

Modified Paths:

Modified: src/keybindings.c
28 lines changed, 1 insertions(+), 27 deletions(-)
@@ -1101,23 +1101,6 @@ static gboolean check_menu_key(GeanyDocument *doc, guint keyval, guint state, gu
 #ifdef HAVE_VTE
-static gboolean on_menu_expose_event(GtkWidget *widget, GdkEventExpose *event,
-		gpointer user_data)
-	if (!gtk_widget_get_sensitive(widget))
-		gtk_widget_set_sensitive(GTK_WIDGET(widget), TRUE);
-	return FALSE;
-#if GTK_CHECK_VERSION(3, 0, 0)
-static gboolean on_menu_draw(GtkWidget *widget, cairo_t *cr, gpointer user_data)
-	return on_menu_expose_event(widget, NULL, user_data);
 static gboolean set_sensitive(gpointer widget)
 	gtk_widget_set_sensitive(GTK_WIDGET(widget), TRUE);
@@ -1158,16 +1141,7 @@ static gboolean check_vte(GdkModifierType state, guint keyval)
 	 * Note: maybe there's a better way of doing this ;-) */
 	widget = ui_lookup_widget(main_widgets.window, "menubar1");
 	gtk_widget_set_sensitive(widget, FALSE);
-	{
-		/* make the menubar sensitive before it is redrawn */
-		static gboolean connected = FALSE;
-		if (!connected)
-#if GTK_CHECK_VERSION(3, 0, 0)
-			g_signal_connect(widget, "draw", G_CALLBACK(on_menu_draw), NULL);
-			g_signal_connect(widget, "expose-event", G_CALLBACK(on_menu_expose_event), NULL);
-	}
+	g_idle_add_full(G_PRIORITY_HIGH, set_sensitive, widget, NULL);
 	widget = main_widgets.editor_menu;
 	gtk_widget_set_sensitive(widget, FALSE);

This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).

More information about the Commits mailing list