fix: Windows uyumlulugu - APPDATA config, taskkill
Build Windows / build-windows (push) Has been cancelled

This commit is contained in:
Alhan committed 2026-07-22 06:00:39 +03:00
1 parent d622d0ec04
commit 9a0e89bcea
5 files changed
+11 -2

No files matched your search

Binary file not shown.
Binary file not shown.
+7 -2
View File
@@ -5,8 +5,13 @@ import 'package:flutter/material.dart';
/// Persists and restores window position and size.
class WindowPersistence {
static File get _configFile {
final home = Platform.environment['HOME'] ?? '/tmp';
return File('$home/.config/imajviewer/window.json');
String dir;
if (Platform.isWindows) {
dir = '${Platform.environment['APPDATA'] ?? Platform.environment['USERPROFILE'] ?? '.'}/imajviewer';
} else {
dir = '${Platform.environment['HOME'] ?? '/tmp'}/.config/imajviewer';
}
return File('$dir/window.json');
}
/// Save window rect synchronously (safe to call before destroy).
+4
View File
@@ -21,7 +21,11 @@ class AppShortcuts extends StatelessWidget {
// Ctrl+Shift+Q: tüm pencereleri kapat
if (ctrl && shift && event.logicalKey == LogicalKeyboardKey.keyQ) {
if (Platform.isWindows) {
Process.runSync('taskkill', ['/F', '/IM', 'imajviewer.exe']);
} else {
Process.runSync('pkill', ['imajviewer']);
}
return KeyEventResult.handled;
}
Binary file not shown.