Skip to content

Commit

Permalink
Use make_wid to simplify code
Browse files Browse the repository at this point in the history
  • Loading branch information
SludgePhD committed Aug 13, 2022
1 parent 26a91ec commit c3a61fa
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/platform_impl/linux/wayland/seat/dnd/handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ use percent_encoding::percent_decode_str;
use sctk::data_device::{DataOffer, DndEvent};
use wayland_client::Display;

use crate::{event::WindowEvent, platform_impl::wayland::event_loop::WinitState};
use crate::{
event::WindowEvent,
platform_impl::wayland::{event_loop::WinitState, make_wid},
};

use super::DndInner;

Expand All @@ -20,14 +23,7 @@ pub(super) fn handle_dnd(event: DndEvent<'_>, inner: &mut DndInner, winit_state:
surface,
..
} => {
let window_id = match winit_state
.window_map
.iter()
.find(|(_, window)| window.window.surface() == &surface)
{
Some((id, _)) => *id,
None => return,
};
let window_id = make_wid(&surface);

if let Ok(paths) = parse_offer(&winit_state.display, offer) {
if !paths.is_empty() {
Expand Down

0 comments on commit c3a61fa

Please sign in to comment.