forked from Shinonome/dots-hyprland
fix empty gap for weird monitor scales (#424)
This commit is contained in:
@@ -1,17 +1,19 @@
|
|||||||
const { GLib } = imports.gi;
|
const { Gdk } = imports.gi;
|
||||||
import Variable from 'resource:///com/github/Aylur/ags/variable.js';
|
|
||||||
import * as Utils from 'resource:///com/github/Aylur/ags/utils.js';
|
import * as Utils from 'resource:///com/github/Aylur/ags/utils.js';
|
||||||
const { execAsync, exec } = Utils;
|
const { execAsync, exec } = Utils;
|
||||||
|
|
||||||
export let monitors;
|
export let monitors;
|
||||||
|
|
||||||
// ughh condition race theoretically but overview won't be open at init so i guess it's okay
|
// Mixes with Gdk monitor size cuz it reports monitor size scaled
|
||||||
async function updateStuff() {
|
async function updateStuff() {
|
||||||
monitors = JSON.parse(exec('hyprctl monitors -j'))
|
monitors = JSON.parse(exec('hyprctl monitors -j'))
|
||||||
monitors.forEach(monitor => {
|
const display = Gdk.Display.get_default();
|
||||||
monitor.width /= monitor.scale;
|
monitors.forEach((monitor, i) => {
|
||||||
monitor.height /= monitor.scale;
|
const gdkMonitor = display.get_monitor(i);
|
||||||
|
monitor.width = gdkMonitor.get_geometry().width;
|
||||||
|
monitor.height = gdkMonitor.get_geometry().height;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
updateStuff();
|
updateStuff().catch(print);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user