Attempted mitigation for the problems regarding user-initiated resizes/moves.
This commit is contained in:
@@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
* user Interface module for WinAPI on Windows.
|
* user Interface module for WinAPI on Windows.
|
||||||
*
|
*
|
||||||
* Version: @(#)win_ui.c 1.0.36 2018/10/24
|
* Version: @(#)win_ui.c 1.0.37 2018/10/28
|
||||||
*
|
*
|
||||||
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
||||||
* Miran Grca, <mgrca8@gmail.com>
|
* Miran Grca, <mgrca8@gmail.com>
|
||||||
@@ -52,6 +52,7 @@ HICON hIcon[256]; /* icon data loaded from resources */
|
|||||||
RECT oldclip; /* mouse rect */
|
RECT oldclip; /* mouse rect */
|
||||||
int infocus = 1;
|
int infocus = 1;
|
||||||
int rctrl_is_lalt = 0;
|
int rctrl_is_lalt = 0;
|
||||||
|
int user_resize = 0;
|
||||||
|
|
||||||
char openfilestring[260];
|
char openfilestring[260];
|
||||||
WCHAR wopenfilestring[260];
|
WCHAR wopenfilestring[260];
|
||||||
@@ -543,6 +544,9 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_SIZE:
|
case WM_SIZE:
|
||||||
|
if (user_resize && !vid_resize)
|
||||||
|
break;
|
||||||
|
|
||||||
SendMessage(hwndSBAR, SB_GETBORDERS, 0, (LPARAM) sb_borders);
|
SendMessage(hwndSBAR, SB_GETBORDERS, 0, (LPARAM) sb_borders);
|
||||||
|
|
||||||
temp_x = (lParam & 0xFFFF);
|
temp_x = (lParam & 0xFFFF);
|
||||||
@@ -588,11 +592,6 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_MOVE:
|
case WM_MOVE:
|
||||||
/* If window is not resizable, then tell the main thread to
|
|
||||||
resize it, as sometimes, moves can mess up the window size. */
|
|
||||||
if (!vid_resize)
|
|
||||||
doresize = 1;
|
|
||||||
|
|
||||||
if (window_remember) {
|
if (window_remember) {
|
||||||
GetWindowRect(hwnd, &rect);
|
GetWindowRect(hwnd, &rect);
|
||||||
window_x = rect.left;
|
window_x = rect.left;
|
||||||
@@ -688,6 +687,19 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
hook_enabled = 0;
|
hook_enabled = 0;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case WM_ENTERSIZEMOVE:
|
||||||
|
user_resize = 1;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case WM_EXITSIZEMOVE:
|
||||||
|
user_resize = 0;
|
||||||
|
|
||||||
|
/* If window is not resizable, then tell the main thread to
|
||||||
|
resize it, as sometimes, moves can mess up the window size. */
|
||||||
|
if (!vid_resize)
|
||||||
|
doresize = 1;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return(0);
|
return(0);
|
||||||
@@ -989,6 +1001,7 @@ plat_resize(int x, int y)
|
|||||||
/* First, see if we should resize the UI window. */
|
/* First, see if we should resize the UI window. */
|
||||||
if (!vid_resize) {
|
if (!vid_resize) {
|
||||||
video_wait_for_blit();
|
video_wait_for_blit();
|
||||||
|
|
||||||
SendMessage(hwndSBAR, SB_GETBORDERS, 0, (LPARAM) sb_borders);
|
SendMessage(hwndSBAR, SB_GETBORDERS, 0, (LPARAM) sb_borders);
|
||||||
|
|
||||||
GetWindowRect(hwndMain, &r);
|
GetWindowRect(hwndMain, &r);
|
||||||
|
Reference in New Issue
Block a user