mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-06 23:21:57 -07:00
dwindle: Use window->middle() when cursor is on reserved area (#4253)
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user