From d1eb8cd8097871315fc497a99f0cac45bd06a67b Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Thu, 11 Jan 2018 21:45:32 -0500 Subject: x11: Only set the keymap display once Not necessary to do this more than once. --- gdk/x11/gdkdisplay-x11.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'gdk/x11/gdkdisplay-x11.c') diff --git a/gdk/x11/gdkdisplay-x11.c b/gdk/x11/gdkdisplay-x11.c index 762de7f96d..8fc1688840 100644 --- a/gdk/x11/gdkdisplay-x11.c +++ b/gdk/x11/gdkdisplay-x11.c @@ -2928,9 +2928,10 @@ gdk_x11_display_get_keymap (GdkDisplay *display) display_x11 = GDK_X11_DISPLAY (display); if (!display_x11->keymap) - display_x11->keymap = g_object_new (GDK_TYPE_X11_KEYMAP, NULL); - - display_x11->keymap->display = display; + { + display_x11->keymap = g_object_new (GDK_TYPE_X11_KEYMAP, NULL); + display_x11->keymap->display = display; /* beware of ref cycle */ + } return display_x11->keymap; } -- cgit v1.2.1