From 4a9a712af88af685e555b1c69626725d5de95088 Mon Sep 17 00:00:00 2001 From: ur name Date: Mon, 19 Oct 2020 15:57:58 +0000 Subject: [PATCH] added a always-there variable called window_name, that contains.. who would have guessed.. the window name - LegendOfMiracles --- src/app.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/app.rs b/src/app.rs index c179ab7..bcf6859 100644 --- a/src/app.rs +++ b/src/app.rs @@ -104,7 +104,7 @@ impl App { pos: Option, size: Option, ) -> Result<()> { - // remove and close existing window of the same type + // remove and close existing window with the same name let _ = self.close_window(window_name); let mut window_def = self @@ -131,18 +131,22 @@ impl App { // run on_screen_changed to set the visual correctly initially. on_screen_changed(&window, None); window.connect_screen_changed(on_screen_changed); - - let empty_local_state = HashMap::new(); + let mut almost_empty_local_state = HashMap::new(); + almost_empty_local_state.insert( + VarName("window_name".to_string()), + crate::value::AttrValue::from_primitive(window_name.to_string()), + ); let root_widget = &widgets::widget_use_to_gtk_widget( &self.eww_config.get_widgets(), &mut self.eww_state, window_name, - &empty_local_state, + &almost_empty_local_state, &window_def.widget, )?; root_widget.get_style_context().add_class(&window_name.to_string()); window.add(root_widget); + // REAL SHIT 0_o :elkowar_with_a_looking_glass: window.show_all(); let gdk_window = window.get_window().context("couldn't get gdk window from gtk window")?;