Various fixes for native windows:

move_region_on_impl() - doesn't need to copy anything if dx/dy == 0
Ensure that we queue an update when invalidating an empty area but we have outstanding moves
Temporarily unset background when moving native child windows
This commit is contained in:
Alexander Larsson 2008-12-18 13:36:52 +01:00 committed by Alexander Larsson
parent 76e23f00da
commit 4a0cb4a240
3 changed files with 38 additions and 28 deletions

View File

@ -2382,6 +2382,12 @@ move_region_on_impl (GdkWindowObject *private,
GdkWindowObject *impl_window;
gboolean free_region;
if (dx == 0 && dy == 0)
{
gdk_region_destroy (region);
return;
}
free_region = TRUE;
impl_window = gdk_window_get_impl_window (private);
@ -4568,13 +4574,18 @@ gdk_window_invalidate_maybe_recurse (GdkWindow *window,
tmp_list = tmp_list->next;
}
if (!gdk_region_empty (visible_region))
impl_window = gdk_window_get_impl_window (private);
if (!gdk_region_empty (visible_region) ||
/* Even if we're not exposing anything, make sure we process
idles for windows with outstanding moves */
(impl_window->outstanding_moves != NULL &&
impl_window->update_area == NULL))
{
if (debug_updates)
draw_ugly_color (window, region);
/* Convert to impl coords */
impl_window = gdk_window_get_impl_window (private);
gdk_region_offset (visible_region, private->abs_x, private->abs_y);
if (impl_window->update_area)
{

View File

@ -190,9 +190,6 @@ _gdk_window_move_resize_child (GdkWindow *window,
GdkWindowImplX11 *impl;
GdkWindowObject *obj;
GdkRectangle new_info;
gint dx, dy;
gboolean is_move;
gboolean is_resize;
g_return_if_fail (window != NULL);
@ -201,6 +198,10 @@ _gdk_window_move_resize_child (GdkWindow *window,
impl = GDK_WINDOW_IMPL_X11 (GDK_WINDOW_OBJECT (window)->impl);
obj = GDK_WINDOW_OBJECT (window);
is_resize =
width != obj->width ||
height != obj->height;
obj->x = x;
obj->y = y;
obj->width = width;
@ -211,10 +212,14 @@ _gdk_window_move_resize_child (GdkWindow *window,
new_info.width = obj->width;
new_info.height = obj->height;
_gdk_x11_window_tmp_unset_bg (window, TRUE);
_gdk_x11_window_tmp_unset_bg (obj->parent, FALSE);
if (is_resize)
move_resize (window, &new_info);
else
move (window, &new_info);
_gdk_x11_window_tmp_reset_bg (obj->parent, FALSE);
_gdk_x11_window_tmp_reset_bg (window, TRUE);
}
static Bool

View File

@ -290,18 +290,15 @@ _gdk_x11_window_tmp_unset_bg (GdkWindow *window,
if (private->input_only || private->destroyed ||
(private->window_type != GDK_WINDOW_ROOT &&
!GDK_WINDOW_IS_MAPPED (window)) ||
!_gdk_window_has_impl (window) ||
!GDK_WINDOW_IS_X11 (window))
{
!GDK_WINDOW_IS_MAPPED (window)))
return;
}
if (private->window_type != GDK_WINDOW_ROOT &&
if (_gdk_window_has_impl (window) &&
GDK_WINDOW_IS_X11 (window) &&
private->window_type != GDK_WINDOW_ROOT &&
private->window_type != GDK_WINDOW_FOREIGN)
{
tmp_unset_bg (window);
}
if (recurse)
{
@ -324,18 +321,15 @@ _gdk_x11_window_tmp_reset_bg (GdkWindow *window,
if (private->input_only || private->destroyed ||
(private->window_type != GDK_WINDOW_ROOT &&
!GDK_WINDOW_IS_MAPPED (window)) ||
!_gdk_window_has_impl (window) ||
!GDK_WINDOW_IS_X11 (window))
{
!GDK_WINDOW_IS_MAPPED (window)))
return;
}
if (private->window_type != GDK_WINDOW_ROOT &&
if (_gdk_window_has_impl (window) &&
GDK_WINDOW_IS_X11 (window) &&
private->window_type != GDK_WINDOW_ROOT &&
private->window_type != GDK_WINDOW_FOREIGN)
{
tmp_reset_bg (window);
}
if (recurse)
{