summaryrefslogtreecommitdiff
path: root/src/clients/client.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/clients/client.rs')
-rw-r--r--src/clients/client.rs19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/clients/client.rs b/src/clients/client.rs
index 6ab664b..c8fca6c 100644
--- a/src/clients/client.rs
+++ b/src/clients/client.rs
@@ -2,14 +2,14 @@ use xcb::{
x::{
self, ChangeProperty, ChangeWindowAttributes, ConfigWindow, ConfigWindowMask,
ConfigureNotifyEvent, ConfigureWindow, Cw, EventMask, MapWindow, PropMode, SendEvent,
- SendEventDest, StackMode, Window,
+ SendEventDest, StackMode, UnmapWindow, Window,
},
VoidCookieChecked, Xid,
};
use crate::{config::BORDER_WIDTH, conn_info::Connection};
-use super::{hints, MonitorGeometry};
+use super::{hints, MonitorGeometry, Tag};
/// Information about a single client / window
#[derive(Debug)]
@@ -28,6 +28,8 @@ pub struct Client {
urgent: bool,
never_focus: bool,
layout_mode: LayoutMode,
+
+ pub tag: Tag,
}
/// How this window's geometry is determined,
@@ -44,7 +46,7 @@ pub enum LayoutMode {
}
impl Client {
- pub const fn new(window: Window) -> Self {
+ pub const fn new(window: Window, tag: Tag) -> Self {
Self {
window,
x: 0,
@@ -56,6 +58,7 @@ impl Client {
urgent: false,
never_focus: false,
layout_mode: LayoutMode::Tiled,
+ tag,
}
}
@@ -226,6 +229,16 @@ impl Client {
});
}
+ /// Ensure this client is currently unmapped
+ pub fn ensure_unmapped(&mut self, conn: &Connection<'_>) {
+ if self.mapped {
+ conn.send_request(&UnmapWindow {
+ window: self.window,
+ });
+ self.mapped = false;
+ }
+ }
+
/// Ensure this client is currently mapped / visible
pub fn ensure_mapped(&mut self, conn: &Connection<'_>) {
if !self.mapped {