fix weird focus for slideleft & slideright (#502)

This commit is contained in:
end-4
2024-05-18 19:30:51 +07:00
parent ecfacef55f
commit ec69988c05
6 changed files with 28 additions and 10 deletions
@@ -1,10 +1,17 @@
import App from 'resource:///com/github/Aylur/ags/app.js';
import Widget from 'resource:///com/github/Aylur/ags/widget.js';
import { monitors } from '../.miscutils/hyprlanddata.js';
const { Box, EventBox } = Widget;
export const clickCloseRegion = ({ name, multimonitor = true, expand = true }) => {
export const clickCloseRegion = ({ name, multimonitor = true, monitor = 0, expand = true, fillMonitor = '' }) => {
return EventBox({
child: Box({ expand: expand }),
child: Box({
expand: expand,
css: fillMonitor ? `
min-width: ${fillMonitor.includes('h') ? monitors[monitor].width : 0}px;
min-height: ${fillMonitor.includes('v') ? monitors[monitor].height : 0}px;
` : null,
}),
setup: (self) => self.on('button-press-event', (self, event) => { // Any mouse button
if (multimonitor) closeWindowOnAllMonitors(name);
else App.closeWindow(name);