mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
kwin/convergentwindows: Fix race condition causing windows to be maximized too large
See https://invent.kde.org/teams/plasma-mobile/issues/-/issues/256 We have a race condition between maximizing and disabling window decorations on a window (the calls aren't blocking). Workaround this by having the window already be in maximized size before we disable window decorations.
This commit is contained in:
parent
8b9015e4fb
commit
b5e58a8db1
1 changed files with 16 additions and 4 deletions
|
|
@ -10,11 +10,23 @@ Loader {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
function run(window) {
|
function run(window) {
|
||||||
if (!ShellSettings.Settings.convergenceModeEnabled) {
|
if (ShellSettings.Settings.convergenceModeEnabled) {
|
||||||
window.noBorder = true;
|
|
||||||
window.setMaximize(true, true);
|
|
||||||
} else {
|
|
||||||
window.noBorder = false;
|
window.noBorder = false;
|
||||||
|
} else {
|
||||||
|
const output = window.output;
|
||||||
|
const desktop = window.desktops[0]; // assume it's the first desktop that the window is on
|
||||||
|
const maximizeRect = KWinComponents.Workspace.clientArea(KWinComponents.Workspace.MaximizeArea, output, desktop);
|
||||||
|
|
||||||
|
// set the window to the maximized size and position instantly, avoiding race condition
|
||||||
|
// between maximizing and window decorations being turned off (changing window height)
|
||||||
|
// see: https://invent.kde.org/teams/plasma-mobile/issues/-/issues/256
|
||||||
|
window.frameGeometry = maximizeRect;
|
||||||
|
|
||||||
|
// turn off window decorations
|
||||||
|
window.noBorder = true;
|
||||||
|
|
||||||
|
// run maximize after to ensure the state is maximized
|
||||||
|
window.setMaximize(true, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue