Skip to content

Commit 61ed284

Browse files
SiegeLordExSiegeLord
authored andcommitted
Use a different variable to ignore D3D live resize events.
1 parent d49a47f commit 61ed284

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

include/allegro5/platform/aintwin.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,15 @@ struct ALLEGRO_DISPLAY_WIN
9191
*/
9292
bool ignore_resize;
9393

94+
/* DefWindowProc for WM_ENTERSIZEMOVE enters a modal loop, which also
95+
* ends up blocking the loop in d3d_display_thread_proc (which is
96+
* where we are called from, if using D3D). Rather than batching up
97+
* intermediate resize events which the user cannot acknowledge in the
98+
* meantime anyway, make it so only a single resize event is generated
99+
* at WM_EXITSIZEMOVE.
100+
*/
101+
bool d3d_ignore_resize;
102+
94103
/* Size to reset to when al_set_display_flag(FULLSCREEN_WINDOW, false)
95104
* is called.
96105
*/

src/win/wwindow.c

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ static void win_generate_resize_event(ALLEGRO_DISPLAY_WIN *win_display)
311311
WINDOWINFO wi;
312312
int x, y, w, h;
313313

314-
if (win_display->ignore_resize) {
314+
if (win_display->ignore_resize || win_display->d3d_ignore_resize) {
315315
return;
316316
}
317317

@@ -987,16 +987,9 @@ static LRESULT CALLBACK window_callback(HWND hWnd, UINT message,
987987
return 0;
988988
}
989989
case WM_ENTERSIZEMOVE: {
990-
/* DefWindowProc for WM_ENTERSIZEMOVE enters a modal loop, which also
991-
* ends up blocking the loop in d3d_display_thread_proc (which is
992-
* where we are called from, if using D3D). Rather than batching up
993-
* intermediate resize events which the user cannot acknowledge in the
994-
* meantime anyway, make it so only a single resize event is generated
995-
* at WM_EXITSIZEMOVE.
996-
*/
997990
al_lock_mutex(resize_event_thread_mutex);
998991
if (d->flags & ALLEGRO_DIRECT3D_INTERNAL) {
999-
win_display->ignore_resize = true;
992+
win_display->d3d_ignore_resize = true;
1000993
}
1001994
ALLEGRO_DISPLAY_WIN **add = (ALLEGRO_DISPLAY_WIN **)_al_vector_alloc_back(&resizing_displays);
1002995
*add = win_display;
@@ -1006,7 +999,7 @@ static LRESULT CALLBACK window_callback(HWND hWnd, UINT message,
1006999
case WM_EXITSIZEMOVE:
10071000
al_lock_mutex(resize_event_thread_mutex);
10081001
if (d->flags & ALLEGRO_DIRECT3D_INTERNAL) {
1009-
win_display->ignore_resize = false;
1002+
win_display->d3d_ignore_resize = false;
10101003
}
10111004
_al_vector_find_and_delete(&resizing_displays, &win_display);
10121005
al_unlock_mutex(resize_event_thread_mutex);

0 commit comments

Comments
 (0)