From af21f6d16e58dfdf3a440e54d43bf5a1d2c2b317 Mon Sep 17 00:00:00 2001 From: Umbrix Developer Date: Sun, 18 Jan 2026 05:56:12 +0300 Subject: [PATCH] fix: restore window from minimized state --- lib/main.dart | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 85930e00..f4d087a2 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -19,9 +19,16 @@ void main() async { final result = await Process.run('ps', ['-p', pid.toString()]); if (result.exitCode == 0) { - // Process alive - try to focus existing window + // Process alive - restore and focus existing window 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 (_) { // xdotool not available, just exit }