autocommit 2022-04-17 17:08:31 CEST
This commit is contained in:
parent
50b792db78
commit
a30306e3d5
23 changed files with 390 additions and 42 deletions
|
|
@ -35,7 +35,7 @@ use {
|
|||
pub struct NodeSeatState {
|
||||
pointer_foci: SmallMap<SeatId, Rc<WlSeatGlobal>, 1>,
|
||||
kb_foci: SmallMap<SeatId, Rc<WlSeatGlobal>, 1>,
|
||||
grabs: SmallMap<SeatId, Rc<WlSeatGlobal>, 1>,
|
||||
pointer_grabs: SmallMap<SeatId, Rc<WlSeatGlobal>, 1>,
|
||||
dnd_targets: SmallMap<SeatId, Rc<WlSeatGlobal>, 1>,
|
||||
}
|
||||
|
||||
|
|
@ -59,11 +59,11 @@ impl NodeSeatState {
|
|||
}
|
||||
|
||||
pub(super) fn add_pointer_grab(&self, seat: &Rc<WlSeatGlobal>) {
|
||||
self.grabs.insert(seat.id, seat.clone());
|
||||
self.pointer_grabs.insert(seat.id, seat.clone());
|
||||
}
|
||||
|
||||
pub(super) fn remove_pointer_grab(&self, seat: &WlSeatGlobal) {
|
||||
self.grabs.remove(&seat.id);
|
||||
self.pointer_grabs.remove(&seat.id);
|
||||
}
|
||||
|
||||
pub(super) fn add_dnd_target(&self, seat: &Rc<WlSeatGlobal>) {
|
||||
|
|
@ -89,10 +89,10 @@ impl NodeSeatState {
|
|||
}
|
||||
|
||||
fn release_kb_focus2(&self, focus_last: bool) {
|
||||
self.release_kb_grab();
|
||||
while let Some((_, seat)) = self.kb_foci.pop() {
|
||||
seat.ungrab_kb();
|
||||
seat.keyboard_node.set(seat.state.root.clone());
|
||||
log::info!("keyboard_node = root");
|
||||
// log::info!("keyboard_node = root");
|
||||
if focus_last {
|
||||
if let Some(tl) = seat.toplevel_focus_history.last() {
|
||||
seat.focus_node(tl.focus_surface(seat.id));
|
||||
|
|
@ -116,7 +116,7 @@ impl NodeSeatState {
|
|||
fn destroy_node2(&self, node: &dyn Node, focus_last: bool) {
|
||||
// NOTE: Also called by set_visible(false)
|
||||
|
||||
while let Some((_, seat)) = self.grabs.pop() {
|
||||
while let Some((_, seat)) = self.pointer_grabs.pop() {
|
||||
seat.pointer_owner.revert_to_default(&seat);
|
||||
}
|
||||
let node_id = node.node_id();
|
||||
|
|
@ -631,7 +631,14 @@ impl WlSeatGlobal {
|
|||
surface.client.flush();
|
||||
}
|
||||
|
||||
pub fn dnd_surface_enter(&self, surface: &WlSurface, dnd: &Dnd, x: Fixed, y: Fixed, serial: u32) {
|
||||
pub fn dnd_surface_enter(
|
||||
&self,
|
||||
surface: &WlSurface,
|
||||
dnd: &Dnd,
|
||||
x: Fixed,
|
||||
y: Fixed,
|
||||
serial: u32,
|
||||
) {
|
||||
if let Some(src) = &dnd.src {
|
||||
ipc::offer_source_to::<WlDataDevice>(src, &surface.client);
|
||||
src.for_each_data_offer(|offer| {
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ use {
|
|||
crate::{ifs::wl_seat::WlSeatGlobal, tree::Node, utils::clonecell::CloneCell},
|
||||
std::rc::Rc,
|
||||
};
|
||||
use crate::xwayland::XWaylandEvent;
|
||||
|
||||
pub struct KbOwnerHolder {
|
||||
default: Rc<DefaultKbOwner>,
|
||||
|
|
@ -58,6 +59,9 @@ impl KbOwner for DefaultKbOwner {
|
|||
return;
|
||||
}
|
||||
log::info!("unfocus {}", old.node_id());
|
||||
if old.node_is_xwayland_surface() && !node.node_is_xwayland_surface() {
|
||||
seat.state.xwayland.queue.push(XWaylandEvent::ActivateRoot);
|
||||
}
|
||||
old.node_unfocus(seat);
|
||||
if old.node_seat_state().unfocus(seat) {
|
||||
old.node_active_changed(false);
|
||||
|
|
|
|||
|
|
@ -426,7 +426,12 @@ impl PointerOwner for DndPointerOwner {
|
|||
target.node_dnd_leave(&self.dnd);
|
||||
target.node_seat_state().remove_dnd_target(seat);
|
||||
target = node;
|
||||
target.node_dnd_enter(&self.dnd, x, y, seat.state.next_serial(target.node_client().as_deref()));
|
||||
target.node_dnd_enter(
|
||||
&self.dnd,
|
||||
x,
|
||||
y,
|
||||
seat.state.next_serial(target.node_client().as_deref()),
|
||||
);
|
||||
target.node_seat_state().add_dnd_target(seat);
|
||||
self.target.set(target);
|
||||
} else if (self.pos_x.get(), self.pos_y.get()) != (x, y) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue