Move the remaining menubar signal connections from the shell to the window

This commit is contained in:
Michael Natterer 2009-09-25 22:41:50 +02:00
parent 375a25dd24
commit a8876834e8
2 changed files with 27 additions and 11 deletions

View File

@ -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 */

View File

@ -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,