Ensure gtk apps only run on X11
This commit is contained in:
@ -77,6 +77,14 @@ fn main() -> anyhow::Result<()> {
|
||||
init_logging("BSCREENSAVER_DIALOG_GTK3_LOG");
|
||||
glib::log_set_default_handler(glib::rust_log_handler);
|
||||
|
||||
// Can't use the rust version as it requires gtk_init() to be
|
||||
// called first, but the underlying C function requires that
|
||||
// it hasn't.
|
||||
let backends = CString::new("x11").unwrap();
|
||||
unsafe {
|
||||
gtk::gdk::ffi::gdk_set_allowed_backends(backends.as_ptr());
|
||||
};
|
||||
|
||||
let config = Configuration::load()?;
|
||||
let new_login_command =
|
||||
if config.new_login_command == NewLoginCommand::Disabled {
|
||||
|
Reference in New Issue
Block a user