From 74e81e6581cbce750955606e6b48b6f4eb395a46 Mon Sep 17 00:00:00 2001 From: "Brian J. Tarricone" Date: Wed, 4 May 2022 01:03:26 -0700 Subject: [PATCH] Remove bscreensaver-dialog-gtk4 I don't think it's even possible to use gtk4 to build a dialog, as gtk4 has dropped GtkPlug/GtkSocket and doesn't support embedding anymore. They also don't seem to give access to enough internals so I can build it myself. --- Cargo.toml | 1 - dialog-gtk4/Cargo.toml | 9 --------- dialog-gtk4/src/main.rs | 43 ----------------------------------------- 3 files changed, 53 deletions(-) delete mode 100644 dialog-gtk4/Cargo.toml delete mode 100644 dialog-gtk4/src/main.rs diff --git a/Cargo.toml b/Cargo.toml index dbb3dab..22c43eb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,7 +5,6 @@ members = [ "locker", "dbus-service", "dialog-gtk3", -# "dialog-gtk4", # "dialog-iced", "util", "systemd", diff --git a/dialog-gtk4/Cargo.toml b/dialog-gtk4/Cargo.toml deleted file mode 100644 index 3670e90..0000000 --- a/dialog-gtk4/Cargo.toml +++ /dev/null @@ -1,9 +0,0 @@ -[package] -name = "bscreensaver-dialog-gtk4" -version = "0.1.0" -edition = "2021" - -[dependencies] -gtk = { version = "0.4", package = "gtk4", features = ["v4_6"]} -gdk-x11 = { version = "0.4", package = "gdk4-x11", features = ["v4_4", "xlib"]} -x11 = "2.19" diff --git a/dialog-gtk4/src/main.rs b/dialog-gtk4/src/main.rs deleted file mode 100644 index 3933f19..0000000 --- a/dialog-gtk4/src/main.rs +++ /dev/null @@ -1,43 +0,0 @@ -use gdk_x11::{X11Surface, X11Display}; -use gtk::{prelude::*, Application, ApplicationWindow, Label}; -use std::process::exit; - -fn main() { - let app = Application::builder() - .application_id("org.spurint.bscreensaver.dialog-gtk4") - .build(); - app.connect_activate(build_ui); - - app.run(); -} - -fn build_ui(app: &Application) { - let titlebar = Label::builder() - .label("Unlock Screen") - .halign(gtk::Align::Center) - .single_line_mode(true) - .build(); - titlebar.show(); - - let window = ApplicationWindow::builder() - .application(app) - .titlebar(&titlebar) - .modal(true) - .decorated(false) - .build(); - window.realize(); - - let surface = unsafe { window.surface().unsafe_cast::() }; - let xid = surface.xid(); - if xid == 0 { - eprintln!("Lock dialog has no XID"); - exit(1); - } - println!("{}", surface.xid()); - - let mut buf = String::new(); - let stdin = std::io::stdin(); - stdin.read_line(&mut buf).unwrap(); - - window.present(); -}