display: Rename window_ids to xids

As the hash table no longer stores only window IDs, we should rename it so
that we make sure to check if something is actually a window before using it
as a window.

https://bugzilla.gnome.org/show_bug.cgi?id=677215
This commit is contained in:
Jasper St. Pierre
2013-02-06 17:02:59 -05:00
parent 57c31a56f4
commit d8f569eaf5
4 changed files with 14 additions and 14 deletions

View File

@@ -588,8 +588,8 @@ meta_display_open (void)
event_callback,
the_display);
the_display->window_ids = g_hash_table_new (meta_unsigned_long_hash,
meta_unsigned_long_equal);
the_display->xids = g_hash_table_new (meta_unsigned_long_hash,
meta_unsigned_long_equal);
i = 0;
while (i < N_IGNORED_CROSSING_SERIALS)
@@ -1004,7 +1004,7 @@ meta_display_list_windows (MetaDisplay *display,
winlist = NULL;
g_hash_table_iter_init (&iter, display->window_ids);
g_hash_table_iter_init (&iter, display->xids);
while (g_hash_table_iter_next (&iter, &key, &value))
{
MetaWindow *window = value;
@@ -1114,7 +1114,7 @@ meta_display_close (MetaDisplay *display,
/* Must be after all calls to meta_window_unmanage() since they
* unregister windows
*/
g_hash_table_destroy (display->window_ids);
g_hash_table_destroy (display->xids);
if (display->leader_window != None)
XDestroyWindow (display->xdisplay, display->leader_window);
@@ -3569,7 +3569,7 @@ MetaWindow*
meta_display_lookup_x_window (MetaDisplay *display,
Window xwindow)
{
return g_hash_table_lookup (display->window_ids, &xwindow);
return g_hash_table_lookup (display->xids, &xwindow);
}
void
@@ -3577,18 +3577,18 @@ meta_display_register_x_window (MetaDisplay *display,
Window *xwindowp,
MetaWindow *window)
{
g_return_if_fail (g_hash_table_lookup (display->window_ids, xwindowp) == NULL);
g_return_if_fail (g_hash_table_lookup (display->xids, xwindowp) == NULL);
g_hash_table_insert (display->window_ids, xwindowp, window);
g_hash_table_insert (display->xids, xwindowp, window);
}
void
meta_display_unregister_x_window (MetaDisplay *display,
Window xwindow)
{
g_return_if_fail (g_hash_table_lookup (display->window_ids, &xwindow) != NULL);
g_return_if_fail (g_hash_table_lookup (display->xids, &xwindow) != NULL);
g_hash_table_remove (display->window_ids, &xwindow);
g_hash_table_remove (display->xids, &xwindow);
/* Remove any pending pings */
remove_pending_pings_for_window (display, xwindow);