mirror of
https://github.com/brl/mutter.git
synced 2025-07-09 12:14:53 +00:00
x11: Generalize x11 selection owner checks
Shuffle things so the x11 selection can check the current owner directly,
instead of its type.
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1206
(cherry picked from commit a7e63bea6c
)
This commit is contained in:

committed by
Robert Mader

parent
a32bb758f7
commit
5465c912c7
@ -297,8 +297,8 @@ source_new_cb (GObject *object,
|
|||||||
source = meta_selection_source_x11_new_finish (res, &error);
|
source = meta_selection_source_x11_new_finish (res, &error);
|
||||||
if (source)
|
if (source)
|
||||||
{
|
{
|
||||||
meta_selection_set_owner (selection, selection_type, source);
|
|
||||||
g_set_object (&x11_display->selection.owners[selection_type], source);
|
g_set_object (&x11_display->selection.owners[selection_type], source);
|
||||||
|
meta_selection_set_owner (selection, selection_type, source);
|
||||||
g_object_unref (source);
|
g_object_unref (source);
|
||||||
}
|
}
|
||||||
else if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
|
else if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
|
||||||
@ -382,7 +382,7 @@ notify_selection_owner (MetaX11Display *x11_display,
|
|||||||
{
|
{
|
||||||
Display *xdisplay = x11_display->xdisplay;
|
Display *xdisplay = x11_display->xdisplay;
|
||||||
|
|
||||||
if (new_owner && !META_IS_SELECTION_SOURCE_X11 (new_owner))
|
if (new_owner && new_owner != x11_display->selection.owners[selection_type])
|
||||||
{
|
{
|
||||||
if (x11_display->selection.cancellables[selection_type])
|
if (x11_display->selection.cancellables[selection_type])
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user