ID:2949550
 
Resolved
When a maximized window was minimized, using winset on it could cause the is-maximized parameter to reset to false.
BYOND Version:515
Operating System:Windows 10 Home 64-bit
Web Browser:Firefox 131.0
Applies to:Dream Seeker
Status: Resolved (515.1646)

This issue has been resolved.
Descriptive Problem Summary:
When the window would flash on the taskbar, occasionally nothing would happen, and the game window would change size when I refocus on the window. This only happens when the game is not in focus or is minimized.
Numbered Steps to Reproduce Problem:
1. Open the Flash Loop program below
2. Click on the 'Start Flash Loop' button
3. Change window focus by minimizing the game window.
4. Wait for the flash to be sent by the program.
5. This should cause the icon on the taskbar to flash. If all went as has happened to me, it shouldn't and when re-focusing on the game window, it will be re-sized to the middle of the screen in a square, and the flash won't have gone through.

Code Snippet (if applicable) to Reproduce Problem:
/*
These are simple defaults for your project.
*/


world
fps = 25 // 25 frames per second
icon_size = 32 // 32x32 icon size by default

view = 6 // show up to 6 tiles outward from center (13x13 view)


// Make objects move 8 pixels per tick when walking

mob
step_size = 8

verb
start_flash_loop()
usr << "Starting loop"
while(world)
sleep(50)
winset(usr,"default","flash=-1")
usr << "Flash sent"

obj
step_size = 8


Expected Results:
When the 'Start Flash Loop' button is pressed and the window is minimized, the window should resize upon re-opening the window.
Actual Results:
The window resized as expected.
Does the problem occur:
Every time? Or how often?
Only when the game is minimized, and even then, not every time.
In other games?
I haven't tested it in other games.
In other user accounts?
Yes, it has happened on every account that I have used.
On other computers?
Not sure if it has happened on other computers in the past but other users have stated similar issues when brought up.

When does the problem NOT occur?
Only when the window isn't minimized does it happen.

Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? (Visit http://www.byond.com/download/build to download old versions for testing.)
It has happened in previous versions, but I'm not certain which ones. I know for certain that it works in 515
Workarounds:
Don't minimize the game window and it won't happen.
The bug report doesn't make any sense, because you have a code snippet but your numbered steps to reproduce include joining a game.

BYOND Bug reports should not involve joining a game. All test cases need to be self contained. I have no idea if there's a problem with that specific game or if it's a broader issue.

Can you edit this to produce a test case that clearly causes the issue without involving a third-party game?
Lummox JR changed status to 'Test case needed'
My apologies.
In response to Lummox JR
I believe I fixed the post, please do let me know if it is still incorrect.
Your snippet doesn't flash at all, ever, and the bit in step #5 about a "ping" makes no sense. I don't understand what that means.

It's clear to me that the snippet is not enough to reproduce this issue. I need a test project so we're on the same page.
In response to Lummox JR
When I run the code on my machine it flashes for me. And by 'ping' I meant the taskbar flash. It only flashes when it's unfocused, which is what it's supposed to do, but when I minimize the window of the program it will only flash after two are sent and when I re-focus the window it will be a smaller sized window than when I minimized it if the window was previously maximized.
In response to Lummox JR
https://youtu.be/t9Kt4wTIZcg
Here is a video showing exactly what I mean.
Okay, I was able to reproduce the problem, but this bug report has a number of issues.

1. The flash happens. You say it doesn't. I haven't been able to reproduce the flash not occurring.
2. Your numbered steps to reproduce the problem don't mention requiring to maximize the window first.
3. The snippet you provided does not in a vacuum reproduce the problem. You need to create a project that has a window named "default". This is why Lummox asked you for a downloadable project that reproduces the problem, because otherwise this can't be reproduced.

That said, here's a link to a downloadable project that reproduces the problem.

Steps to reproduce:

1. Open the DMB file. Maximize the window.
2. Press the "Start flash loop" verb.
3. Minimize the window.
4. Wait for the taskbar icon for the program to flash.
5. Open the window by clicking the icon on the taskbar. Observe that the window is no longer in its maximized width form and has been changed to its "Restore Down" form.

The "Restore Down" thing doesn't happen while minimized.
Ohh, I see the problem. I'm very, *very* sorry for not having a very good grasp on this, it's my first time submitting a bug report, and I've never actually created anything in BYOND myself.
Upon rereading, I'm realizing how aggressive my post may have been worded. I apologize for that. It's tough to get bug reports right, especially when you haven't done it before, and especially nowadays where downloadable test cases are all too frequently required to reproduce a bug.

You should never feel bad about trying to help out the engine. Please don't let this experience make you feel unwanted. You've done more by reporting an issue than most do in their time here. Thank you for that.
I didn't take offense to how you worded it at all! I truly appreciate the help! I realize now that my reply came off as snarky. I'm happy that you helped!
Lummox JR resolved issue with message:
When a maximized window was minimized, using winset on it could cause the is-maximized parameter to reset to false.