Compare commits

..

1 Commits

Author SHA1 Message Date
LGUG2Z
381253da20 fix(wm): switch to correct ws when following links
Silly boolean error meant that if a link was clicked in one
monitor/workspace, the browser, if not on the same workspace, would be
brought into the workspace the link was clicked in.

This was because I was checking if the focused monitor != the known
monitor && the focused workspace != the known workspace, when in fact,
we don't need both of those conditions to be true in order to switch to
where the browser is, we only need one of them to be true.

After changing the && (and) to a || (or), the behaviour is now as
expected, and clicking a link will switch to the workspace where the
browser is open.
2021-08-20 17:16:16 -07:00
5 changed files with 14 additions and 14 deletions

10
Cargo.lock generated
View File

@@ -496,7 +496,7 @@ dependencies = [
[[package]]
name = "komorebi"
version = "0.1.1"
version = "0.1.2"
dependencies = [
"bindings",
"bitflags",
@@ -527,7 +527,7 @@ dependencies = [
[[package]]
name = "komorebi-core"
version = "0.1.1"
version = "0.1.2"
dependencies = [
"bindings",
"clap",
@@ -539,7 +539,7 @@ dependencies = [
[[package]]
name = "komorebic"
version = "0.1.1"
version = "0.1.2"
dependencies = [
"bindings",
"clap",
@@ -1155,9 +1155,9 @@ dependencies = [
[[package]]
name = "syn"
version = "1.0.74"
version = "1.0.75"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1873d832550d4588c3dbc20f01361ab00bfe741048f71e3fecf145a7cc18b29c"
checksum = "b7f58f7e8eaa0009c5fec437aabf511bd9933e4b2d7407bd05273c01a8906ea7"
dependencies = [
"proc-macro2",
"quote",

View File

@@ -1,6 +1,6 @@
[package]
name = "komorebi-core"
version = "0.1.1"
version = "0.1.2"
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View File

@@ -1,6 +1,6 @@
[package]
name = "komorebi"
version = "0.1.1"
version = "0.1.2"
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View File

@@ -154,16 +154,16 @@ impl WindowManager {
}
}
if let Some(indices) = switch_to {
if self.focused_monitor_idx() != indices.0
&& self
if let Some((known_monitor_idx, known_workspace_idx)) = switch_to {
if self.focused_monitor_idx() != known_monitor_idx
|| self
.focused_monitor()
.context("there is no monitor")?
.focused_workspace_idx()
!= indices.1
!= known_workspace_idx
{
self.focus_monitor(indices.0)?;
self.focus_workspace(indices.1)?;
self.focus_monitor(known_monitor_idx)?;
self.focus_workspace(known_workspace_idx)?;
return Ok(());
}
}

View File

@@ -1,6 +1,6 @@
[package]
name = "komorebic"
version = "0.1.1"
version = "0.1.2"
authors = ["Jade Iqbal <jadeiqbal@fastmail.com>"]
description = "The command-line interface for Komorebi, a tiling window manager for Windows"
categories = ["cli", "tiling-window-manager", "windows"]