|
@@ -263,18 +263,22 @@ namespace WallpaperEngine::Application
|
|
|
void CWallpaperApplication::show ()
|
|
void CWallpaperApplication::show ()
|
|
|
{
|
|
{
|
|
|
// initialize OpenGL driver
|
|
// initialize OpenGL driver
|
|
|
|
|
+#ifdef ENABLE_WAYLAND
|
|
|
const bool WAYLAND = getenv("WAYLAND_DISPLAY") && this->m_context.settings.render.mode == CApplicationContext::WAYLAND_LAYER_SHELL;
|
|
const bool WAYLAND = getenv("WAYLAND_DISPLAY") && this->m_context.settings.render.mode == CApplicationContext::WAYLAND_LAYER_SHELL;
|
|
|
if (WAYLAND) {
|
|
if (WAYLAND) {
|
|
|
videoDriver = std::make_unique<WallpaperEngine::Render::Drivers::CWaylandOpenGLDriver>("wallpaperengine", this->m_context, this);
|
|
videoDriver = std::make_unique<WallpaperEngine::Render::Drivers::CWaylandOpenGLDriver>("wallpaperengine", this->m_context, this);
|
|
|
inputContext = std::make_unique<WallpaperEngine::Input::CInputContext>(*(WallpaperEngine::Render::Drivers::CWaylandOpenGLDriver*)videoDriver.get());
|
|
inputContext = std::make_unique<WallpaperEngine::Input::CInputContext>(*(WallpaperEngine::Render::Drivers::CWaylandOpenGLDriver*)videoDriver.get());
|
|
|
} else {
|
|
} else {
|
|
|
|
|
+#endif
|
|
|
videoDriver = std::make_unique<WallpaperEngine::Render::Drivers::CX11OpenGLDriver>("wallpaperengine", this->m_context);
|
|
videoDriver = std::make_unique<WallpaperEngine::Render::Drivers::CX11OpenGLDriver>("wallpaperengine", this->m_context);
|
|
|
inputContext = std::make_unique<WallpaperEngine::Input::CInputContext>(*(WallpaperEngine::Render::Drivers::CX11OpenGLDriver*)videoDriver.get());
|
|
inputContext = std::make_unique<WallpaperEngine::Input::CInputContext>(*(WallpaperEngine::Render::Drivers::CX11OpenGLDriver*)videoDriver.get());
|
|
|
|
|
+#ifdef ENABLE_WAYLAND
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (WAYLAND)
|
|
if (WAYLAND)
|
|
|
fullscreenDetector = std::make_unique<WallpaperEngine::Render::Drivers::Detectors::CWaylandFullScreenDetector>(this->m_context, *(WallpaperEngine::Render::Drivers::CWaylandOpenGLDriver*)videoDriver.get());
|
|
fullscreenDetector = std::make_unique<WallpaperEngine::Render::Drivers::Detectors::CWaylandFullScreenDetector>(this->m_context, *(WallpaperEngine::Render::Drivers::CWaylandOpenGLDriver*)videoDriver.get());
|
|
|
else
|
|
else
|
|
|
|
|
+#endif
|
|
|
fullscreenDetector = std::make_unique<WallpaperEngine::Render::Drivers::Detectors::CX11FullScreenDetector>(this->m_context, *videoDriver);
|
|
fullscreenDetector = std::make_unique<WallpaperEngine::Render::Drivers::Detectors::CX11FullScreenDetector>(this->m_context, *videoDriver);
|
|
|
// stereo mix recorder for audio processing
|
|
// stereo mix recorder for audio processing
|
|
|
WallpaperEngine::Audio::Drivers::Recorders::CPulseAudioPlaybackRecorder audioRecorder;
|
|
WallpaperEngine::Audio::Drivers::Recorders::CPulseAudioPlaybackRecorder audioRecorder;
|
|
@@ -296,10 +300,11 @@ namespace WallpaperEngine::Application
|
|
|
case CApplicationContext::X11_BACKGROUND:
|
|
case CApplicationContext::X11_BACKGROUND:
|
|
|
output = new WallpaperEngine::Render::Drivers::Output::CX11Output (this->m_context, *videoDriver, *fullscreenDetector);
|
|
output = new WallpaperEngine::Render::Drivers::Output::CX11Output (this->m_context, *videoDriver, *fullscreenDetector);
|
|
|
break;
|
|
break;
|
|
|
-
|
|
|
|
|
|
|
+#ifdef ENABLE_WAYLAND
|
|
|
case CApplicationContext::WAYLAND_LAYER_SHELL:
|
|
case CApplicationContext::WAYLAND_LAYER_SHELL:
|
|
|
output = new WallpaperEngine::Render::Drivers::Output::CWaylandOutput (this->m_context, *videoDriver, *fullscreenDetector);
|
|
output = new WallpaperEngine::Render::Drivers::Output::CWaylandOutput (this->m_context, *videoDriver, *fullscreenDetector);
|
|
|
break;
|
|
break;
|
|
|
|
|
+#endif
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// initialize render context
|
|
// initialize render context
|
|
@@ -318,6 +323,7 @@ namespace WallpaperEngine::Application
|
|
|
this->m_defaultBackground->getWallpaper (), *context, *audioContext
|
|
this->m_defaultBackground->getWallpaper (), *context, *audioContext
|
|
|
));
|
|
));
|
|
|
|
|
|
|
|
|
|
+#ifdef ENABLE_WAYLAND
|
|
|
if (WAYLAND) {
|
|
if (WAYLAND) {
|
|
|
renderFrame();
|
|
renderFrame();
|
|
|
|
|
|
|
@@ -325,10 +331,13 @@ namespace WallpaperEngine::Application
|
|
|
videoDriver->dispatchEventQueue();
|
|
videoDriver->dispatchEventQueue();
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
|
|
+#endif
|
|
|
while (!videoDriver->closeRequested () && this->m_context.state.general.keepRunning) {
|
|
while (!videoDriver->closeRequested () && this->m_context.state.general.keepRunning) {
|
|
|
renderFrame();
|
|
renderFrame();
|
|
|
}
|
|
}
|
|
|
|
|
+#ifdef ENABLE_WAYLAND
|
|
|
}
|
|
}
|
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
// ensure this is updated as sometimes it might not come from a signal
|
|
// ensure this is updated as sometimes it might not come from a signal
|
|
|
this->m_context.state.general.keepRunning = false;
|
|
this->m_context.state.general.keepRunning = false;
|