mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-06 00:30:08 +00:00
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:
parent
76e23f00da
commit
4a0cb4a240
@ -2382,6 +2382,12 @@ move_region_on_impl (GdkWindowObject *private,
|
|||||||
GdkWindowObject *impl_window;
|
GdkWindowObject *impl_window;
|
||||||
gboolean free_region;
|
gboolean free_region;
|
||||||
|
|
||||||
|
if (dx == 0 && dy == 0)
|
||||||
|
{
|
||||||
|
gdk_region_destroy (region);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
free_region = TRUE;
|
free_region = TRUE;
|
||||||
impl_window = gdk_window_get_impl_window (private);
|
impl_window = gdk_window_get_impl_window (private);
|
||||||
|
|
||||||
@ -4568,13 +4574,18 @@ gdk_window_invalidate_maybe_recurse (GdkWindow *window,
|
|||||||
tmp_list = tmp_list->next;
|
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)
|
if (debug_updates)
|
||||||
draw_ugly_color (window, region);
|
draw_ugly_color (window, region);
|
||||||
|
|
||||||
/* Convert to impl coords */
|
/* Convert to impl coords */
|
||||||
impl_window = gdk_window_get_impl_window (private);
|
|
||||||
gdk_region_offset (visible_region, private->abs_x, private->abs_y);
|
gdk_region_offset (visible_region, private->abs_x, private->abs_y);
|
||||||
if (impl_window->update_area)
|
if (impl_window->update_area)
|
||||||
{
|
{
|
||||||
|
@ -190,9 +190,6 @@ _gdk_window_move_resize_child (GdkWindow *window,
|
|||||||
GdkWindowImplX11 *impl;
|
GdkWindowImplX11 *impl;
|
||||||
GdkWindowObject *obj;
|
GdkWindowObject *obj;
|
||||||
GdkRectangle new_info;
|
GdkRectangle new_info;
|
||||||
|
|
||||||
gint dx, dy;
|
|
||||||
gboolean is_move;
|
|
||||||
gboolean is_resize;
|
gboolean is_resize;
|
||||||
|
|
||||||
g_return_if_fail (window != NULL);
|
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);
|
impl = GDK_WINDOW_IMPL_X11 (GDK_WINDOW_OBJECT (window)->impl);
|
||||||
obj = GDK_WINDOW_OBJECT (window);
|
obj = GDK_WINDOW_OBJECT (window);
|
||||||
|
|
||||||
|
is_resize =
|
||||||
|
width != obj->width ||
|
||||||
|
height != obj->height;
|
||||||
|
|
||||||
obj->x = x;
|
obj->x = x;
|
||||||
obj->y = y;
|
obj->y = y;
|
||||||
obj->width = width;
|
obj->width = width;
|
||||||
@ -211,10 +212,14 @@ _gdk_window_move_resize_child (GdkWindow *window,
|
|||||||
new_info.width = obj->width;
|
new_info.width = obj->width;
|
||||||
new_info.height = obj->height;
|
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)
|
if (is_resize)
|
||||||
move_resize (window, &new_info);
|
move_resize (window, &new_info);
|
||||||
else
|
else
|
||||||
move (window, &new_info);
|
move (window, &new_info);
|
||||||
|
_gdk_x11_window_tmp_reset_bg (obj->parent, FALSE);
|
||||||
|
_gdk_x11_window_tmp_reset_bg (window, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
|
@ -290,18 +290,15 @@ _gdk_x11_window_tmp_unset_bg (GdkWindow *window,
|
|||||||
|
|
||||||
if (private->input_only || private->destroyed ||
|
if (private->input_only || private->destroyed ||
|
||||||
(private->window_type != GDK_WINDOW_ROOT &&
|
(private->window_type != GDK_WINDOW_ROOT &&
|
||||||
!GDK_WINDOW_IS_MAPPED (window)) ||
|
!GDK_WINDOW_IS_MAPPED (window)))
|
||||||
!_gdk_window_has_impl (window) ||
|
|
||||||
!GDK_WINDOW_IS_X11 (window))
|
|
||||||
{
|
|
||||||
return;
|
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)
|
private->window_type != GDK_WINDOW_FOREIGN)
|
||||||
{
|
|
||||||
tmp_unset_bg (window);
|
tmp_unset_bg (window);
|
||||||
}
|
|
||||||
|
|
||||||
if (recurse)
|
if (recurse)
|
||||||
{
|
{
|
||||||
@ -324,18 +321,15 @@ _gdk_x11_window_tmp_reset_bg (GdkWindow *window,
|
|||||||
|
|
||||||
if (private->input_only || private->destroyed ||
|
if (private->input_only || private->destroyed ||
|
||||||
(private->window_type != GDK_WINDOW_ROOT &&
|
(private->window_type != GDK_WINDOW_ROOT &&
|
||||||
!GDK_WINDOW_IS_MAPPED (window)) ||
|
!GDK_WINDOW_IS_MAPPED (window)))
|
||||||
!_gdk_window_has_impl (window) ||
|
|
||||||
!GDK_WINDOW_IS_X11 (window))
|
|
||||||
{
|
|
||||||
return;
|
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)
|
private->window_type != GDK_WINDOW_FOREIGN)
|
||||||
{
|
|
||||||
tmp_reset_bg (window);
|
tmp_reset_bg (window);
|
||||||
}
|
|
||||||
|
|
||||||
if (recurse)
|
if (recurse)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user