Commit 7e25e200 authored by Arjen Hiemstra's avatar Arjen Hiemstra
Browse files

Use the minimum of workspace area size and panel size for input method placement

Rather than assuming the input panel to always be less than or equal to
the maximized area, ensure it is. This ensures that the input panel gets
placed correctly when there maximized area is smaller, like when there's
a panel on the side.

Additionally, don't skip the entire positioning code when "m_output" is
empty, to avoid the placement not happening when Kickoff is open.


(cherry picked from commit 03a3ae66)
parent 39153cf7
Pipeline #139059 passed with stage
in 14 minutes and 48 seconds
......@@ -75,22 +75,28 @@ void KWin::InputPanelV1Client::reposition()
switch (m_mode) {
case Toplevel: {
if (m_output) {
const QSize panelSize = surface()->size();
if (!panelSize.isValid() || panelSize.isEmpty()) {
return;
}
QSize panelSize = surface()->size();
if (!panelSize.isValid() || panelSize.isEmpty()) {
return;
}
QRect availableArea;
QRect availableArea;
if (m_output) {
if (waylandServer()->isScreenLocked()) {
availableArea = m_output->geometry();
} else {
availableArea = workspace()->clientArea(MaximizeArea, this, m_output);
}
QRect geo(availableArea.topLeft(), panelSize);
geo.translate((availableArea.width() - panelSize.width())/2, availableArea.height() - panelSize.height());
moveResize(geo);
} else {
availableArea = workspace()->clientArea(MaximizeArea, this);
}
panelSize = panelSize.boundedTo(availableArea.size());
QRect geo(availableArea.topLeft(), panelSize);
geo.translate((availableArea.width() - panelSize.width())/2, availableArea.height() - panelSize.height());
moveResize(geo);
} break;
case Overlay: {
auto textInputSurface = waylandServer()->seat()->focusedTextInputSurface();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment