winit/examples
Matěj Laitl ae4c449670 x11: fix WindowAttributesExtX11::with_x11_screen()
Based on https://github.com/rust-windowing/winit/pull/3973, which should be merged first.

There's an API to programmatically specify X11 screen id (override what is determined from the `DISPLAY` env variable), but it doesn't work.

Seeting up X Server with 2 screens and calling `DISPLAY=:0 X11_SCREEN_ID=1 cargo run --example window` should be equivalent to calling `DISPLAY=:0.1 cargo run --example window`

The latter works (and places the window on the correct screen), but the former yields

`failed to create initial window: Os(OsError { line: 620, file: "src/platform_impl/linux/x11/window.rs", error: X11Error(X11Error { error_kind: Match, error_code: 8, sequence: 219, bad_value: 1319, minor_opcode: 0, major_opcode: 1, extension_name: None, request_name: Some("CreateWindow") }) })`

_Here `1319` is the root window id for screen 0, which doesn't match the screen 1 that we request._

The problem is that we need to factor in the screen id when determining the parent (root) window when not explicitly set. This patch does that.

---

Also: Extend the window example with X11_{SCREEN,VISUAL}_ID env variables
2024-11-06 08:30:25 -08:00
..
data Deprecate window creation with stale event loop 2024-02-21 14:44:29 +04:00
util chore: always pull raw-window-handle 2024-11-03 00:39:01 +03:00
child_window.rs api: overhaul pointer API 2024-10-08 15:19:00 +03:00
control_flow.rs api: convert Window to dyn Window 2024-08-23 23:40:27 +03:00
pump_events.rs api: convert Window to dyn Window 2024-08-23 23:40:27 +03:00
run_on_demand.rs Rename "inner size" to "surface size" (#3889) 2024-09-04 15:04:48 +02:00
window.rs x11: fix WindowAttributesExtX11::with_x11_screen() 2024-11-06 08:30:25 -08:00
x11_embed.rs Rename "inner size" to "surface size" (#3889) 2024-09-04 15:04:48 +02:00