summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2011-07-20 01:17:15 +0200
committerJasper St. Pierre <jstpierre@mecheye.net>2012-11-03 19:47:37 -0400
commitae1290e3b42baaef4c2334f88f751d07b9a561ac (patch)
treed063c7e5ecbcf6e52d12f6c9ea3cc0021076e646
parent8037cc5ec496b379830b513d42a0bce472a19ac1 (diff)
downloadmutter-ae1290e3b42baaef4c2334f88f751d07b9a561ac.tar.gz
display: Make focus info persistent
It must not be freed (at least meanwhile the device pair exists), so ensure it's kept around, and we don't create info for a same keyboard twice.
-rw-r--r--src/core/display.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/core/display.c b/src/core/display.c
index 2b05b7b55..952d83a9e 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -626,8 +626,7 @@ meta_display_open (void)
the_display->current_grabs = g_hash_table_new_full (NULL, NULL, NULL,
(GDestroyNotify) g_free);
- the_display->focus_info = g_hash_table_new_full (NULL, NULL, NULL,
- (GDestroyNotify) g_free);
+ the_display->focus_info = g_hash_table_new (NULL, NULL);
the_display->edge_resistance_info = g_hash_table_new (NULL, NULL);
#ifdef HAVE_XSYNC
@@ -6172,13 +6171,13 @@ meta_display_get_focus_info (MetaDisplay *display,
if (!device)
return NULL;
+ if (!META_IS_DEVICE_KEYBOARD (device))
+ device = meta_device_get_paired_device (device);
+
info = g_hash_table_lookup (display->focus_info, device);
if (!info)
{
- if (!META_IS_DEVICE_KEYBOARD (device))
- device = meta_device_get_paired_device (device);
-
info = g_slice_new0 (MetaFocusInfo);
info->last_focus_time = display->current_time;