test the window state stuff
2001-02-26 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c: test the window state stuff * gtk/gtkwindow.c (gtk_window_present): new function, makes a window come to the user's attention as if it were just created (gtk_window_iconify): new function (gtk_window_deiconify): new function (gtk_window_stick): new function (gtk_window_unstick): new function (gtk_window_maximize): new function (gtk_window_unmaximize): new function * gtk/gtkwidget.h, gtk/gtkwidget.c: add window_state_event signal * gtk/gtkmain.c (gtk_main_do_event): handle GDK_WINDOW_STATE * gdk/x11/gdkevents-x11.c: create window state events when appropriate (gdk_wmspec_supported): new function * gdk/x11/gdkwindow-x11.c (gdk_window_iconify): handle iconification before showing the window (gdk_window_deiconify): new function (gdk_window_stick): new function (gdk_window_unstick): new function (gdk_window_maximize): new function (gdk_window_unmaximize): new function * gdk/gdkwindow.c: store the window state in the window; change to using the GDK_WINDOW_STATE_WITHDRAWN flag instead of window->mapped. (gdk_window_get_state): return the current window state * gdk/gdkevents.c (gdk_event_get_time): handle GDK_WINDOW_STATE (gdk_event_get_state): handle GDK_WINDOW_STATE (gdk_synthesize_window_state): function to create the window state events * gdk/gdkevents.h (struct _GdkEventWindowState): new type of event, for changes to "window state" such as maximized, sticky, etc. * gdk/x11/gdkwindow-x11.c (gdk_window_focus): new function, focuses a window * gdk/x11/gdkmain-x11.c (_gdk_wmspec_supported): new function, finds out if we support a given WM spec hint
This commit is contained in:
committed by
Havoc Pennington
parent
af03d3855d
commit
75d79abf98
@ -99,6 +99,7 @@ enum {
|
||||
CLIENT_EVENT,
|
||||
NO_EXPOSE_EVENT,
|
||||
VISIBILITY_NOTIFY_EVENT,
|
||||
WINDOW_STATE_EVENT,
|
||||
DEBUG_MSG,
|
||||
LAST_SIGNAL
|
||||
};
|
||||
@ -314,6 +315,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
|
||||
klass->focus_out_event = NULL;
|
||||
klass->map_event = NULL;
|
||||
klass->unmap_event = NULL;
|
||||
klass->window_state_event = NULL;
|
||||
klass->property_notify_event = gtk_selection_property_notify;
|
||||
klass->selection_clear_event = gtk_selection_clear;
|
||||
klass->selection_request_event = gtk_selection_request;
|
||||
@ -775,6 +777,14 @@ gtk_widget_class_init (GtkWidgetClass *klass)
|
||||
gtk_marshal_BOOLEAN__POINTER,
|
||||
GTK_TYPE_BOOL, 1,
|
||||
GTK_TYPE_GDK_EVENT);
|
||||
widget_signals[WINDOW_STATE_EVENT] =
|
||||
gtk_signal_new ("window_state_event",
|
||||
GTK_RUN_LAST,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkWidgetClass, no_expose_event),
|
||||
gtk_marshal_BOOLEAN__POINTER,
|
||||
GTK_TYPE_BOOL, 1,
|
||||
GTK_TYPE_GDK_EVENT);
|
||||
widget_signals[DEBUG_MSG] =
|
||||
gtk_signal_new ("debug_msg",
|
||||
GTK_RUN_LAST | GTK_RUN_ACTION,
|
||||
@ -2337,6 +2347,9 @@ gtk_widget_event (GtkWidget *widget,
|
||||
case GDK_UNMAP:
|
||||
signal_num = UNMAP_EVENT;
|
||||
break;
|
||||
case GDK_WINDOW_STATE:
|
||||
signal_num = WINDOW_STATE_EVENT;
|
||||
break;
|
||||
case GDK_PROPERTY_NOTIFY:
|
||||
signal_num = PROPERTY_NOTIFY_EVENT;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user