mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
taskpanel: Delay setting panel position on screen change, so shell doesn't crash
Setting it immediately seems to trigger an underlying bug that causes the shell to crash, see https://invent.kde.org/plasma/plasma-mobile/-/issues/321 I've cherry-picked this for Plasma 6 so we don't have this issue on stable, but I'm not sure if we should merge this into master or keep trying to identify the root cause.
This commit is contained in:
parent
7cb6ebaae1
commit
b553850e0a
1 changed files with 12 additions and 3 deletions
|
|
@ -46,15 +46,24 @@ ContainmentItem {
|
|||
readonly property int intendedWindowLocation: inLandscape ? PlasmaCore.Types.RightEdge : PlasmaCore.Types.BottomEdge
|
||||
|
||||
onIntendedWindowLengthChanged: maximizeTimer.restart() // ensure it always takes up the full length of the screen
|
||||
onIntendedWindowLocationChanged: {
|
||||
root.panel.location = intendedWindowLocation;
|
||||
}
|
||||
onIntendedWindowLocationChanged: setPanelLocationTimer.restart()
|
||||
onIntendedWindowOffsetChanged: {
|
||||
if (root.panel) {
|
||||
root.panel.offset = intendedWindowOffset;
|
||||
}
|
||||
}
|
||||
|
||||
// HACK: the entire shell seems to crash sometimes if this is applied immediately after a display change (ex. screen rotation)
|
||||
// see https://invent.kde.org/plasma/plasma-mobile/-/issues/321
|
||||
Timer {
|
||||
id: setPanelLocationTimer
|
||||
running: false
|
||||
interval: 100
|
||||
onTriggered: {
|
||||
root.panel.location = intendedWindowLocation;
|
||||
}
|
||||
}
|
||||
|
||||
// use a timer so we don't have to maximize for every single pixel
|
||||
// - improves performance if the shell is run in a window, and can be resized
|
||||
Timer {
|
||||
|
|
|
|||
Loading…
Reference in a new issue