mirror of https://github.com/GNOME/gimp.git
Bill Skaggs <weskaggs@primate.ucdavis.edu>
* app/tools/gimptexttool.c * app/display/gimpdisplayshell.c * app/display/gimpdisplayshell-callbacks.[ch]: fix some bugs arising from making display shell a non-toplevel. svn path=/branches/weskaggs/; revision=25419
This commit is contained in:
parent
c3c315b73d
commit
cf6780bf65
|
@ -1,3 +1,10 @@
|
|||
2008-04-08 Bill Skaggs <weskaggs@primate.ucdavis.edu>
|
||||
|
||||
* app/tools/gimptexttool.c
|
||||
* app/display/gimpdisplayshell.c
|
||||
* app/display/gimpdisplayshell-callbacks.[ch]: fix some
|
||||
bugs arising from making display shell a non-toplevel.
|
||||
|
||||
2008-04-08 Bill Skaggs <weskaggs@primate.ucdavis.edu>
|
||||
|
||||
* app/gui/gui-message.c (gui_message_error_dialog):
|
||||
|
|
|
@ -99,6 +99,86 @@ static GdkEvent * gimp_display_shell_compress_motion (GimpDisplayShell *shell)
|
|||
|
||||
/* public functions */
|
||||
|
||||
gboolean
|
||||
gimp_display_shell_container_events (GtkWidget *widget,
|
||||
GdkEvent *event,
|
||||
GimpDisplayShell *shell)
|
||||
{
|
||||
Gimp *gimp;
|
||||
|
||||
/* are we in destruction? */
|
||||
if (! shell->display || ! shell->display->shell)
|
||||
return TRUE;
|
||||
|
||||
gimp = shell->display->image->gimp;
|
||||
|
||||
switch (event->type)
|
||||
{
|
||||
case GDK_WINDOW_STATE:
|
||||
{
|
||||
GdkEventWindowState *sevent = (GdkEventWindowState *) event;
|
||||
GimpDisplayOptions *options;
|
||||
gboolean fullscreen;
|
||||
GimpActionGroup *group;
|
||||
|
||||
shell->window_state = sevent->new_window_state;
|
||||
|
||||
if (! (sevent->changed_mask & GDK_WINDOW_STATE_FULLSCREEN))
|
||||
break;
|
||||
|
||||
fullscreen = gimp_display_shell_get_fullscreen (shell);
|
||||
|
||||
gtk_widget_set_name (GTK_WIDGET (shell->menubar),
|
||||
fullscreen ? "gimp-menubar-fullscreen" : NULL);
|
||||
|
||||
options = fullscreen ? shell->fullscreen_options : shell->options;
|
||||
|
||||
gimp_display_shell_set_show_menubar (shell,
|
||||
options->show_menubar);
|
||||
gimp_display_shell_set_show_rulers (shell,
|
||||
options->show_rulers);
|
||||
gimp_display_shell_set_show_scrollbars (shell,
|
||||
options->show_scrollbars);
|
||||
gimp_display_shell_set_show_statusbar (shell,
|
||||
options->show_statusbar);
|
||||
gimp_display_shell_set_show_selection (shell,
|
||||
options->show_selection);
|
||||
gimp_display_shell_set_show_layer (shell,
|
||||
options->show_layer_boundary);
|
||||
gimp_display_shell_set_show_guides (shell,
|
||||
options->show_guides);
|
||||
gimp_display_shell_set_show_grid (shell,
|
||||
options->show_grid);
|
||||
gimp_display_shell_set_show_sample_points (shell,
|
||||
options->show_sample_points);
|
||||
gimp_display_shell_set_padding (shell,
|
||||
options->padding_mode,
|
||||
&options->padding_color);
|
||||
|
||||
group = gimp_ui_manager_get_action_group (shell->menubar_manager,
|
||||
"view");
|
||||
gimp_action_group_set_action_active (group, "view-fullscreen",
|
||||
fullscreen);
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
gboolean
|
||||
gimp_display_shell_events (GtkWidget *widget,
|
||||
GdkEvent *event,
|
||||
|
@ -207,63 +287,6 @@ gimp_display_shell_events (GtkWidget *widget,
|
|||
}
|
||||
break;
|
||||
|
||||
case GDK_WINDOW_STATE:
|
||||
{
|
||||
GdkEventWindowState *sevent = (GdkEventWindowState *) event;
|
||||
GimpDisplayOptions *options;
|
||||
gboolean fullscreen;
|
||||
GimpActionGroup *group;
|
||||
|
||||
shell->window_state = sevent->new_window_state;
|
||||
|
||||
if (! (sevent->changed_mask & GDK_WINDOW_STATE_FULLSCREEN))
|
||||
break;
|
||||
|
||||
fullscreen = gimp_display_shell_get_fullscreen (shell);
|
||||
|
||||
gtk_widget_set_name (GTK_WIDGET (shell->menubar),
|
||||
fullscreen ? "gimp-menubar-fullscreen" : NULL);
|
||||
|
||||
options = fullscreen ? shell->fullscreen_options : shell->options;
|
||||
|
||||
gimp_display_shell_set_show_menubar (shell,
|
||||
options->show_menubar);
|
||||
gimp_display_shell_set_show_rulers (shell,
|
||||
options->show_rulers);
|
||||
gimp_display_shell_set_show_scrollbars (shell,
|
||||
options->show_scrollbars);
|
||||
gimp_display_shell_set_show_statusbar (shell,
|
||||
options->show_statusbar);
|
||||
gimp_display_shell_set_show_selection (shell,
|
||||
options->show_selection);
|
||||
gimp_display_shell_set_show_layer (shell,
|
||||
options->show_layer_boundary);
|
||||
gimp_display_shell_set_show_guides (shell,
|
||||
options->show_guides);
|
||||
gimp_display_shell_set_show_grid (shell,
|
||||
options->show_grid);
|
||||
gimp_display_shell_set_show_sample_points (shell,
|
||||
options->show_sample_points);
|
||||
gimp_display_shell_set_padding (shell,
|
||||
options->padding_mode,
|
||||
&options->padding_color);
|
||||
|
||||
group = gimp_ui_manager_get_action_group (shell->menubar_manager,
|
||||
"view");
|
||||
gimp_action_group_set_action_active (group, "view-fullscreen",
|
||||
fullscreen);
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -38,6 +38,10 @@ gboolean gimp_display_shell_events (GtkWidget *widget,
|
|||
GdkEvent *event,
|
||||
GimpDisplayShell *shell);
|
||||
|
||||
gboolean gimp_display_shell_container_events (GtkWidget *widget,
|
||||
GdkEvent *event,
|
||||
GimpDisplayShell *shell);
|
||||
|
||||
void gimp_display_shell_canvas_realize (GtkWidget *widget,
|
||||
GimpDisplayShell *shell);
|
||||
void gimp_display_shell_canvas_size_allocate (GtkWidget *widget,
|
||||
|
|
|
@ -363,9 +363,6 @@ gimp_display_shell_init (GimpDisplayShell *shell)
|
|||
g_signal_connect (shell, "key-press-event",
|
||||
G_CALLBACK (gimp_display_shell_events),
|
||||
shell);
|
||||
g_signal_connect (shell, "window-state-event",
|
||||
G_CALLBACK (gimp_display_shell_events),
|
||||
shell);
|
||||
|
||||
gimp_display_shell_dnd_init (shell);
|
||||
|
||||
|
@ -1118,6 +1115,9 @@ gimp_display_shell_new (GimpDisplay *display,
|
|||
g_signal_connect (shell->container_window, "delete-event",
|
||||
G_CALLBACK (gimp_display_shell_container_window_closed),
|
||||
shell);
|
||||
g_signal_connect (shell->container_window, "window-state-event",
|
||||
G_CALLBACK (gimp_display_shell_container_events),
|
||||
shell);
|
||||
|
||||
filter = gimp_display_shell_filter_new (shell,
|
||||
gimp->config->color_management);
|
||||
|
|
|
@ -56,6 +56,7 @@
|
|||
#include "widgets/gimpviewabledialog.h"
|
||||
|
||||
#include "display/gimpdisplay.h"
|
||||
#include "display/gimpdisplayshell.h"
|
||||
|
||||
#include "gimpeditselectiontool.h"
|
||||
#include "gimptextoptions.h"
|
||||
|
@ -736,6 +737,7 @@ gimp_text_tool_editor (GimpTextTool *text_tool)
|
|||
GimpTextOptions *options = GIMP_TEXT_TOOL_GET_OPTIONS (text_tool);
|
||||
GimpDialogFactory *dialog_factory;
|
||||
GtkWindow *parent = NULL;
|
||||
GimpDisplay *display = GIMP_TOOL (text_tool)->display;
|
||||
|
||||
if (text_tool->editor)
|
||||
{
|
||||
|
@ -745,8 +747,8 @@ gimp_text_tool_editor (GimpTextTool *text_tool)
|
|||
|
||||
dialog_factory = gimp_dialog_factory_from_name ("toplevel");
|
||||
|
||||
if (GIMP_TOOL (text_tool)->display)
|
||||
parent = GTK_WINDOW (GIMP_TOOL (text_tool)->display->shell);
|
||||
if (display)
|
||||
parent = GIMP_DISPLAY_SHELL (display->shell)->container_window;
|
||||
|
||||
text_tool->editor = gimp_text_options_editor_new (parent, options,
|
||||
dialog_factory->menu_factory,
|
||||
|
|
Loading…
Reference in New Issue