Skip to content
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
14 changes: 14 additions & 0 deletions core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3041,6 +3041,20 @@ impl<'a> ApplicationHandler<UserEvent> for Application<'a> {
} else if wm.is_active_window(window_id) {
log::info!("window_event: active window resized to {:?}", new_size);
wm.resize_active_window(new_size);
let monitor_size = wm
.active_gfx_mut()
.and_then(|gfx| gfx.window().current_monitor())
.map(|monitor| monitor.size());
if monitor_size == Some(new_size)
&& self.pending_overlay_repair.is_none()
&& self.remote_control.as_ref().is_some_and(|remote_control| {
let overlay_window =
remote_control.cursor_controller.get_overlay_window();
!overlay_window.matches_size(new_size)
})
{
self.pending_overlay_repair = wm.active_monitor_id();
}
}
}
}
Expand Down
6 changes: 5 additions & 1 deletion core/src/overlay_window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use core::fmt;
use std::sync::{Arc, Mutex};

use winit::dpi::PhysicalPosition;
use winit::dpi::{PhysicalPosition, PhysicalSize};

use crate::utils::geometry::{Extent, Frame, Position};

Expand Down Expand Up @@ -103,6 +103,10 @@ impl OverlayWindow {
}
}

pub fn matches_size(&self, size: PhysicalSize<u32>) -> bool {
self.extent.width == size.width as f64 && self.extent.height == size.height as f64
}

pub fn source_to_global(&self, position: Position) -> Option<Position> {
self.source_to_global_with_frame(position, self.capture_frame())
}
Expand Down
Loading