Commit 2553b3ca authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann
Browse files

app/display/gimpdisplayshell-callbacks.c app/display/gimpdisplayshell.[ch]

2003-03-11  Sven Neumann  <sven@gimp.org>

	* app/display/gimpdisplayshell-callbacks.c
	* app/display/gimpdisplayshell.[ch]
	* app/gui/image-menu.c
	* app/gui/view-commands.c: rewrote the fullscreen mode
	implementation so that it doesn't loop infinitely.
parent 632b7f8a
2003-03-11 Sven Neumann <sven@gimp.org>
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell.[ch]
* app/gui/image-menu.c
* app/gui/view-commands.c: rewrote the fullscreen mode
implementation so that it doesn't loop infinitely.
2003-03-11 Sven Neumann <sven@gimp.org>
 
* app/display/gimpdisplayshell-callbacks.c
......@@ -132,16 +132,20 @@ view_fullscreen_cmd_callback (GtkWidget *widget,
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
gimp_display_shell_toggle_fullscreen (shell);
gimp_display_shell_set_fullscreen (shell,
GTK_CHECK_MENU_ITEM (widget)->active);
fullscreen = shell->window_state & GDK_WINDOW_STATE_FULLSCREEN;
fullscreen = (shell->window_state & GDK_WINDOW_STATE_FULLSCREEN) != 0;
gimp_item_factory_set_active (GTK_ITEM_FACTORY (shell->menubar_factory),
"/View/Fullscreen",
fullscreen);
gimp_item_factory_set_active (GTK_ITEM_FACTORY (shell->popup_factory),
"/View/Fullscreen",
fullscreen);
if (fullscreen != GTK_CHECK_MENU_ITEM (widget)->active)
{
gimp_item_factory_set_active (GTK_ITEM_FACTORY (shell->menubar_factory),
"/View/Fullscreen",
fullscreen);
gimp_item_factory_set_active (GTK_ITEM_FACTORY (shell->popup_factory),
"/View/Fullscreen",
fullscreen);
}
}
void
......
......@@ -166,8 +166,7 @@ gimp_display_shell_events (GtkWidget *widget,
break;
case GDK_Escape:
if (shell->window_state & GDK_WINDOW_STATE_FULLSCREEN)
gimp_display_shell_toggle_fullscreen (shell);
gimp_display_shell_set_fullscreen (shell, FALSE);
break;
default:
......@@ -193,7 +192,7 @@ gimp_display_shell_events (GtkWidget *widget,
shell->window_state = sevent->new_window_state;
fullscreen = shell->window_state & GDK_WINDOW_STATE_FULLSCREEN;
fullscreen = (shell->window_state & GDK_WINDOW_STATE_FULLSCREEN) != 0;
gimp_item_factory_set_active (GTK_ITEM_FACTORY (shell->menubar_factory),
"/View/Fullscreen",
......
......@@ -1628,12 +1628,21 @@ gimp_display_shell_selection_visibility (GimpDisplayShell *shell,
}
void
gimp_display_shell_toggle_fullscreen (GimpDisplayShell *shell)
gimp_display_shell_set_fullscreen (GimpDisplayShell *shell,
gboolean fullscreen)
{
if (shell->window_state & GDK_WINDOW_STATE_FULLSCREEN)
gtk_window_unfullscreen (GTK_WINDOW (shell));
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
if (fullscreen)
{
if (! (shell->window_state & GDK_WINDOW_STATE_FULLSCREEN))
gtk_window_fullscreen (GTK_WINDOW (shell));
}
else
gtk_window_fullscreen (GTK_WINDOW (shell));
{
if (shell->window_state & GDK_WINDOW_STATE_FULLSCREEN)
gtk_window_unfullscreen (GTK_WINDOW (shell));
}
}
......
......@@ -233,7 +233,8 @@ void gimp_display_shell_shrink_wrap (GimpDisplayShell *shell);
void gimp_display_shell_selection_visibility (GimpDisplayShell *shell,
GimpSelectionControl control);
void gimp_display_shell_toggle_fullscreen (GimpDisplayShell *shell);
void gimp_display_shell_set_fullscreen (GimpDisplayShell *shell,
gboolean fullscreen);
#endif /* __GIMP_DISPLAY_SHELL_H__ */
......@@ -1628,12 +1628,21 @@ gimp_display_shell_selection_visibility (GimpDisplayShell *shell,
}
void
gimp_display_shell_toggle_fullscreen (GimpDisplayShell *shell)
gimp_display_shell_set_fullscreen (GimpDisplayShell *shell,
gboolean fullscreen)
{
if (shell->window_state & GDK_WINDOW_STATE_FULLSCREEN)
gtk_window_unfullscreen (GTK_WINDOW (shell));
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
if (fullscreen)
{
if (! (shell->window_state & GDK_WINDOW_STATE_FULLSCREEN))
gtk_window_fullscreen (GTK_WINDOW (shell));
}
else
gtk_window_fullscreen (GTK_WINDOW (shell));
{
if (shell->window_state & GDK_WINDOW_STATE_FULLSCREEN)
gtk_window_unfullscreen (GTK_WINDOW (shell));
}
}
......
......@@ -233,7 +233,8 @@ void gimp_display_shell_shrink_wrap (GimpDisplayShell *shell);
void gimp_display_shell_selection_visibility (GimpDisplayShell *shell,
GimpSelectionControl control);
void gimp_display_shell_toggle_fullscreen (GimpDisplayShell *shell);
void gimp_display_shell_set_fullscreen (GimpDisplayShell *shell,
gboolean fullscreen);
#endif /* __GIMP_DISPLAY_SHELL_H__ */
......@@ -355,11 +355,6 @@ GimpItemFactoryEntry image_menu_entries[] =
NULL,
"view/dot_for_dot.html", NULL },
{ { N_("/View/Fullscreen"), "F11",
view_fullscreen_cmd_callback, 0, "<ToggleItem>" },
NULL,
"view/fullscreen.html", NULL },
MENU_SEPARATOR ("/View/---"),
{ { N_("/View/Info Window..."), "<control><shift>I",
......@@ -411,6 +406,11 @@ GimpItemFactoryEntry image_menu_entries[] =
NULL,
"view/toggle_statusbar.html", NULL },
{ { N_("/View/Fullscreen"), "F11",
view_fullscreen_cmd_callback, 0, "<ToggleItem>" },
NULL,
"view/fullscreen.html", NULL },
MENU_SEPARATOR ("/View/---"),
{ { N_("/View/New View"), "",
......@@ -1260,10 +1260,6 @@ image_menu_update (GtkItemFactory *item_factory,
SET_SENSITIVE ("/View/Dot for Dot", gdisp);
SET_ACTIVE ("/View/Dot for Dot", gdisp && shell->dot_for_dot);
SET_SENSITIVE ("/View/Fullscreen", gdisp);
SET_ACTIVE ("/View/Fullscreen",
gdisp && (shell->window_state & GDK_WINDOW_STATE_FULLSCREEN));
SET_SENSITIVE ("/View/Info Window...", gdisp);
SET_SENSITIVE ("/View/Navigation Window...", gdisp);
SET_SENSITIVE ("/View/Display Filters...", gdisp);
......@@ -1291,6 +1287,10 @@ image_menu_update (GtkItemFactory *item_factory,
SET_ACTIVE ("/View/Show Statusbar",
gdisp && GTK_WIDGET_VISIBLE (shell->statusbar));
SET_SENSITIVE ("/View/Fullscreen", gdisp);
SET_ACTIVE ("/View/Fullscreen",
gdisp && (shell->window_state & GDK_WINDOW_STATE_FULLSCREEN));
SET_SENSITIVE ("/View/New View", gdisp);
SET_SENSITIVE ("/View/Shrink Wrap", gdisp);
......
......@@ -132,16 +132,20 @@ view_fullscreen_cmd_callback (GtkWidget *widget,
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
gimp_display_shell_toggle_fullscreen (shell);
gimp_display_shell_set_fullscreen (shell,
GTK_CHECK_MENU_ITEM (widget)->active);
fullscreen = shell->window_state & GDK_WINDOW_STATE_FULLSCREEN;
fullscreen = (shell->window_state & GDK_WINDOW_STATE_FULLSCREEN) != 0;
gimp_item_factory_set_active (GTK_ITEM_FACTORY (shell->menubar_factory),
"/View/Fullscreen",
fullscreen);
gimp_item_factory_set_active (GTK_ITEM_FACTORY (shell->popup_factory),
"/View/Fullscreen",
fullscreen);
if (fullscreen != GTK_CHECK_MENU_ITEM (widget)->active)
{
gimp_item_factory_set_active (GTK_ITEM_FACTORY (shell->menubar_factory),
"/View/Fullscreen",
fullscreen);
gimp_item_factory_set_active (GTK_ITEM_FACTORY (shell->popup_factory),
"/View/Fullscreen",
fullscreen);
}
}
void
......
......@@ -355,11 +355,6 @@ GimpItemFactoryEntry image_menu_entries[] =
NULL,
"view/dot_for_dot.html", NULL },
{ { N_("/View/Fullscreen"), "F11",
view_fullscreen_cmd_callback, 0, "<ToggleItem>" },
NULL,
"view/fullscreen.html", NULL },
MENU_SEPARATOR ("/View/---"),
{ { N_("/View/Info Window..."), "<control><shift>I",
......@@ -411,6 +406,11 @@ GimpItemFactoryEntry image_menu_entries[] =
NULL,
"view/toggle_statusbar.html", NULL },
{ { N_("/View/Fullscreen"), "F11",
view_fullscreen_cmd_callback, 0, "<ToggleItem>" },
NULL,
"view/fullscreen.html", NULL },
MENU_SEPARATOR ("/View/---"),
{ { N_("/View/New View"), "",
......@@ -1260,10 +1260,6 @@ image_menu_update (GtkItemFactory *item_factory,
SET_SENSITIVE ("/View/Dot for Dot", gdisp);
SET_ACTIVE ("/View/Dot for Dot", gdisp && shell->dot_for_dot);
SET_SENSITIVE ("/View/Fullscreen", gdisp);
SET_ACTIVE ("/View/Fullscreen",
gdisp && (shell->window_state & GDK_WINDOW_STATE_FULLSCREEN));
SET_SENSITIVE ("/View/Info Window...", gdisp);
SET_SENSITIVE ("/View/Navigation Window...", gdisp);
SET_SENSITIVE ("/View/Display Filters...", gdisp);
......@@ -1291,6 +1287,10 @@ image_menu_update (GtkItemFactory *item_factory,
SET_ACTIVE ("/View/Show Statusbar",
gdisp && GTK_WIDGET_VISIBLE (shell->statusbar));
SET_SENSITIVE ("/View/Fullscreen", gdisp);
SET_ACTIVE ("/View/Fullscreen",
gdisp && (shell->window_state & GDK_WINDOW_STATE_FULLSCREEN));
SET_SENSITIVE ("/View/New View", gdisp);
SET_SENSITIVE ("/View/Shrink Wrap", gdisp);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment