+2001-06-19 Havoc Pennington <hp@pobox.com>
+
+ * gdk/x11/gdkwindow-x11.c (gdk_window_show_unraised): new function
+ for mapping a window without fooling with stacking order, but
+ updating the "withdrawn" flag
+
+ * gdk/x11/gdkevents-x11.c (gdk_event_translate): Do event
+ filtering as soon as possible, moving move resize and wmspec_check
+ handling after the event filter. Make default filter apply to all
+ events, not just those with no GdkWindow wrapped around the X
+ window. Fix a FIXME about how the window could be a pixmap using
+ RTTI; this of course assumes GDK_IS_WINDOW() is optimized.
+
+ Also, be robust against events not on a known GdkWindow.
+
+ * gdk/x11/gdkmain-x11.c (gdk_x11_grab_server,
+ gdk_x11_ungrab_server): export reference-counted server grabs, so
+ other people can grab server over a GDK function that also does
+ so.
+
Wed Jun 27 19:40:31 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeviewcolumn.c
+2001-06-19 Havoc Pennington <hp@pobox.com>
+
+ * gdk/x11/gdkwindow-x11.c (gdk_window_show_unraised): new function
+ for mapping a window without fooling with stacking order, but
+ updating the "withdrawn" flag
+
+ * gdk/x11/gdkevents-x11.c (gdk_event_translate): Do event
+ filtering as soon as possible, moving move resize and wmspec_check
+ handling after the event filter. Make default filter apply to all
+ events, not just those with no GdkWindow wrapped around the X
+ window. Fix a FIXME about how the window could be a pixmap using
+ RTTI; this of course assumes GDK_IS_WINDOW() is optimized.
+
+ Also, be robust against events not on a known GdkWindow.
+
+ * gdk/x11/gdkmain-x11.c (gdk_x11_grab_server,
+ gdk_x11_ungrab_server): export reference-counted server grabs, so
+ other people can grab server over a GDK function that also does
+ so.
+
Wed Jun 27 19:40:31 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeviewcolumn.c
+2001-06-19 Havoc Pennington <hp@pobox.com>
+
+ * gdk/x11/gdkwindow-x11.c (gdk_window_show_unraised): new function
+ for mapping a window without fooling with stacking order, but
+ updating the "withdrawn" flag
+
+ * gdk/x11/gdkevents-x11.c (gdk_event_translate): Do event
+ filtering as soon as possible, moving move resize and wmspec_check
+ handling after the event filter. Make default filter apply to all
+ events, not just those with no GdkWindow wrapped around the X
+ window. Fix a FIXME about how the window could be a pixmap using
+ RTTI; this of course assumes GDK_IS_WINDOW() is optimized.
+
+ Also, be robust against events not on a known GdkWindow.
+
+ * gdk/x11/gdkmain-x11.c (gdk_x11_grab_server,
+ gdk_x11_ungrab_server): export reference-counted server grabs, so
+ other people can grab server over a GDK function that also does
+ so.
+
Wed Jun 27 19:40:31 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeviewcolumn.c
+2001-06-19 Havoc Pennington <hp@pobox.com>
+
+ * gdk/x11/gdkwindow-x11.c (gdk_window_show_unraised): new function
+ for mapping a window without fooling with stacking order, but
+ updating the "withdrawn" flag
+
+ * gdk/x11/gdkevents-x11.c (gdk_event_translate): Do event
+ filtering as soon as possible, moving move resize and wmspec_check
+ handling after the event filter. Make default filter apply to all
+ events, not just those with no GdkWindow wrapped around the X
+ window. Fix a FIXME about how the window could be a pixmap using
+ RTTI; this of course assumes GDK_IS_WINDOW() is optimized.
+
+ Also, be robust against events not on a known GdkWindow.
+
+ * gdk/x11/gdkmain-x11.c (gdk_x11_grab_server,
+ gdk_x11_ungrab_server): export reference-counted server grabs, so
+ other people can grab server over a GDK function that also does
+ so.
+
Wed Jun 27 19:40:31 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeviewcolumn.c
+2001-06-19 Havoc Pennington <hp@pobox.com>
+
+ * gdk/x11/gdkwindow-x11.c (gdk_window_show_unraised): new function
+ for mapping a window without fooling with stacking order, but
+ updating the "withdrawn" flag
+
+ * gdk/x11/gdkevents-x11.c (gdk_event_translate): Do event
+ filtering as soon as possible, moving move resize and wmspec_check
+ handling after the event filter. Make default filter apply to all
+ events, not just those with no GdkWindow wrapped around the X
+ window. Fix a FIXME about how the window could be a pixmap using
+ RTTI; this of course assumes GDK_IS_WINDOW() is optimized.
+
+ Also, be robust against events not on a known GdkWindow.
+
+ * gdk/x11/gdkmain-x11.c (gdk_x11_grab_server,
+ gdk_x11_ungrab_server): export reference-counted server grabs, so
+ other people can grab server over a GDK function that also does
+ so.
+
Wed Jun 27 19:40:31 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeviewcolumn.c
+2001-06-19 Havoc Pennington <hp@pobox.com>
+
+ * gdk/x11/gdkwindow-x11.c (gdk_window_show_unraised): new function
+ for mapping a window without fooling with stacking order, but
+ updating the "withdrawn" flag
+
+ * gdk/x11/gdkevents-x11.c (gdk_event_translate): Do event
+ filtering as soon as possible, moving move resize and wmspec_check
+ handling after the event filter. Make default filter apply to all
+ events, not just those with no GdkWindow wrapped around the X
+ window. Fix a FIXME about how the window could be a pixmap using
+ RTTI; this of course assumes GDK_IS_WINDOW() is optimized.
+
+ Also, be robust against events not on a known GdkWindow.
+
+ * gdk/x11/gdkmain-x11.c (gdk_x11_grab_server,
+ gdk_x11_ungrab_server): export reference-counted server grabs, so
+ other people can grab server over a GDK function that also does
+ so.
+
Wed Jun 27 19:40:31 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeviewcolumn.c
+2001-06-19 Havoc Pennington <hp@pobox.com>
+
+ * gdk/x11/gdkwindow-x11.c (gdk_window_show_unraised): new function
+ for mapping a window without fooling with stacking order, but
+ updating the "withdrawn" flag
+
+ * gdk/x11/gdkevents-x11.c (gdk_event_translate): Do event
+ filtering as soon as possible, moving move resize and wmspec_check
+ handling after the event filter. Make default filter apply to all
+ events, not just those with no GdkWindow wrapped around the X
+ window. Fix a FIXME about how the window could be a pixmap using
+ RTTI; this of course assumes GDK_IS_WINDOW() is optimized.
+
+ Also, be robust against events not on a known GdkWindow.
+
+ * gdk/x11/gdkmain-x11.c (gdk_x11_grab_server,
+ gdk_x11_ungrab_server): export reference-counted server grabs, so
+ other people can grab server over a GDK function that also does
+ so.
+
Wed Jun 27 19:40:31 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeviewcolumn.c
#GtkRcStyle structures to form a #GtkStyle.
</para>
-@parent_instance:
@name:
@bg_pixmap_name:
@font_desc:
@displayed_width:
@drag_x:
@drag_y:
-@func:
-@func_data:
-@destroy:
@title:
-@cell:
-@attributes:
+@cell_list:
@column_type:
@sort_clicked_signal:
@sort_column_changed_signal:
</para>
@tree_column:
+@cell_renderer:
@attribute:
@column:
</para>
@tree_column:
+@cell_renderer:
@Varargs:
If the window can be resized to a larger size by the user.
</para>
+<!-- ##### ARG GtkWindow:resizable ##### -->
+<para>
+
+</para>
+
<!-- ##### ARG GtkWindow:modal ##### -->
<para>
If the window is modal, i.e. it grabs all GTK+ events.
* drawing operations performed on @window will be diverted to the
* backing store. When you call gdk_window_end_paint(), the backing
* store will be copied to @window, making it visible onscreen. Only
- * the part of window contained in @region will be modified; that is,
+ * the part of @window contained in @region will be modified; that is,
* drawing operations are clipped to @region.
*
* The net result of all this is to remove flicker, because the user
void gdk_window_show (GdkWindow *window);
void gdk_window_hide (GdkWindow *window);
void gdk_window_withdraw (GdkWindow *window);
+void gdk_window_show_unraised (GdkWindow *window);
void gdk_window_move (GdkWindow *window,
gint x,
gint y);
*/
motif_find_drag_window (TRUE);
- XGrabServer(gdk_display);
+ gdk_x11_grab_server ();
motif_read_target_table();
/* Check again, in case it was added in the meantime */
8, PropModeReplace,
data, total_size);
}
- XUngrabServer(gdk_display);
+ gdk_x11_ungrab_server ();
}
g_list_free (sorted);
gint xoffset, yoffset;
return_val = FALSE;
+
+ /* init these, since the done: block uses them */
+ window = NULL;
+ window_private = NULL;
+ event->any.window = NULL;
- /* Find the GdkWindow that this event occurred in.
- *
- * We handle events with window=None
- * specially - they are generated by XFree86's XInput under
- * some circumstances.
- */
+ if (gdk_default_filters)
+ {
+ /* Apply global filters */
+ GdkFilterReturn result;
+ result = gdk_event_apply_filters (xevent, event,
+ gdk_default_filters);
+
+ if (result != GDK_FILTER_CONTINUE)
+ {
+ return_val = (result == GDK_FILTER_TRANSLATE) ? TRUE : FALSE;
+ goto done;
+ }
+ }
+
+ /* We handle events with window=None
+ * specially - they are generated by XFree86's XInput under
+ * some circumstances. This handling for obvious reasons
+ * goes before we bother to lookup the event window.
+ */
if (xevent->xany.window == None)
{
else
return_val = FALSE;
}
+
+ /* Find the GdkWindow that this event occurred in. */
window = gdk_window_lookup (xevent->xany.window);
window_private = (GdkWindowObject *) window;
-
- if (_gdk_moveresize_window &&
- (xevent->xany.type == MotionNotify ||
- xevent->xany.type == ButtonRelease))
- {
- _gdk_moveresize_handle_event (xevent);
- gdk_window_unref (window);
- return FALSE;
- }
-
- if (wmspec_check_window != None &&
- xevent->xany.window == wmspec_check_window)
- {
- if (xevent->type == DestroyNotify)
- wmspec_check_window = None;
-
- /* Eat events on this window unless someone had wrapped
- * it as a foreign window
- */
- if (window == NULL)
- return FALSE;
- }
- /* FIXME: window might be a GdkPixmap!!! */
if (window != NULL)
{
- window_impl = GDK_WINDOW_IMPL_X11 (window_private->impl);
+ /* Window may be a pixmap, so check its type.
+ * (This check is probably too expensive unless
+ * GLib short-circuits an exact type match,
+ * which has been proposed)
+ */
+ if (GDK_IS_WINDOW (window))
+ {
+ window_impl = GDK_WINDOW_IMPL_X11 (window_private->impl);
- if (xevent->xany.window != GDK_WINDOW_XID (window))
- {
- g_assert (xevent->xany.window == window_impl->focus_window);
-
- switch (xevent->type)
- {
- case KeyPress:
- case KeyRelease:
- xevent->xany.window = GDK_WINDOW_XID (window);
- break;
- default:
- return False;
- }
- }
+ if (xevent->xany.window != GDK_WINDOW_XID (window))
+ {
+ g_assert (xevent->xany.window == window_impl->focus_window);
+
+ switch (xevent->type)
+ {
+ case KeyPress:
+ case KeyRelease:
+ xevent->xany.window = GDK_WINDOW_XID (window);
+ break;
+ default:
+ return False;
+ }
+ }
+ }
- gdk_window_ref (window);
+ g_object_ref (G_OBJECT (window));
}
event->any.window = window;
if (xevent->type != DestroyNotify)
return FALSE;
}
- else
+ else if (window_private)
{
- /* Check for filters for this window
- */
+ /* Apply per-window filters */
GdkFilterReturn result;
result = gdk_event_apply_filters (xevent, event,
- window_private
- ?window_private->filters
- :gdk_default_filters);
+ window_private->filters);
if (result != GDK_FILTER_CONTINUE)
{
goto done;
}
}
+
+ if (wmspec_check_window != None &&
+ xevent->xany.window == wmspec_check_window)
+ {
+ if (xevent->type == DestroyNotify)
+ wmspec_check_window = None;
+
+ /* Eat events on this window unless someone had wrapped
+ * it as a foreign window
+ */
+ if (window == NULL)
+ return FALSE;
+ }
+ if (window &&
+ _gdk_moveresize_window &&
+ (xevent->xany.type == MotionNotify ||
+ xevent->xany.type == ButtonRelease))
+ {
+ _gdk_moveresize_handle_event (xevent);
+ gdk_window_unref (window);
+ return FALSE;
+ }
+
/* We do a "manual" conversion of the XEvent to a
* GdkEvent. The structures are mostly the same so
* the conversion is fairly straightforward. We also
xoffset = 0;
yoffset = 0;
}
-
+
switch (xevent->type)
{
case KeyPress:
+ if (window_private == NULL)
+ {
+ return_val = FALSE;
+ break;
+ }
+
/* Lookup the string corresponding to the given keysym.
*/
break;
case KeyRelease:
+ if (window_private == NULL)
+ {
+ return_val = FALSE;
+ break;
+ }
+
/* Lookup the string corresponding to the given keysym.
*/
xevent->xbutton.x, xevent->xbutton.y,
xevent->xbutton.button));
- if (window_private &&
- (window_private->extension_events != 0) &&
- gdk_input_ignore_core)
+ if (window_private == NULL ||
+ ((window_private->extension_events != 0) &&
+ gdk_input_ignore_core))
{
return_val = FALSE;
break;
xevent->xbutton.x, xevent->xbutton.y,
xevent->xbutton.button));
- if (window_private &&
- (window_private->extension_events != 0) &&
- gdk_input_ignore_core)
+ if (window_private == NULL ||
+ ((window_private->extension_events != 0) &&
+ gdk_input_ignore_core))
{
return_val = FALSE;
break;
xevent->xmotion.x, xevent->xmotion.y,
(xevent->xmotion.is_hint) ? "true" : "false"));
- if (window_private &&
- (window_private->extension_events != 0) &&
- gdk_input_ignore_core)
+ if (window_private == NULL ||
+ ((window_private->extension_events != 0) &&
+ gdk_input_ignore_core))
{
return_val = FALSE;
break;
xevent->xcrossing.window,
xevent->xcrossing.detail,
xevent->xcrossing.subwindow));
-
+
+ if (window_private == NULL)
+ {
+ return_val = FALSE;
+ break;
+ }
+
/* Handle focusing (in the case where no window manager is running */
if (window &&
GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD &&
g_message ("leave notify:\t\twindow: %ld detail: %d subwin: %ld",
xevent->xcrossing.window,
xevent->xcrossing.detail, xevent->xcrossing.subwindow));
+
+ if (window_private == NULL)
+ {
+ return_val = FALSE;
+ break;
+ }
/* Handle focusing (in the case where no window manager is running */
if (window &&
xevent->xexpose.x, xevent->xexpose.y,
xevent->xexpose.width, xevent->xexpose.height,
event->any.send_event ? " (send)" : ""));
+
+ if (window_private == NULL)
+ {
+ return_val = FALSE;
+ break;
+ }
+
{
GdkRectangle expose_rect;
GDK_NOTE (EVENTS,
g_message ("graphics expose:\tdrawable: %ld",
xevent->xgraphicsexpose.drawable));
-
+
+ if (window_private == NULL)
+ {
+ return_val = FALSE;
+ break;
+ }
+
expose_rect.x = xevent->xgraphicsexpose.x + xoffset;
expose_rect.y = xevent->xgraphicsexpose.y + yoffset;
expose_rect.width = xevent->xgraphicsexpose.width;
}
#endif /* G_ENABLE_DEBUG */
+ if (window_private == NULL)
+ {
+ return_val = FALSE;
+ break;
+ }
+
event->visibility.type = GDK_VISIBILITY_NOTIFY;
event->visibility.window = window;
atom ? "\"" : "");
g_free (atom);
);
+
+ if (window_private == NULL)
+ {
+ return_val = FALSE;
+ break;
+ }
event->property.type = GDK_PROPERTY_NOTIFY;
event->property.window = window;
break;
case GDK_FILTER_CONTINUE:
/* Send unknown ClientMessage's on to Gtk for it to use */
- event->client.type = GDK_CLIENT_EVENT;
- event->client.window = window;
- event->client.message_type = xevent->xclient.message_type;
- event->client.data_format = xevent->xclient.format;
- memcpy(&event->client.data, &xevent->xclient.data,
- sizeof(event->client.data));
- }
+ if (window_private == NULL)
+ {
+ return_val = FALSE;
+ }
+ else
+ {
+ event->client.type = GDK_CLIENT_EVENT;
+ event->client.window = window;
+ event->client.message_type = xevent->xclient.message_type;
+ event->client.data_format = xevent->xclient.format;
+ memcpy(&event->client.data, &xevent->xclient.data,
+ sizeof(event->client.data));
+ }
+ break;
+ }
}
break;
GdkRegion *invalidate_region = gdk_region_rectangle (area);
GdkRegion *clip_region;
GSList *tmp_list = translate_queue;
-
+
impl = GDK_WINDOW_IMPL_X11 (GDK_WINDOW_OBJECT (window)->impl);
while (tmp_list)
if (!gdk_region_empty (invalidate_region))
gdk_window_invalidate_region (window, invalidate_region, FALSE);
-
+
gdk_region_destroy (invalidate_region);
gdk_region_destroy (clip_region);
}
*rects = rectangles;
*n_rects = region->numRects;
}
+
+/* FIXME put in GdkDisplay */
+static gint grab_count = 0;
+void
+gdk_x11_grab_server (void)
+{
+ if (grab_count == 0)
+ XGrabServer (gdk_display);
+ ++grab_count;
+}
+
+void
+gdk_x11_ungrab_server (void)
+{
+ g_return_if_fail (grab_count > 0);
+
+ --grab_count;
+ if (grab_count == 0)
+ XUngrabServer (gdk_display);
+}
}
}
-void
-gdk_window_show (GdkWindow *window)
+static void
+show_window_internal (GdkWindow *window,
+ gboolean raise)
{
GdkWindowObject *private;
private = (GdkWindowObject*) window;
if (!private->destroyed)
{
- XRaiseWindow (GDK_WINDOW_XDISPLAY (window),
- GDK_WINDOW_XID (window));
+ if (raise)
+ XRaiseWindow (GDK_WINDOW_XDISPLAY (window),
+ GDK_WINDOW_XID (window));
if (!GDK_WINDOW_IS_MAPPED (window))
{
}
}
+/**
+ * gdk_window_show_unraised:
+ * @window: a #GdkWindow
+ *
+ * Shows a #GdkWindow onscreen, but does not modify its stacking
+ * order. In contrast, gdk_window_show() will raise the window
+ * to the top of the window stack.
+ *
+ **/
+void
+gdk_window_show_unraised (GdkWindow *window)
+{
+ g_return_if_fail (GDK_IS_WINDOW (window));
+
+ show_window_internal (window, FALSE);
+}
+
+void
+gdk_window_show (GdkWindow *window)
+{
+ g_return_if_fail (GDK_IS_WINDOW (window));
+
+ show_window_internal (window, TRUE);
+}
+
void
gdk_window_hide (GdkWindow *window)
{
xwindow = GDK_ROOT_WINDOW ();
xdisplay = GDK_DISPLAY ();
-
- XGrabServer (xdisplay);
+
+ gdk_x11_grab_server ();
while (xwindow)
{
xwindow_last = xwindow;
&winx, &winy,
&xmask);
}
- XUngrabServer (xdisplay);
+ gdk_x11_ungrab_server ();
window = gdk_window_lookup (xwindow_last);
root = GDK_WINDOW_XID (window);
num = g_list_length (excludes);
- XGrabServer (xdisplay);
+ gdk_x11_grab_server ();
if (!XQueryTree (xdisplay, root, &root_win, &parent_win, &list, &num))
{
- XUngrabServer (xdisplay);
+ gdk_x11_ungrab_server ();
return root;
}
if (list)
if (!g_list_find (excludes, (gpointer *) child))
{
XFree (list);
- XUngrabServer (xdisplay);
+ gdk_x11_ungrab_server ();
return child;
}
}
else
{
XFree (list);
- XUngrabServer (xdisplay);
+ gdk_x11_ungrab_server ();
return child;
}
} while (--i > 0);
XFree (list);
}
- XUngrabServer (xdisplay);
+ gdk_x11_ungrab_server ();
return root;
}
guint32 gdk_x11_get_server_time (GdkWindow *window);
+/* FIXME should take a GdkDisplay* */
+void gdk_x11_grab_server (void);
+void gdk_x11_ungrab_server (void);
+
/* returns TRUE if we support the given WM spec feature */
gboolean gdk_net_wm_supports (GdkAtom property);