Merge branch 'master' into opengl
This commit is contained in:
@@ -71,6 +71,7 @@ BEGIN
|
||||
#endif
|
||||
END
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Specify dimensions", IDM_VID_SPECIFY_DIM
|
||||
MENUITEM "F&orce 4:3 display ratio", IDM_VID_FORCE43
|
||||
POPUP "&Window scale factor"
|
||||
BEGIN
|
||||
@@ -342,6 +343,27 @@ BEGIN
|
||||
#endif
|
||||
END
|
||||
|
||||
DLG_SPECIFY_DIM DIALOG DISCARDABLE 0, 0, 175, 66
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Specify Main Window Dimensions"
|
||||
FONT 9, "Segoe UI"
|
||||
BEGIN
|
||||
LTEXT "Width:",IDT_1709,7,9,24,12
|
||||
EDITTEXT IDC_EDIT_WIDTH,33,7,45,12,ES_AUTOHSCROLL | ES_NUMBER
|
||||
CONTROL "",IDC_WIDTHSPIN,"msctls_updown32",UDS_SETBUDDYINT |
|
||||
UDS_ALIGNRIGHT | UDS_ARROWKEYS | UDS_NOTHOUSANDS,76,6,
|
||||
12,12
|
||||
LTEXT "Height:",IDT_1710,97,9,24,12
|
||||
EDITTEXT IDC_EDIT_HEIGHT,123,7,45,12,ES_AUTOHSCROLL | ES_NUMBER
|
||||
CONTROL "",IDC_HEIGHTSPIN,"msctls_updown32",UDS_SETBUDDYINT |
|
||||
UDS_ALIGNRIGHT | UDS_ARROWKEYS | UDS_NOTHOUSANDS,166,6,
|
||||
12,12
|
||||
CONTROL "Lock to this size",IDC_CHECK_LOCK_SIZE,"Button",
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,7,26,94,10
|
||||
DEFPUSHBUTTON "OK",IDOK,30,45,50,14
|
||||
PUSHBUTTON "Cancel",IDCANCEL,99,45,50,14
|
||||
END
|
||||
|
||||
DLG_CFG_MACHINE DIALOG DISCARDABLE 107, 0, 305, 200
|
||||
STYLE DS_CONTROL | WS_CHILD
|
||||
FONT 9, "Segoe UI"
|
||||
|
||||
@@ -19,7 +19,7 @@ add_library(plat OBJECT win.c win_dynld.c win_thread.c win_cdrom.c
|
||||
win_keyboard.c win_crashdump.c win_midi.c win_mouse.c)
|
||||
|
||||
add_library(ui OBJECT win_ui.c win_stbar.c win_sdl.c win_dialog.c win_about.c
|
||||
win_settings.c win_devconf.c win_snd_gain.c win_new_floppy.c
|
||||
win_settings.c win_devconf.c win_snd_gain.c win_specify_dim.c win_new_floppy.c
|
||||
win_jsconf.c win_media_menu.c 86Box.rc glad.c win_opengl.c)
|
||||
|
||||
if(MSVC)
|
||||
|
||||
@@ -447,7 +447,7 @@ else
|
||||
UIOBJ := win_ui.o win_stbar.o \
|
||||
win_sdl.o win_opengl.o glad.o \
|
||||
win_dialog.o win_about.o \
|
||||
win_settings.o win_devconf.o win_snd_gain.o \
|
||||
win_settings.o win_devconf.o win_snd_gain.o win_specify_dim.o \
|
||||
win_new_floppy.o win_jsconf.o win_media_menu.o
|
||||
endif
|
||||
|
||||
|
||||
@@ -1033,7 +1033,7 @@ plat_setfullscreen(int on)
|
||||
plat_resize(scrnsz_x, scrnsz_y);
|
||||
if (vid_resize) {
|
||||
/* scale the screen base on DPI */
|
||||
if (window_remember) {
|
||||
if (!(vid_resize & 2) && window_remember) {
|
||||
MoveWindow(hwndMain, window_x, window_y, window_w, window_h, TRUE);
|
||||
GetClientRect(hwndMain, &rect);
|
||||
|
||||
@@ -1041,11 +1041,11 @@ plat_setfullscreen(int on)
|
||||
temp_y = rect.bottom - rect.top + 1 - sbar_height;
|
||||
} else {
|
||||
if (dpi_scale) {
|
||||
temp_x = MulDiv(unscaled_size_x, dpi, 96);
|
||||
temp_y = MulDiv(unscaled_size_y, dpi, 96);
|
||||
temp_x = MulDiv((vid_resize & 2) ? fixed_size_x : unscaled_size_x, dpi, 96);
|
||||
temp_y = MulDiv((vid_resize & 2) ? fixed_size_y : unscaled_size_y, dpi, 96);
|
||||
} else {
|
||||
temp_x = unscaled_size_x;
|
||||
temp_y = unscaled_size_y;
|
||||
temp_x = (vid_resize & 2) ? fixed_size_x : unscaled_size_x;
|
||||
temp_y = (vid_resize & 2) ? fixed_size_y : unscaled_size_y;
|
||||
}
|
||||
|
||||
/* Main Window. */
|
||||
@@ -1062,8 +1062,8 @@ plat_setfullscreen(int on)
|
||||
if (mouse_capture)
|
||||
ClipCursor(&rect);
|
||||
|
||||
scrnsz_x = unscaled_size_x;
|
||||
scrnsz_y = unscaled_size_y;
|
||||
scrnsz_x = (vid_resize & 2) ? fixed_size_x : unscaled_size_x;
|
||||
scrnsz_y = (vid_resize & 2) ? fixed_size_y : unscaled_size_y;
|
||||
}
|
||||
}
|
||||
video_fullscreen &= 1;
|
||||
|
||||
179
src/win/win_specify_dim.c
Normal file
179
src/win/win_specify_dim.c
Normal file
@@ -0,0 +1,179 @@
|
||||
/*
|
||||
* 86Box A hypervisor and IBM PC system emulator that specializes in
|
||||
* running old operating systems and software designed for IBM
|
||||
* PC systems and compatibles from 1981 through fairly recent
|
||||
* system designs based on the PCI bus.
|
||||
*
|
||||
* This file is part of the 86Box distribution.
|
||||
*
|
||||
* Handle the dialog for specifying the dimensions of the main window.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Authors: Miran Grca, <mgrca8@gmail.com>
|
||||
*
|
||||
* Copyright 2016-2018 Miran Grca.
|
||||
*/
|
||||
#define UNICODE
|
||||
#define BITMAP WINDOWS_BITMAP
|
||||
#include <windows.h>
|
||||
#include <windowsx.h>
|
||||
#undef BITMAP
|
||||
#include <commctrl.h>
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <wchar.h>
|
||||
#include <86box/86box.h>
|
||||
#include <86box/config.h>
|
||||
#include <86box/plat.h>
|
||||
#include <86box/sound.h>
|
||||
#include <86box/win.h>
|
||||
|
||||
|
||||
#if defined(__amd64__) || defined(__aarch64__)
|
||||
static LRESULT CALLBACK
|
||||
#else
|
||||
static BOOL CALLBACK
|
||||
#endif
|
||||
SpecifyDimensionsDialogProcedure(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
HWND h, h2;
|
||||
HMENU hmenu;
|
||||
UDACCEL accel, accel2;
|
||||
RECT r;
|
||||
uint32_t temp_x = 0, temp_y = 0;
|
||||
int dpi = 96, lock;
|
||||
LPTSTR lptsTemp;
|
||||
char *stransi;
|
||||
|
||||
switch (message) {
|
||||
case WM_INITDIALOG:
|
||||
GetWindowRect(hwndRender, &r);
|
||||
|
||||
h = GetDlgItem(hdlg, IDC_WIDTHSPIN);
|
||||
h2 = GetDlgItem(hdlg, IDC_EDIT_WIDTH);
|
||||
SendMessage(h, UDM_SETBUDDY, (WPARAM)h2, 0);
|
||||
SendMessage(h, UDM_SETRANGE, 0, (120 << 16) | 2048);
|
||||
accel.nSec = 0;
|
||||
accel.nInc = 8;
|
||||
SendMessage(h, UDM_SETACCEL, 1, (LPARAM)&accel);
|
||||
SendMessage(h, UDM_SETPOS, 0, r.right - r.left);
|
||||
|
||||
h = GetDlgItem(hdlg, IDC_HEIGHTSPIN);
|
||||
h2 = GetDlgItem(hdlg, IDC_EDIT_HEIGHT);
|
||||
SendMessage(h, UDM_SETBUDDY, (WPARAM)h2, 0);
|
||||
SendMessage(h, UDM_SETRANGE, 0, (120 << 16) | 2048);
|
||||
accel2.nSec = 0;
|
||||
accel2.nInc = 8;
|
||||
SendMessage(h, UDM_SETACCEL, 1, (LPARAM)&accel2);
|
||||
SendMessage(h, UDM_SETPOS, 0, r.bottom - r.top);
|
||||
|
||||
h = GetDlgItem(hdlg, IDC_CHECK_LOCK_SIZE);
|
||||
SendMessage(h, BM_SETCHECK, !!(vid_resize & 2), 0);
|
||||
break;
|
||||
|
||||
case WM_COMMAND:
|
||||
switch (LOWORD(wParam)) {
|
||||
case IDOK:
|
||||
lptsTemp = (LPTSTR) malloc(512 * sizeof(WCHAR));
|
||||
stransi = (char *)malloc(512);
|
||||
|
||||
h = GetDlgItem(hdlg, IDC_EDIT_WIDTH);
|
||||
SendMessage(h, WM_GETTEXT, 255, (LPARAM) lptsTemp);
|
||||
wcstombs(stransi, lptsTemp, 512);
|
||||
sscanf(stransi, "%u", &temp_x);
|
||||
fixed_size_x = temp_x;
|
||||
|
||||
h = GetDlgItem(hdlg, IDC_EDIT_HEIGHT);
|
||||
SendMessage(h, WM_GETTEXT, 255, (LPARAM) lptsTemp);
|
||||
wcstombs(stransi, lptsTemp, 512);
|
||||
sscanf(stransi, "%u", &temp_y);
|
||||
fixed_size_y = temp_y;
|
||||
|
||||
h = GetDlgItem(hdlg, IDC_CHECK_LOCK_SIZE);
|
||||
lock = SendMessage(h, BM_GETCHECK, 0, 0);
|
||||
|
||||
if (lock) {
|
||||
vid_resize = 2;
|
||||
window_remember = 0;
|
||||
} else {
|
||||
vid_resize = 1;
|
||||
window_remember = 1;
|
||||
}
|
||||
hmenu = GetMenu(hwndMain);
|
||||
CheckMenuItem(hmenu, IDM_VID_REMEMBER, (window_remember == 1) ? MF_CHECKED : MF_UNCHECKED);
|
||||
CheckMenuItem(hmenu, IDM_VID_RESIZE, (vid_resize == 1) ? MF_CHECKED : MF_UNCHECKED);
|
||||
EnableMenuItem(hmenu, IDM_VID_RESIZE, (vid_resize & 2) ? MF_GRAYED : MF_ENABLED);
|
||||
|
||||
if (vid_resize == 1)
|
||||
SetWindowLongPtr(hwndMain, GWL_STYLE, (WS_OVERLAPPEDWINDOW) | WS_VISIBLE);
|
||||
else
|
||||
SetWindowLongPtr(hwndMain, GWL_STYLE, (WS_OVERLAPPEDWINDOW & ~WS_SIZEBOX & ~WS_MAXIMIZEBOX) | WS_VISIBLE);
|
||||
|
||||
/* scale the screen base on DPI */
|
||||
if (dpi_scale) {
|
||||
dpi = win_get_dpi(hwndMain);
|
||||
temp_x = MulDiv(temp_x, dpi, 96);
|
||||
temp_y = MulDiv(temp_y, dpi, 96);
|
||||
} else {
|
||||
temp_x = temp_x;
|
||||
temp_y = temp_y;
|
||||
}
|
||||
|
||||
ResizeWindowByClientArea(hwndMain, temp_x, temp_y + sbar_height);
|
||||
|
||||
if (vid_resize) {
|
||||
CheckMenuItem(hmenu, IDM_VID_SCALE_1X + scale, MF_UNCHECKED);
|
||||
CheckMenuItem(hmenu, IDM_VID_SCALE_2X, MF_CHECKED);
|
||||
scale = 1;
|
||||
}
|
||||
EnableMenuItem(hmenu, IDM_VID_SCALE_1X, vid_resize ? MF_GRAYED : MF_ENABLED);
|
||||
EnableMenuItem(hmenu, IDM_VID_SCALE_2X, vid_resize ? MF_GRAYED : MF_ENABLED);
|
||||
EnableMenuItem(hmenu, IDM_VID_SCALE_3X, vid_resize ? MF_GRAYED : MF_ENABLED);
|
||||
EnableMenuItem(hmenu, IDM_VID_SCALE_4X, vid_resize ? MF_GRAYED : MF_ENABLED);
|
||||
|
||||
scrnsz_x = fixed_size_x;
|
||||
scrnsz_y = fixed_size_y;
|
||||
doresize = 1;
|
||||
|
||||
GetWindowRect(hwndMain, &r);
|
||||
|
||||
if (mouse_capture)
|
||||
ClipCursor(&r);
|
||||
|
||||
if (!(vid_resize & 2) && window_remember) {
|
||||
window_x = r.left;
|
||||
window_y = r.top;
|
||||
window_w = r.right - r.left;
|
||||
window_h = r.bottom - r.top;
|
||||
}
|
||||
|
||||
config_save();
|
||||
|
||||
free(stransi);
|
||||
free(lptsTemp);
|
||||
|
||||
EndDialog(hdlg, 0);
|
||||
return TRUE;
|
||||
|
||||
case IDCANCEL:
|
||||
EndDialog(hdlg, 0);
|
||||
return TRUE;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
SpecifyDimensionsDialogCreate(HWND hwnd)
|
||||
{
|
||||
DialogBox(hinstance, (LPCTSTR)DLG_SPECIFY_DIM, hwnd, SpecifyDimensionsDialogProcedure);
|
||||
}
|
||||
@@ -61,11 +61,12 @@ 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;
|
||||
int fixed_size_x = 0, fixed_size_y = 0;
|
||||
|
||||
extern char openfilestring[512];
|
||||
extern WCHAR wopenfilestring[512];
|
||||
@@ -125,7 +126,7 @@ int win_get_system_metrics(int index, int dpi) {
|
||||
void
|
||||
ResizeWindowByClientArea(HWND hwnd, int width, int height)
|
||||
{
|
||||
if (vid_resize || padded_frame) {
|
||||
if ((vid_resize == 1) || padded_frame) {
|
||||
int padding = win_get_system_metrics(SM_CXPADDEDBORDER, dpi);
|
||||
width += (win_get_system_metrics(SM_CXFRAME, dpi) + padding) * 2;
|
||||
height += (win_get_system_metrics(SM_CYFRAME, dpi) + padding) * 2;
|
||||
@@ -279,13 +280,13 @@ ResetAllMenus(void)
|
||||
CheckMenuItem(menuMain, IDM_VID_OVERSCAN, enable_overscan?MF_CHECKED:MF_UNCHECKED);
|
||||
CheckMenuItem(menuMain, IDM_VID_INVERT, invert_display ? MF_CHECKED : MF_UNCHECKED);
|
||||
|
||||
if (vid_resize)
|
||||
if (vid_resize == 1)
|
||||
CheckMenuItem(menuMain, IDM_VID_RESIZE, MF_CHECKED);
|
||||
CheckMenuItem(menuMain, IDM_VID_SDL_SW+vid_api, MF_CHECKED);
|
||||
CheckMenuItem(menuMain, IDM_VID_FS_FULL+video_fullscreen_scale, MF_CHECKED);
|
||||
CheckMenuItem(menuMain, IDM_VID_REMEMBER, window_remember?MF_CHECKED:MF_UNCHECKED);
|
||||
CheckMenuItem(menuMain, IDM_VID_SCALE_1X+scale, MF_CHECKED);
|
||||
CheckMenuItem(menuMain, IDM_VID_HIDPI, dpi_scale?MF_CHECKED:MF_UNCHECKED);
|
||||
CheckMenuItem(menuMain, IDM_VID_HIDPI, dpi_scale?MF_CHECKED:MF_UNCHECKED);
|
||||
|
||||
CheckMenuItem(menuMain, IDM_VID_CGACON, vid_cga_contrast?MF_CHECKED:MF_UNCHECKED);
|
||||
CheckMenuItem(menuMain, IDM_VID_GRAYCT_601+video_graytype, MF_CHECKED);
|
||||
@@ -300,6 +301,20 @@ ResetAllMenus(void)
|
||||
#ifdef MTR_ENABLED
|
||||
EnableMenuItem(menuMain, IDM_ACTION_END_TRACE, MF_DISABLED);
|
||||
#endif
|
||||
|
||||
if (vid_resize) {
|
||||
if (vid_resize >= 2) {
|
||||
CheckMenuItem(menuMain, IDM_VID_RESIZE, MF_UNCHECKED);
|
||||
EnableMenuItem(menuMain, IDM_VID_RESIZE, MF_GRAYED);
|
||||
}
|
||||
|
||||
CheckMenuItem(menuMain, IDM_VID_SCALE_1X + scale, MF_UNCHECKED);
|
||||
CheckMenuItem(menuMain, IDM_VID_SCALE_2X, MF_CHECKED);
|
||||
EnableMenuItem(menuMain, IDM_VID_SCALE_1X, MF_GRAYED);
|
||||
EnableMenuItem(menuMain, IDM_VID_SCALE_2X, MF_GRAYED);
|
||||
EnableMenuItem(menuMain, IDM_VID_SCALE_3X, MF_GRAYED);
|
||||
EnableMenuItem(menuMain, IDM_VID_SCALE_4X, MF_GRAYED);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -456,10 +471,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 +530,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:
|
||||
@@ -595,10 +614,10 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
break;
|
||||
|
||||
case IDM_VID_RESIZE:
|
||||
vid_resize = !vid_resize;
|
||||
CheckMenuItem(hmenu, IDM_VID_RESIZE, (vid_resize)? MF_CHECKED : MF_UNCHECKED);
|
||||
vid_resize ^= 1;
|
||||
CheckMenuItem(hmenu, IDM_VID_RESIZE, (vid_resize & 1) ? MF_CHECKED : MF_UNCHECKED);
|
||||
|
||||
if (vid_resize)
|
||||
if (vid_resize == 1)
|
||||
SetWindowLongPtr(hwnd, GWL_STYLE, (WS_OVERLAPPEDWINDOW) | WS_VISIBLE);
|
||||
else
|
||||
SetWindowLongPtr(hwnd, GWL_STYLE, (WS_OVERLAPPEDWINDOW & ~WS_SIZEBOX & ~WS_MAXIMIZEBOX) | WS_VISIBLE);
|
||||
@@ -638,7 +657,7 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
window_remember = !window_remember;
|
||||
CheckMenuItem(hmenu, IDM_VID_REMEMBER, window_remember ? MF_CHECKED : MF_UNCHECKED);
|
||||
GetWindowRect(hwnd, &rect);
|
||||
if (window_remember) {
|
||||
if (!(vid_resize & 2) && window_remember) {
|
||||
window_x = rect.left;
|
||||
window_y = rect.top;
|
||||
window_w = rect.right - rect.left;
|
||||
@@ -696,6 +715,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);
|
||||
@@ -829,9 +852,19 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
GetWindowRect(hwndSBAR, &rect);
|
||||
sbar_height = rect.bottom - rect.top;
|
||||
rect_p = (RECT*)lParam;
|
||||
if (vid_resize)
|
||||
if (vid_resize == 1)
|
||||
MoveWindow(hwnd, rect_p->left, rect_p->top, rect_p->right - rect_p->left, rect_p->bottom - rect_p->top, TRUE);
|
||||
else if (!user_resize)
|
||||
else if (vid_resize >= 2) {
|
||||
temp_x = fixed_size_x;
|
||||
temp_y = fixed_size_y;
|
||||
if (dpi_scale) {
|
||||
temp_x = MulDiv(temp_x, dpi, 96);
|
||||
temp_y = MulDiv(temp_y, dpi, 96);
|
||||
}
|
||||
|
||||
/* Main Window. */
|
||||
ResizeWindowByClientArea(hwndMain, temp_x, temp_y + sbar_height);
|
||||
} else if (!user_resize)
|
||||
doresize = 1;
|
||||
break;
|
||||
|
||||
@@ -1063,9 +1096,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:
|
||||
@@ -1230,10 +1268,10 @@ ui_init(int nCmdShow)
|
||||
sbar_height = sbar_rect.bottom - sbar_rect.top;
|
||||
|
||||
/* Set up main window for resizing if configured. */
|
||||
if (vid_resize)
|
||||
if (vid_resize == 1)
|
||||
SetWindowLongPtr(hwnd, GWL_STYLE,
|
||||
(WS_OVERLAPPEDWINDOW));
|
||||
else
|
||||
else
|
||||
SetWindowLongPtr(hwnd, GWL_STYLE,
|
||||
(WS_OVERLAPPEDWINDOW&~WS_SIZEBOX&~WS_THICKFRAME&~WS_MAXIMIZEBOX));
|
||||
|
||||
@@ -1243,10 +1281,15 @@ ui_init(int nCmdShow)
|
||||
|
||||
/* Initiate a resize in order to properly arrange all controls.
|
||||
Move to the last-saved position if needed. */
|
||||
if (window_remember)
|
||||
if ((vid_resize < 2) && window_remember)
|
||||
MoveWindow(hwnd, window_x, window_y, window_w, window_h, TRUE);
|
||||
else
|
||||
else {
|
||||
if (vid_resize >= 2) {
|
||||
scrnsz_x = fixed_size_x;
|
||||
scrnsz_y = fixed_size_y;
|
||||
}
|
||||
ResizeWindowByClientArea(hwndMain, scrnsz_x, scrnsz_y + sbar_height);
|
||||
}
|
||||
|
||||
/* Reset all menus to their defaults. */
|
||||
ResetAllMenus();
|
||||
@@ -1466,7 +1509,6 @@ plat_resize(int x, int y)
|
||||
{
|
||||
/* First, see if we should resize the UI window. */
|
||||
if (!vid_resize) {
|
||||
|
||||
/* scale the screen base on DPI */
|
||||
if (dpi_scale) {
|
||||
x = MulDiv(x, dpi, 96);
|
||||
|
||||
Reference in New Issue
Block a user