Changeset View
Changeset View
Standalone View
Standalone View
input.cpp
Show First 20 Lines • Show All 2201 Lines • ▼ Show 20 Line(s) | |||||
2202 | } | 2202 | } | ||
2203 | 2203 | | |||
2204 | static bool acceptsInput(Toplevel *t, const QPoint &pos) | 2204 | static bool acceptsInput(Toplevel *t, const QPoint &pos) | ||
2205 | { | 2205 | { | ||
2206 | const QRegion input = t->inputShape(); | 2206 | const QRegion input = t->inputShape(); | ||
2207 | if (input.isEmpty()) { | 2207 | if (input.isEmpty()) { | ||
2208 | return true; | 2208 | return true; | ||
2209 | } | 2209 | } | ||
2210 | return input.translated(t->pos()).contains(pos); | 2210 | // TODO: What about sub-surfaces sticking outside the main surface? | ||
2211 | const QPoint localPoint = pos - t->bufferGeometry().topLeft(); | ||||
2212 | return input.contains(localPoint); | ||||
2211 | } | 2213 | } | ||
2212 | 2214 | | |||
2213 | Toplevel *InputRedirection::findToplevel(const QPoint &pos) | 2215 | Toplevel *InputRedirection::findToplevel(const QPoint &pos) | ||
2214 | { | 2216 | { | ||
2215 | if (!Workspace::self()) { | 2217 | if (!Workspace::self()) { | ||
2216 | return nullptr; | 2218 | return nullptr; | ||
2217 | } | 2219 | } | ||
2218 | const bool isScreenLocked = waylandServer() && waylandServer()->isScreenLocked(); | 2220 | const bool isScreenLocked = waylandServer() && waylandServer()->isScreenLocked(); | ||
▲ Show 20 Lines • Show All 319 Lines • Show Last 20 Lines |