summaryrefslogtreecommitdiff
path: root/gtk/gtkclipboard.c
diff options
context:
space:
mode:
authorMichael Natterer <mitch@imendio.com>2005-11-10 12:09:42 +0000
committerMichael Natterer <mitch@src.gnome.org>2005-11-10 12:09:42 +0000
commit8bdc0bf97c72dc9481c1510770e604dfb282c6eb (patch)
tree2e44c685a1515af8f23c7c4bae5dba940d102124 /gtk/gtkclipboard.c
parent1571574ced47b75e412743d91f1317c0c9abfff3 (diff)
downloadgdk-pixbuf-8bdc0bf97c72dc9481c1510770e604dfb282c6eb.tar.gz
Applied patch from maemo-gtk that addresses many issues wrt display
2005-11-10 Michael Natterer <mitch@imendio.com> Applied patch from maemo-gtk that addresses many issues wrt display migration and display closing (bug #85715). * gdk/gdkdisplay.c (gdk_display_dispose): don't just set the default display to NULL when it's closed. Instead set the most recently opened display as new default (if one exists). * gdk/gdkpango.c (on_renderer_display_closed): fixed signature of this callback. * gdk/gdkscreen.c (gdk_screen_dispose): check if the GCs still exist before unrefing them. * gdk/gdkwindow.c (_gdk_window_destroy_hierarchy): if the screen is closed, allow destruction of the root window. * gdk/x11/gdkdisplay-x11.c: moved some stuff from finalize() to dispose(), free stuff that was leaked before. * gdk/x11/gdkevents-x11.c (_gdk_x11_events_uninit_screen): check if the xsettings_client still exists before destroying it. * gdk/x11/gdkkeys-x11.c: added finalization and free the allocated X resources. * gdk/x11/gdkpixmap-x11.c: moved stuff from finalize() to new dispose() implementation. * gdk/x11/gdkscreen-x11.c: moved stuff from finalize() to dispose() and check if it still exists before unrefing it. Set their pointers to NULL/None *after* upchaining in dispose(), because X11 implementations of members of the parent class still need them for their own destruction. * gdk/x11/gdkvisual-x11.c: removed finalize() implementation which was g_error()ing when finalizing a visual. * gtk/gtkclipboard.c (gtk_clipboard_finalize): don't use get_clipboard_widget() because it would create the widget if it doesn't exist. Use g_object_get_data() directly instead. * gtk/gtktextdisplay.c (on_renderer_display_closed): fixed signature of this callback.
Diffstat (limited to 'gtk/gtkclipboard.c')
-rw-r--r--gtk/gtkclipboard.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/gtk/gtkclipboard.c b/gtk/gtkclipboard.c
index d7692a8b0..25ae16664 100644
--- a/gtk/gtkclipboard.c
+++ b/gtk/gtkclipboard.c
@@ -203,20 +203,21 @@ gtk_clipboard_finalize (GObject *object)
if (g_slist_index (clipboards, clipboard) >= 0)
g_warning ("GtkClipboard prematurely finalized");
- clipboard_widget = get_clipboard_widget (clipboard->display);
-
+ /* don't use get_clipboard_widget() here because it would create the
+ * widget if it doesn't exist.
+ */
+ clipboard_widget = g_object_get_data (G_OBJECT (clipboard->display),
+ "gtk-clipboard-widget");
+
clipboard_unset (clipboard);
clipboards = g_object_get_data (G_OBJECT (clipboard->display), "gtk-clipboard-list");
clipboards = g_slist_remove (clipboards, clipboard);
g_object_set_data (G_OBJECT (clipboard->display), I_("gtk-clipboard-list"), clipboards);
- if (g_main_loop_is_running (clipboard->store_loop))
- {
- g_main_loop_quit (clipboard->store_loop);
- g_main_loop_unref (clipboard->store_loop);
- }
-
+ if (clipboard->store_loop && g_main_loop_is_running (clipboard->store_loop))
+ g_main_loop_quit (clipboard->store_loop);
+
if (clipboard->store_timeout != 0)
g_source_remove (clipboard->store_timeout);