mirror of
https://github.com/FunkyFr3sh/cnc-ddraw.git
synced 2025-03-24 17:49:52 +01:00
add temporary workaround for ubuntu alt+enter bug until we got a better solution
This commit is contained in:
parent
366ce012b2
commit
b9eab72850
@ -96,6 +96,7 @@ typedef struct IDirectDrawImpl
|
|||||||
BOOL noactivateapp;
|
BOOL noactivateapp;
|
||||||
char shader[MAX_PATH];
|
char shader[MAX_PATH];
|
||||||
BOOL autorenderer;
|
BOOL autorenderer;
|
||||||
|
BOOL wine;
|
||||||
|
|
||||||
} IDirectDrawImpl;
|
} IDirectDrawImpl;
|
||||||
|
|
||||||
|
12
src/main.c
12
src/main.c
@ -486,6 +486,9 @@ LRESULT CALLBACK dummy_WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara
|
|||||||
return DefWindowProc(hWnd, uMsg, wParam, lParam);
|
return DefWindowProc(hWnd, uMsg, wParam, lParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// LastSetWindowPosTick = Workaround for a wine+gnome bug where each SetWindowPos call triggers a WA_INACTIVE message
|
||||||
|
DWORD LastSetWindowPosTick;
|
||||||
|
|
||||||
void ToggleFullscreen()
|
void ToggleFullscreen()
|
||||||
{
|
{
|
||||||
if (ddraw->windowed)
|
if (ddraw->windowed)
|
||||||
@ -497,6 +500,7 @@ void ToggleFullscreen()
|
|||||||
|
|
||||||
SetWindowLong(ddraw->hWnd, GWL_STYLE, GetWindowLong(ddraw->hWnd, GWL_STYLE) & ~(WS_CAPTION | WS_THICKFRAME | WS_MINIMIZE | WS_MAXIMIZE | WS_SYSMENU));
|
SetWindowLong(ddraw->hWnd, GWL_STYLE, GetWindowLong(ddraw->hWnd, GWL_STYLE) & ~(WS_CAPTION | WS_THICKFRAME | WS_MINIMIZE | WS_MAXIMIZE | WS_SYSMENU));
|
||||||
SetWindowPos(ddraw->hWnd, HWND_TOPMOST, 0, 0, ddraw->render.width, ddraw->render.height, SWP_SHOWWINDOW);
|
SetWindowPos(ddraw->hWnd, HWND_TOPMOST, 0, 0, ddraw->render.width, ddraw->render.height, SWP_SHOWWINDOW);
|
||||||
|
LastSetWindowPosTick = timeGetTime();
|
||||||
}
|
}
|
||||||
mouse_lock();
|
mouse_lock();
|
||||||
}
|
}
|
||||||
@ -583,6 +587,12 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||||||
}
|
}
|
||||||
else if (wParam == WA_INACTIVE)
|
else if (wParam == WA_INACTIVE)
|
||||||
{
|
{
|
||||||
|
if (ddraw->wine && LastSetWindowPosTick + 500 > timeGetTime())
|
||||||
|
{
|
||||||
|
LastSetWindowPosTick = 0;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
mouse_unlock();
|
mouse_unlock();
|
||||||
|
|
||||||
/* minimize our window on defocus when in fullscreen */
|
/* minimize our window on defocus when in fullscreen */
|
||||||
@ -985,6 +995,8 @@ HRESULT WINAPI DirectDrawCreate(GUID FAR* lpGUID, LPDIRECTDRAW FAR* lplpDD, IUnk
|
|||||||
This->render.ev = CreateEvent(NULL, TRUE, FALSE, NULL);
|
This->render.ev = CreateEvent(NULL, TRUE, FALSE, NULL);
|
||||||
This->render.sem = CreateSemaphore(NULL, 0, 1, NULL);
|
This->render.sem = CreateSemaphore(NULL, 0, 1, NULL);
|
||||||
|
|
||||||
|
This->wine = GetProcAddress(GetModuleHandleA("ntdll.dll"), "wine_get_version") != 0;
|
||||||
|
|
||||||
/* load configuration options from ddraw.ini */
|
/* load configuration options from ddraw.ini */
|
||||||
char cwd[MAX_PATH];
|
char cwd[MAX_PATH];
|
||||||
char tmp[256];
|
char tmp[256];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user