Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fix mouse dragging #2082

Merged
merged 2 commits into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion neovide-derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pub fn setting_group(item: TokenStream) -> TokenStream {
let input = parse_macro_input!(item as DeriveInput);
let prefix = setting_prefix(input.attrs.as_ref())
.map(|p| format!("{p}_"))
.unwrap_or_else(|| "".to_string());
.unwrap_or_default();
stream(input, prefix)
}

Expand Down
21 changes: 11 additions & 10 deletions src/window/mouse_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,16 +183,17 @@ impl MouseManager {
} else {
// otherwise, update the window_id_under_mouse to match the one selected
self.window_details_under_mouse = Some(relevant_window_details.clone());
}
if has_moved {
// Send a mouse move command
EVENT_AGGREGATOR.send(UiCommand::Serial(SerialCommand::MouseButton {
button: "move".into(),
action: "".into(), // this is ignored by nvim
grid_id: relevant_window_details.id,
position: self.relative_position.into(),
modifier_string: keyboard_manager.format_modifier_string("", true),
}))

if has_moved {
// Send a mouse move command
EVENT_AGGREGATOR.send(UiCommand::Serial(SerialCommand::MouseButton {
button: "move".into(),
action: "".into(), // this is ignored by nvim
grid_id: relevant_window_details.id,
position: self.relative_position.into(),
modifier_string: keyboard_manager.format_modifier_string("", true),
}))
}
}

self.has_moved = self.dragging.is_some() && (self.has_moved || has_moved);
Expand Down