[gtk+] Fix some issues with initial setup of GdkX11DisplayManager
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Fix some issues with initial setup of GdkX11DisplayManager
- Date: Mon, 27 Dec 2010 06:04:43 +0000 (UTC)
commit 48b47971b5c6657a8141b9128c5dc05bfa80ced7
Author: Matthias Clasen <mclasen redhat com>
Date: Mon Dec 27 01:02:52 2010 -0500
Fix some issues with initial setup of GdkX11DisplayManager
We need to defer setting the default display until the
GdkDisplay is fully initialized. Also, short-circuit some
encoding conversions when creating windows, to avoid an
implicit dependency on the display being in the list of
displays yet.
gdk/x11/gdkdisplaymanager-x11.c | 12 ++++++++----
gdk/x11/gdkwindow-x11.c | 2 +-
2 files changed, 9 insertions(+), 5 deletions(-)
---
diff --git a/gdk/x11/gdkdisplaymanager-x11.c b/gdk/x11/gdkdisplaymanager-x11.c
index 7d557fd..dd712d9 100644
--- a/gdk/x11/gdkdisplaymanager-x11.c
+++ b/gdk/x11/gdkdisplaymanager-x11.c
@@ -49,7 +49,14 @@ static GdkDisplay *
gdk_x11_display_manager_open_display (GdkDisplayManager *manager,
const gchar *name)
{
- return _gdk_x11_display_open (name);
+ GdkX11DisplayManager *manager_x11 = GDK_X11_DISPLAY_MANAGER (manager);
+ GdkDisplay *display;
+
+ display = _gdk_x11_display_open (name);
+ if (manager_x11->default_display == NULL)
+ gdk_display_manager_set_default_display (manager, display);
+
+ return display;
}
static GSList *
@@ -111,9 +118,6 @@ _gdk_x11_display_manager_add_display (GdkDisplayManager *manager,
{
GdkX11DisplayManager *manager_x11 = GDK_X11_DISPLAY_MANAGER (manager);
- if (manager_x11->displays == NULL)
- gdk_display_manager_set_default_display (manager, display);
-
manager_x11->displays = g_slist_prepend (manager_x11->displays, display);
}
diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c
index 5cc9fd2..bd76a51 100644
--- a/gdk/x11/gdkwindow-x11.c
+++ b/gdk/x11/gdkwindow-x11.c
@@ -2244,7 +2244,7 @@ set_text_property (GdkDisplay *display,
if (utf8_is_latin1 (utf8_str))
{
prop_type = XA_STRING;
- prop_text = gdk_utf8_to_string_target (utf8_str);
+ prop_text = _gdk_x11_display_utf8_to_string_target (display, utf8_str);
prop_length = prop_text ? strlen (prop_text) : 0;
prop_format = 8;
is_compound_text = FALSE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]