mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-02 14:26:00 +01:00
Merge pull request #727 from Dickby/main
Scale border size in window size pos calculation
This commit is contained in:
commit
190229942f
2 changed files with 13 additions and 10 deletions
|
@ -182,15 +182,16 @@ void CHyprDwindleLayout::applyNodeDataToWindow(SDwindleNodeData* pNode, bool for
|
||||||
PWINDOW->m_vPosition = pNode->position;
|
PWINDOW->m_vPosition = pNode->position;
|
||||||
|
|
||||||
static auto *const PNOGAPSWHENONLY = &g_pConfigManager->getConfigValuePtr("dwindle:no_gaps_when_only")->intValue;
|
static auto *const PNOGAPSWHENONLY = &g_pConfigManager->getConfigValuePtr("dwindle:no_gaps_when_only")->intValue;
|
||||||
|
float scaledBorderSize = *PBORDERSIZE / PMONITOR->scale;
|
||||||
|
|
||||||
auto calcPos = PWINDOW->m_vPosition + Vector2D(*PBORDERSIZE, *PBORDERSIZE);
|
auto calcPos = PWINDOW->m_vPosition + Vector2D(scaledBorderSize, scaledBorderSize);
|
||||||
auto calcSize = PWINDOW->m_vSize - Vector2D(2 * *PBORDERSIZE, 2 * *PBORDERSIZE);
|
auto calcSize = PWINDOW->m_vSize - Vector2D(2 * scaledBorderSize, 2 * scaledBorderSize);
|
||||||
|
|
||||||
const auto NODESONWORKSPACE = getNodesOnWorkspace(PWINDOW->m_iWorkspaceID);
|
const auto NODESONWORKSPACE = getNodesOnWorkspace(PWINDOW->m_iWorkspaceID);
|
||||||
|
|
||||||
if (*PNOGAPSWHENONLY && PWINDOW->m_iWorkspaceID != SPECIAL_WORKSPACE_ID && (NODESONWORKSPACE == 1 || (pNode->isGroupMember() && pNode->getGroupMemberCount() == NODESONWORKSPACE))) {
|
if (*PNOGAPSWHENONLY && PWINDOW->m_iWorkspaceID != SPECIAL_WORKSPACE_ID && (NODESONWORKSPACE == 1 || (pNode->isGroupMember() && pNode->getGroupMemberCount() == NODESONWORKSPACE))) {
|
||||||
PWINDOW->m_vRealPosition = calcPos - Vector2D(*PBORDERSIZE, *PBORDERSIZE);
|
PWINDOW->m_vRealPosition = calcPos - Vector2D(scaledBorderSize, scaledBorderSize);
|
||||||
PWINDOW->m_vRealSize = calcSize + Vector2D(2 * *PBORDERSIZE, 2 * *PBORDERSIZE);
|
PWINDOW->m_vRealSize = calcSize + Vector2D(2 * scaledBorderSize, 2 * scaledBorderSize);
|
||||||
|
|
||||||
PWINDOW->updateWindowDecos();
|
PWINDOW->updateWindowDecos();
|
||||||
|
|
||||||
|
|
|
@ -133,7 +133,7 @@ void CHyprMasterLayout::recalculateMonitor(const int& monid) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PWORKSPACE->m_bHasFullscreenWindow) {
|
if (PWORKSPACE->m_bHasFullscreenWindow) {
|
||||||
if (PWORKSPACE->m_efFullscreenMode == FULLSCREEN_FULL)
|
if (PWORKSPACE->m_efFullscreenMode == FULLSCREEN_FULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// massive hack from the fullscreen func
|
// massive hack from the fullscreen func
|
||||||
|
@ -241,12 +241,14 @@ void CHyprMasterLayout::applyNodeDataToWindow(SMasterNodeData* pNode) {
|
||||||
PWINDOW->m_vSize = pNode->size;
|
PWINDOW->m_vSize = pNode->size;
|
||||||
PWINDOW->m_vPosition = pNode->position;
|
PWINDOW->m_vPosition = pNode->position;
|
||||||
|
|
||||||
auto calcPos = PWINDOW->m_vPosition + Vector2D(*PBORDERSIZE, *PBORDERSIZE);
|
float scaledBorderSize = *PBORDERSIZE / PMONITOR->scale;
|
||||||
auto calcSize = PWINDOW->m_vSize - Vector2D(2 * *PBORDERSIZE, 2 * *PBORDERSIZE);
|
|
||||||
|
auto calcPos = PWINDOW->m_vPosition + Vector2D(scaledBorderSize, scaledBorderSize);
|
||||||
|
auto calcSize = PWINDOW->m_vSize - Vector2D(2 * scaledBorderSize, 2 * scaledBorderSize);
|
||||||
|
|
||||||
if (*PNOGAPSWHENONLY && PWINDOW->m_iWorkspaceID != SPECIAL_WORKSPACE_ID && getNodesOnWorkspace(PWINDOW->m_iWorkspaceID) == 1) {
|
if (*PNOGAPSWHENONLY && PWINDOW->m_iWorkspaceID != SPECIAL_WORKSPACE_ID && getNodesOnWorkspace(PWINDOW->m_iWorkspaceID) == 1) {
|
||||||
PWINDOW->m_vRealPosition = calcPos - Vector2D(*PBORDERSIZE, *PBORDERSIZE);
|
PWINDOW->m_vRealPosition = calcPos - Vector2D(scaledBorderSize, scaledBorderSize);
|
||||||
PWINDOW->m_vRealSize = calcSize + Vector2D(2 * *PBORDERSIZE, 2 * *PBORDERSIZE);
|
PWINDOW->m_vRealSize = calcSize + Vector2D(2 * scaledBorderSize, 2 * scaledBorderSize);
|
||||||
|
|
||||||
PWINDOW->updateWindowDecos();
|
PWINDOW->updateWindowDecos();
|
||||||
|
|
||||||
|
@ -612,4 +614,4 @@ void CHyprMasterLayout::onEnable() {
|
||||||
|
|
||||||
void CHyprMasterLayout::onDisable() {
|
void CHyprMasterLayout::onDisable() {
|
||||||
m_lMasterNodesData.clear();
|
m_lMasterNodesData.clear();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue