Open wiiznokes opened 1 month ago
@wiiznokes Can you please share the output of xdpyinfo
on the affected system?
I asked a question to the user on the linked issue: https://github.com/wiiznokes/fan-control/issues/98#issuecomment-2099674881
I faced the same issue when running the hello world for winit.
Reproduce:
git clone git@github.com:rust-windowing/winit.git
cd winit
cargo run --example window
Output:
2024-05-08T06:29:53.282877Z INFO window: Starting to send user event every second
2024-05-08T06:29:53.283745Z INFO window: Loading cursor assets
2024-05-08T06:29:53.284421Z INFO window: Resumed the event loop
2024-05-08T06:29:53.284437Z INFO window: Monitors information
2024-05-08T06:29:53.295810Z INFO window: Primary monitor: HDMI-2
2024-05-08T06:29:53.295828Z INFO window: Current mode: 3424x1926 @ 59.950 Hz
2024-05-08T06:29:53.295838Z INFO window: Position: 0,0
2024-05-08T06:29:53.295844Z INFO window: Scale factor: 2
2024-05-08T06:29:53.295851Z INFO window: Available modes (width x height x bit-depth):
2024-05-08T06:29:53.295864Z INFO window: 2560x1440x24 @ 59.950 Hz
2024-05-08T06:29:53.295873Z INFO window: 2560x1440x24 @ 74.968 Hz
2024-05-08T06:29:53.295880Z INFO window: 1920x1080x24 @ 119.982 Hz
2024-05-08T06:29:53.295893Z INFO window: 1920x1080x24 @ 99.930 Hz
2024-05-08T06:29:53.295900Z INFO window: 1920x1080x24 @ 60.0 Hz
2024-05-08T06:29:53.295907Z INFO window: 1920x1080x24 @ 60.0 Hz
2024-05-08T06:29:53.295915Z INFO window: 1920x1080x24 @ 50.0 Hz
2024-05-08T06:29:53.295922Z INFO window: 1920x1080x24 @ 59.940 Hz
2024-05-08T06:29:53.295929Z INFO window: 1280x1440x24 @ 59.912 Hz
2024-05-08T06:29:53.295936Z INFO window: 1280x1024x24 @ 75.24 Hz
2024-05-08T06:29:53.295943Z INFO window: 1280x1024x24 @ 60.19 Hz
2024-05-08T06:29:53.295950Z INFO window: 1440x900x24 @ 59.901 Hz
2024-05-08T06:29:53.295957Z INFO window: 1280x720x24 @ 60.0 Hz
2024-05-08T06:29:53.295965Z INFO window: 1280x720x24 @ 50.0 Hz
2024-05-08T06:29:53.295972Z INFO window: 1280x720x24 @ 59.940 Hz
2024-05-08T06:29:53.295979Z INFO window: 1024x768x24 @ 119.988 Hz
2024-05-08T06:29:53.295986Z INFO window: 1024x768x24 @ 75.28 Hz
2024-05-08T06:29:53.295994Z INFO window: 1024x768x24 @ 70.69 Hz
2024-05-08T06:29:53.296001Z INFO window: 1024x768x24 @ 60.3 Hz
2024-05-08T06:29:53.296009Z INFO window: 832x624x24 @ 74.551 Hz
2024-05-08T06:29:53.296016Z INFO window: 800x600x24 @ 119.971 Hz
2024-05-08T06:29:53.296023Z INFO window: 800x600x24 @ 72.187 Hz
2024-05-08T06:29:53.296030Z INFO window: 800x600x24 @ 75.0 Hz
2024-05-08T06:29:53.296038Z INFO window: 800x600x24 @ 60.316 Hz
2024-05-08T06:29:53.296045Z INFO window: 800x600x24 @ 56.250 Hz
2024-05-08T06:29:53.296052Z INFO window: 720x576x24 @ 50.0 Hz
2024-05-08T06:29:53.296059Z INFO window: 720x480x24 @ 60.0 Hz
2024-05-08T06:29:53.296066Z INFO window: 720x480x24 @ 59.940 Hz
2024-05-08T06:29:53.296073Z INFO window: 640x480x24 @ 75.0 Hz
2024-05-08T06:29:53.296081Z INFO window: 640x480x24 @ 72.808 Hz
2024-05-08T06:29:53.296088Z INFO window: 640x480x24 @ 66.666 Hz
2024-05-08T06:29:53.296095Z INFO window: 640x480x24 @ 60.0 Hz
2024-05-08T06:29:53.296102Z INFO window: 640x480x24 @ 59.940 Hz
2024-05-08T06:29:53.296109Z INFO window: 720x400x24 @ 70.81 Hz
2024-05-08T06:29:53.296293Z INFO winit::platform_impl::platform::x11::window: Guessed window scale factor: 2
thread 'main' panicked at examples/window.rs:467:46:
failed to create initial window: PlatformError(Some("Visual 0x79 does not use softbuffer's pixel format and is unsupported"), None)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
uname -a
:
Linux monolith 5.15.0-105-generic #115-Ubuntu SMP Mon Apr 15 09:52:04 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
xdpyinfo for visual 0x79:
visual:
visual id: 0x79
class: TrueColor
depth: 32 planes
available colormap entries: 256 per subfield
red, green, blue masks: 0xff0000, 0xff00, 0xff
significant bits in color specification: 8 bits
For the winit part, see: https://github.com/rust-windowing/winit/issues/3646
(I'll leave it to someone else to decide whether this issue can be closed as "winit bug")
The problem is this part of the visual information:
depth: 32 planes
softbuffer used to "trust you" that you used it directly. Since commit 09b8126909031eb442a638020fb3d9062de958b9 it actually checks that the visual is correct. Softbuffer never supported (nor claimed to support) transparency, but winit tries to use ARGB visuals anyway.
A work around is to not use with_transparent(true)
with winit.
I have two users who reported this error in my not so used app. I see it is expected to not work but what the story about this ? Is it going to be supported at some point ?