From a8876834e80b6e94f18f03b7ce75e53b6be7e135 Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Fri, 25 Sep 2009 22:41:50 +0200 Subject: [PATCH] Move the remaining menubar signal connections from the shell to the window --- app/display/gimpdisplayshell.c | 11 ----------- app/display/gimpimagewindow.c | 27 +++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 11 deletions(-) diff --git a/app/display/gimpdisplayshell.c b/app/display/gimpdisplayshell.c index 7745c20841..62c4d642a5 100644 --- a/app/display/gimpdisplayshell.c +++ b/app/display/gimpdisplayshell.c @@ -896,17 +896,6 @@ gimp_display_shell_new (GimpDisplay *display, gtk_widget_show (menubar); else gtk_widget_hide (menubar); - - /* active display callback */ - g_signal_connect (menubar, "button-press-event", - G_CALLBACK (gimp_display_shell_events), - shell); - g_signal_connect (menubar, "button-release-event", - G_CALLBACK (gimp_display_shell_events), - shell); - g_signal_connect (menubar, "key-press-event", - G_CALLBACK (gimp_display_shell_events), - shell); } /* another vbox for everything except the statusbar */ diff --git a/app/display/gimpimagewindow.c b/app/display/gimpimagewindow.c index 0ff8b11112..386a5a5139 100644 --- a/app/display/gimpimagewindow.c +++ b/app/display/gimpimagewindow.c @@ -39,6 +39,7 @@ #include "gimpdisplay-foreach.h" #include "gimpdisplayshell.h" #include "gimpdisplayshell-appearance.h" +#include "gimpdisplayshell-callbacks.h" #include "gimpdisplayshell-close.h" #include "gimpdisplayshell-scroll.h" #include "gimpimagewindow.h" @@ -88,6 +89,10 @@ static void gimp_image_window_show_tooltip (GimpUIManager *man static void gimp_image_window_hide_tooltip (GimpUIManager *manager, GimpImageWindow *window); +static gboolean gimp_image_window_shell_events (GtkWidget *widget, + GdkEvent *event, + GimpImageWindow *window); + static void gimp_image_window_image_notify (GimpDisplay *display, const GParamSpec *pspec, GimpImageWindow *window); @@ -205,6 +210,17 @@ gimp_image_window_constructor (GType type, g_signal_connect (window->menubar, "can-activate-accel", G_CALLBACK (gtk_true), NULL); + + /* active display callback */ + g_signal_connect (window->menubar, "button-press-event", + G_CALLBACK (gimp_image_window_shell_events), + window); + g_signal_connect (window->menubar, "button-release-event", + G_CALLBACK (gimp_image_window_shell_events), + window); + g_signal_connect (window->menubar, "key-press-event", + G_CALLBACK (gimp_image_window_shell_events), + window); } window->statusbar = gimp_statusbar_new (); @@ -721,6 +737,17 @@ gimp_image_window_hide_tooltip (GimpUIManager *manager, gimp_statusbar_pop (GIMP_STATUSBAR (window->statusbar), "menu-tooltip"); } +static gboolean +gimp_image_window_shell_events (GtkWidget *widget, + GdkEvent *event, + GimpImageWindow *window) +{ + GimpDisplay *display = gimp_image_window_get_active_display (window); + + return gimp_display_shell_events (widget, event, + GIMP_DISPLAY_SHELL (display->shell)); +} + static void gimp_image_window_image_notify (GimpDisplay *display, const GParamSpec *pspec,