Merge branch 'master' into feature/toolbar

This commit is contained in:
David Hrdlička
2022-01-12 21:12:43 +01:00
5 changed files with 72 additions and 15 deletions

View File

@@ -369,7 +369,7 @@ END
#define STR_SIZE_MB "Tamanho (MB):"
#define STR_TYPE "Tipo:"
#define STR_IMG_FORMAT "Formato:"
#define STR_BLOCK_SIZE "Tamanho do bloco:"
#define STR_BLOCK_SIZE "Bloco:"
#define STR_FLOPPY_DRIVES "Unidades de disquete:"
#define STR_TURBO "Turbo"
@@ -479,7 +479,7 @@ BEGIN
IDS_2115 "Magneto-óptico %i (%ls): %ls"
IDS_2116 "Imagens magneto-ópticas (*.IM?;*.MDI)\0*.IM?;*.MDI\0Todos os arquivos (*.*)\0*.*\0"
IDS_2117 "Bem-vindo ao 86Box!"
IDS_2118 "Controle interno"
IDS_2118 "Controlador interno"
IDS_2119 "Sair"
IDS_2120 "Nenhum ROM encontrada"
IDS_2121 "Você deseja salvar as configurações?"

View File

@@ -200,8 +200,9 @@ static void set_parent_binding(int enable)
* @param wParam
* @param lParam
* @param fullscreen
* @return Was message handled
*/
static void handle_window_messages(UINT message, WPARAM wParam, LPARAM lParam, int fullscreen)
static int handle_window_messages(UINT message, WPARAM wParam, LPARAM lParam, int fullscreen)
{
switch (message)
{
@@ -219,7 +220,7 @@ static void handle_window_messages(UINT message, WPARAM wParam, LPARAM lParam, i
/* Mouse events that enter and exit capture. */
PostMessage(parent, message, wParam, lParam);
}
break;
return 1;
case WM_KEYDOWN:
case WM_KEYUP:
case WM_SYSKEYDOWN:
@@ -228,7 +229,7 @@ static void handle_window_messages(UINT message, WPARAM wParam, LPARAM lParam, i
{
PostMessage(parent, message, wParam, lParam);
}
break;
return 1;
case WM_INPUT:
if (fullscreen)
{
@@ -256,8 +257,17 @@ static void handle_window_messages(UINT message, WPARAM wParam, LPARAM lParam, i
}
free(raw);
}
break;
return 1;
case WM_MOUSELEAVE:
if (fullscreen)
{
/* Leave fullscreen if mouse leaves the renderer window. */
PostMessage(GetAncestor(parent, GA_ROOT), WM_LEAVEFULLSCREEN, 0, 0);
}
return 0;
}
return 0;
}
/**
@@ -638,12 +648,13 @@ static void opengl_main(void* param)
/* Handle window messages */
MSG msg;
if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
{
if (msg.hwnd == window_hwnd)
handle_window_messages(msg.message, msg.wParam, msg.lParam, fullscreen);
TranslateMessage(&msg);
DispatchMessage(&msg);
if (msg.hwnd != window_hwnd || !handle_window_messages(msg.message, msg.wParam, msg.lParam, fullscreen))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
/* Wait for synchronized events for 1ms before going back to window events */
@@ -722,7 +733,14 @@ static void opengl_main(void* param)
{
SetForegroundWindow(window_hwnd);
SetFocus(window_hwnd);
/* Clip cursor to prevent it moving to another monitor. */
RECT rect;
GetWindowRect(window_hwnd, &rect);
ClipCursor(&rect);
}
else
ClipCursor(NULL);
}
if (fullscreen)

View File

@@ -974,6 +974,9 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
break;
case WM_WINDOWPOSCHANGED:
if (video_fullscreen & 1)
PostMessage(hwndMain, WM_LEAVEFULLSCREEN, 0, 0);
pos = (WINDOWPOS*)lParam;
GetClientRect(hwndMain, &rect);
@@ -1174,6 +1177,13 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
}
break;
case WM_ACTIVATEAPP:
/* Leave full screen on switching application except
for OpenGL Core and VNC renderers. */
if (video_fullscreen & 1 && wParam == FALSE && vid_api < 3)
PostMessage(hwndMain, WM_LEAVEFULLSCREEN, 0, 0);
break;
case WM_ENTERSIZEMOVE:
user_resize = 1;
break;