Skip to content

Commit

Permalink
misc: properly set GSK_RENDERER=gl
Browse files Browse the repository at this point in the history
This is so it also applies with other packaging.
  • Loading branch information
SeaDve committed Mar 5, 2024
1 parent 5a7c2f7 commit e780836
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 0 additions & 1 deletion build-aux/io.github.seadve.Kooha.Devel.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"--socket=fallback-x11",
"--socket=pulseaudio",
"--socket=wayland",
"--env=GSK_RENDERER=gl",
"--env=RUST_BACKTRACE=1",
"--env=RUST_LIB_BACKTRACE=0",
"--env=RUST_LOG=kooha=debug",
Expand Down
9 changes: 9 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ mod settings;
mod timer;
mod window;

use std::env;

use gettextrs::{gettext, LocaleCategory};
use gtk::{gio, glib};

Expand All @@ -53,6 +55,13 @@ use self::{
};

fn main() -> glib::ExitCode {
// HACK Use gl renderer by default instead of ngl due to gtk4paintablesink bug.
// See https://gitlab.gnome.org/GNOME/gtk/-/issues/6411 and
// https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/issues/508
if env::var("GSK_RENDERER").map_or(true, |val| val.is_empty()) {
env::set_var("GSK_RENDERER", "gl");
}

tracing_subscriber::fmt::init();

gettextrs::setlocale(LocaleCategory::LcAll, "");
Expand Down

0 comments on commit e780836

Please sign in to comment.