Commit a081fe7d authored by Alexander Larsson's avatar Alexander Larsson Committed by Alexander Larsson

Don't leak visible_region. Use visible_region instead of region.

2001-01-22    <alexl@redhat.com>

	* gdk/gdkwindow.c (gdk_window_invalidate_region):
	Don't leak visible_region. Use visible_region instead of region.

	* gdk/linux-fb/gdkwindow-fb.c (gdk_window_new):
	Don't do extra gdk_drawable_ref(). This is not X.
	(gdk_fb_window_find_focus, gdk_fb_change_focus): make sure
	gdk_fb_focused_window is ref:ed.
	(gdk_fb_window_send_crossing_events): Watch out for destroyed
	windows.
parent 18cb3ee1
2001-01-22 <alexl@redhat.com>
* gdk/gdkwindow.c (gdk_window_invalidate_region):
Don't leak visible_region. Use visible_region instead of region.
* gdk/linux-fb/gdkwindow-fb.c (gdk_window_new):
Don't do extra gdk_drawable_ref(). This is not X.
(gdk_fb_window_find_focus, gdk_fb_change_focus): make sure
gdk_fb_focused_window is ref:ed.
(gdk_fb_window_send_crossing_events): Watch out for destroyed
windows.
2001-01-22 <alexl@redhat.com>
* gtk/gtkwindow-decorate.c (gtk_decorated_window_realize):
......
2001-01-22 <alexl@redhat.com>
* gdk/gdkwindow.c (gdk_window_invalidate_region):
Don't leak visible_region. Use visible_region instead of region.
* gdk/linux-fb/gdkwindow-fb.c (gdk_window_new):
Don't do extra gdk_drawable_ref(). This is not X.
(gdk_fb_window_find_focus, gdk_fb_change_focus): make sure
gdk_fb_focused_window is ref:ed.
(gdk_fb_window_send_crossing_events): Watch out for destroyed
windows.
2001-01-22 <alexl@redhat.com>
* gtk/gtkwindow-decorate.c (gtk_decorated_window_realize):
......
2001-01-22 <alexl@redhat.com>
* gdk/gdkwindow.c (gdk_window_invalidate_region):
Don't leak visible_region. Use visible_region instead of region.
* gdk/linux-fb/gdkwindow-fb.c (gdk_window_new):
Don't do extra gdk_drawable_ref(). This is not X.
(gdk_fb_window_find_focus, gdk_fb_change_focus): make sure
gdk_fb_focused_window is ref:ed.
(gdk_fb_window_send_crossing_events): Watch out for destroyed
windows.
2001-01-22 <alexl@redhat.com>
* gtk/gtkwindow-decorate.c (gtk_decorated_window_realize):
......
2001-01-22 <alexl@redhat.com>
* gdk/gdkwindow.c (gdk_window_invalidate_region):
Don't leak visible_region. Use visible_region instead of region.
* gdk/linux-fb/gdkwindow-fb.c (gdk_window_new):
Don't do extra gdk_drawable_ref(). This is not X.
(gdk_fb_window_find_focus, gdk_fb_change_focus): make sure
gdk_fb_focused_window is ref:ed.
(gdk_fb_window_send_crossing_events): Watch out for destroyed
windows.
2001-01-22 <alexl@redhat.com>
* gtk/gtkwindow-decorate.c (gtk_decorated_window_realize):
......
2001-01-22 <alexl@redhat.com>
* gdk/gdkwindow.c (gdk_window_invalidate_region):
Don't leak visible_region. Use visible_region instead of region.
* gdk/linux-fb/gdkwindow-fb.c (gdk_window_new):
Don't do extra gdk_drawable_ref(). This is not X.
(gdk_fb_window_find_focus, gdk_fb_change_focus): make sure
gdk_fb_focused_window is ref:ed.
(gdk_fb_window_send_crossing_events): Watch out for destroyed
windows.
2001-01-22 <alexl@redhat.com>
* gtk/gtkwindow-decorate.c (gtk_decorated_window_realize):
......
2001-01-22 <alexl@redhat.com>
* gdk/gdkwindow.c (gdk_window_invalidate_region):
Don't leak visible_region. Use visible_region instead of region.
* gdk/linux-fb/gdkwindow-fb.c (gdk_window_new):
Don't do extra gdk_drawable_ref(). This is not X.
(gdk_fb_window_find_focus, gdk_fb_change_focus): make sure
gdk_fb_focused_window is ref:ed.
(gdk_fb_window_send_crossing_events): Watch out for destroyed
windows.
2001-01-22 <alexl@redhat.com>
* gtk/gtkwindow-decorate.c (gtk_decorated_window_realize):
......
2001-01-22 <alexl@redhat.com>
* gdk/gdkwindow.c (gdk_window_invalidate_region):
Don't leak visible_region. Use visible_region instead of region.
* gdk/linux-fb/gdkwindow-fb.c (gdk_window_new):
Don't do extra gdk_drawable_ref(). This is not X.
(gdk_fb_window_find_focus, gdk_fb_change_focus): make sure
gdk_fb_focused_window is ref:ed.
(gdk_fb_window_send_crossing_events): Watch out for destroyed
windows.
2001-01-22 <alexl@redhat.com>
* gtk/gtkwindow-decorate.c (gtk_decorated_window_realize):
......
......@@ -1796,16 +1796,16 @@ gdk_window_invalidate_region (GdkWindow *window,
visible_region = gdk_drawable_get_visible_region (window);
gdk_region_intersect (visible_region, region);
if (!gdk_region_empty (region))
if (!gdk_region_empty (visible_region))
{
if (private->update_area)
{
gdk_region_union (private->update_area, region);
gdk_region_union (private->update_area, visible_region);
}
else
{
update_windows = g_slist_prepend (update_windows, window);
private->update_area = gdk_region_copy (region);
private->update_area = gdk_region_copy (visible_region);
if (!private->update_freeze_count && !update_idle)
update_idle = g_idle_add_full (GDK_PRIORITY_REDRAW,
......@@ -1830,7 +1830,7 @@ gdk_window_invalidate_region (GdkWindow *window,
gdk_window_get_position ((GdkWindow *)child, &x, &y);
/* This copy could be saved with a little more complexity */
child_region = gdk_region_copy (region);
child_region = gdk_region_copy (visible_region);
gdk_region_offset (child_region, -x, -y);
gdk_window_invalidate_region ((GdkWindow *)child, child_region, TRUE);
......@@ -1840,6 +1840,8 @@ gdk_window_invalidate_region (GdkWindow *window,
}
}
}
gdk_region_destroy (visible_region);
}
GdkRegion *
......
......@@ -254,8 +254,6 @@ gdk_window_new (GdkWindow *parent,
impl->drawable_data.colormap = NULL;
}
gdk_drawable_ref (window);
if (impl->drawable_data.colormap)
gdk_colormap_ref (impl->drawable_data.colormap);
......@@ -488,7 +486,7 @@ gdk_fb_window_find_focus (void)
return _gdk_fb_keyboard_grab_window;
if (!gdk_fb_focused_window)
gdk_fb_focused_window = gdk_parent_root;
gdk_fb_focused_window = gdk_window_ref (gdk_parent_root);
return gdk_fb_focused_window;
}
......@@ -525,8 +523,11 @@ gdk_fb_change_focus (GdkWindow *new_focus_window)
event = (GdkEventFocus *)gdk_event_make (event_win, GDK_FOCUS_CHANGE, TRUE);
event->in = TRUE;
}
if (gdk_fb_focused_window)
gdk_window_unref (gdk_fb_focused_window);
gdk_fb_focused_window = gdk_window_ref (new_win);
}
gdk_fb_focused_window = new_win;
}
static GdkWindow *
......@@ -597,6 +598,13 @@ gdk_fb_window_send_crossing_events (GdkWindow *src,
if (a==b)
return;
/* gdk_fb_window_containing_pointer might have been destroyed.
* The refcount we hold on it should keep it, but it's parents
* might have died.
*/
if (GDK_WINDOW_DESTROYED (a))
a = gdk_parent_root;
gdk_fb_mouse_get_info (&x, &y, &my_mask);
c = gdk_fb_find_common_ancestor (a, b);
......
Markdown is supported
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