Skip to content

Commit

Permalink
Fix TilingLayout::element_under position with global workspaces
Browse files Browse the repository at this point in the history
I didn't see any issue with how mouse events were handled, but a bisect
showed b818a68 caused the issue.
Reverting the definition of `element_under` to the version before that
change fixed the behavior.

Comparing what both versions return, the right element is returned, but
the location returned is wrong. This makes the return value match the
position that was returned by the previous implementation. It seems to
be working correctly now.

Fixes #161.
  • Loading branch information
ids1024 committed Sep 13, 2023
1 parent 82c7d65 commit 4ca1e60
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion config.ron
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
(modifiers: [], key: "XF86MonBrightnessUp"): Spawn("busctl --user call com.system76.CosmicSettingsDaemon /com/system76/CosmicSettingsDaemon com.system76.CosmicSettingsDaemon IncreaseDisplayBrightness"),
(modifiers: [], key: "XF86MonBrightnessDown"): Spawn("busctl --user call com.system76.CosmicSettingsDaemon /com/system76/CosmicSettingsDaemon com.system76.CosmicSettingsDaemon DecreaseDisplayBrightness"),
},
workspace_mode: OutputBound,
workspace_mode: Global,
workspace_amount: Dynamic,
workspace_layout: Vertical,
tiling_enabled: false,
Expand Down
5 changes: 3 additions & 2 deletions src/shell/layout/tiling/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3055,7 +3055,7 @@ impl TilingLayout {
mapped.is_in_input_region(&test_point).then(|| {
(
mapped.clone().into(),
last_geometry.loc - output_data.location - mapped.geometry().loc,
last_geometry.loc + output_data.location - mapped.geometry().loc,
)
})
}
Expand Down Expand Up @@ -3086,7 +3086,8 @@ impl TilingLayout {
orientation,
}
.into(),
last_geometry.loc - output_data.location
last_geometry.loc
+ output_data.location
+ tree
.children(&id)
.unwrap()
Expand Down

0 comments on commit 4ca1e60

Please sign in to comment.