Changeset View
Changeset View
Standalone View
Standalone View
src/server/datadevice_interface.cpp
Show First 20 Lines • Show All 94 Lines • ▼ Show 20 Line(s) | 93 | { | |||
---|---|---|---|---|---|
95 | Q_UNUSED(serial) | 95 | Q_UNUSED(serial) | ||
96 | // TODO: verify serial | 96 | // TODO: verify serial | ||
97 | cast<Private>(resource)->startDrag(DataSourceInterface::get(source), SurfaceInterface::get(origin), SurfaceInterface::get(icon), serial); | 97 | cast<Private>(resource)->startDrag(DataSourceInterface::get(source), SurfaceInterface::get(origin), SurfaceInterface::get(icon), serial); | ||
98 | } | 98 | } | ||
99 | 99 | | |||
100 | void DataDeviceInterface::Private::startDrag(DataSourceInterface *dataSource, SurfaceInterface *origin, SurfaceInterface *i, quint32 serial) | 100 | void DataDeviceInterface::Private::startDrag(DataSourceInterface *dataSource, SurfaceInterface *origin, SurfaceInterface *i, quint32 serial) | ||
101 | { | 101 | { | ||
102 | // TODO: allow touch | 102 | // TODO: allow touch | ||
103 | if (seat->hasImplicitPointerGrab(serial) && seat->focusedPointerSurface() != origin) { | 103 | if (!seat->hasImplicitPointerGrab(serial) || seat->focusedPointerSurface() != origin) { | ||
adridg: this looks like it's still missing a !, based on the explanation "when the client does not have… | |||||
romangg: There is a `!` in the beginning. Or did you mean something else? | |||||
adridg: I need new glasses :) | |||||
104 | wl_resource_post_error(resource, 0, "Surface doesn't have pointer grab"); | 104 | // Surface doesn't have pointer grab. | ||
105 | return; | 105 | return; | ||
106 | } | 106 | } | ||
107 | // TODO: source is allowed to be null, handled client internally! | 107 | // TODO: source is allowed to be null, handled client internally! | ||
108 | Q_Q(DataDeviceInterface); | 108 | Q_Q(DataDeviceInterface); | ||
109 | source = dataSource; | 109 | source = dataSource; | ||
110 | if (dataSource) { | 110 | if (dataSource) { | ||
111 | QObject::connect(dataSource, &Resource::aboutToBeUnbound, q, [this] { source = nullptr; }); | 111 | QObject::connect(dataSource, &Resource::aboutToBeUnbound, q, [this] { source = nullptr; }); | ||
112 | } | 112 | } | ||
▲ Show 20 Lines • Show All 246 Lines • Show Last 20 Lines |
this looks like it's still missing a !, based on the explanation "when the client does not have an implicit pointer grab"