diff options
-rw-r--r-- | ChangeLog | 15 | ||||
-rw-r--r-- | ChangeLog.pre-2-0 | 15 | ||||
-rw-r--r-- | ChangeLog.pre-2-10 | 15 | ||||
-rw-r--r-- | ChangeLog.pre-2-2 | 15 | ||||
-rw-r--r-- | ChangeLog.pre-2-4 | 15 | ||||
-rw-r--r-- | ChangeLog.pre-2-6 | 15 | ||||
-rw-r--r-- | ChangeLog.pre-2-8 | 15 | ||||
-rw-r--r-- | gdk/gdkprivate.h | 1 | ||||
-rw-r--r-- | gdk/gdkwindow.c | 8 | ||||
-rw-r--r-- | gdk/x11/gdkgeometry-x11.c | 84 | ||||
-rw-r--r-- | gdk/x11/gdkprivate-x11.h | 1 | ||||
-rw-r--r-- | gdk/x11/gdkwindow-x11.c | 2 |
12 files changed, 169 insertions, 32 deletions
@@ -1,3 +1,18 @@ +Thu Feb 24 23:58:21 2000 Owen Taylor <otaylor@redhat.com> + + * gdk/x11/gdkgeometry-x11.c: Don't worry about clipping of + toplevel windows and their immediate children by their parents, + since the size of toplevel windows is out of our immediate + control and we don't get any real benefit from trying to track + this size for clipping. + + * gdk/gdkprivate.h (struct _GdkWindowPrivate) gdk/x11/gdkwindow-x11.c : Add a flag + for input_only windows. + + * gdk/gdkwindow.c gdk/x11/gdkgeometry-x11.c: Use the above flag + to fix some hacks and make sure that we don't try to set the + background of input only windows. + Thu Feb 24 18:11:46 2000 Owen Taylor <otaylor@redhat.com> * gdk/gdkinternals.h gdk/gdkprivate.h gdk/Makefile.am: Add a header file for diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index b0d7f7c4b4..2721624743 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,18 @@ +Thu Feb 24 23:58:21 2000 Owen Taylor <otaylor@redhat.com> + + * gdk/x11/gdkgeometry-x11.c: Don't worry about clipping of + toplevel windows and their immediate children by their parents, + since the size of toplevel windows is out of our immediate + control and we don't get any real benefit from trying to track + this size for clipping. + + * gdk/gdkprivate.h (struct _GdkWindowPrivate) gdk/x11/gdkwindow-x11.c : Add a flag + for input_only windows. + + * gdk/gdkwindow.c gdk/x11/gdkgeometry-x11.c: Use the above flag + to fix some hacks and make sure that we don't try to set the + background of input only windows. + Thu Feb 24 18:11:46 2000 Owen Taylor <otaylor@redhat.com> * gdk/gdkinternals.h gdk/gdkprivate.h gdk/Makefile.am: Add a header file for diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index b0d7f7c4b4..2721624743 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,18 @@ +Thu Feb 24 23:58:21 2000 Owen Taylor <otaylor@redhat.com> + + * gdk/x11/gdkgeometry-x11.c: Don't worry about clipping of + toplevel windows and their immediate children by their parents, + since the size of toplevel windows is out of our immediate + control and we don't get any real benefit from trying to track + this size for clipping. + + * gdk/gdkprivate.h (struct _GdkWindowPrivate) gdk/x11/gdkwindow-x11.c : Add a flag + for input_only windows. + + * gdk/gdkwindow.c gdk/x11/gdkgeometry-x11.c: Use the above flag + to fix some hacks and make sure that we don't try to set the + background of input only windows. + Thu Feb 24 18:11:46 2000 Owen Taylor <otaylor@redhat.com> * gdk/gdkinternals.h gdk/gdkprivate.h gdk/Makefile.am: Add a header file for diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index b0d7f7c4b4..2721624743 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,18 @@ +Thu Feb 24 23:58:21 2000 Owen Taylor <otaylor@redhat.com> + + * gdk/x11/gdkgeometry-x11.c: Don't worry about clipping of + toplevel windows and their immediate children by their parents, + since the size of toplevel windows is out of our immediate + control and we don't get any real benefit from trying to track + this size for clipping. + + * gdk/gdkprivate.h (struct _GdkWindowPrivate) gdk/x11/gdkwindow-x11.c : Add a flag + for input_only windows. + + * gdk/gdkwindow.c gdk/x11/gdkgeometry-x11.c: Use the above flag + to fix some hacks and make sure that we don't try to set the + background of input only windows. + Thu Feb 24 18:11:46 2000 Owen Taylor <otaylor@redhat.com> * gdk/gdkinternals.h gdk/gdkprivate.h gdk/Makefile.am: Add a header file for diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index b0d7f7c4b4..2721624743 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,18 @@ +Thu Feb 24 23:58:21 2000 Owen Taylor <otaylor@redhat.com> + + * gdk/x11/gdkgeometry-x11.c: Don't worry about clipping of + toplevel windows and their immediate children by their parents, + since the size of toplevel windows is out of our immediate + control and we don't get any real benefit from trying to track + this size for clipping. + + * gdk/gdkprivate.h (struct _GdkWindowPrivate) gdk/x11/gdkwindow-x11.c : Add a flag + for input_only windows. + + * gdk/gdkwindow.c gdk/x11/gdkgeometry-x11.c: Use the above flag + to fix some hacks and make sure that we don't try to set the + background of input only windows. + Thu Feb 24 18:11:46 2000 Owen Taylor <otaylor@redhat.com> * gdk/gdkinternals.h gdk/gdkprivate.h gdk/Makefile.am: Add a header file for diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index b0d7f7c4b4..2721624743 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,18 @@ +Thu Feb 24 23:58:21 2000 Owen Taylor <otaylor@redhat.com> + + * gdk/x11/gdkgeometry-x11.c: Don't worry about clipping of + toplevel windows and their immediate children by their parents, + since the size of toplevel windows is out of our immediate + control and we don't get any real benefit from trying to track + this size for clipping. + + * gdk/gdkprivate.h (struct _GdkWindowPrivate) gdk/x11/gdkwindow-x11.c : Add a flag + for input_only windows. + + * gdk/gdkwindow.c gdk/x11/gdkgeometry-x11.c: Use the above flag + to fix some hacks and make sure that we don't try to set the + background of input only windows. + Thu Feb 24 18:11:46 2000 Owen Taylor <otaylor@redhat.com> * gdk/gdkinternals.h gdk/gdkprivate.h gdk/Makefile.am: Add a header file for diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index b0d7f7c4b4..2721624743 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,18 @@ +Thu Feb 24 23:58:21 2000 Owen Taylor <otaylor@redhat.com> + + * gdk/x11/gdkgeometry-x11.c: Don't worry about clipping of + toplevel windows and their immediate children by their parents, + since the size of toplevel windows is out of our immediate + control and we don't get any real benefit from trying to track + this size for clipping. + + * gdk/gdkprivate.h (struct _GdkWindowPrivate) gdk/x11/gdkwindow-x11.c : Add a flag + for input_only windows. + + * gdk/gdkwindow.c gdk/x11/gdkgeometry-x11.c: Use the above flag + to fix some hacks and make sure that we don't try to set the + background of input only windows. + Thu Feb 24 18:11:46 2000 Owen Taylor <otaylor@redhat.com> * gdk/gdkinternals.h gdk/gdkprivate.h gdk/Makefile.am: Add a header file for diff --git a/gdk/gdkprivate.h b/gdk/gdkprivate.h index cc5f0848cb..ef92a2663c 100644 --- a/gdk/gdkprivate.h +++ b/gdk/gdkprivate.h @@ -94,6 +94,7 @@ struct _GdkWindowPrivate guint8 resize_count; guint mapped : 1; guint guffaw_gravity : 1; + guint input_only : 1; gint extension_events; diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c index b300cac1ab..efe2fe57ae 100644 --- a/gdk/gdkwindow.c +++ b/gdk/gdkwindow.c @@ -1170,6 +1170,9 @@ gdk_window_invalidate_region (GdkWindow *window, g_return_if_fail (window != NULL); g_return_if_fail (GDK_IS_WINDOW (window)); + if (private->input_only) + return; + if (private->update_area) { gdk_region_union (private->update_area, region); @@ -1196,10 +1199,7 @@ gdk_window_invalidate_region (GdkWindow *window, GdkWindowPrivate *child = tmp_list->data; tmp_list = tmp_list->next; - /* FIXME: this is a HACK to figure out if the child is - * input-only. - */ - if (child->drawable.colormap) + if (child->input_only) { child_rect.x = child->x; child_rect.y = child->y; diff --git a/gdk/x11/gdkgeometry-x11.c b/gdk/x11/gdkgeometry-x11.c index 4826ac8c27..40855e8abb 100644 --- a/gdk/x11/gdkgeometry-x11.c +++ b/gdk/x11/gdkgeometry-x11.c @@ -327,8 +327,13 @@ gdk_window_compute_position (GdkWindow *window, info->x_offset = parent_x_offset + info->x - private->x; info->y_offset = parent_y_offset + info->y - private->y; + /* We don't considering the clipping of toplevel windows and their immediate children + * by their parents, and simply always map those windows. + */ + if (parent_pos->clip_rect.width == G_MAXINT) + info->mapped = TRUE; /* Check if the window would wrap around into the visible space in either direction */ - if (info->x + parent_x_offset < parent_pos->clip_rect.x + parent_pos->clip_rect.width - 65536 || + else if (info->x + parent_x_offset < parent_pos->clip_rect.x + parent_pos->clip_rect.width - 65536 || info->x + info->width + parent_x_offset > parent_pos->clip_rect.x + 65536 || info->y + parent_y_offset < parent_pos->clip_rect.y + parent_pos->clip_rect.height - 65536 || info->y + info->width + parent_y_offset > parent_pos->clip_rect.y + 65536) @@ -337,16 +342,26 @@ gdk_window_compute_position (GdkWindow *window, info->mapped = TRUE; info->no_bg = FALSE; - - info->clip_rect.x = private->x; - info->clip_rect.y = private->y; - info->clip_rect.width = private->drawable.width; - info->clip_rect.height = private->drawable.height; - gdk_rectangle_intersect (&info->clip_rect, &parent_pos->clip_rect, &info->clip_rect); + if (GDK_DRAWABLE_TYPE (private) == GDK_WINDOW_CHILD) + { + info->clip_rect.x = private->x; + info->clip_rect.y = private->y; + info->clip_rect.width = private->drawable.width; + info->clip_rect.height = private->drawable.height; + + gdk_rectangle_intersect (&info->clip_rect, &parent_pos->clip_rect, &info->clip_rect); - info->clip_rect.x -= private->x; - info->clip_rect.y -= private->y; + info->clip_rect.x -= private->x; + info->clip_rect.y -= private->y; + } + else + { + info->clip_rect.x = 0; + info->clip_rect.y = 0; + info->clip_rect.width = G_MAXINT; + info->clip_rect.height = G_MAXINT; + } } static void @@ -365,17 +380,34 @@ gdk_window_compute_parent_pos (GdkWindow *window, parent_pos->x11_x = 0; parent_pos->x11_y = 0; - private = (GdkWindowPrivate *)private->parent; - + /* We take a simple approach here and simply consider toplevel + * windows not to clip their children on the right/bottom, since the + * size of toplevel windows is not directly under our + * control. Clipping only really matters when scrolling and + * generally we aren't going to be moving the immediate child of a + * toplevel beyond the bounds of that toplevel. + * + * We could go ahead and recompute the clips of toplevel windows and + * their descendents when we receive size notification, but it would + * probably not be an improvement in most cases. + */ parent_pos->clip_rect.x = 0; parent_pos->clip_rect.y = 0; - parent_pos->clip_rect.width = private->drawable.width; - parent_pos->clip_rect.height = private->drawable.height; + parent_pos->clip_rect.width = G_MAXINT; + parent_pos->clip_rect.height = G_MAXINT; + private = (GdkWindowPrivate *)private->parent; while (private && private->drawable.window_type == GDK_WINDOW_CHILD) { data = (GdkWindowXData *)private->drawable.klass_data; + tmp_clip.x = - clip_xoffset; + tmp_clip.y = - clip_yoffset; + tmp_clip.width = private->drawable.width; + tmp_clip.height = private->drawable.height; + + gdk_rectangle_intersect (&parent_pos->clip_rect, &tmp_clip, &parent_pos->clip_rect); + parent_pos->x += private->x; parent_pos->y += private->y; parent_pos->x11_x += data->position_info.x; @@ -385,16 +417,6 @@ gdk_window_compute_parent_pos (GdkWindow *window, clip_yoffset += private->y; private = (GdkWindowPrivate *)private->parent; - - if (private) - { - tmp_clip.x = - clip_xoffset; - tmp_clip.y = - clip_yoffset; - tmp_clip.width = private->drawable.width; - tmp_clip.height = private->drawable.height; - - gdk_rectangle_intersect (&parent_pos->clip_rect, &tmp_clip, &parent_pos->clip_rect); - } } } @@ -647,16 +669,22 @@ gdk_window_clip_changed (GdkWindow *window, GdkRectangle *old_clip, GdkRectangle { GdkWindowPrivate *private = (GdkWindowPrivate *)window; - GdkRegion *old_clip_region = gdk_region_rectangle (old_clip); - GdkRegion *new_clip_region = gdk_region_rectangle (new_clip); + GdkRegion *old_clip_region; + GdkRegion *new_clip_region; - /* Trim invalid region of window to new clip rectangle */ + if (private->input_only) + return; + + old_clip_region = gdk_region_rectangle (old_clip); + new_clip_region = gdk_region_rectangle (new_clip); + /* Trim invalid region of window to new clip rectangle + */ if (private->update_area) gdk_region_intersect (private->update_area, new_clip_region); - /* Invalidate newly exposed portion of window */ - + /* Invalidate newly exposed portion of window + */ gdk_region_subtract (new_clip_region, old_clip_region); if (!gdk_region_empty (new_clip_region)) { diff --git a/gdk/x11/gdkprivate-x11.h b/gdk/x11/gdkprivate-x11.h index d1164c35c0..e61e7e28c6 100644 --- a/gdk/x11/gdkprivate-x11.h +++ b/gdk/x11/gdkprivate-x11.h @@ -63,6 +63,7 @@ Window gdk_window_xid_at_coords (gint x, gboolean excl_child); /* Routines from gdkgeometry-x11.c */ + void _gdk_window_init_position (GdkWindow *window); void _gdk_window_move_resize_child (GdkWindow *window, gint x, diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c index be27c77148..aed85b6bc5 100644 --- a/gdk/x11/gdkwindow-x11.c +++ b/gdk/x11/gdkwindow-x11.c @@ -248,6 +248,7 @@ gdk_window_new (GdkWindow *parent, class = InputOutput; depth = visual->depth; + private->input_only = FALSE; private->drawable.depth = depth; if (attributes_mask & GDK_WA_COLORMAP) @@ -319,6 +320,7 @@ gdk_window_new (GdkWindow *parent, { depth = 0; class = InputOnly; + private->input_only = TRUE; private->drawable.colormap = NULL; } |