diff options
| author | dranull <150595692+dranull@users.noreply.github.com> | 2023-12-26 16:24:31 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-12-26 17:24:31 +0100 |
| commit | 34b0ce66b3727d5061a3cec2ac96124470b748da (patch) | |
| tree | 662d99c799afff3e823b993732ee33bc8a5eea82 /src/Compositor.cpp | |
| parent | 2c2ff4b61b774915089229ec43d4e05b690d38bd (diff) | |
dwindle: Use window->middle() when cursor is on reserved area (#4253)
Diffstat (limited to 'src/Compositor.cpp')
| -rw-r--r-- | src/Compositor.cpp | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/Compositor.cpp b/src/Compositor.cpp index a2b11727..38304f33 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -1723,6 +1723,15 @@ bool CCompositor::isPointOnAnyMonitor(const Vector2D& point) { return false; } +bool CCompositor::isPointOnReservedArea(const Vector2D& point, const CMonitor* pMonitor) { + const auto PMONITOR = pMonitor ? pMonitor : getMonitorFromVector(point); + + const auto XY1 = PMONITOR->vecPosition + PMONITOR->vecReservedTopLeft; + const auto XY2 = PMONITOR->vecPosition + PMONITOR->vecSize - PMONITOR->vecReservedBottomRight; + + return !VECINRECT(point, XY1.x, XY1.y, XY2.x, XY2.y); +} + void checkFocusSurfaceIter(wlr_surface* pSurface, int x, int y, void* data) { auto pair = (std::pair<wlr_surface*, bool>*)data; pair->second = pair->second || pSurface == pair->first; @@ -2528,17 +2537,6 @@ void CCompositor::forceReportSizesToWindowsOnWorkspace(const int& wid) { } } -bool CCompositor::cursorOnReservedArea() { - const auto PMONITOR = getMonitorFromCursor(); - - const auto XY1 = PMONITOR->vecPosition + PMONITOR->vecReservedTopLeft; - const auto XY2 = PMONITOR->vecPosition + PMONITOR->vecSize - PMONITOR->vecReservedBottomRight; - - const auto CURSORPOS = g_pInputManager->getMouseCoordsInternal(); - - return !VECINRECT(CURSORPOS, XY1.x, XY1.y, XY2.x, XY2.y); -} - CWorkspace* CCompositor::createNewWorkspace(const int& id, const int& monid, const std::string& name) { const auto NAME = name == "" ? std::to_string(id) : name; auto monID = monid; |
