Browse Source

Use linux (X11) as fallback in Window.cpp code

pull/17/head
falkTX 8 years ago
parent
commit
07174f4fc4
1 changed files with 30 additions and 30 deletions
  1. +30
    -30
      dgl/src/Window.cpp

+ 30
- 30
dgl/src/Window.cpp View File

@@ -79,13 +79,13 @@ struct Window::PrivateData {
fModal(), fModal(),
#if defined(DISTRHO_OS_WINDOWS) #if defined(DISTRHO_OS_WINDOWS)
hwnd(0) hwnd(0)
#elif defined(DISTRHO_OS_LINUX)
xDisplay(nullptr),
xWindow(0)
#elif defined(DISTRHO_OS_MAC) #elif defined(DISTRHO_OS_MAC)
fNeedsIdle(true), fNeedsIdle(true),
mView(nullptr), mView(nullptr),
mWindow(nullptr) mWindow(nullptr)
#else
xDisplay(nullptr),
xWindow(0)
#endif #endif
{ {
DBG("Creating window without parent..."); DBGF; DBG("Creating window without parent..."); DBGF;
@@ -107,26 +107,26 @@ struct Window::PrivateData {
fModal(parent.pData), fModal(parent.pData),
#if defined(DISTRHO_OS_WINDOWS) #if defined(DISTRHO_OS_WINDOWS)
hwnd(0) hwnd(0)
#elif defined(DISTRHO_OS_LINUX)
xDisplay(nullptr),
xWindow(0)
#elif defined(DISTRHO_OS_MAC) #elif defined(DISTRHO_OS_MAC)
fNeedsIdle(false), fNeedsIdle(false),
mView(nullptr), mView(nullptr),
mWindow(nullptr) mWindow(nullptr)
#else
xDisplay(nullptr),
xWindow(0)
#endif #endif
{ {
DBG("Creating window with parent..."); DBGF; DBG("Creating window with parent..."); DBGF;
init(); init();


const PuglInternals* const parentImpl(parent.pData->fView->impl); const PuglInternals* const parentImpl(parent.pData->fView->impl);
#if defined(DISTRHO_OS_LINUX)
XSetTransientForHint(xDisplay, xWindow, parentImpl->win);
//#elif defined(DISTRHO_OS_MAC)
// [parentImpl->window orderWindow:NSWindowBelow relativeTo:[[mView window] windowNumber]];
#if defined(DISTRHO_OS_WINDOWS)
// TODO
#elif defined(DISTRHO_OS_MAC)
// TODO
//[parentImpl->window orderWindow:NSWindowBelow relativeTo:[[mView window] windowNumber]];
#else #else
// unused
return; (void)parentImpl;
XSetTransientForHint(xDisplay, xWindow, parentImpl->win);
#endif #endif
} }


@@ -145,13 +145,13 @@ struct Window::PrivateData {
fModal(), fModal(),
#if defined(DISTRHO_OS_WINDOWS) #if defined(DISTRHO_OS_WINDOWS)
hwnd(0) hwnd(0)
#elif defined(DISTRHO_OS_LINUX)
xDisplay(nullptr),
xWindow(0)
#elif defined(DISTRHO_OS_MAC) #elif defined(DISTRHO_OS_MAC)
fNeedsIdle(parentId == 0), fNeedsIdle(parentId == 0),
mView(nullptr), mView(nullptr),
mWindow(nullptr) mWindow(nullptr)
#else
xDisplay(nullptr),
xWindow(0)
#endif #endif
{ {
if (fUsingEmbed) if (fUsingEmbed)
@@ -213,7 +213,7 @@ struct Window::PrivateData {
} else { } else {
DISTRHO_SAFE_ASSERT(mWindow != nullptr); DISTRHO_SAFE_ASSERT(mWindow != nullptr);
} }
#elif defined(DISTRHO_OS_LINUX)
#else
xDisplay = impl->display; xDisplay = impl->display;
xWindow = impl->win; xWindow = impl->win;
DISTRHO_SAFE_ASSERT(xWindow != 0); DISTRHO_SAFE_ASSERT(xWindow != 0);
@@ -273,7 +273,7 @@ struct Window::PrivateData {
#elif defined(DISTRHO_OS_MAC) #elif defined(DISTRHO_OS_MAC)
mView = nullptr; mView = nullptr;
mWindow = nullptr; mWindow = nullptr;
#elif defined(DISTRHO_OS_LINUX)
#else
xDisplay = nullptr; xDisplay = nullptr;
xWindow = 0; xWindow = 0;
#endif #endif
@@ -367,7 +367,7 @@ struct Window::PrivateData {
// TODO // TODO
#elif defined(DISTRHO_OS_MAC) #elif defined(DISTRHO_OS_MAC)
// TODO // TODO
#elif defined(DISTRHO_OS_LINUX)
#else
int i, wx, wy; int i, wx, wy;
uint u; uint u;
::Window w; ::Window w;
@@ -395,7 +395,7 @@ struct Window::PrivateData {
//[NSApp activateIgnoringOtherApps:YES]; //[NSApp activateIgnoringOtherApps:YES];
//[mWindow makeKeyAndOrderFront:mWindow]; //[mWindow makeKeyAndOrderFront:mWindow];
} }
#elif defined(DISTRHO_OS_LINUX)
#else
XRaiseWindow(xDisplay, xWindow); XRaiseWindow(xDisplay, xWindow);
XSetInputFocus(xDisplay, xWindow, RevertToPointerRoot, CurrentTime); XSetInputFocus(xDisplay, xWindow, RevertToPointerRoot, CurrentTime);
XFlush(xDisplay); XFlush(xDisplay);
@@ -446,7 +446,7 @@ struct Window::PrivateData {
else else
[mView setHidden:YES]; [mView setHidden:YES];
} }
#elif defined(DISTRHO_OS_LINUX)
#else
if (yesNo) if (yesNo)
XMapRaised(xDisplay, xWindow); XMapRaised(xDisplay, xWindow);
else else
@@ -550,7 +550,7 @@ struct Window::PrivateData {
[[mWindow standardWindowButton:NSWindowZoomButton] setHidden:YES]; [[mWindow standardWindowButton:NSWindowZoomButton] setHidden:YES];
} }
} }
#elif defined(DISTRHO_OS_LINUX)
#else
XResizeWindow(xDisplay, xWindow, width, height); XResizeWindow(xDisplay, xWindow, width, height);


if (! fResizable) if (! fResizable)
@@ -606,19 +606,19 @@ struct Window::PrivateData {


[mWindow setTitle:titleString]; [mWindow setTitle:titleString];
} }
#elif defined(DISTRHO_OS_LINUX)
#else
XStoreName(xDisplay, xWindow, title); XStoreName(xDisplay, xWindow, title);
#endif #endif
} }


void setTransientWinId(const uintptr_t winId) void setTransientWinId(const uintptr_t winId)
{ {
#if defined(DISTRHO_OS_LINUX)
XSetTransientForHint(xDisplay, xWindow, static_cast< ::Window>(winId));
#if defined(DISTRHO_OS_WINDOWS)
// TODO
#elif defined(DISTRHO_OS_MAC)
// TODO
#else #else
return;
// unused
(void)winId;
XSetTransientForHint(xDisplay, xWindow, static_cast< ::Window>(winId));
#endif #endif
} }


@@ -884,13 +884,13 @@ struct Window::PrivateData {


#if defined(DISTRHO_OS_WINDOWS) #if defined(DISTRHO_OS_WINDOWS)
HWND hwnd; HWND hwnd;
#elif defined(DISTRHO_OS_LINUX)
Display* xDisplay;
::Window xWindow;
#elif defined(DISTRHO_OS_MAC) #elif defined(DISTRHO_OS_MAC)
bool fNeedsIdle; bool fNeedsIdle;
PuglOpenGLView* mView; PuglOpenGLView* mView;
id mWindow; id mWindow;
#else
Display* xDisplay;
::Window xWindow;
#endif #endif


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


Loading…
Cancel
Save