shell: Fix repeated window grabs in more scenarios
This commit is contained in:
parent
33eedb0b58
commit
8943aa5a15
2 changed files with 8 additions and 4 deletions
|
|
@ -435,6 +435,7 @@ impl PointerTarget<State> for CosmicWindow {
|
|||
PointerTarget::enter(&p.window, seat, data, &event)
|
||||
}
|
||||
} else {
|
||||
p.swap_focus(Focus::Window);
|
||||
PointerTarget::enter(&p.window, seat, data, event)
|
||||
}
|
||||
false
|
||||
|
|
|
|||
|
|
@ -222,7 +222,7 @@ impl MoveSurfaceGrab {
|
|||
// No more buttons are pressed, release the grab.
|
||||
let output = self.seat.active_output();
|
||||
|
||||
let offset = if let Some(grab_state) = self
|
||||
let position = if let Some(grab_state) = self
|
||||
.seat
|
||||
.user_data()
|
||||
.get::<SeatMoveGrabState>()
|
||||
|
|
@ -266,7 +266,10 @@ impl MoveSurfaceGrab {
|
|||
.active_space_mut(&output)
|
||||
.floating_layer
|
||||
.map_internal(grab_state.window, &output, Some(window_location + offset));
|
||||
Some(grab_state.window_offset)
|
||||
|
||||
let pointer_pos = handle.current_location();
|
||||
let relative_pos = state.common.shell.map_global_to_space(pointer_pos, &output);
|
||||
Some(window_location + offset + (pointer_pos - relative_pos).to_i32_round())
|
||||
} else {
|
||||
None
|
||||
}
|
||||
|
|
@ -276,10 +279,10 @@ impl MoveSurfaceGrab {
|
|||
|
||||
handle.unset_grab(state, serial, time);
|
||||
if self.window.alive() {
|
||||
if let Some(offset) = offset {
|
||||
if let Some(position) = position {
|
||||
handle.motion(
|
||||
state,
|
||||
Some((PointerFocusTarget::from(self.window.clone()), offset)),
|
||||
Some((PointerFocusTarget::from(self.window.clone()), position - self.window.geometry().loc)),
|
||||
&MotionEvent {
|
||||
location: handle.current_location(),
|
||||
serial: serial,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue