delayed response to / after window resizing

Found a bug in R'n'D? Report it here!

Moderators: Flumminator, Zomis

Post Reply
Posts: 197
Joined: Fri Jun 20, 2014 10:06 am

delayed response to / after window resizing

Post by filbo » Wed Apr 20, 2016 9:54 am

On SDL2 binary sync'd to d0409bd76aa84a8745ec2ea6d8a5480c8bea0bcd:

Start RnD. If in fullscreen mode, drop out to windowed mode. If zoomed to other than 100%, go to Setup -> Graphics -> Window scaling, click on "100%".

Grab lower right window corner, slowly grow and shrink the window by small amounts, pausing after each small deliberate motion.

Observe that the window title bar reflects the current zoom level -- initially "100%", but will show e.g. "117%" or "42%" or whatever you've set it to. Zoom% reflects the largest version of the game displayable within the current window at normal aspect ratio -- this is normal and means that some window stretching/shrinking motions won't change zoom%.

Now move quickly. e.g. from original 100% zoom, quickly drag to the left (game shrinks), then far to the right (game grows to 100% and is centered in wide window with black space at both ends). With a single grab-click-drag-drag-drag-drag..., zoom from 100% down to small, up to very wide, back and forth 6 or 8 times. Then stop.

For me, the title bar gets stuck at "50%" for a long time -- then eventually it catches up. "Long time" might be 10-20 seconds or longer, depending how much you messed around before letting go.

If, after doing this, you try to interact with game menus while it's still thinking, your mouse actions are queued up and happen later. They probably don't do what you expected, because you clicked on several things trying to get a response; then those actions were eventually reacted to according to future screen layout.

User avatar
Site Admin
Posts: 2718
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany

Re: delayed response to / after window resizing

Post by Holger » Thu Apr 21, 2016 11:48 pm

Yep, could reproduce this.

This nasty behaviour should now be much better. See the last version from the Git repo (together with today's other fixes).

To further improve this, I probably would have to peek through the event list to see if more resizing events follow the current one, to skip some or all window resize events but the last one.

Posts: 197
Joined: Fri Jun 20, 2014 10:06 am

Re: delayed response to / after window resizing

Post by filbo » Fri Apr 22, 2016 2:09 am

Great, seems all fixed!

My machine is apparently fast enough not to need any other special fiddling...

If you did need to further improve it, I'd say, instead of trying to peek ahead to future resize events -- just don't do so much in response to a resize event. Record it in game state variables, but don't tell SDL to do anything special until you get to a quiet point in the event loop; then notice that you have (one and only one) pending resize event, do whatever you have to do.

The changelog suggested that one other longstanding bug might have been fixed, but no, so I will start a new thread on that; plus another new and nasty bug that has come up (but not new to this build)...

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests