fix: restore window from minimized state

This commit is contained in:
Umbrix Developer
2026-01-18 05:56:12 +03:00
parent d8cdee91fe
commit af21f6d16e

View File

@@ -19,9 +19,16 @@ void main() async {
final result = await Process.run('ps', ['-p', pid.toString()]); final result = await Process.run('ps', ['-p', pid.toString()]);
if (result.exitCode == 0) { if (result.exitCode == 0) {
// Process alive - try to focus existing window // Process alive - restore and focus existing window
try { try {
await Process.run('xdotool', ['search', '--name', 'Umbrix', 'windowactivate']); // Find window and restore from minimized state, then activate
final searchResult = await Process.run('xdotool', ['search', '--name', 'Umbrix']);
if (searchResult.exitCode == 0 && searchResult.stdout.toString().trim().isNotEmpty) {
final windowId = searchResult.stdout.toString().trim().split('\n').first;
// Restore from minimized/iconified state
await Process.run('xdotool', ['windowmap', windowId]);
await Process.run('xdotool', ['windowactivate', windowId]);
}
} catch (_) { } catch (_) {
// xdotool not available, just exit // xdotool not available, just exit
} }