Skip to content

Commit

Permalink
fix(wm): identify overflow apps on drag move
Browse files Browse the repository at this point in the history
This commit ensures that border overflow applications are correctly
identified as being moved instead of being resized when dragged to a new
position using the mouse.

fix #159
  • Loading branch information
LGUG2Z committed Jun 21, 2022
1 parent 7cc69a4 commit 7da4310
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion komorebi/src/process_event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ impl WindowManager {
.ok_or_else(|| anyhow!("cannot get monitor idx from current position"))?;

let new_window_behaviour = self.window_container_behaviour;
let invisible_borders = self.invisible_borders;

let workspace = self.focused_workspace_mut()?;
if workspace
Expand Down Expand Up @@ -340,7 +341,10 @@ impl WindowManager {

// If we have moved across the monitors, use that override, otherwise determine
// if a move has taken place by ruling out a resize
let is_move = moved_across_monitors || resize.right == 0 && resize.bottom == 0;
let is_move = moved_across_monitors
|| resize.right == 0 && resize.bottom == 0
|| resize.right.abs() == invisible_borders.right
&& resize.bottom.abs() == invisible_borders.bottom;

if is_move {
tracing::info!("moving with mouse");
Expand Down

0 comments on commit 7da4310

Please sign in to comment.