Comments (2)
The error comes from here: https://github.com/rust-windowing/softbuffer/blob/28ebe6e7373bae59196bff5b39d047bcc0a41137/src/backends/x11.rs#L271
Uhm.... I can reproduce this?!?
$ cargo run --quiet --example window > /dev/null
thread 'main' panicked at 'failed to create initial window: PlatformError(Some("Visual 0x7a does not use softbuffer's pixel format and is unsupported"), None)', examples/window.rs:467:46
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Commit ea70f77 works (randomly chosen old commit). This leads to:
4f47a4e7932fb939408bfa191b5b86428974e5d1 is the first bad commit
commit 4f47a4e7932fb939408bfa191b5b86428974e5d1
Author: daxpedda <[email protected]>
Date: Thu Apr 18 21:52:38 2024 +0200
Update dev-dependencies (#3641)
Cargo.toml | 4 ++--
examples/util/fill.rs | 21 +++++++++++++++------
examples/window.rs | 22 ++++++++++++++++------
3 files changed, 33 insertions(+), 14 deletions(-)
This updated image from 0.24.0 to 0.25.0 and softbuffer from 0.3.0 to 0.4.0.
At that commit, after cargo update --package softbuffer --precise 0.4.0
. things still work. With 0.4.1, I get the failure. Uhm...
Another bisect in softbuffer points at:
09b8126909031eb442a638020fb3d9062de958b9 is the first bad commit
commit 09b8126909031eb442a638020fb3d9062de958b9
Author: Uli Schlachter <[email protected]>
Date: Mon Dec 11 06:54:10 2023 +0100
x11: Check visuals for validity
A visual describes how colors are laid out by the X11 server. So far,
softbuffer did not do anything with visuals and just passed them around.
This commit adds checks that should ensure that a given visual actually
lays out pixels in the only format supported by softbuffer:
- 32 bit per pixel
- 00RRGGBB byte order
In this patch, I also try to handle big endian systems and mixed endian
situations where we are e.g. running on a big endian system and talking
to a little endian X11 server. However, this is all theoretical and
completely untested. I only tested my X11 server's default visual works
and some ARGB visual is rejected.
Fixes: https://github.com/rust-windowing/softbuffer/issues/184
Signed-off-by: Uli Schlachter <[email protected]>
Co-authored-by: John Nunley <[email protected]>
src/x11.rs | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 70 insertions(+), 1 deletion(-)
Uhm... apparently I did this. 🙈
Seems like winit uses softbuffer with some unsupported visuals.
A "fix" is:
diff --git a/examples/window.rs b/examples/window.rs
index 437d90ec..b79f75ae 100644
--- a/examples/window.rs
+++ b/examples/window.rs
@@ -132,7 +132,7 @@ impl Application {
#[allow(unused_mut)]
let mut window_attributes = Window::default_attributes()
.with_title("Winit window")
- .with_transparent(true)
+ //.with_transparent(true)
.with_window_icon(Some(self.icon.clone()));
#[cfg(any(x11_platform, wayland_platform))]
Dunno what a proper fix would be. Not use softbuffer? Talk them into supporting alpha channels (but I don't think they want to do that).
CC @notgull
from winit.
That's x11.
from winit.
Related Issues (20)
- winit 0.30 panics on exit on macOS HOT 1
- Custom cursor (from_rgba) set in response to non-CursorMoved event leads to "already borrowed" panic when resizing HOT 1
- Reintroduce ability to query use of X11 or Wayland as backend on raw `EventLoop` HOT 1
- SSH X11 forwarding seemed to be unsupported HOT 2
- Window does not close under specific conditions.
- MacOS scaled resolution possibly increases memory usage
- Application panics when reading `Window::inner_size` after X server has terminated (e.g.: on user log-out) HOT 1
- Rapid cursor movement causes frame loss HOT 3
- Semantics of getters/setters and events? HOT 4
- Keys leak through on window focus change (alt+tab) HOT 2
- Error handling on `ApplicationHandler` HOT 7
- Possible solution to keep created surface consistent
- with_decorations(false) renders titlebar after click HOT 1
- Cross-platform inconsistency in `ApplicationHandler::resumed()` HOT 2
- Softbuffer 0.4.3 fail (Visual 0x78 does not use softbuffer's pixel format and is unsupported) HOT 2
- doc: pre_present_notify feature is not documented in FEATURES.md HOT 4
- Panics if requesting a new size from the inner_size_writer inside the `WindowEvent::ScaleFactorChanged`
- Pinching on touchpad fires Ctrl key press event
- iOS: Processing non `RedrawRequested` event after the main event loop: AboutToWait HOT 2
- `EventLoopProxy::send_event` executes user events immediately in microtasks
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from winit.