Skip to content

Commit

Permalink
set renderer to gl
Browse files Browse the repository at this point in the history
  • Loading branch information
Kosette committed Sep 19, 2024
1 parent ed54f64 commit 8a2e62d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,14 @@ fn main() -> glib::ExitCode {
textdomain(GETTEXT_PACKAGE).expect("Invalid string passed to textdomain");
}

// redirect cache dir to %LOCALAPPDATA%
#[cfg(target_os = "windows")]
{
// redirect cache dir to %LOCALAPPDATA%
let config_local_dir = dirs::config_local_dir().expect("Failed to get %LOCALAPPDATA%");
std::env::set_var("XDG_CACHE_HOME", config_local_dir);

// Temporarily set renderer to gl to avoid memory leak in GTK4.16
std::env::set_var("GSK_RENDERER", "gl");
}

// Initialize the logger
Expand Down
2 changes: 1 addition & 1 deletion src/ui/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pub mod widgets;
use self::models::SETTINGS;
use adw::prelude::*;
use gtk::gdk::Display;
use gtk::{prelude::*, CssProvider};
use gtk::CssProvider;

pub fn build_ui(app: &adw::Application) {
// Create new window and present it
Expand Down

0 comments on commit 8a2e62d

Please sign in to comment.