mirror of
https://github.com/hyprwm/Hypr.git
synced 2025-05-15 22:50:39 +01:00
Revert "respect docks' reserved area"
This reverts commit 6476407682
. Bugs and stuff.
This commit is contained in:
parent
6476407682
commit
090048410f
5 changed files with 4 additions and 73 deletions
|
@ -209,8 +209,6 @@ CWindow* Events::remapFloatingWindow(int windowID, int forcemonitor) {
|
||||||
|
|
||||||
Debug::log(LOG, "New dock created, setting default XYWH to: " + std::to_string(GEOMETRY->x) + ", " + std::to_string(GEOMETRY->y)
|
Debug::log(LOG, "New dock created, setting default XYWH to: " + std::to_string(GEOMETRY->x) + ", " + std::to_string(GEOMETRY->y)
|
||||||
+ ", " + std::to_string(GEOMETRY->width) + ", " + std::to_string(GEOMETRY->height));
|
+ ", " + std::to_string(GEOMETRY->width) + ", " + std::to_string(GEOMETRY->height));
|
||||||
|
|
||||||
window.setDock(true);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -241,10 +239,6 @@ CWindow* Events::remapFloatingWindow(int windowID, int forcemonitor) {
|
||||||
// Make all floating windows above
|
// Make all floating windows above
|
||||||
g_pWindowManager->setAllFloatingWindowsTop();
|
g_pWindowManager->setAllFloatingWindowsTop();
|
||||||
|
|
||||||
// Fix docks
|
|
||||||
if (window.getDock())
|
|
||||||
g_pWindowManager->recalcAllDocks();
|
|
||||||
|
|
||||||
return g_pWindowManager->getWindowFromDrawable(windowID);
|
return g_pWindowManager->getWindowFromDrawable(windowID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,4 @@ struct SMonitor {
|
||||||
int ID = -1;
|
int ID = -1;
|
||||||
|
|
||||||
std::string szName = "";
|
std::string szName = "";
|
||||||
|
|
||||||
Vector2D vecReservedTopLeft = Vector2D(0,0);
|
|
||||||
Vector2D vecReservedBottomRight = Vector2D(0,0);
|
|
||||||
};
|
};
|
|
@ -89,9 +89,6 @@ public:
|
||||||
EXPOSED_MEMBER(RealBorderColor, CFloatingColor, c);
|
EXPOSED_MEMBER(RealBorderColor, CFloatingColor, c);
|
||||||
EXPOSED_MEMBER(EffectiveBorderColor, CFloatingColor, c);
|
EXPOSED_MEMBER(EffectiveBorderColor, CFloatingColor, c);
|
||||||
|
|
||||||
// Docks
|
|
||||||
EXPOSED_MEMBER(Dock, bool, b);
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
|
@ -542,13 +542,6 @@ CWindow* CWindowManager::getWindowFromDrawable(int64_t window) {
|
||||||
return &w;
|
return &w;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto& w : unmappedWindows) {
|
|
||||||
if (w.getDrawable() == window) {
|
|
||||||
return &w;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -679,7 +672,6 @@ void CWindowManager::setEffectiveSizePosUsingConfig(CWindow* pWindow) {
|
||||||
const auto MONITOR = getMonitorFromWindow(pWindow);
|
const auto MONITOR = getMonitorFromWindow(pWindow);
|
||||||
const auto BARHEIGHT = ConfigManager::getInt("bar:enabled") == 1 ? ConfigManager::getInt("bar:height") : ConfigManager::parseError == "" ? 0 : ConfigManager::getInt("bar:height");
|
const auto BARHEIGHT = ConfigManager::getInt("bar:enabled") == 1 ? ConfigManager::getInt("bar:height") : ConfigManager::parseError == "" ? 0 : ConfigManager::getInt("bar:height");
|
||||||
|
|
||||||
|
|
||||||
// set some flags.
|
// set some flags.
|
||||||
const bool DISPLAYLEFT = STICKS(pWindow->getPosition().x, MONITOR->vecPosition.x);
|
const bool DISPLAYLEFT = STICKS(pWindow->getPosition().x, MONITOR->vecPosition.x);
|
||||||
const bool DISPLAYRIGHT = STICKS(pWindow->getPosition().x + pWindow->getSize().x, MONITOR->vecPosition.x + MONITOR->vecSize.x);
|
const bool DISPLAYRIGHT = STICKS(pWindow->getPosition().x + pWindow->getSize().x, MONITOR->vecPosition.x + MONITOR->vecSize.x);
|
||||||
|
@ -689,18 +681,12 @@ void CWindowManager::setEffectiveSizePosUsingConfig(CWindow* pWindow) {
|
||||||
pWindow->setEffectivePosition(pWindow->getPosition() + Vector2D(ConfigManager::getInt("border_size"), ConfigManager::getInt("border_size")));
|
pWindow->setEffectivePosition(pWindow->getPosition() + Vector2D(ConfigManager::getInt("border_size"), ConfigManager::getInt("border_size")));
|
||||||
pWindow->setEffectiveSize(pWindow->getSize() - (Vector2D(ConfigManager::getInt("border_size"), ConfigManager::getInt("border_size")) * 2));
|
pWindow->setEffectiveSize(pWindow->getSize() - (Vector2D(ConfigManager::getInt("border_size"), ConfigManager::getInt("border_size")) * 2));
|
||||||
|
|
||||||
const auto OFFSETTOPLEFT = Vector2D(DISPLAYLEFT ? ConfigManager::getInt("gaps_out") + MONITOR->vecReservedTopLeft.x : ConfigManager::getInt("gaps_in"),
|
|
||||||
DISPLAYTOP ? ConfigManager::getInt("gaps_out") + MONITOR->vecReservedTopLeft.y + BARHEIGHT : ConfigManager::getInt("gaps_in"));
|
|
||||||
|
|
||||||
const auto OFFSETBOTTOMRIGHT = Vector2D( DISPLAYRIGHT ? ConfigManager::getInt("gaps_out") + MONITOR->vecReservedBottomRight.x : ConfigManager::getInt("gaps_in"),
|
|
||||||
DISPLAYBOTTOM ? ConfigManager::getInt("gaps_out") + MONITOR->vecReservedBottomRight.y : ConfigManager::getInt("gaps_in"));
|
|
||||||
|
|
||||||
// do gaps, set top left
|
// do gaps, set top left
|
||||||
pWindow->setEffectivePosition(pWindow->getEffectivePosition() + OFFSETTOPLEFT);
|
pWindow->setEffectivePosition(pWindow->getEffectivePosition() + Vector2D(DISPLAYLEFT ? ConfigManager::getInt("gaps_out") : ConfigManager::getInt("gaps_in"), DISPLAYTOP ? ConfigManager::getInt("gaps_out") + (MONITOR->ID == ConfigManager::getInt("bar:monitor") ? BARHEIGHT : 0) : ConfigManager::getInt("gaps_in")));
|
||||||
// fix to old size bottom right
|
// fix to old size bottom right
|
||||||
pWindow->setEffectiveSize(pWindow->getEffectiveSize() - OFFSETTOPLEFT);
|
pWindow->setEffectiveSize(pWindow->getEffectiveSize() - Vector2D(DISPLAYLEFT ? ConfigManager::getInt("gaps_out") : ConfigManager::getInt("gaps_in"), DISPLAYTOP ? ConfigManager::getInt("gaps_out") + (MONITOR->ID == ConfigManager::getInt("bar:monitor") ? BARHEIGHT : 0) : ConfigManager::getInt("gaps_in")));
|
||||||
// set bottom right
|
// set bottom right
|
||||||
pWindow->setEffectiveSize(pWindow->getEffectiveSize() - OFFSETBOTTOMRIGHT);
|
pWindow->setEffectiveSize(pWindow->getEffectiveSize() - Vector2D(DISPLAYRIGHT ? ConfigManager::getInt("gaps_out") : ConfigManager::getInt("gaps_in"), DISPLAYBOTTOM ? ConfigManager::getInt("gaps_out") : ConfigManager::getInt("gaps_in")));
|
||||||
}
|
}
|
||||||
|
|
||||||
CWindow* CWindowManager::findWindowAtCursor() {
|
CWindow* CWindowManager::findWindowAtCursor() {
|
||||||
|
@ -1022,8 +1008,6 @@ void CWindowManager::closeWindowAllChecks(int64_t id) {
|
||||||
if (!CLOSEDWINDOW)
|
if (!CLOSEDWINDOW)
|
||||||
return; // It's not in the vec, ignore. (weird)
|
return; // It's not in the vec, ignore. (weird)
|
||||||
|
|
||||||
CLOSEDWINDOW->setDead(true);
|
|
||||||
|
|
||||||
if (const auto WORKSPACE = getWorkspaceByID(CLOSEDWINDOW->getWorkspaceID()); WORKSPACE && CLOSEDWINDOW->getFullscreen())
|
if (const auto WORKSPACE = getWorkspaceByID(CLOSEDWINDOW->getWorkspaceID()); WORKSPACE && CLOSEDWINDOW->getFullscreen())
|
||||||
WORKSPACE->setHasFullscreenWindow(false);
|
WORKSPACE->setHasFullscreenWindow(false);
|
||||||
|
|
||||||
|
@ -1032,10 +1016,6 @@ void CWindowManager::closeWindowAllChecks(int64_t id) {
|
||||||
|
|
||||||
// delete off of the arr
|
// delete off of the arr
|
||||||
g_pWindowManager->removeWindowFromVectorSafe(id);
|
g_pWindowManager->removeWindowFromVectorSafe(id);
|
||||||
|
|
||||||
// Fix docks
|
|
||||||
if (CLOSEDWINDOW->getDock())
|
|
||||||
g_pWindowManager->recalcAllDocks();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CWindowManager::fixMasterWorkspaceOnClosed(CWindow* pWindow) {
|
void CWindowManager::fixMasterWorkspaceOnClosed(CWindow* pWindow) {
|
||||||
|
@ -1795,39 +1775,3 @@ void CWindowManager::handleClientMessage(xcb_client_message_event_t* E) {
|
||||||
Debug::log(LOG, "Message recieved to set active for " + std::to_string(PWINDOW->getDrawable()));
|
Debug::log(LOG, "Message recieved to set active for " + std::to_string(PWINDOW->getDrawable()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CWindowManager::recalcAllDocks() {
|
|
||||||
for (auto& mon : monitors) {
|
|
||||||
mon.vecReservedTopLeft = {0, 0};
|
|
||||||
mon.vecReservedBottomRight = {0, 0};
|
|
||||||
|
|
||||||
setAllWorkspaceWindowsDirtyByID(activeWorkspaces[mon.ID]);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (auto& w : windows) {
|
|
||||||
if (!w.getDock() && !w.getDead())
|
|
||||||
continue;
|
|
||||||
|
|
||||||
const auto MONITOR = &monitors[w.getMonitor()];
|
|
||||||
|
|
||||||
const auto VERTICAL = w.getSize().x / w.getSize().y < 1;
|
|
||||||
|
|
||||||
if (VERTICAL) {
|
|
||||||
if (w.getPosition().x < MONITOR->vecSize.x / 2.f + MONITOR->vecPosition.x) {
|
|
||||||
// Left
|
|
||||||
MONITOR->vecReservedTopLeft = Vector2D(w.getSize().x, 0);
|
|
||||||
} else {
|
|
||||||
// Right
|
|
||||||
MONITOR->vecReservedBottomRight = Vector2D(w.getSize().x, 0);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (w.getPosition().y < MONITOR->vecSize.y / 2.f + MONITOR->vecPosition.y) {
|
|
||||||
// Top
|
|
||||||
MONITOR->vecReservedTopLeft = Vector2D(0, w.getSize().y);
|
|
||||||
} else {
|
|
||||||
// Bottom
|
|
||||||
MONITOR->vecReservedBottomRight = Vector2D(0, w.getSize().y);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -83,7 +83,6 @@ public:
|
||||||
void moveActiveWindowToWorkspace(int);
|
void moveActiveWindowToWorkspace(int);
|
||||||
void warpCursorTo(Vector2D);
|
void warpCursorTo(Vector2D);
|
||||||
void toggleWindowFullscrenn(const int&);
|
void toggleWindowFullscrenn(const int&);
|
||||||
void recalcAllDocks();
|
|
||||||
|
|
||||||
void changeWorkspaceByID(int);
|
void changeWorkspaceByID(int);
|
||||||
void setAllWorkspaceWindowsDirtyByID(int);
|
void setAllWorkspaceWindowsDirtyByID(int);
|
||||||
|
|
Loading…
Reference in a new issue