gtk: With SSD, window is drawn with default size before being redrawn with configured window-width/height #5960
Replies: 3 comments 1 reply
-
What environment are you running in? My test VM with Wayland and KDE Plasma 6 doesn't show this behavior, but then it could be because it's rather slow compared to running on bare metal. |
Beta Was this translation helpful? Give feedback.
-
Ah yeah, forgot to mention... Fedora 41 XFCE X11 bare metal, Core i7-6950X Decacore @ 3.00GHz w/ 64Gb memory. I would have thought a slow environment would make the behavior more noticeable but maybe it's also a X11 vs wayland thing. BTW, I also tested both before and after your recent commits and got the same results so I don't think any recent changes are involved. |
Beta Was this translation helpful? Give feedback.
-
./tmp/config:
Set the playback speed to 0.25 and you can see it clearly. 2025-02-23_16-33-39.mp4 |
Beta Was this translation helpful? Give feedback.
-
If you're using client-side decoration or no decoration, the initial window draws using the configured width and height. If you're using server-side-decoration however, the initial window draws with the default size then resizes to the configured size. It's kind of annoying. The GLFW build does the same thing but of course window decoration doesn't matter in that case.
I thought that moving the "initial-size" stuff earlier in the initialization process would be a way to fix this but doing so would be fairly intrusive give all the moving parts, especially with GTK. Then I thought changing the default initial size to something tiny that couldn't be seen, then setting initial-size to the default if window-width/height weren't specified might work. Nope. Finally I thought I might be able to start the window minimized then restore it after all the resizes were done. That kinda worked.
For GLFW, it was simple. In
apprt.glfw.init.Surface.init()
, I just added aniconify()
right afterglfw.Window.create()
and a correspondingrestore()
at the end of init(). Works great.For GTK, starting the window minimized was easy... At the end of
apprt.gtk.Window.init()
, I added a call togtk_window_minimize()
right before the final call toc.gtk_widget_show()
. Unfortunately, every place I tried to insert the corresponding call togtk_window_unminimize()
was too early and resulted in the window still drawing with the default size before resizing. The closest I got was adding it toapprt.gtk.Surface.setTitle()
but that only kinda-worked and only if you weren't setting a static title because that gets set early.setTitle()
also gets called often so it wasn't the best place anyway.I suppose the "right" way to do this would be to do the calculations early and pass them in to the rt_app/rt_surface/window init steps. The rt_surface has to provide content scale anyway and the rest of the inputs to the calculations come from the font.
Any other ideas?
Beta Was this translation helpful? Give feedback.
All reactions