mirror of
https://github.com/emilk/egui.git
synced 2026-08-29 04:40:03 -04:00
## Problem `ViewportBuilder::with_monitor(idx)` is a **no-op on the glow backend**. A window built with `.with_monitor(...)` opens on the default monitor, not fullscreen — while the exact same code works on wgpu. The monitor → `Fullscreen::Borderless(Some(monitor))` resolution only lives in `egui_winit::create_window`, which the **wgpu** backend uses. The **glow** backend builds its windows straight from `egui_winit::create_winit_window_attributes` at two sites in `glow_integration.rs` — the initial window and per-viewport deferred windows — so the monitor is never applied there. ## Repro A multi-viewport app on the glow renderer with any viewport built via `ViewportBuilder::default().with_monitor(1)` opens that window on monitor 0, un-fullscreen. Switching to the wgpu renderer places it correctly. Seen on a 3-monitor GNOME/Wayland setup where the main window and secondary viewports all need to land borderless-fullscreen on specific outputs. ## Fix Extract the resolution into a public `apply_monitor_to_window_attributes` in `egui-winit` and call it from `create_window` (unchanged behaviour) plus both glow window-creation sites, so `with_monitor` behaves the same on glow and wgpu. No public API change beyond the new helper; no behaviour change on wgpu. 🤖 Generated with [Claude Code](https://claude.com/claude-code)