From f0ceed7bf8b8fee6c92e816fb4d4389c322e21b7 Mon Sep 17 00:00:00 2001 From: JosephMcc Date: Mon, 23 Dec 2024 10:03:26 -0800 Subject: [PATCH] modalDialog: Make sure we can use the on screen keyboard We need to make sure the keyboard is stacked above our modal dialogs when they are open. Also restrict placement of the dialogs to the monitor work area. This ensures we don't end up with the dialog behind the keyboard in some situations. Fixes: https://github.com/linuxmint/mint22.1-beta/issues/70 --- js/ui/modalDialog.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/js/ui/modalDialog.js b/js/ui/modalDialog.js index 4d39b3fee6..2ca829c19e 100644 --- a/js/ui/modalDialog.js +++ b/js/ui/modalDialog.js @@ -84,6 +84,10 @@ var ModalDialog = GObject.registerClass({ this._cinnamonReactive = params.cinnamonReactive; this._destroyOnClose = params.destroyOnClose; + // We track this to make sure we can access the on screen keyboard + // when hiding and showing modal dialogs + this._onScreenKeyboard = Main.layoutManager.keyboardBox; + Main.uiGroup.add_actor(this); let constraint = new Clutter.BindConstraint({ @@ -98,7 +102,7 @@ var ModalDialog = GObject.registerClass({ x_fill: true, y_fill: true }); - this._monitorConstraint = new Layout.MonitorConstraint(); + this._monitorConstraint = new Layout.MonitorConstraint({ work_area: true }); this._backgroundBin.add_constraint(this._monitorConstraint); this.add_actor(this._backgroundBin); @@ -238,6 +242,9 @@ var ModalDialog = GObject.registerClass({ if (!this.pushModal(timestamp)) return false; + if (this._onScreenKeyboard.visible) + Main.uiGroup.set_child_above_sibling(this._onScreenKeyboard, null); + this._fadeOpen(); return true; } @@ -257,6 +264,9 @@ var ModalDialog = GObject.registerClass({ this.popModal(timestamp); this._savedKeyFocus = null; + if (this._onScreenKeyboard.visible) + Main.panelManager.lowerActorBelowPanels(this._onScreenKeyboard); + this.ease({ opacity: 0, duration: this.openAndCloseTime,