x11/selection: Unset selection ownership on shutdown
This makes sure we don't accidentally try to paste from past Xwayland connection instances. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2364>
This commit is contained in:
parent
86d3a6b4bc
commit
9930b5d7ca
@ -524,16 +524,24 @@ meta_x11_selection_init (MetaX11Display *x11_display)
|
|||||||
void
|
void
|
||||||
meta_x11_selection_shutdown (MetaX11Display *x11_display)
|
meta_x11_selection_shutdown (MetaX11Display *x11_display)
|
||||||
{
|
{
|
||||||
MetaDisplay *display = meta_get_display ();
|
MetaDisplay *display = meta_x11_display_get_display (x11_display);
|
||||||
|
MetaSelection *selection = meta_display_get_selection (display);
|
||||||
guint i;
|
guint i;
|
||||||
|
|
||||||
g_signal_handlers_disconnect_by_func (meta_display_get_selection (display),
|
g_signal_handlers_disconnect_by_func (selection,
|
||||||
notify_selection_owner,
|
notify_selection_owner,
|
||||||
x11_display);
|
x11_display);
|
||||||
|
|
||||||
for (i = 0; i < META_N_SELECTION_TYPES; i++)
|
for (i = 0; i < META_N_SELECTION_TYPES; i++)
|
||||||
{
|
{
|
||||||
g_clear_object (&x11_display->selection.owners[i]);
|
MetaSelectionSource *owner;
|
||||||
|
|
||||||
|
owner = x11_display->selection.owners[i];
|
||||||
|
if (owner)
|
||||||
|
{
|
||||||
|
meta_selection_unset_owner (selection, i, owner);
|
||||||
|
g_clear_object (&x11_display->selection.owners[i]);
|
||||||
|
}
|
||||||
if (x11_display->selection.cancellables[i])
|
if (x11_display->selection.cancellables[i])
|
||||||
{
|
{
|
||||||
g_cancellable_cancel (x11_display->selection.cancellables[i]);
|
g_cancellable_cancel (x11_display->selection.cancellables[i]);
|
||||||
|
Loading…
Reference in New Issue
Block a user