Added the ability to size the window to a specific resolution, closes #1362;

Fixed unsolicited mouse captures after a double-click in an open file dialog, fixes #1367.
This commit is contained in:
OBattler
2021-04-12 03:42:03 +02:00
parent 7aac3a3d21
commit b6b5558aa3
6 changed files with 213 additions and 14 deletions

View File

@@ -61,9 +61,9 @@ HWND hwndMain, /* application main window */
HMENU menuMain; /* application main menu */
HICON hIcon[256]; /* icon data loaded from resources */
RECT oldclip; /* mouse rect */
int sbar_height = 23; /* statusbar height */
int sbar_height = 23; /* statusbar height */
int minimized = 0;
int infocus = 1;
int infocus = 1, button_down = 0;
int rctrl_is_lalt = 0;
int user_resize = 0;
@@ -456,10 +456,14 @@ input_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
#endif
break;
case WM_LBUTTONDOWN:
button_down |= 1;
break;
case WM_LBUTTONUP:
pclog("video_fullscreen = %i\n", video_fullscreen);
if (! video_fullscreen)
if ((button_down & 1) && !video_fullscreen)
plat_mouse_capture(1);
button_down &= ~1;
break;
case WM_MBUTTONUP:
@@ -511,12 +515,12 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
break;
#ifdef MTR_ENABLED
case IDM_ACTION_BEGIN_TRACE:
case IDM_ACTION_END_TRACE:
case IDM_ACTION_TRACE:
tracing_on = !tracing_on;
handle_trace(hmenu, tracing_on);
break;
case IDM_ACTION_BEGIN_TRACE:
case IDM_ACTION_END_TRACE:
case IDM_ACTION_TRACE:
tracing_on = !tracing_on;
handle_trace(hmenu, tracing_on);
break;
#endif
case IDM_ACTION_HRESET:
@@ -696,6 +700,10 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
config_save();
break;
case IDM_VID_SPECIFY_DIM:
SpecifyDimensionsDialogCreate(hwnd);
break;
case IDM_VID_FORCE43:
video_toggle_option(hmenu, &force_43, IDM_VID_FORCE43);
video_force_resize_set(1);
@@ -1063,9 +1071,14 @@ static LRESULT CALLBACK
SubWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message) {
case WM_LBUTTONDOWN:
button_down |= 2;
break;
case WM_LBUTTONUP:
if (! video_fullscreen)
if ((button_down & 2) && !video_fullscreen)
plat_mouse_capture(1);
button_down &= ~2;
break;
case WM_MBUTTONUP: