Giter Club home page Giter Club logo

Comments (2)

psychon avatar psychon commented on June 2, 2024 1

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.

kchibisov avatar kchibisov commented on June 2, 2024

That's x11.

from winit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.