1
0
Fork 0
forked from wry/wry

autocommit 2022-03-29 15:40:59 CEST

This commit is contained in:
Julian Orth 2022-03-29 15:40:59 +02:00
parent 6ebf731aea
commit 9842264fad
39 changed files with 121 additions and 92 deletions

View file

@ -52,6 +52,7 @@ use std::ops::{Deref, DerefMut};
use std::rc::Rc;
use thiserror::Error;
use uapi::{c, Errno, OwnedFd};
use crate::utils::rc_eq::rc_eq;
const POINTER: u32 = 1;
const KEYBOARD: u32 = 2;
@ -193,7 +194,7 @@ impl WlSeatGlobal {
for seat in client.values() {
let kbs = seat.keyboards.lock();
for kb in kbs.values() {
let fd = match seat.keymap_fd(&keymap) {
let fd = match seat.keymap_fd(keymap) {
Ok(fd) => fd,
Err(e) => {
log::error!("Could not creat a file descriptor to transfer the keymap to client {}: {}", id, ErrorFmt(e));
@ -344,7 +345,7 @@ impl WlSeatGlobal {
pub fn set_cursor(&self, cursor: Option<Rc<dyn Cursor>>) {
if let Some(old) = self.cursor.get() {
if let Some(new) = cursor.as_ref() {
if Rc::ptr_eq(&old, new) {
if rc_eq(&old, new) {
return;
}
}

View file

@ -236,7 +236,7 @@ impl WlSeatGlobal {
client: &Rc<Client>,
) {
match field.get() {
Some(sel) => ipc::offer_source_to::<T>(&sel, &client),
Some(sel) => ipc::offer_source_to::<T>(&sel, client),
None => T::for_each_device(self, client.id, |dd| {
T::send_selection(dd, ObjectId::NONE.into());
}),
@ -441,7 +441,7 @@ impl WlSeatGlobal {
pub fn focus_surface(&self, surface: &WlSurface) {
let pressed_keys: Vec<_> = self.pressed_keys.borrow().iter().copied().collect();
let serial = self.serial.fetch_add(1);
self.surface_kb_event(0, &surface, |k| {
self.surface_kb_event(0, surface, |k| {
k.send_enter(serial, surface.id, &pressed_keys)
});
let ModifierState {
@ -452,7 +452,7 @@ impl WlSeatGlobal {
..
} = self.kb_state.borrow().mods();
let serial = self.serial.fetch_add(1);
self.surface_kb_event(0, &surface, |k| {
self.surface_kb_event(0, surface, |k| {
k.send_modifiers(serial, mods_depressed, mods_latched, mods_locked, group)
});

View file

@ -275,7 +275,7 @@ impl PointerOwner for GrabPointerOwner {
icon.dnd_icons.insert(seat.id(), seat.clone());
}
if let Some(new) = &src {
ipc::attach_seat::<WlDataDevice>(&new, seat, ipc::Role::Dnd)?;
ipc::attach_seat::<WlDataDevice>(new, seat, ipc::Role::Dnd)?;
}
*seat.dropped_dnd.borrow_mut() = None;
let pointer_owner = Rc::new(DndPointerOwner {

View file

@ -126,7 +126,7 @@ impl WlSubsurface {
self.sync_ancestor.set(sync_ancestor);
self.depth.set(depth);
self.surface.ext.set(self.clone());
update_children_attach(&self, sync_ancestor, depth)?;
update_children_attach(self, sync_ancestor, depth)?;
Ok(())
}

View file

@ -530,7 +530,7 @@ impl XdgSurfaceExt for XdgToplevel {
if let Some(workspace) = self.xdg.workspace.get() {
let output = workspace.output.get();
let bindings = output.global.bindings.borrow_mut();
for binding in bindings.get(&self.xdg.surface.client.id) {
if let Some(binding) = bindings.get(&self.xdg.surface.client.id) {
for binding in binding.values() {
self.xdg.surface.send_enter(binding.id);
}