diff options
Diffstat (limited to 'intern/ghost')
-rw-r--r-- | intern/ghost/intern/GHOST_ISystem.cpp | 26 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_SystemWayland.cpp | 6 |
2 files changed, 16 insertions, 16 deletions
diff --git a/intern/ghost/intern/GHOST_ISystem.cpp b/intern/ghost/intern/GHOST_ISystem.cpp index 11d1c501d04..9e3bf66d925 100644 --- a/intern/ghost/intern/GHOST_ISystem.cpp +++ b/intern/ghost/intern/GHOST_ISystem.cpp @@ -54,30 +54,30 @@ GHOST_TSuccess GHOST_ISystem::createSystem() { GHOST_TSuccess success; if (!m_system) { -#if defined(WITH_GHOST_X11) || defined(WITH_GHOST_WAYLAND) -# ifdef WITH_GHOST_WAYLAND +#if defined(WITH_GHOST_X11) && defined(WITH_GHOST_WAYLAND) + /* Special case, try Wayland, fall back to X11. */ try { m_system = new GHOST_SystemWayland(); } - catch (const std::exception &) { + catch (const std::runtime_error &) { + /* fallback to X11. */ } -# endif -# ifdef WITH_GHOST_X11 if (!m_system) { m_system = new GHOST_SystemX11(); } -# endif -#else -# ifdef WITH_HEADLESS +#elif defined(WITH_GHOST_X11) + m_system = new GHOST_SystemX11(); +#elif defined(WITH_GHOST_WAYLAND) + m_system = new GHOST_SystemWayland(); +#elif defined(WITH_HEADLESS) m_system = new GHOST_SystemNULL(); -# elif defined(WITH_GHOST_SDL) +#elif defined(WITH_GHOST_SDL) m_system = new GHOST_SystemSDL(); -# elif defined(WIN32) +#elif defined(WIN32) m_system = new GHOST_SystemWin32(); -# else -# ifdef __APPLE__ +#else +# ifdef __APPLE__ m_system = new GHOST_SystemCocoa(); -# endif # endif #endif success = m_system != NULL ? GHOST_kSuccess : GHOST_kFailure; diff --git a/intern/ghost/intern/GHOST_SystemWayland.cpp b/intern/ghost/intern/GHOST_SystemWayland.cpp index 9030a02abb1..666515ed088 100644 --- a/intern/ghost/intern/GHOST_SystemWayland.cpp +++ b/intern/ghost/intern/GHOST_SystemWayland.cpp @@ -1197,7 +1197,7 @@ GHOST_SystemWayland::GHOST_SystemWayland() : GHOST_System(), d(new display_t) d->display = wl_display_connect(nullptr); if (!d->display) { display_destroy(d); - throw std::exception(); + throw std::runtime_error("Wayland: unable to connect to display!"); } /* Register interfaces. */ @@ -1211,7 +1211,7 @@ GHOST_SystemWayland::GHOST_SystemWayland() : GHOST_System(), d(new display_t) if (!d->xdg_shell) { display_destroy(d); - throw std::exception(); + throw std::runtime_error("Wayland: unable to access xdg_shell!"); } /* Register data device per seat for IPC between Wayland clients. */ @@ -1230,7 +1230,7 @@ GHOST_SystemWayland::GHOST_SystemWayland() : GHOST_System(), d(new display_t) d->cursor_theme = wl_cursor_theme_load(theme, sizei, d->shm); if (!d->cursor_theme) { display_destroy(d); - throw std::exception(); + throw std::runtime_error("Wayland: unable to access cursor themes!"); } } |