diff options
author | dec05eba <dec05eba@protonmail.com> | 2024-11-24 19:13:35 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2024-11-24 19:13:35 +0100 |
commit | 3468554eb3ddeac3cbf079ad6ebf3c8a39efc2f2 (patch) | |
tree | a0dbccbb6926716f180300afe8fa1e36d3fd3d2a /src/main.cpp | |
parent | 734280f3042a1b2d08764599d1decdee2d4d3132 (diff) |
Allow running the ui on Wayland through XWayland
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/main.cpp b/src/main.cpp index be2e50d..cded01c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -56,6 +56,11 @@ int main(void) { signal(SIGINT, sigint_handler); + if(mgl_init() != 0) { + fprintf(stderr, "error: failed to initialize mgl. Either failed to connec to the X11 server or failed to setup opengl\n"); + exit(1); + } + gsr::GsrInfo gsr_info; // TODO: Show the error in ui gsr::GsrInfoExitStatus gsr_info_exit_status = gsr::get_gpu_screen_recorder_info(&gsr_info); @@ -64,10 +69,8 @@ int main(void) { exit(1); } - if(gsr_info.system_info.display_server == gsr::DisplayServer::WAYLAND) { - fprintf(stderr, "error: Wayland is currently not supported\n"); - exit(1); - } + if(gsr_info.system_info.display_server == gsr::DisplayServer::WAYLAND) + fprintf(stderr, "warning: Wayland support is experimental and requires XWayland. Things may not work as expected.\n"); std::string resources_path; if(access("sibs-build", F_OK) == 0) { @@ -80,7 +83,6 @@ int main(void) { #endif } - mgl::Init init; mgl_context *context = mgl_get_context(); egl_functions egl_funcs; @@ -198,6 +200,7 @@ int main(void) { overlay.reset(); gsr::deinit_theme(); gsr::deinit_color_theme(); + mgl_deinit(); return 0; } |