Commit 7fe1ef80 authored by Owen Taylor's avatar Owen Taylor Committed by Owen Taylor
Browse files

Don't worry about clipping of toplevel windows and their immediate

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.
parent aee7dfc9
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
......
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
......
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
......
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
......
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
......
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
......
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
......
......@@ -94,6 +94,7 @@ struct _GdkWindowPrivate
guint8 resize_count;
guint mapped : 1;
guint guffaw_gravity : 1;
guint input_only : 1;
gint extension_events;
......
......@@ -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;
......
......@@ -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))
{
......
......@@ -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,
......
......@@ -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;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment