mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-08-15 01:55:52 -07:00
fix(tracker): follow active hyprland and visible x11 windows
This commit is contained in:
@@ -39,8 +39,8 @@ export function parseX11WindowGeometry(winInfo: string): {
|
||||
width: number;
|
||||
height: number;
|
||||
} | null {
|
||||
const xMatch = winInfo.match(/Absolute upper-left X:\s*(\d+)/);
|
||||
const yMatch = winInfo.match(/Absolute upper-left Y:\s*(\d+)/);
|
||||
const xMatch = winInfo.match(/Absolute upper-left X:\s*(-?\d+)/);
|
||||
const yMatch = winInfo.match(/Absolute upper-left Y:\s*(-?\d+)/);
|
||||
const widthMatch = winInfo.match(/Width:\s*(\d+)/);
|
||||
const heightMatch = winInfo.match(/Height:\s*(\d+)/);
|
||||
if (!xMatch || !yMatch || !widthMatch || !heightMatch) {
|
||||
@@ -112,7 +112,12 @@ export class X11WindowTracker extends BaseWindowTracker {
|
||||
}
|
||||
|
||||
private async pollGeometryAsync(): Promise<void> {
|
||||
const windowIdsOutput = await this.runCommand('xdotool', ['search', '--class', 'mpv']);
|
||||
const windowIdsOutput = await this.runCommand('xdotool', [
|
||||
'search',
|
||||
'--onlyvisible',
|
||||
'--class',
|
||||
'mpv',
|
||||
]);
|
||||
const windowIds = windowIdsOutput.trim();
|
||||
if (!windowIds) {
|
||||
this.updateGeometry(null);
|
||||
|
||||
Reference in New Issue
Block a user