Revision: 2749 http://geany.svn.sourceforge.net/geany/?rev=2749&view=rev Author: ntrel Date: 2008-07-03 10:04:12 -0700 (Thu, 03 Jul 2008)
Log Message: ----------- Avoid flickering the menu bar when 'Override Geany keybindings' Terminal pref is set.
Modified Paths: -------------- trunk/ChangeLog trunk/src/keybindings.c
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-07-03 15:20:44 UTC (rev 2748) +++ trunk/ChangeLog 2008-07-03 17:04:12 UTC (rev 2749) @@ -5,6 +5,9 @@ allocate string when '<' found. Factor insert_closing_tag() from handle_xml(), fixing a memory leak when ignoring tags like <br>. + * src/keybindings.c: + Avoid flickering the menu bar when 'Override Geany keybindings' + Terminal pref is set.
2008-07-03 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
Modified: trunk/src/keybindings.c =================================================================== --- trunk/src/keybindings.c 2008-07-03 15:20:44 UTC (rev 2748) +++ trunk/src/keybindings.c 2008-07-03 17:04:12 UTC (rev 2749) @@ -832,6 +832,15 @@
#ifdef HAVE_VTE +static gboolean on_menu_expose_event(GtkWidget *widget, GdkEventExpose *event, + gpointer user_data) +{ + if (!GTK_WIDGET_SENSITIVE(widget)) + gtk_widget_set_sensitive(GTK_WIDGET(widget), TRUE); + return FALSE; +} + + static gboolean set_sensitive(gpointer widget) { gtk_widget_set_sensitive(GTK_WIDGET(widget), TRUE); @@ -865,14 +874,19 @@
/* Temporarily disable the menus to prevent conflicting menu accelerators * from overriding the VTE bash shortcuts. - * Ideally we would just somehow disable the menubar without redrawing it, - * but maybe that's not possible. */ + * Note: maybe there's a better way of doing this ;-) */ widget = lookup_widget(main_widgets.window, "menubar1"); gtk_widget_set_sensitive(widget, FALSE); - g_idle_add(&set_sensitive, (gpointer) widget); + { + /* make the menubar sensitive before it is redrawn */ + static gboolean connected = FALSE; + if (!connected) + g_signal_connect(widget, "expose-event", G_CALLBACK(on_menu_expose_event), NULL); + } + widget = main_widgets.editor_menu; gtk_widget_set_sensitive(widget, FALSE); - g_idle_add(&set_sensitive, (gpointer) widget); + g_idle_add(set_sensitive, widget); return TRUE; } #endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.