Skip to content

Commit bab0e86

Browse files
inlined set_pin
1 parent 98b69c4 commit bab0e86

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

src/scratchpad.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,12 @@ impl Scratchpad {
249249
WindowIdentifier::Address(client.address.clone())
250250
)?;
251251

252-
if self.options.pin {
253-
set_pin(client, true)?;
252+
if self.options.pin && !client.pinned {
253+
hyprland::dispatch!(
254+
TogglePinWindow,
255+
WindowIdentifier::Address(client.address.clone())
256+
)
257+
.log_err(file!(), line!());
254258
}
255259

256260
if !self.options.poly {

src/utils.rs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -98,18 +98,14 @@ pub fn send_request(socket: Option<&str>, request: &str, message: &str) -> Resul
9898
Ok(())
9999
}
100100

101-
pub fn set_pin(client: &Client, set_to: bool) -> Result<()> {
102-
if client.pinned != set_to {
101+
pub fn move_to_special(cl: &Client) {
102+
if cl.pinned {
103103
hyprland::dispatch!(
104104
TogglePinWindow,
105-
WindowIdentifier::Address(client.address.clone())
106-
)?;
105+
WindowIdentifier::Address(cl.address.clone())
106+
)
107+
.log_err(file!(), line!());
107108
}
108-
Ok(())
109-
}
110-
111-
pub fn move_to_special(cl: &Client) {
112-
set_pin(cl, false).log_err(file!(), line!());
113109

114110
hyprland::dispatch!(
115111
MoveToWorkspaceSilent,

0 commit comments

Comments
 (0)