Add GtkWidget::window_state_event() implementation to GimpImageWindow
Keep an own window_state member around and update it accordingly. Chain up in GimpDisplayShell's window_state_event() impl.
This commit is contained in:
@ -643,6 +643,8 @@ gimp_display_shell_window_state_event (GtkWidget *widget,
|
|||||||
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (widget);
|
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (widget);
|
||||||
Gimp *gimp = shell->display->gimp;
|
Gimp *gimp = shell->display->gimp;
|
||||||
|
|
||||||
|
GTK_WIDGET_CLASS (parent_class)->window_state_event (widget, event);
|
||||||
|
|
||||||
shell->window_state = event->new_window_state;
|
shell->window_state = event->new_window_state;
|
||||||
|
|
||||||
if (event->changed_mask & GDK_WINDOW_STATE_FULLSCREEN)
|
if (event->changed_mask & GDK_WINDOW_STATE_FULLSCREEN)
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
#include "gimpdisplayshell.h"
|
#include "gimpdisplayshell.h"
|
||||||
#include "gimpimagewindow.h"
|
#include "gimpimagewindow.h"
|
||||||
|
|
||||||
|
#include "gimp-log.h"
|
||||||
#include "gimp-intl.h"
|
#include "gimp-intl.h"
|
||||||
|
|
||||||
|
|
||||||
@ -57,6 +58,9 @@ static void gimp_image_window_get_property (GObject *object,
|
|||||||
|
|
||||||
static void gimp_image_window_destroy (GtkObject *object);
|
static void gimp_image_window_destroy (GtkObject *object);
|
||||||
|
|
||||||
|
static gboolean gimp_image_window_window_state (GtkWidget *widget,
|
||||||
|
GdkEventWindowState *event);
|
||||||
|
|
||||||
|
|
||||||
G_DEFINE_TYPE (GimpImageWindow, gimp_image_window, GIMP_TYPE_WINDOW)
|
G_DEFINE_TYPE (GimpImageWindow, gimp_image_window, GIMP_TYPE_WINDOW)
|
||||||
|
|
||||||
@ -68,6 +72,7 @@ gimp_image_window_class_init (GimpImageWindowClass *klass)
|
|||||||
{
|
{
|
||||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||||
GtkObjectClass *gtk_object_class = GTK_OBJECT_CLASS (klass);
|
GtkObjectClass *gtk_object_class = GTK_OBJECT_CLASS (klass);
|
||||||
|
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
|
||||||
|
|
||||||
object_class->constructor = gimp_image_window_constructor;
|
object_class->constructor = gimp_image_window_constructor;
|
||||||
object_class->finalize = gimp_image_window_finalize;
|
object_class->finalize = gimp_image_window_finalize;
|
||||||
@ -76,6 +81,8 @@ gimp_image_window_class_init (GimpImageWindowClass *klass)
|
|||||||
|
|
||||||
gtk_object_class->destroy = gimp_image_window_destroy;
|
gtk_object_class->destroy = gimp_image_window_destroy;
|
||||||
|
|
||||||
|
widget_class->window_state_event = gimp_image_window_window_state;
|
||||||
|
|
||||||
g_object_class_install_property (object_class, PROP_MENU_FACTORY,
|
g_object_class_install_property (object_class, PROP_MENU_FACTORY,
|
||||||
g_param_spec_object ("menu-factory",
|
g_param_spec_object ("menu-factory",
|
||||||
NULL, NULL,
|
NULL, NULL,
|
||||||
@ -171,6 +178,17 @@ gimp_image_window_destroy (GtkObject *object)
|
|||||||
GTK_OBJECT_CLASS (parent_class)->destroy (object);
|
GTK_OBJECT_CLASS (parent_class)->destroy (object);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
gimp_image_window_window_state (GtkWidget *widget,
|
||||||
|
GdkEventWindowState *event)
|
||||||
|
{
|
||||||
|
GimpImageWindow *window = GIMP_IMAGE_WINDOW (widget);
|
||||||
|
|
||||||
|
window->window_state = event->new_window_state;
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* public functions */
|
/* public functions */
|
||||||
|
|
||||||
|
@ -37,6 +37,8 @@ struct _GimpImageWindow
|
|||||||
GimpWindow parent_instance;
|
GimpWindow parent_instance;
|
||||||
|
|
||||||
GimpUIManager *menubar_manager;
|
GimpUIManager *menubar_manager;
|
||||||
|
|
||||||
|
GdkWindowState window_state;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _GimpImageWindowClass
|
struct _GimpImageWindowClass
|
||||||
|
Reference in New Issue
Block a user