mirror of
https://github.com/brl/mutter.git
synced 2025-02-09 01:54:10 +00:00
window: Remove pending pings in unmanage
This makes sure that we see them for Wayland clients as well, and don't time out and crash when we're accessing an invalid window / surface. Spotted-by: Rui Matos <tiagomatos@gmail.com>
This commit is contained in:
parent
024652bfb4
commit
82dce6758a
@ -445,6 +445,9 @@ void meta_display_sanity_check_timestamps (MetaDisplay *display,
|
|||||||
gboolean meta_display_timestamp_too_old (MetaDisplay *display,
|
gboolean meta_display_timestamp_too_old (MetaDisplay *display,
|
||||||
guint32 *timestamp);
|
guint32 *timestamp);
|
||||||
|
|
||||||
|
void meta_display_remove_pending_pings_for_window (MetaDisplay *display,
|
||||||
|
MetaWindow *window);
|
||||||
|
|
||||||
MetaGestureTracker * meta_display_get_gesture_tracker (MetaDisplay *display);
|
MetaGestureTracker * meta_display_get_gesture_tracker (MetaDisplay *display);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -296,16 +296,9 @@ ping_data_free (MetaPingData *ping_data)
|
|||||||
g_free (ping_data);
|
g_free (ping_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
void
|
||||||
* remove_pending_pings_for_window:
|
meta_display_remove_pending_pings_for_window (MetaDisplay *display,
|
||||||
* @display: The display the window appears on
|
MetaWindow *window)
|
||||||
* @xwindow: The X ID of the window whose pings we should remove
|
|
||||||
*
|
|
||||||
* Frees every pending ping structure for the given X window on the
|
|
||||||
* given display. This means that we also destroy the timeouts.
|
|
||||||
*/
|
|
||||||
static void
|
|
||||||
remove_pending_pings_for_window (MetaDisplay *display, Window xwindow)
|
|
||||||
{
|
{
|
||||||
GSList *tmp;
|
GSList *tmp;
|
||||||
GSList *dead;
|
GSList *dead;
|
||||||
@ -318,7 +311,7 @@ remove_pending_pings_for_window (MetaDisplay *display, Window xwindow)
|
|||||||
{
|
{
|
||||||
MetaPingData *ping_data = tmp->data;
|
MetaPingData *ping_data = tmp->data;
|
||||||
|
|
||||||
if (ping_data->window->xwindow == xwindow)
|
if (ping_data->window == window)
|
||||||
dead = g_slist_prepend (dead, ping_data);
|
dead = g_slist_prepend (dead, ping_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1613,9 +1606,6 @@ meta_display_unregister_x_window (MetaDisplay *display,
|
|||||||
g_return_if_fail (g_hash_table_lookup (display->xids, &xwindow) != NULL);
|
g_return_if_fail (g_hash_table_lookup (display->xids, &xwindow) != NULL);
|
||||||
|
|
||||||
g_hash_table_remove (display->xids, &xwindow);
|
g_hash_table_remove (display->xids, &xwindow);
|
||||||
|
|
||||||
/* Remove any pending pings */
|
|
||||||
remove_pending_pings_for_window (display, xwindow);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -1272,6 +1272,8 @@ meta_window_unmanage (MetaWindow *window,
|
|||||||
meta_stack_thaw (window->screen->stack);
|
meta_stack_thaw (window->screen->stack);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
meta_display_remove_pending_pings_for_window (window->display, window);
|
||||||
|
|
||||||
meta_window_shutdown_group (window); /* safe to do this early as
|
meta_window_shutdown_group (window); /* safe to do this early as
|
||||||
* group.c won't re-add to the
|
* group.c won't re-add to the
|
||||||
* group if window->unmanaging
|
* group if window->unmanaging
|
||||||
|
Loading…
x
Reference in New Issue
Block a user