wayland/xwayland: Gracefully handle Xdnd start drag focus race
If a X11 client would initiate a Xdnd session after it had lost pointer focus (for example when the Xdnd event starting the drag happens after the implicit pointer grab is already broken due to the button being released), just end the drag operation instead of dereferencing the non-existing focus surface. Also avoid using a native Wayland surface as a drag origin, as that can never happen, but allow any arbitrary Xwayland client, since there is no way to find out the actual drag origin. https://bugzilla.gnome.org/show_bug.cgi?id=770940
This commit is contained in:
parent
60bc6798f4
commit
b1d95438d6
@ -33,7 +33,9 @@
|
||||
#include <gdk/gdkx.h>
|
||||
#include <X11/Xatom.h>
|
||||
#include <X11/extensions/Xfixes.h>
|
||||
|
||||
#include <meta/errors.h>
|
||||
#include "meta-xwayland.h"
|
||||
#include "meta-xwayland-private.h"
|
||||
#include "meta-xwayland-selection-private.h"
|
||||
#include "meta-wayland-data-device.h"
|
||||
@ -1584,14 +1586,14 @@ meta_xwayland_selection_handle_xfixes_selection_notify (MetaWaylandCompositor *c
|
||||
{
|
||||
MetaWaylandDataDevice *data_device = &compositor->seat->data_device;
|
||||
MetaXWaylandSelection *selection_data = compositor->xwayland_manager.selection_data;
|
||||
MetaWaylandSurface *focus;
|
||||
|
||||
selection->owner = event->owner;
|
||||
focus = compositor->seat->pointer->focus_surface;
|
||||
|
||||
if (event->owner != None && event->owner != selection->window)
|
||||
if (event->owner != None && event->owner != selection->window &&
|
||||
focus && meta_xwayland_is_xwayland_surface (focus))
|
||||
{
|
||||
MetaWaylandSurface *focus;
|
||||
|
||||
focus = compositor->seat->pointer->focus_surface;
|
||||
selection->source = meta_wayland_data_source_xwayland_new (selection);
|
||||
meta_wayland_data_device_set_dnd_source (&compositor->seat->data_device,
|
||||
selection->source);
|
||||
|
Loading…
Reference in New Issue
Block a user