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.
This commit is contained in:
parent
aab395f07b
commit
03a3ae666c
1 changed files with 15 additions and 9 deletions
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue