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: mouse click on KeyboardSwap crashes #882

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 31 additions & 22 deletions src/input/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use crate::{
floating::ResizeGrabMarker,
tiling::{NodeDesc, TilingLayout},
},
SeatExt, Trigger,
OverviewMode, SeatExt, Trigger,
},
utils::{prelude::*, quirks::workspace_overview_is_open},
wayland::{
Expand Down Expand Up @@ -665,27 +665,36 @@ impl State {
match mouse_button {
smithay::backend::input::MouseButton::Left => {
supress_button();
self.common.event_loop_handle.insert_idle(
move |state| {
let mut shell =
state.common.shell.write().unwrap();
let res = shell.move_request(
&surface,
&seat_clone,
serial,
ReleaseMode::NoMouseButtons,
false,
&state.common.config,
&state.common.event_loop_handle,
&state.common.xdg_activation_state,
false,
);
drop(shell);
dispatch_grab(
res, seat_clone, serial, state,
);
},
);
// Mouse click in KeyboardSwap Overview Mode
// crashes compositor. Workspace Overview Mode
// needs mouse click.
if !matches!(
shell.overview_mode().0.trigger(),
Some(&Trigger::KeyboardSwap(_, _))
) {
self.common.event_loop_handle.insert_idle(
move |state| {
let mut shell =
state.common.shell.write().unwrap();

let res = shell.move_request(
&surface,
&seat_clone,
serial,
ReleaseMode::NoMouseButtons,
false,
&state.common.config,
&state.common.event_loop_handle,
&state.common.xdg_activation_state,
false,
);
drop(shell);
dispatch_grab(
res, seat_clone, serial, state,
);
},
);
}
}
smithay::backend::input::MouseButton::Right => {
supress_button();
Expand Down