Signed-off-by: falkTX <falktx@falktx.com>pull/375/head
@@ -444,6 +444,10 @@ ifeq ($(FILE_BROWSER_DISABLED),true) | |||||
BUILD_CXX_FLAGS += -DDGL_FILE_BROWSER_DISABLED | BUILD_CXX_FLAGS += -DDGL_FILE_BROWSER_DISABLED | ||||
endif | endif | ||||
ifneq ($(WINDOWS_ICON_ID),) | |||||
BUILD_CXX_FLAGS += -DDGL_WINDOWS_ICON_ID=$(WINDOWS_ICON_ID) | |||||
endif | |||||
ifeq ($(USE_OPENGL3),true) | ifeq ($(USE_OPENGL3),true) | ||||
BUILD_CXX_FLAGS += -DDGL_USE_OPENGL3 | BUILD_CXX_FLAGS += -DDGL_USE_OPENGL3 | ||||
endif | endif | ||||
@@ -567,7 +567,30 @@ void puglWin32ShowCentered(PuglView* const view) | |||||
} | } | ||||
else | else | ||||
{ | { | ||||
ShowWindow(impl->hwnd, SW_SHOWNORMAL); | |||||
#ifdef DGL_WINDOWS_ICON_ID | |||||
WNDCLASSEX wClass; | |||||
std::memset(&wClass, 0, sizeof(wClass)); | |||||
const HINSTANCE hInstance = GetModuleHandle(nullptr); | |||||
if (GetClassInfoEx(hInstance, view->world->className, &wClass)) | |||||
wClass.hIcon = LoadIcon(nullptr, MAKEINTRESOURCE(DGL_WINDOWS_ICON_ID)); | |||||
SetClassLongPtr(impl->hwnd, GCLP_HICON, (LONG_PTR) LoadIcon(hInstance, MAKEINTRESOURCE(DGL_WINDOWS_ICON_ID))); | |||||
#endif | |||||
MONITORINFO mInfo; | |||||
std::memset(&mInfo, 0, sizeof(mInfo)); | |||||
mInfo.cbSize = sizeof(mInfo); | |||||
if (GetMonitorInfo(MonitorFromWindow(impl->hwnd, MONITOR_DEFAULTTOPRIMARY), &mInfo)) | |||||
SetWindowPos(impl->hwnd, | |||||
HWND_TOP, | |||||
mInfo.rcWork.left + (mInfo.rcWork.right - view->frame.width) / 2, | |||||
mInfo.rcWork.top + (mInfo.rcWork.bottom - view->frame.height) / 2, | |||||
0, 0, SWP_SHOWWINDOW|SWP_NOSIZE); | |||||
else | |||||
ShowWindow(impl->hwnd, SW_NORMAL); | |||||
} | } | ||||
SetFocus(impl->hwnd); | SetFocus(impl->hwnd); | ||||
@@ -944,11 +944,15 @@ int main(int argc, char* argv[]) | |||||
if (errorString.isNotEmpty()) | if (errorString.isNotEmpty()) | ||||
{ | { | ||||
errorString[errorString.length()-2] = '.'; | errorString[errorString.length()-2] = '.'; | ||||
d_stderr("Failed to create jack client, reason was:\n%s", errorString.buffer()); | |||||
d_stderr("Failed to create the JACK client, reason was:\n%s", errorString.buffer()); | |||||
} | } | ||||
else | else | ||||
d_stderr("Failed to create jack client, cannot continue!"); | |||||
d_stderr("Failed to create the JACK client, cannot continue!"); | |||||
#if defined(DISTRHO_OS_WINDOWS) && DISTRHO_PLUGIN_HAS_UI | |||||
const String win32error = "Failed to create JACK client, reason was:\n" + errorString; | |||||
MessageBoxA(nullptr, win32error.buffer(), "", MB_ICONERROR); | |||||
#endif | |||||
return 1; | return 1; | ||||
} | } | ||||