Skip to content

Commit c2ef52a

Browse files
wineeedeepin-bot[bot]
authored andcommitted
fix: layershell calcular in x11 emulation
Log: fix bug 305717 系统缩放调整到125%,最大化应用窗口后会被任务栏覆盖
1 parent c40886d commit c2ef52a

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

frame/layershell/x11dlayershellemulation.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,11 @@ void LayerShellEmulation::onExclusionZoneChanged()
172172
} else if ((anchors == DLayerShellWindow::AnchorRight) || (anchors ^ DLayerShellWindow::AnchorRight) == (DLayerShellWindow::AnchorTop | DLayerShellWindow::AnchorBottom)) {
173173
int boundary = 0;
174174
for (auto screen : qApp->screens()) {
175-
if (boundary < screen->geometry().right())
176-
boundary = screen->geometry().right();
175+
int right = screen->geometry().x()/scaleFactor + screen->geometry().width();
176+
if (boundary < right)
177+
boundary = right;
177178
}
178-
strut_partial.right = boundary - rect.right() + (m_dlayerShellWindow->exclusionZone()) * scaleFactor;
179+
strut_partial.right = (boundary - rect.right() + m_dlayerShellWindow->exclusionZone()) * scaleFactor;
179180
strut_partial.right_start_y = rect.y();
180181
strut_partial.right_end_y = rect.y() + m_window->height();
181182
} else if ((anchors == DLayerShellWindow::AnchorTop) || (anchors ^ DLayerShellWindow::AnchorTop) == (DLayerShellWindow::AnchorLeft | DLayerShellWindow::AnchorRight)) {
@@ -188,10 +189,11 @@ void LayerShellEmulation::onExclusionZoneChanged()
188189
// but there is no issue.
189190
int boundary = 0;
190191
for (auto screen : qApp->screens()) {
191-
if (boundary < screen->geometry().bottom())
192-
boundary = screen->geometry().bottom();
192+
int botton = screen->geometry().y()/scaleFactor + screen->geometry().height();
193+
if (boundary < botton)
194+
boundary = botton;
193195
}
194-
strut_partial.bottom = boundary - rect.bottom() + (m_dlayerShellWindow->exclusionZone()) * scaleFactor;
196+
strut_partial.bottom = (boundary - rect.bottom() + m_dlayerShellWindow->exclusionZone()) * scaleFactor;
195197
strut_partial.bottom_start_x = rect.x();
196198
strut_partial.bottom_end_x = rect.x() + m_window->width();
197199
}

0 commit comments

Comments
 (0)