cursor_user: ensure cursor position is on live output
This commit is contained in:
parent
22f1d92877
commit
b56c1a1b0a
3 changed files with 24 additions and 2 deletions
|
|
@ -414,6 +414,8 @@ impl CursorUser {
|
||||||
x = x.apply_fract(x_tmp);
|
x = x.apply_fract(x_tmp);
|
||||||
y = y.apply_fract(y_tmp);
|
y = y.apply_fract(y_tmp);
|
||||||
}
|
}
|
||||||
|
let x_int = x.round_down();
|
||||||
|
let y_int = y.round_down();
|
||||||
if self.software_cursor()
|
if self.software_cursor()
|
||||||
&& let Some(cursor) = self.cursor.get()
|
&& let Some(cursor) = self.cursor.get()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -534,6 +534,25 @@ impl WlSeatGlobal {
|
||||||
self.cursor_user_group.latest_output()
|
self.cursor_user_group.latest_output()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub(crate) fn handle_output_disconnected(
|
||||||
|
self: &Rc<Self>,
|
||||||
|
output: &Rc<OutputNode>,
|
||||||
|
target: &Rc<OutputNode>,
|
||||||
|
) {
|
||||||
|
let old_output = self.pointer_cursor.output().id;
|
||||||
|
let old_position = self.pointer_cursor.position_int();
|
||||||
|
self.cursor_user_group.output_disconnected(output, target);
|
||||||
|
let new_output = self.pointer_cursor.output().id;
|
||||||
|
let new_position = self.pointer_cursor.position_int();
|
||||||
|
if old_output == new_output && old_position == new_position {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
self.pos_time_usec.set(self.state.now_usec());
|
||||||
|
self.changes.or_assign(CHANGE_CURSOR_MOVED);
|
||||||
|
self.pointer_stack_modified.set(true);
|
||||||
|
self.apply_changes();
|
||||||
|
}
|
||||||
|
|
||||||
pub fn get_keyboard_node(&self) -> Rc<dyn Node> {
|
pub fn get_keyboard_node(&self) -> Rc<dyn Node> {
|
||||||
self.keyboard_node.get()
|
self.keyboard_node.get()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -388,8 +388,9 @@ impl ConnectorHandler {
|
||||||
for group in on.ext_workspace_groups.lock().drain_values() {
|
for group in on.ext_workspace_groups.lock().drain_values() {
|
||||||
group.handle_destroyed();
|
group.handle_destroyed();
|
||||||
}
|
}
|
||||||
for seat in self.state.globals.seats.lock().values() {
|
let seats: Vec<_> = self.state.globals.seats.lock().values().cloned().collect();
|
||||||
seat.cursor_group().output_disconnected(&on, &target);
|
for seat in seats {
|
||||||
|
seat.handle_output_disconnected(&on, &target);
|
||||||
}
|
}
|
||||||
for item in on.tray_items.iter() {
|
for item in on.tray_items.iter() {
|
||||||
item.destroy_node();
|
item.destroy_node();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue