fix(desktop): Persist window size and position across restarts
The desktop window always reset to its default size after restart because no WindowState was persisted. Add WindowStateStorage backed by multiplatform-settings (java.util.prefs on desktop) to save and restore width, height, and position. Use snapshotFlow inside the Window composition to persist changes continuously, with an explicit Preferences.flush() to ensure values reach disk before exit. Also add 'desktop-install' Makefile target to rebuild and copy the app to /Applications/myicek.app.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
.PHONY: android desktop android-usb android-emulator
|
||||
.PHONY: android desktop desktop-install android-usb android-emulator
|
||||
|
||||
ADB := $(shell command -v adb 2>/dev/null || echo "$(HOME)/Library/Android/sdk/platform-tools/adb")
|
||||
EMULATOR := $(shell command -v emulator 2>/dev/null || echo "$(HOME)/Library/Android/sdk/emulator/emulator")
|
||||
@@ -11,6 +11,10 @@ android:
|
||||
desktop:
|
||||
./gradlew composeApp:run
|
||||
|
||||
desktop-install:
|
||||
./gradlew composeApp:packageDistributionForCurrentOS
|
||||
cp -R composeApp/build/compose/binaries/main/app/myicek.app /Applications/myicek.app
|
||||
|
||||
android-usb: android
|
||||
$(ADB) -d install -r $(APK)
|
||||
$(ADB) -d shell am start -n ch.parano.myicek/.MainActivity
|
||||
|
||||
Reference in New Issue
Block a user