diff options
author | falkTX <falktx@gmail.com> | 2018-09-29 21:48:16 +0200 |
---|---|---|
committer | falkTX <falktx@gmail.com> | 2018-09-29 21:48:16 +0200 |
commit | 6604655e6bea117023314c96798ba358b0087752 (patch) | |
tree | 0c58efe03de67e443cf8a0a00783d5dfe0a40e39 /dgl/src | |
parent | bf7594cbad62d2f035d6a1f7a1da5edd281786d1 (diff) |
Import minor DGL fixes from Carla
Diffstat (limited to 'dgl/src')
-rw-r--r-- | dgl/src/Window.cpp | 4 | ||||
-rw-r--r-- | dgl/src/pugl/pugl_win.cpp | 4 |
2 files changed, 7 insertions, 1 deletions
diff --git a/dgl/src/Window.cpp b/dgl/src/Window.cpp index c677d111..c03ee758 100644 --- a/dgl/src/Window.cpp +++ b/dgl/src/Window.cpp @@ -32,6 +32,8 @@ #if defined(DISTRHO_OS_WINDOWS) # include "pugl/pugl_win.cpp" +# undef max +# undef min #elif defined(DISTRHO_OS_MAC) # define PuglWindow DISTRHO_JOIN_MACRO(PuglWindow, DGL_NAMESPACE) # define PuglOpenGLView DISTRHO_JOIN_MACRO(PuglOpenGLView, DGL_NAMESPACE) @@ -573,7 +575,7 @@ struct Window::PrivateData { #if defined(DISTRHO_OS_WINDOWS) const int winFlags = WS_POPUPWINDOW | WS_CAPTION | (fResizable ? WS_SIZEBOX : 0x0); - RECT wr = { 0, 0, static_cast<long>(width), static_cast<long>(height) }; + RECT wr = { 0, 0, static_cast<LONG>(width), static_cast<LONG>(height) }; AdjustWindowRectEx(&wr, fUsingEmbed ? WS_CHILD : winFlags, FALSE, WS_EX_TOPMOST); SetWindowPos(hwnd, 0, 0, 0, wr.right-wr.left, wr.bottom-wr.top, diff --git a/dgl/src/pugl/pugl_win.cpp b/dgl/src/pugl/pugl_win.cpp index 67f40581..c87af857 100644 --- a/dgl/src/pugl/pugl_win.cpp +++ b/dgl/src/pugl/pugl_win.cpp @@ -111,7 +111,11 @@ puglCreateWindow(PuglView* view, const char* title) static int wc_count = 0; char classNameBuf[256]; std::srand((std::time(NULL))); +#ifdef __WINE__ + std::snprintf(classNameBuf, sizeof(classNameBuf), "%s_%d-%d", title, std::rand(), ++wc_count); +#else _snprintf(classNameBuf, sizeof(classNameBuf), "%s_%d-%d", title, std::rand(), ++wc_count); +#endif classNameBuf[sizeof(classNameBuf)-1] = '\0'; impl->wc.style = CS_OWNDC; |