Commit 75d79abf authored by Havoc Pennington's avatar Havoc Pennington Committed by Havoc Pennington
Browse files

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
parent af03d385
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
Tue Feb 27 13:37:38 GMT 2001 Tony Gale <gale@gtk.org>
* docs/faq/gtk-faq.sgml: New question re memory leaks.
......@@ -24,7 +73,6 @@ Sat Feb 24 20:11:39 2001 Jonathan Blandford <jrb@webwynk.net>
* gtk/gtkclipboard.h: actually put /* */ around #endif comment.
Fri Feb 23 17:50:13 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_bin_expose): Only draw the
......
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
Tue Feb 27 13:37:38 GMT 2001 Tony Gale <gale@gtk.org>
* docs/faq/gtk-faq.sgml: New question re memory leaks.
......@@ -24,7 +73,6 @@ Sat Feb 24 20:11:39 2001 Jonathan Blandford <jrb@webwynk.net>
* gtk/gtkclipboard.h: actually put /* */ around #endif comment.
Fri Feb 23 17:50:13 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_bin_expose): Only draw the
......
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
Tue Feb 27 13:37:38 GMT 2001 Tony Gale <gale@gtk.org>
* docs/faq/gtk-faq.sgml: New question re memory leaks.
......@@ -24,7 +73,6 @@ Sat Feb 24 20:11:39 2001 Jonathan Blandford <jrb@webwynk.net>
* gtk/gtkclipboard.h: actually put /* */ around #endif comment.
Fri Feb 23 17:50:13 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_bin_expose): Only draw the
......
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
Tue Feb 27 13:37:38 GMT 2001 Tony Gale <gale@gtk.org>
* docs/faq/gtk-faq.sgml: New question re memory leaks.
......@@ -24,7 +73,6 @@ Sat Feb 24 20:11:39 2001 Jonathan Blandford <jrb@webwynk.net>
* gtk/gtkclipboard.h: actually put /* */ around #endif comment.
Fri Feb 23 17:50:13 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_bin_expose): Only draw the
......
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
Tue Feb 27 13:37:38 GMT 2001 Tony Gale <gale@gtk.org>
* docs/faq/gtk-faq.sgml: New question re memory leaks.
......@@ -24,7 +73,6 @@ Sat Feb 24 20:11:39 2001 Jonathan Blandford <jrb@webwynk.net>
* gtk/gtkclipboard.h: actually put /* */ around #endif comment.
Fri Feb 23 17:50:13 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_bin_expose): Only draw the
......
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
Tue Feb 27 13:37:38 GMT 2001 Tony Gale <gale@gtk.org>
* docs/faq/gtk-faq.sgml: New question re memory leaks.
......@@ -24,7 +73,6 @@ Sat Feb 24 20:11:39 2001 Jonathan Blandford <jrb@webwynk.net>
* gtk/gtkclipboard.h: actually put /* */ around #endif comment.
Fri Feb 23 17:50:13 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_bin_expose): Only draw the
......
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
Tue Feb 27 13:37:38 GMT 2001 Tony Gale <gale@gtk.org>
* docs/faq/gtk-faq.sgml: New question re memory leaks.
......@@ -24,7 +73,6 @@ Sat Feb 24 20:11:39 2001 Jonathan Blandford <jrb@webwynk.net>
* gtk/gtkclipboard.h: actually put /* */ around #endif comment.
Fri Feb 23 17:50:13 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_bin_expose): Only draw the
......
......@@ -454,6 +454,7 @@ gdk_event_get_time (GdkEvent *event)
case GDK_EXPOSE:
case GDK_MAP:
case GDK_UNMAP:
case GDK_WINDOW_STATE:
/* return current time */
break;
}
......@@ -529,6 +530,7 @@ gdk_event_get_state (GdkEvent *event,
case GDK_EXPOSE:
case GDK_MAP:
case GDK_UNMAP:
case GDK_WINDOW_STATE:
/* no state field */
break;
}
......@@ -803,3 +805,56 @@ gdk_event_button_generate (GdkEvent *event)
button_number[0] = event->button.button;
}
}
void
gdk_synthesize_window_state (GdkWindow *window,
GdkWindowState unset_flags,
GdkWindowState set_flags)
{
GdkEventWindowState temp_event;
GdkWindowState old;
g_return_if_fail (window != NULL);
temp_event.window = window;
temp_event.type = GDK_WINDOW_STATE;
temp_event.send_event = FALSE;
old = ((GdkWindowObject*) temp_event.window)->state;
temp_event.changed_mask = (unset_flags | set_flags) ^ old;
temp_event.new_window_state = old;
temp_event.new_window_state |= set_flags;
temp_event.new_window_state &= ~unset_flags;
if (temp_event.new_window_state == old)
return; /* No actual work to do, nothing changed. */
/* Actually update the field in GdkWindow, this is sort of an odd
* place to do it, but seems like the safest since it ensures we expose no
* inconsistent state to the user.
*/
((GdkWindowObject*) window)->state = temp_event.new_window_state;
/* We only really send the event to toplevels, since
* all the window states don't apply to non-toplevels.
* Non-toplevels do use the GDK_WINDOW_STATE_WITHDRAWN flag
* internally so we needed to update window->state.
*/
switch (((GdkWindowObject*) window)->window_type)
{
case GDK_WINDOW_TOPLEVEL:
case GDK_WINDOW_DIALOG:
case GDK_WINDOW_TEMP: /* ? */
gdk_event_put ((GdkEvent*) &temp_event);
break;
case GDK_WINDOW_FOREIGN:
case GDK_WINDOW_ROOT:
case GDK_WINDOW_CHILD:
break;
}
}
......@@ -28,8 +28,8 @@ typedef struct _GdkEventProperty GdkEventProperty;
typedef struct _GdkEventSelection GdkEventSelection;
typedef struct _GdkEventProximity GdkEventProximity;
typedef struct _GdkEventClient GdkEventClient;
typedef struct _GdkEventDND GdkEventDND;
typedef struct _GdkEventWindowState GdkEventWindowState;
typedef union _GdkEvent GdkEvent;
......@@ -110,7 +110,8 @@ typedef enum
GDK_CLIENT_EVENT = 28,
GDK_VISIBILITY_NOTIFY = 29,
GDK_NO_EXPOSE = 30,
GDK_SCROLL = 31
GDK_SCROLL = 31,
GDK_WINDOW_STATE = 32
} GdkEventType;
/* Event masks. (Used to select what types of events a window
......@@ -193,6 +194,14 @@ typedef enum
GDK_PROPERTY_DELETE
} GdkPropertyState;
typedef enum
{
GDK_WINDOW_STATE_WITHDRAWN = 1 << 0,
GDK_WINDOW_STATE_ICONIFIED = 1 << 1,
GDK_WINDOW_STATE_MAXIMIZED = 1 << 2,
GDK_WINDOW_STATE_STICKY = 1 << 3
} GdkWindowState;
struct _GdkEventAny
{
GdkEventType type;
......@@ -366,6 +375,16 @@ struct _GdkEventClient
} data;
};
struct _GdkEventWindowState
{
GdkEventType type;
GdkWindow *window;
gint8 send_event;
GdkWindowState changed_mask;
GdkWindowState new_window_state;
};
/* Event types for DND */
struct _GdkEventDND {
......@@ -397,6 +416,7 @@ union _GdkEvent
GdkEventProximity proximity;
GdkEventClient client;
GdkEventDND dnd;
GdkEventWindowState window_state;
};
gboolean gdk_events_pending (void);
......
......@@ -117,6 +117,9 @@ void gdk_event_queue_remove_link (GList *node);
void gdk_event_queue_append (GdkEvent *event);
void gdk_event_button_generate (GdkEvent *event);
void gdk_synthesize_window_state (GdkWindow *window,
GdkWindowState unset_flags,
GdkWindowState set_flags);
/*************************************
* Interfaces used by windowing code *
......@@ -163,6 +166,8 @@ void _gdk_windowing_window_clear_area_e (GdkWindow *window,
gint width,
gint height);
#define GDK_WINDOW_IS_MAPPED(window) ((((GdkWindowObject*)window)->state & GDK_WINDOW_STATE_WITHDRAWN) == 0)
/* Called before processing updates for a window. This gives the windowing
* layer a chance to save the region for later use in avoiding duplicate
* exposes. The return value indicates whether the function has a saved
......
......@@ -188,6 +188,8 @@ gdk_window_init (GdkWindowObject *window)
window->window_type = GDK_WINDOW_CHILD;
window->state = GDK_WINDOW_STATE_WITHDRAWN;
window->impl = g_object_new (_gdk_window_impl_get_type (), NULL);
}
......@@ -290,7 +292,7 @@ _gdk_window_destroy_hierarchy (GdkWindow *window,
case GDK_WINDOW_FOREIGN:
if (!GDK_WINDOW_DESTROYED (window))
{
private->mapped = FALSE;
private->state |= GDK_WINDOW_STATE_WITHDRAWN;
private->destroyed = TRUE;
_gdk_windowing_window_destroy (window, recursing, foreign_destroy);
......@@ -573,12 +575,9 @@ gdk_window_get_toplevels (void)
gboolean
gdk_window_is_visible (GdkWindow *window)
{
GdkWindowObject *private = (GdkWindowObject *)window;
g_return_val_if_fail (window != NULL, FALSE);
g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE);
return private->mapped;
return GDK_WINDOW_IS_MAPPED (window);
}
/*************************************************************
......@@ -605,7 +604,7 @@ gdk_window_is_viewable (GdkWindow *window)
(private != (GdkWindowObject *)gdk_parent_root) &&
(GDK_WINDOW_TYPE (private) != GDK_WINDOW_FOREIGN))
{
if (!private->mapped)
if (!GDK_WINDOW_IS_MAPPED (window))
return FALSE;
private = (GdkWindowObject *)private->parent;
......@@ -614,6 +613,25 @@ gdk_window_is_viewable (GdkWindow *window)
return TRUE;
}
/**
* gdk_window_get_state:
* @window: a #GdkWindow
*
* Gets the bitwise OR of the currently active window state flags,
* from the #GdkWindowState enumeration.
*
* Return value: window state bitfield
**/
GdkWindowState
gdk_window_get_state (GdkWindow *window)
{
GdkWindowObject *private = (GdkWindowObject *)window;
g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE);
return private->state;
}
/**
* gdk_window_begin_paint_rect:
* @window: a #GdkWindow
......@@ -1871,7 +1889,7 @@ gdk_window_invalidate_rect (GdkWindow *window,
if (GDK_WINDOW_DESTROYED (window))
return;
if (private->input_only || !private->mapped)
if (private->input_only || !GDK_WINDOW_IS_MAPPED (window))
return;
if (!rect)
......@@ -1927,7 +1945,7 @@ gdk_window_invalidate_region (GdkWindow *window,