Browse Source

Import minor DGL fixes from Carla

pull/77/head
falkTX 5 years ago
parent
commit
6604655e6b
4 changed files with 15 additions and 1 deletions
  1. +4
    -0
      dgl/Widget.hpp
  2. +4
    -0
      dgl/Window.hpp
  3. +3
    -1
      dgl/src/Window.cpp
  4. +4
    -0
      dgl/src/pugl/pugl_win.cpp

+ 4
- 0
dgl/Widget.hpp View File

@@ -24,9 +24,11 @@
// -----------------------------------------------------------------------
// Forward class names

#ifdef DISTRHO_DEFINES_H_INCLUDED
START_NAMESPACE_DISTRHO
class UI;
END_NAMESPACE_DISTRHO
#endif

START_NAMESPACE_DGL

@@ -394,7 +396,9 @@ private:
friend class NanoWidget;
friend class Window;
friend class StandaloneWindow;
#ifdef DISTRHO_DEFINES_H_INCLUDED
friend class DISTRHO_NAMESPACE::UI;
#endif

DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(Widget)
};


+ 4
- 0
dgl/Window.hpp View File

@@ -19,9 +19,11 @@

#include "Geometry.hpp"

#ifdef DISTRHO_DEFINES_H_INCLUDED
START_NAMESPACE_DISTRHO
class UIExporter;
END_NAMESPACE_DISTRHO
#endif

START_NAMESPACE_DGL

@@ -129,7 +131,9 @@ private:
friend class Application;
friend class Widget;
friend class StandaloneWindow;
#ifdef DISTRHO_DEFINES_H_INCLUDED
friend class DISTRHO_NAMESPACE::UIExporter;
#endif

virtual void _addWidget(Widget* const widget);
virtual void _removeWidget(Widget* const widget);


+ 3
- 1
dgl/src/Window.cpp View File

@@ -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,


+ 4
- 0
dgl/src/pugl/pugl_win.cpp View File

@@ -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;


Loading…
Cancel
Save