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.
This commit is contained in:
Brian Tarricone 2022-05-04 01:03:26 -07:00
parent c779bca1b0
commit 74e81e6581
3 changed files with 0 additions and 53 deletions

View File

@ -5,7 +5,6 @@ members = [
"locker",
"dbus-service",
"dialog-gtk3",
# "dialog-gtk4",
# "dialog-iced",
"util",
"systemd",

View File

@ -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"

View File

@ -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::<X11Surface>() };
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();
}