Revision: 3754 http://geany.svn.sourceforge.net/geany/?rev=3754&view=rev Author: eht16 Date: 2009-04-30 17:17:13 +0000 (Thu, 30 Apr 2009)
Log Message: ----------- Update the View->Fullscreen menu item when fullscreen state is changed externally (e.g. by the window manager).
Modified Paths: -------------- trunk/ChangeLog trunk/src/callbacks.c trunk/src/callbacks.h trunk/src/main.c
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2009-04-30 13:58:29 UTC (rev 3753) +++ trunk/ChangeLog 2009-04-30 17:17:13 UTC (rev 3754) @@ -1,3 +1,10 @@ +2009-04-30 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de> + + * src/callbacks.c, src/callbacks.h, src/main.c: + Update the View->Fullscreen menu item when fullscreen state is + changed externally (e.g. by the window manager). + + 2009-04-27 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
* src/callbacks.c, src/keyfile.c, src/main.c, src/ui_utils.c,
Modified: trunk/src/callbacks.c =================================================================== --- trunk/src/callbacks.c 2009-04-30 13:58:29 UTC (rev 3753) +++ trunk/src/callbacks.c 2009-04-30 17:17:13 UTC (rev 3754) @@ -946,6 +946,9 @@ on_fullscreen1_toggled (GtkCheckMenuItem *checkmenuitem, gpointer user_data) { + if (ignore_callback) + return; + ui_prefs.fullscreen = (ui_prefs.fullscreen) ? FALSE : TRUE; ui_set_fullscreen(); } @@ -2239,3 +2242,25 @@ #endif }
+gboolean on_window_state_event (GtkWidget *widget, + GdkEventWindowState *event, + gpointer user_data) +{ + + if (event->changed_mask & GDK_WINDOW_STATE_FULLSCREEN) + { + static GtkWidget *menuitem = NULL; + + if (menuitem == NULL) + menuitem = ui_lookup_widget(widget, "menu_fullscreen1"); + + ignore_callback = TRUE; + + ui_prefs.fullscreen = (event->new_window_state & GDK_WINDOW_STATE_FULLSCREEN) ? TRUE : FALSE; + gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menuitem), ui_prefs.fullscreen); + + ignore_callback = FALSE; + } + return FALSE; +} +
Modified: trunk/src/callbacks.h =================================================================== --- trunk/src/callbacks.h 2009-04-30 13:58:29 UTC (rev 3753) +++ trunk/src/callbacks.h 2009-04-30 17:17:13 UTC (rev 3754) @@ -602,3 +602,7 @@ void on_very_small_icons1_activate (GtkCheckMenuItem *menuitem, gpointer user_data); + +gboolean on_window_state_event (GtkWidget *widget, + GdkEventWindowState *event, + gpointer user_data);
Modified: trunk/src/main.c =================================================================== --- trunk/src/main.c 2009-04-30 13:58:29 UTC (rev 3753) +++ trunk/src/main.c 2009-04-30 17:17:13 UTC (rev 3754) @@ -1019,6 +1019,7 @@ GtkWidget *entry;
g_signal_connect(main_widgets.window, "delete-event", G_CALLBACK(on_exit_clicked), NULL); + g_signal_connect(main_widgets.window, "window-state-event", G_CALLBACK(on_window_state_event), NULL); g_signal_connect(main_widgets.toolbar, "button-press-event", G_CALLBACK(toolbar_popup_menu), NULL);
g_signal_connect(ui_lookup_widget(main_widgets.window, "textview_scribble"),
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.