summaryrefslogtreecommitdiff
path: root/gdk/x11/gdkdisplay-x11.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2018-01-11 21:45:32 -0500
committerMatthias Clasen <mclasen@redhat.com>2018-01-12 09:24:08 -0500
commitd1eb8cd8097871315fc497a99f0cac45bd06a67b (patch)
treed2b14ea330f8bf856cbafe226156b750bed72c3c /gdk/x11/gdkdisplay-x11.c
parentd72508590b9b4bde91c0e1445ac61be62c3af2ff (diff)
downloadgtk+-d1eb8cd8097871315fc497a99f0cac45bd06a67b.tar.gz
x11: Only set the keymap display once
Not necessary to do this more than once.
Diffstat (limited to 'gdk/x11/gdkdisplay-x11.c')
-rw-r--r--gdk/x11/gdkdisplay-x11.c7
1 files changed, 4 insertions, 3 deletions
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;
}