fix: coklu monitorde cascade dogru ekrani kullanir, .deb guncellendi

- window_persistence: onceki pencerenin bulundugu monitorun calisma alani kullanilir (getAllDisplays), primary degil
- viewer_screen: catchError donus tipi duzeltildi (analyze warning)
- dist/imajviewer_1.0.0_amd64.deb yeniden derlendi
This commit is contained in:
Alhan
2026-08-03 06:54:22 +03:00
parent a65bdc152c
commit 56ab4b5495
3 changed files with 18 additions and 2 deletions

View File

@@ -60,7 +60,7 @@ class _ViewerScreenState extends State<ViewerScreen> with WindowListener {
case 'resize':
case 'move':
// Son bilinen konumu hemen güncelle (kapanış senkron kaydı için)
windowManager.getBounds().then((b) => _lastBounds = b).catchError((_) {});
windowManager.getBounds().then((b) => _lastBounds = b).catchError((_) => _lastBounds);
_saveDebounce?.cancel();
_saveDebounce = Timer(const Duration(milliseconds: 300), () {
_doSave();

View File

@@ -61,7 +61,23 @@ class WindowPersistence {
required Size previousSize,
}) async {
try {
final display = await screenRetriever.getPrimaryDisplay();
final displays = await screenRetriever.getAllDisplays();
// Önceki pencerenin bulunduğu monitörü bul (çoklu monitör desteği)
Display display = await screenRetriever.getPrimaryDisplay();
for (final d in displays) {
final pos = d.visiblePosition;
final size = d.visibleSize ?? d.size;
if (pos != null &&
previousPosition.dx >= pos.dx &&
previousPosition.dx < pos.dx + size.width &&
previousPosition.dy >= pos.dy &&
previousPosition.dy < pos.dy + size.height) {
display = d;
break;
}
}
final workLeft = display.visiblePosition?.dx ?? 0;
final workTop = display.visiblePosition?.dy ?? 0;
final workWidth = display.visibleSize?.width ?? display.size.width;