1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-01 06:10:06 -04:00

Simplify arguments to process_viewport_commands

This commit is contained in:
Emil Ernerfeldt
2023-11-12 10:54:15 +01:00
parent 6e17040539
commit e1f261b079
2 changed files with 16 additions and 13 deletions

View File

@@ -990,9 +990,8 @@ fn translate_cursor(cursor_icon: egui::CursorIcon) -> Option<winit::window::Curs
pub fn process_viewport_commands(
commands: Vec<ViewportCommand>,
viewport_id: ViewportId,
focused: Option<ViewportId>,
window: &winit::window::Window,
is_viewport_focused: bool,
) {
use winit::window::ResizeDirection;
@@ -1000,11 +999,9 @@ pub fn process_viewport_commands(
match command {
egui::ViewportCommand::Drag => {
// if this is not checked on x11 the input will be permanently taken until the app is killed!
if let Some(focus) = focused {
if focus == viewport_id {
// TODO possible return the error to `egui::Context`
let _ = window.drag_window();
}
if is_viewport_focused {
// TODO possible return the error to `egui::Context`
let _ = window.drag_window();
}
}
egui::ViewportCommand::InnerSize(size) => {