feat: jfif/jpe/wbmp format destegi, pencere cascade yerlesimi, konum kaydi duzeltmesi
- file_handler/image_manager: jfif, jpe, wbmp uzantilari - .desktop + install.sh MimeType: image/vnd.wap.wbmp eklendi - main.dart: yeni pencere oncekinin saginda acilir (screen_retriever ile ekran tespiti) - viewer_screen: 2sn polling kaldirildi, konum kaydi tek akisa oturtuldu (acilis + move/resize debounce + close senkron) - dist/rebuild-deb.sh: .desktop kaynaktan kopyalanir (MimeType/StartupWMClass guncel kalir) - .deb guncellendi, docs: session-2026-08-03 + plan dokumanlari
This commit is contained in:
1 parent
d09351feef
commit
a65bdc152c
17 files changed
+272
-38
No files matched your search
@@ -21,7 +21,6 @@ class _ViewerScreenState extends State<ViewerScreen> with WindowListener {
|
||||
bool _hasImages = false;
|
||||
bool _isDragging = false;
|
||||
Timer? _saveDebounce;
|
||||
Timer? _pollTimer;
|
||||
Rect _lastBounds = Rect.zero;
|
||||
|
||||
@override
|
||||
@@ -35,29 +34,6 @@ class _ViewerScreenState extends State<ViewerScreen> with WindowListener {
|
||||
FileHandler.loadImagesFromPaths(widget.initialFiles);
|
||||
});
|
||||
}
|
||||
|
||||
// İlk kayıt + periyodik polling başlat
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
||||
await Future.delayed(const Duration(milliseconds: 200));
|
||||
await _doSave();
|
||||
_startPolling();
|
||||
});
|
||||
}
|
||||
|
||||
void _startPolling() {
|
||||
_pollTimer?.cancel();
|
||||
_pollTimer = Timer.periodic(const Duration(seconds: 2), (_) async {
|
||||
try {
|
||||
final bounds = await windowManager.getBounds();
|
||||
if (bounds != _lastBounds) {
|
||||
_lastBounds = bounds;
|
||||
WindowPersistence.saveSync(
|
||||
position: bounds.topLeft,
|
||||
size: bounds.size,
|
||||
);
|
||||
}
|
||||
} catch (_) {}
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -65,7 +41,6 @@ class _ViewerScreenState extends State<ViewerScreen> with WindowListener {
|
||||
windowManager.removeListener(this);
|
||||
ImageManager.instance.removeListener(_onImageManagerChanged);
|
||||
_saveDebounce?.cancel();
|
||||
_pollTimer?.cancel();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@@ -74,10 +49,18 @@ class _ViewerScreenState extends State<ViewerScreen> with WindowListener {
|
||||
void onWindowEvent(String eventName) {
|
||||
switch (eventName) {
|
||||
case 'close':
|
||||
_doSave();
|
||||
// Senkron kayıt — async çağrı kapanışta tamamlanmayabilir
|
||||
if (_lastBounds != Rect.zero) {
|
||||
WindowPersistence.saveSync(
|
||||
position: _lastBounds.topLeft,
|
||||
size: _lastBounds.size,
|
||||
);
|
||||
}
|
||||
break;
|
||||
case 'resize':
|
||||
case 'move':
|
||||
// Son bilinen konumu hemen güncelle (kapanış senkron kaydı için)
|
||||
windowManager.getBounds().then((b) => _lastBounds = b).catchError((_) {});
|
||||
_saveDebounce?.cancel();
|
||||
_saveDebounce = Timer(const Duration(milliseconds: 300), () {
|
||||
_doSave();
|
||||
|
||||
Reference in new issue
Block a user