@@ -116,7 +116,14 @@ FocusScope {
116116 if ((flags & ignoreHideIfMouseOverLauncher) && Utils.Functions.itemUnderMouse(panel)) {
117117 return;
118118 }
119− switchToNextState("")
119+ if (root.lockedVisible) {
120+ // Due to binding updates when switching between modes
121+ // it could happen that our request to show will be overwritten
122+ // with a hide request. Rewrite it when we know hiding is not allowed.
123+ switchToNextState("visible")
124+ } else {
125+ switchToNextState("")
126+ }
120127 }
121128
122129 function fadeOut() {
@@ -254,13 +261,6 @@ FocusScope {
254261 interval: 1
255262 property string nextState: ""
256263 onTriggered: {
257− if (root.lockedVisible && nextState == "") {
258− // Due to binding updates when switching between modes
259− // it could happen that our request to show will be overwritten
260− // with a hide request. Rewrite it when we know hiding is not allowed.
261− nextState = "visible"
262− }
263−
264264 // switching to an intermediate state here to make sure all the
265265 // values are restored, even if we were already in the target state
266266 root.state = "tmp"
@@ -379,8 +379,7 @@ FocusScope {
379379 }
380380
381381 Keys.onEscapePressed: {
382− switchToNextState("");
383− root.focus = false;
382+ root.hide()
384383 }
385384
386385 onDragDistanceChanged: {