Fix graphics flickering/stretching on Windows #367

Merged
NQNStudios merged 12 commits from windows-flicker into master 2024-06-27 12:40:34 +00:00
NQNStudios commented 2024-06-19 22:22:10 +00:00 (Migrated from github.com)

Fixes #366

This bug was unbelievably hard to track down and fix.

I think it was probably caused by a change in SFML's code for handling window resize events on Windows. When we add the menubar to the window by bypassing SFML and using the Windows APIs, SFML now detects that change and shrinks the logical viewport of your window without expanding the window itself to fit the menubar in it.

I updated menuProc() to catch that first unwanted resize event and discard it. I also made the window expand to fit the menubar's additional height, handled for a rare edge case where the menubar needs more than 1 row for its buttons, and made sure the splash screens still render in the right places.

I need to test this on Linux and Mac to make sure it didn't break those.

Fixes #366 This bug was unbelievably hard to track down and fix. I think it was probably caused by a change in SFML's code for handling window resize events on Windows. When we add the menubar to the window by bypassing SFML and using the Windows APIs, SFML now detects that change and shrinks the logical viewport of your window without expanding the window itself to fit the menubar in it. I updated `menuProc()` to catch that first unwanted resize event and discard it. I also made the window expand to fit the menubar's additional height, handled for a rare edge case where the menubar needs more than 1 row for its buttons, and made sure the splash screens still render in the right places. I need to test this on Linux and Mac to make sure it didn't break those.
NQNStudios commented 2024-06-19 22:47:48 +00:00 (Migrated from github.com)

This doesn't break the Linux behavior.

This doesn't break the Linux behavior.
CelticMinstrel (Migrated from github.com) reviewed 2024-06-19 23:04:31 +00:00
@@ -109,18 +109,23 @@ bool handle_startup_press(location the_point) {
CelticMinstrel (Migrated from github.com) commented 2024-06-19 23:04:31 +00:00

No space after while and if please.

No space after while and if please.
CelticMinstrel (Migrated from github.com) reviewed 2024-06-19 23:04:57 +00:00
@@ -444,5 +444,30 @@ ModalSession::~ModalSession() {
}
CelticMinstrel (Migrated from github.com) commented 2024-06-19 23:04:57 +00:00

Ditto.

Ditto.
NQNStudios commented 2024-06-20 00:53:59 +00:00 (Migrated from github.com)

I checked and this also doesn't break anything on Mac OS.

I checked and this also doesn't break anything on Mac OS.
NQNStudios commented 2024-06-20 01:24:31 +00:00 (Migrated from github.com)

These changes didn't fix the scenario and character editors, though...

These changes didn't fix the scenario and character editors, though...
NQNStudios commented 2024-06-20 02:59:22 +00:00 (Migrated from github.com)

Would be bad practice to leave something broken in the editors when there's a known solution, so I applied the same fix to them and it worked.

Would be bad practice to leave something broken in the editors when there's a known solution, so I applied the same fix to them and it worked.
NQNStudios commented 2024-06-24 00:53:34 +00:00 (Migrated from github.com)

I think issue #59 must be related to the same underlying cause (stuffing a menu bar into an SFML window making it squish its effective viewport weirdly). So I might as well see if that's still a problem and try to fix that too.

I think issue #59 must be related to the same underlying cause (stuffing a menu bar into an SFML window making it squish its effective viewport weirdly). So I might as well see if that's still a problem and try to fix that too.
NQNStudios commented 2024-06-25 03:15:45 +00:00 (Migrated from github.com)

@CelticMinstrel I'm done fiddling with this one if you don't have any other changes in mind.

@CelticMinstrel I'm done fiddling with this one if you don't have any other changes in mind.
CelticMinstrel commented 2024-06-26 00:24:12 +00:00 (Migrated from github.com)

I assume you checked that this doesn't break anything on Mac or Linux, right?

I assume you checked that this doesn't break anything on Mac or Linux, right?
NQNStudios commented 2024-06-26 00:32:48 +00:00 (Migrated from github.com)

Yeah I did

On Tue, Jun 25, 2024 at 6:24 PM Celtic Minstrel @.***>
wrote:

I assume you checked that this doesn't break anything on Mac or Linux,
right?


Reply to this email directly, view it on GitHub
https://github.com/calref/cboe/pull/367#issuecomment-2190255029, or
unsubscribe
https://github.com/notifications/unsubscribe-auth/AATXBKJH7YE2KRGTDKO7IKLZJIC4FAVCNFSM6AAAAABJSYZZ6OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJQGI2TKMBSHE
.
You are receiving this because you authored the thread.Message ID:
@.***>

Yeah I did On Tue, Jun 25, 2024 at 6:24 PM Celtic Minstrel ***@***.***> wrote: > I assume you checked that this doesn't break anything on Mac or Linux, > right? > > — > Reply to this email directly, view it on GitHub > <https://github.com/calref/cboe/pull/367#issuecomment-2190255029>, or > unsubscribe > <https://github.com/notifications/unsubscribe-auth/AATXBKJH7YE2KRGTDKO7IKLZJIC4FAVCNFSM6AAAAABJSYZZ6OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJQGI2TKMBSHE> > . > You are receiving this because you authored the thread.Message ID: > ***@***.***> >
Sign in to join this conversation.
No description provided.