[mutter/wip/xinput2r: 56/68] display: Make focus info persistent
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/xinput2r: 56/68] display: Make focus info persistent
- Date: Wed, 24 Oct 2012 16:14:01 +0000 (UTC)
commit af8c64276351cacce8c7998be6ad6768e875be3b
Author: Carlos Garnacho <carlosg gnome org>
Date: Wed Jul 20 01:17:15 2011 +0200
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.
src/core/display.c | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/src/core/display.c b/src/core/display.c
index 9eea880..eddd2b6 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -625,8 +625,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
@@ -6184,13 +6183,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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]