Move updating the "view-fullscreen" actions to the proper place

Update the actions in gimp_display_shell_appearance_update() and remove
all action code from the window-state-event handlers.
This commit is contained in:
Michael Natterer 2009-09-25 14:06:14 +02:00
parent 8b5b36751d
commit 4f60240a04
3 changed files with 9 additions and 30 deletions

View File

@ -65,10 +65,17 @@ void
gimp_display_shell_appearance_update (GimpDisplayShell *shell)
{
GimpDisplayOptions *options;
GtkWidget *toplevel;
GimpImageWindow *window;
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
options = appearance_get_options (shell);
options = appearance_get_options (shell);
toplevel = gtk_widget_get_toplevel (GTK_WIDGET (shell));
window = GIMP_IMAGE_WINDOW (toplevel);
appearance_set_action_active (shell, "view-fullscreen",
gimp_image_window_get_fullscreen (window));
gimp_display_shell_set_show_menubar (shell,
options->show_menubar);

View File

@ -661,30 +661,9 @@ gimp_display_shell_window_state_event (GtkWidget *widget,
GdkEventWindowState *event)
{
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (widget);
Gimp *gimp = shell->display->gimp;
GTK_WIDGET_CLASS (parent_class)->window_state_event (widget, event);
if (event->changed_mask & GDK_WINDOW_STATE_FULLSCREEN)
{
GtkWidget *window;
GimpActionGroup *group;
gboolean fullscreen;
window = gtk_widget_get_toplevel (widget);
fullscreen = gimp_image_window_get_fullscreen (GIMP_IMAGE_WINDOW (window));
if (shell->display ==
gimp_context_get_display (gimp_get_user_context (gimp)))
{
group = gimp_ui_manager_get_action_group (shell->popup_manager,
"view");
gimp_action_group_set_action_active (group,
"view-fullscreen", fullscreen);
}
}
if (event->changed_mask & GDK_WINDOW_STATE_ICONIFIED)
{
gimp_display_shell_progress_window_state_changed (shell);

View File

@ -350,10 +350,7 @@ gimp_image_window_window_state_event (GtkWidget *widget,
if (event->changed_mask & GDK_WINDOW_STATE_FULLSCREEN)
{
GimpActionGroup *group;
gboolean fullscreen;
fullscreen = gimp_image_window_get_fullscreen (window);
gboolean fullscreen = gimp_image_window_get_fullscreen (window);
GIMP_LOG (WM, "Image window '%s' [%p] set fullscreen %s",
gtk_window_get_title (GTK_WINDOW (widget)),
@ -368,10 +365,6 @@ gimp_image_window_window_state_event (GtkWidget *widget,
! fullscreen);
gimp_display_shell_appearance_update (GIMP_DISPLAY_SHELL (display->shell));
group = gimp_ui_manager_get_action_group (window->menubar_manager, "view");
gimp_action_group_set_action_active (group,
"view-fullscreen", fullscreen);
}
if (event->changed_mask & GDK_WINDOW_STATE_ICONIFIED)