HumbleUI / JWM

Cross-platform window management and OS integration library for Java
Apache License 2.0
570 stars 46 forks source link

fix resize frame #284

Closed TheDrawingCoder-Gamer closed 8 months ago

TheDrawingCoder-Gamer commented 8 months ago

Resizing doesn't correctly request a new frame. This changes the code so it goes through the platform specific way of requesting a new frame, instead of just accepting a frame event. Fixes resizing oddities in X11 (and wayland when the patch is applied to my branch).

tonsky commented 8 months ago

There’s Platform.CURRENT != Platform.X11, how can it possibly fix oddities in X11?

TheDrawingCoder-Gamer commented 8 months ago

I was mistaken. Works for Wayland at least, fixes oddities there. Before this change, my wayland branch with HumbleUI didn't update the buffer size until I did something that would trigger a repaint anyway, like hovering over a button. Now it resizes it correctly.

Note for X11: The reason I've made this change is that sometimes, before the change, the surface I got was a null pointer. After this change it's no longer null, but it still is sometimes null on X11. I haven't observed this in actual HumbleUI but I've been observing this in my own toolkit.

tonsky commented 8 months ago

How does it help though? Is there some extra work that’s been done in requestFrame? Because you are supposed to reset surfaces in EventFrame hanlder, right? And it shouldn’t matter if it was called from resize event or frame event? It’s called either way?

TheDrawingCoder-Gamer commented 8 months ago

I can't observe the changes anymore. Probably a quirk of my system; closing