Open meanbeanmachine opened 1 year ago
Using Ubuntu 22.04.2 LTS, I can confirm a similar situation:
What I did -use basic tauri app example -add window-state plugin
My Problem The window grows in height each time the app is closed then re-opened, leading me to the same conclusion as @meanbeanmachine.
Initially, I wasn't aware of this plugin, so I had rolled my own solution in Javascript, using appWindow.onResized()
and appWindow.onMoved()
. My code has exactly the same trouble. I found that appWindow.innerSize()
and appWindow.outerSize()
were returning identical values, and I believe that's a pointer to the root cause of the issue in the plugin.
Can one of you confirm whether this is still an issue? Especially interested in v2 but iirc both versions received a few changes that touched the size getters.
Checked Tauri v2...Still drifts on the Y axis every run.
run1
run2
run3
Looks like the gtk get position won't include the decoration's height. However, when setting (moving) the window, Gtk will move the whole frame (including the decoration) to the position.
It seems that setting window gravity to Static or SouthXXX can solve the issue, but I'm not sure what will be broken...
Using Pop!_OS 22.04 X64
What I did
-use basic tauri app example -add window-state plugin
The Problem
When the app is closed and then re-opened, the Y coordinate drifts +37 pixels. I thought this was a very strange number, but suspected what it might be. I took a screenshot of the app and opened GIMP, and sure enough, the title bar of the app is exactly 37 pixels in height. I'm not sure if this is a Linux issue but it seems the window-state plugin is not accounting for the title bar in some way, resulting in a compounding 37px drift every time the app is opened.
screenshot