Browse Source

Misc changes

pull/32/head
falkTX 6 years ago
parent
commit
f0cca0af92
5 changed files with 45 additions and 22 deletions
  1. +0
    -3
      dgl/Makefile
  2. +11
    -1
      dgl/src/NanoVG.cpp
  3. +24
    -9
      dgl/src/Window.cpp
  4. +8
    -7
      dgl/src/pugl/pugl_osx.m
  5. +2
    -2
      distrho/DistrhoUtils.hpp

+ 0
- 3
dgl/Makefile View File

@@ -15,9 +15,6 @@ LINK_FLAGS += $(DGL_LIBS)
ifneq ($(MACOS_OLD),true)
# needed by sofd right now, fix later
BUILD_CXX_FLAGS += -Wno-type-limits -fpermissive

# needed by stb_image
BUILD_CXX_FLAGS += -Wno-misleading-indentation -Wno-shift-negative-value
endif

# --------------------------------------------------------------


+ 11
- 1
dgl/src/NanoVG.cpp View File

@@ -1,6 +1,6 @@
/*
* DISTRHO Plugin Framework (DPF)
* Copyright (C) 2012-2016 Filipe Coelho <falktx@falktx.com>
* Copyright (C) 2012-2018 Filipe Coelho <falktx@falktx.com>
*
* Permission to use, copy, modify, and/or distribute this software for any purpose with
* or without fee is hereby granted, provided that the above copyright notice and this
@@ -972,8 +972,18 @@ END_NAMESPACE_DGL

#undef final

#if defined(__GNUC__) && (__GNUC__ >= 6)
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wmisleading-indentation"
# pragma GCC diagnostic ignored "-Wshift-negative-value"
#endif

extern "C" {
#include "nanovg/nanovg.c"
}

#if defined(__GNUC__) && (__GNUC__ >= 6)
# pragma GCC diagnostic pop
#endif

// -----------------------------------------------------------------------

+ 24
- 9
dgl/src/Window.cpp View File

@@ -1,6 +1,6 @@
/*
* DISTRHO Plugin Framework (DPF)
* Copyright (C) 2012-2016 Filipe Coelho <falktx@falktx.com>
* Copyright (C) 2012-2018 Filipe Coelho <falktx@falktx.com>
*
* Permission to use, copy, modify, and/or distribute this software for any purpose with
* or without fee is hereby granted, provided that the above copyright notice and this
@@ -25,6 +25,11 @@

#include "pugl/pugl.h"

#if defined(__GNUC__) && (__GNUC__ >= 7)
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
#endif

#if defined(DISTRHO_OS_WINDOWS)
# include "pugl/pugl_win.cpp"
#elif defined(DISTRHO_OS_MAC)
@@ -37,6 +42,10 @@ extern "C" {
}
#endif

#if defined(__GNUC__) && (__GNUC__ >= 7)
# pragma GCC diagnostic pop
#endif

#include "ApplicationPrivateData.hpp"
#include "WidgetPrivateData.hpp"
#include "../StandaloneWindow.hpp"
@@ -123,11 +132,14 @@ struct Window::PrivateData {
#if defined(DISTRHO_OS_WINDOWS)
// TODO
#elif defined(DISTRHO_OS_MAC)
// TODO
//[parentImpl->window orderWindow:NSWindowBelow relativeTo:[[mView window] windowNumber]];
[parentImpl->window orderWindow:NSWindowBelow relativeTo:[[mView window] windowNumber]];
#else
XSetTransientForHint(xDisplay, xWindow, parentImpl->win);
#endif
return;

// maybe unused
(void)parentImpl;
}

PrivateData(Application& app, Window* const self, const intptr_t parentId)
@@ -392,11 +404,7 @@ struct Window::PrivateData {
SetFocus(hwnd);
#elif defined(DISTRHO_OS_MAC)
if (mWindow != nullptr)
{
// TODO
//[NSApp activateIgnoringOtherApps:YES];
//[mWindow makeKeyAndOrderFront:mWindow];
}
[mWindow makeKeyWindow];
#else
XRaiseWindow(xDisplay, xWindow);
XSetInputFocus(xDisplay, xWindow, RevertToPointerRoot, CurrentTime);
@@ -615,10 +623,17 @@ struct Window::PrivateData {

void setTransientWinId(const uintptr_t winId)
{
DISTRHO_SAFE_ASSERT_RETURN(winId != 0,);

#if defined(DISTRHO_OS_WINDOWS)
// TODO
#elif defined(DISTRHO_OS_MAC)
// TODO
NSWindow* const window = [NSApp windowWithWindowNumber:winId];
DISTRHO_SAFE_ASSERT_RETURN(window != nullptr,);

[window addChildWindow:mWindow
ordered:NSWindowAbove];
[mWindow makeKeyWindow];
#else
XSetTransientForHint(xDisplay, xWindow, static_cast< ::Window>(winId));
#endif


+ 8
- 7
dgl/src/pugl/pugl_osx.m View File

@@ -441,13 +441,11 @@ void
puglLeaveContext(PuglView* view, bool flush)
{
#ifdef PUGL_HAVE_GL
if (view->ctx_type == PUGL_GL) {
if (flush) {
if (view->impl->glview->doubleBuffered) {
[[view->impl->glview openGLContext] flushBuffer];
} else {
glFlush();
}
if (view->ctx_type == PUGL_GL && flush) {
if (view->impl->glview->doubleBuffered) {
[[view->impl->glview openGLContext] flushBuffer];
} else {
glFlush();
}
//[NSOpenGLContext clearCurrentContext];
}
@@ -575,4 +573,7 @@ void*
puglGetContext(PuglView* view)
{
return NULL;

// unused
(void)view;
}

+ 2
- 2
distrho/DistrhoUtils.hpp View File

@@ -1,6 +1,6 @@
/*
* DISTRHO Plugin Framework (DPF)
* Copyright (C) 2012-2016 Filipe Coelho <falktx@falktx.com>
* Copyright (C) 2012-2018 Filipe Coelho <falktx@falktx.com>
*
* Permission to use, copy, modify, and/or distribute this software for any purpose with
* or without fee is hereby granted, provided that the above copyright notice and this
@@ -33,7 +33,7 @@
# include <stdint.h>
#endif

#if defined(DISTRHO_OS_MAC) && ! defined(CARLA_OS_MAC) && ! (defined(DISTRHO_PROPER_CPP11_SUPPORT) && defined(__clang__))
#if defined(DISTRHO_OS_MAC) && ! defined(CARLA_OS_MAC) && ! defined(DISTRHO_PROPER_CPP11_SUPPORT)
namespace std {
inline float fmin(float __x, float __y)
{ return __builtin_fminf(__x, __y); }


Loading…
Cancel
Save