ags: fix multi-monitor widgets

This commit is contained in:
MoetaYuko
2024-05-01 20:12:58 +08:00
parent 8041153434
commit d696089c78
6 changed files with 40 additions and 37 deletions
@@ -2,6 +2,7 @@ import PopupWindow from '../.widgethacks/popupwindow.js';
import OnScreenKeyboard from "./onscreenkeyboard.js";
export default (id) => PopupWindow({
monitor: id,
anchor: ['bottom'],
name: `osk${id}`,
showClassName: 'osk-show',
@@ -14,7 +14,7 @@ const keyboardJson = oskLayouts[keyboardLayout];
async function startYdotoolIfNeeded() {
const running = exec('pidof ydotool')
if(!running) execAsync(['ydotoold']).catch(print);
if (!running) execAsync(['ydotoold']).catch(print);
}
function releaseAllKeys() {
@@ -72,7 +72,7 @@ const KeyboardControls = () => Box({
className: 'osk-control-button txt-norm icon-material',
onClicked: () => {
releaseAllKeys();
App.toggleWindowOnAllMonitors('osk');
toggleWindowOnAllMonitors('osk');
},
label: 'keyboard_hide',
}),
@@ -213,7 +213,7 @@ const KeyboardWindow = () => Box({
})
],
setup: (self) => self.hook(App, (self, name, visible) => { // Update on open
if(!name) return;
if (!name) return;
if (name.startsWith('osk') && visible) {
self.setCss(`margin-bottom: -0px;`);
}