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

update deps except smithay #59

Merged
merged 3 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
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
340 changes: 170 additions & 170 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion benches/image_compression.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ fn compression_benchmark(c: &mut Criterion) {
let files = fs::read_dir("/home/rasputin/qoi_benchmark_images/screenshot_web/")
.unwrap()
.map(|dirent| dirent.unwrap().path())
.filter(|path| path.extension().map_or(false, |ext| ext == "png"));
.filter(|path| path.extension().is_some_and(|ext| ext == "png"));
let mut compression_ratios = Vec::new();
let mut filter_compression_ratios = Vec::new();
for file in files {
Expand Down
2 changes: 1 addition & 1 deletion deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ allow = [
"BSD-3-Clause",
"ISC",
"MIT",
"Unicode-DFS-2016",
"Unicode-3.0",
"Zlib",
]
confidence-threshold = 1.0
Expand Down
5 changes: 3 additions & 2 deletions src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,9 @@ pub trait OptionalConfig<Conf: Config>:
return None;
}

let config_str = fs::read_to_string(&config_file)
.expect("config file at path {config_file} exists but there was an error reading it");
let config_str = fs::read_to_string(&config_file).unwrap_or_else(|_| {
panic!("config file at path {config_file:?} exists but there was an error reading it")
});
let config: Self = Options::default()
.with_default_extension(Extensions::IMPLICIT_SOME)
.from_str(&config_str)
Expand Down
4 changes: 3 additions & 1 deletion src/client/smithay_handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,9 @@ impl SeatHandler for WprsClientState {
if let Some(seat_obj) = self.seat_objects.iter_mut().find(|s| s.seat == seat) {
match capability {
Capability::Keyboard => {
seat_obj.keyboard.take().map(|k| k.release());
if let Some(k) = seat_obj.keyboard.take() {
k.release()
}
},
Capability::Pointer => {
seat_obj.pointer.take();
Expand Down
8 changes: 6 additions & 2 deletions src/xwayland_xdg_shell/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -538,10 +538,14 @@ impl SeatHandler for WprsState {
{
match capability {
Capability::Keyboard => {
seat_obj.keyboard.take().map(|k| k.release());
if let Some(k) = seat_obj.keyboard.take() {
k.release()
}
},
Capability::Pointer => {
seat_obj.pointer.take().map(|p| p.pointer().release());
if let Some(p) = seat_obj.pointer.take() {
p.pointer().release()
}
},
_ => {},
}
Expand Down
2 changes: 1 addition & 1 deletion src/xwayland_xdg_shell/compositor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ pub(crate) fn find_x11_parent(
.find(|(_, xwls)| {
xwls.x11_surface
.as_ref()
.map_or(false, |s| s.window_id() == parent_id)
.is_some_and(|s| s.window_id() == parent_id)
})
.unwrap();

Expand Down
11 changes: 5 additions & 6 deletions src/xwayland_xdg_shell/xwayland.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,11 @@ impl XwmHandler for WprsState {
// Without this, xwayland still thinks the key that triggered the
// window close is still held down and sends key repeat events.
if let Some(keyboard) = self.compositor_state.seat.get_keyboard() {
if keyboard
.current_focus()
.map_or(false, |focus| focus == window)
{
let serial = SERIAL_COUNTER.next_serial();
keyboard.set_focus(self, None, serial);
if let Some(focus) = keyboard.current_focus() {
if focus == window {
let serial = SERIAL_COUNTER.next_serial();
keyboard.set_focus(self, None, serial);
}
}
}
}
Expand Down