orbtk icon indicating copy to clipboard operation
orbtk copied to clipboard

[FAQ] Can orbtk run like a x11 app?

Open cqh963852 opened this issue 3 years ago • 11 comments

Context

In which context or scenario will your feature/widget be used?

I am running orbtk example in wsl. I have install VcXsrv,And run x11 app successfully image

Problem description & Solution

Describe your problem and possible solution here

Is there any way I can run orbtk like a x11 app? It give an error while trying cargo run --example showcase --release

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: "No available video device"', /home/cqh/.cargo/git/checkouts/orbclient-519a630a59c70d98/904157c/src/sys/sdl2.rs:26:68

cqh963852 avatar Feb 09 '21 10:02 cqh963852

Even if I start the desktop environment, it still report an error image

cqh963852 avatar Feb 09 '21 11:02 cqh963852

Any solution? Faced the same issue in my vagrant box with X forwarding. Other apps like xclock and even this SDL2 hello world https://gist.github.com/fschr/92958222e35a823e738bb181fe045274 work just fine so it probably has something to do with how orbtk uses SDL2.

DevAlone avatar Mar 07 '21 18:03 DevAlone

As a workaround, you can use electron https://github.com/redox-os/orbtk#run-examples-with-cargo-node I know electron is a piece of crap, but it's better than nothing.

DevAlone avatar Mar 07 '21 19:03 DevAlone

I haven't changed anything in the code, just have installed a bunch of libraries while trying to investigate the issue by running a simple SDL2 example in Rust and now it works. Strange... Will try to figure out which exactly little later. Btw, what is backtrace in your case?

DevAlone avatar Mar 07 '21 20:03 DevAlone

There is a backtrace:

vagrant@ubuntu-focal:~/projects/project1$ RUST_BACKTRACE=1 cargo run
    Finished dev [unoptimized + debuginfo] target(s) in 0.07s
     Running `target/debug/project1`
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: "No available video device"', /home/vagrant/.cargo/git/checkouts/orbclient-519a630a59c70d98/8ef4433/src/sys/sdl2.rs:26:68
stack backtrace:
   0: rust_begin_unwind
             at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/std/src/panicking.rs:493:5
   1: core::panicking::panic_fmt
             at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/core/src/panicking.rs:92:14
   2: core::option::expect_none_failed
             at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/core/src/option.rs:1268:5
   3: core::result::Result<T,E>::unwrap
             at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/core/src/result.rs:973:23
   4: orbclient::sys::init
             at /home/vagrant/.cargo/git/checkouts/orbclient-519a630a59c70d98/8ef4433/src/sys/sdl2.rs:26:44
   5: orbclient::sys::Window::new_flags
             at /home/vagrant/.cargo/git/checkouts/orbclient-519a630a59c70d98/8ef4433/src/sys/sdl2.rs:149:18
   6: orbtk_shell::platform::window_builder::WindowBuilder<A>::build
             at /home/vagrant/.cargo/git/checkouts/orbtk-90d798f349c2ab56/5cf60b6/crates/shell/src/orbclient/window_builder.rs:119:22
   7: orbtk_api::application::Application::window
             at /home/vagrant/.cargo/git/checkouts/orbtk-90d798f349c2ab56/5cf60b6/crates/api/src/application/mod.rs:81:9
   8: project1::main
             at ./src/main.rs:7:5
   9: core::ops::function::FnOnce::call_once
             at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/core/src/ops/function.rs:227:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
vagrant@ubuntu-focal:~/projects/project1$ RUST_BACKTRACE=full cargo run                                                                                                                                                                     
    Finished dev [unoptimized + debuginfo] target(s) in 0.05s                                                                                                                                                                               
     Running `target/debug/project1`                                                                                                                                                                                                        
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: "No available video device"', /home/vagrant/.cargo/git/checkouts/orbclient-519a630a59c70d98/8ef4433/src/sys/sdl2.rs:26:68                                           
stack backtrace:                                                                                                                                                                                                                            
   0:     0x5613777c1fc0 - std::backtrace_rs::backtrace::libunwind::trace::h25e12e0d899beba0
                               at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/std/src/../../backtrace/src/backtrace/libunwind.rs:90:5
   1:     0x5613777c1fc0 - std::backtrace_rs::backtrace::trace_unsynchronized::h70e61195d6ae3df6
                               at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x5613777c1fc0 - std::sys_common::backtrace::_print_fmt::hba93ab80d779695a
                               at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/std/src/sys_common/backtrace.rs:67:5
   3:     0x5613777c1fc0 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hf092b5883b4b2e50
                               at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/std/src/sys_common/backtrace.rs:46:22
   4:     0x5613777df56c - core::fmt::write::hf68bc350a8f2f0dc   
                               at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/core/src/fmt/mod.rs:1078:17
   5:     0x5613777bf542 - std::io::Write::write_fmt::hf66811b1bc767436
                               at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/std/src/io/mod.rs:1517:15
   6:     0x5613777c40e5 - std::sys_common::backtrace::_print::hd425a11bfe1f20f8
                               at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/std/src/sys_common/backtrace.rs:49:5
   7:     0x5613777c40e5 - std::sys_common::backtrace::print::h6d678795c1e61e13                                                                                                                                                             
                               at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/std/src/sys_common/backtrace.rs:36:9
   8:     0x5613777c40e5 - std::panicking::default_hook::{{closure}}::h78a02a4a0dee5e7e
                               at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/std/src/panicking.rs:208:50
   9:     0x5613777c3c3a - std::panicking::default_hook::h56eb7eda02f355a7
                               at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/std/src/panicking.rs:225:9
  10:     0x5613777c4881 - std::panicking::rust_panic_with_hook::hb27ea14285131c61
                               at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/std/src/panicking.rs:591:17
  11:     0x5613777c43c7 - std::panicking::begin_panic_handler::{{closure}}::hc552fcee62aad17f
                               at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/std/src/panicking.rs:497:13
  12:     0x5613777c247c - std::sys_common::backtrace::__rust_end_short_backtrace::hb9f0aa9a78e885a0
                               at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/std/src/sys_common/backtrace.rs:141:18
  13:     0x5613777c4329 - rust_begin_unwind
                               at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/std/src/panicking.rs:493:5
  14:     0x5613777ddf21 - core::panicking::panic_fmt::h12ac4570ea43d06f
                               at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/core/src/panicking.rs:92:14
  15:     0x5613777ddd43 - core::option::expect_none_failed::h096fa60f757b7204
                               at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/core/src/option.rs:1268:5
  16:     0x56137764a653 - core::result::Result<T,E>::unwrap::h837bf4cb6fee6342
                               at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/core/src/result.rs:973:23
  17:     0x561377644543 - orbclient::sys::init::h62e614d4ab52b3a0
                               at /home/vagrant/.cargo/git/checkouts/orbclient-519a630a59c70d98/8ef4433/src/sys/sdl2.rs:26:44
  18:     0x561377644a2c - orbclient::sys::Window::new_flags::hce7b3452585e19e9
                               at /home/vagrant/.cargo/git/checkouts/orbclient-519a630a59c70d98/8ef4433/src/sys/sdl2.rs:149:18
  19:     0x5613774a67e6 - orbtk_shell::platform::window_builder::WindowBuilder<A>::build::h33917fc7f348aa1c
                               at /home/vagrant/.cargo/git/checkouts/orbtk-90d798f349c2ab56/5cf60b6/crates/shell/src/orbclient/window_builder.rs:119:22
  20:     0x561377388e42 - orbtk_api::application::Application::window::hebf0182e7b165f0e
                               at /home/vagrant/.cargo/git/checkouts/orbtk-90d798f349c2ab56/5cf60b6/crates/api/src/application/mod.rs:81:9
  21:     0x56137739f16b - project1::main::hfc78354d30a6a504
                               at /home/vagrant/projects/project1/src/main.rs:7:5
  22:     0x5613773850cb - core::ops::function::FnOnce::call_once::h4b5d66f877bb6636
                               at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/core/src/ops/function.rs:227:5
  23:     0x5613773a067e - std::sys_common::backtrace::__rust_begin_short_backtrace::hdd0dc3a3aad6e016
                               at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/std/src/sys_common/backtrace.rs:125:18
  24:     0x5613773911f1 - std::rt::lang_start::{{closure}}::h3406a64ae6cf2fe0
                               at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/std/src/rt.rs:66:18
  25:     0x5613777c4ca7 - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h78040f802d89ccdc
                               at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/core/src/ops/function.rs:259:13
  26:     0x5613777c4ca7 - std::panicking::try::do_call::h6853cad536dd09a1
                               at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/std/src/panicking.rs:379:40
  27:     0x5613777c4ca7 - std::panicking::try::h827495f03a9fbb9a
                               at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/std/src/panicking.rs:343:19
  28:     0x5613777c4ca7 - std::panic::catch_unwind::h4bdf17571090eb17
                               at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/std/src/panic.rs:396:14
  29:     0x5613777c4ca7 - std::rt::lang_start_internal::h2f319c33bb013f29
                               at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/std/src/rt.rs:51:25
  30:     0x5613773911c7 - std::rt::lang_start::h161a446a993da6b9
                               at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/std/src/rt.rs:65:5
  31:     0x56137739f1aa - main
  32:     0x7f88b37270b3 - __libc_start_main
  33:     0x5613773847ee - _start
  34:                0x0 - <unknown>

DevAlone avatar Mar 08 '21 17:03 DevAlone

I don't know what kind of magic happens here, but the I did the next and now it works.

  1. Tried to cargo run an orbtk app, got this no video device error
  2. Built another simple project with sdl and to do that I also installed build-essential, cmake and libsdl2-dev
[dependencies]
sdl2 = "0.34.3"

main.rs:

extern crate sdl2;                                                                                                                                                                                                                          
                                                                                                                                                                                                                                            
use sdl2::event::Event;                                                                                                                                                                                                                     
use sdl2::keyboard::Keycode;                                                                                                                                                                                                                
use sdl2::pixels::Color;                                                                                                                                                                                                                    
use std::time::Duration;                                                                                                                                                                                                                    

pub fn main() -> Result<(), String> {
    let sdl_context = sdl2::init()?;
    let video_subsystem = sdl_context.video()?;

    let window = video_subsystem
        .window("rust-sdl2 demo: Video", 800, 600)
        .position_centered()
        .opengl()
        .build()
        .map_err(|e| e.to_string())?;

    let mut canvas = window.into_canvas().build().map_err(|e| e.to_string())?;

    canvas.set_draw_color(Color::RGB(255, 0, 0));
    canvas.clear();
    canvas.present();
    let mut event_pump = sdl_context.event_pump()?;

    'running: loop {
        for event in event_pump.poll_iter() {
            match event {
                Event::Quit { .. }
                | Event::KeyDown {
                    keycode: Some(Keycode::Escape),
                    ..
                } => break 'running,
                _ => {}
            }
        }

        canvas.clear();
        canvas.present();
        ::std::thread::sleep(Duration::new(0, 1_000_000_000u32 / 30));
        // The rest of the game loop goes here...
    }

    Ok(())
}
  1. The orbtk project still doesn't work
  2. Removed Cargo.lock and target
  3. Rebuilt the orbtk project
  4. It magically works now

DevAlone avatar Mar 08 '21 18:03 DevAlone

For anybody who wants to investigate the issue further, you can reproduce it by following the next steps:

  1. Create a Vagrant box with the next config:
Vagrant.configure("2") do |config|
  config.vm.box = "ubuntu/focal64"
  config.ssh.shell = "sh"

  config.vm.provider "virtualbox" do |vb|
    vb.memory = "4096"
    vb.cpus = "12"
  end

  config.ssh.forward_agent = true
  config.ssh.forward_x11 = true
end

I just copied mine, the only important things are OS and ssh X forwarding.

  1. Install rust by curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
  2. Create a simple orbtk app
[dependencies]
orbtk = { git = "https://github.com/redox-os/orbtk.git", branch= "develop" }

main.rs:

use orbtk::prelude::*;

fn main() {
    // use this only if you want to run it as web application.
    orbtk::initialize();

    Application::new()
        .window(|ctx| {
            Window::new()
                .title("OrbTk - minimal example")
                .position((100.0, 100.0))
                .size(420.0, 730.0)
                .child(TextBlock::new().text("OrbTk").build(ctx))
                .build(ctx)
        })
        .run();
}
  1. Try to cargo run it and get the "No available video device" error

DevAlone avatar Mar 08 '21 18:03 DevAlone

I have the same error for a simple hello world, but can't fix it. SDL2 does not seem to load X11 correctly.

Same issue as https://github.com/redox-os/orbtk/issues/431 , which also was resolved magically.

I am on: Ubuntu 20.04.3 LTS Linux home 5.11.0-34-generic #36~20.04.1-Ubuntu SMP Fri Aug 27 08:06:32 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

$ dpkg -l libx11-dev libsdl2-2.0-0 libsdl2-dev libxkbcommon-dev libwayland-dev libx11-6
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                   Version            Architecture Description
+++-======================-==================-============-=========================================================
ii  libsdl2-2.0-0:amd64    2.0.10+dfsg1-3     amd64        Simple DirectMedia Layer
ii  libsdl2-dev:amd64      2.0.10+dfsg1-3     amd64        Simple DirectMedia Layer development files
ii  libwayland-dev:amd64   1.18.0-1           amd64        wayland compositor infrastructure - development files
ii  libx11-6:amd64         2:1.6.9-2ubuntu1.2 amd64        X11 client-side library
ii  libx11-6:i386          2:1.6.9-2ubuntu1.2 i386         X11 client-side library
ii  libx11-dev:amd64       2:1.6.9-2ubuntu1.2 amd64        X11 client-side library (development headers)
ii  libxkbcommon-dev:amd64 0.10.0-1           amd64        library interface to the XKB compiler - development files

I tried to build https://wiki.libsdl.org/Installation manually, but with the standard ../configure I run into a non usable desktop environment.

I just try to cargo run the minimal example:

use orbtk::prelude::*;

fn main() {
      Application::new()
        .window(|ctx| {
            Window::new()
                .title("OrbTk - minimal example")
                .position((100.0, 100.0))
                .size(420.0, 730.0)
                .child(TextBlock::new().text("OrbTk").build(ctx))
                .build(ctx)
        })
        .run();
}

Cargo.toml

[dependencies]
# orbtk = "0.2.31"
# orbtk = "0.3.1-alpha3"
orbtk = { git = "https://github.com/redox-os/orbtk.git", branch = "develop" }

If I try to run the showcase.rs example on develop (4479802ae45712383f50b1677c06cedc9cd4df0d), I run into (libxext-dev is installed):

sebastian@home:~/develop/rust/orbtk/orbtk/examples$ cargo run --example showcase
warning: profiles for the non root package will be ignored, specify profiles at the workspace root:
package:   /home/sebastian/develop/rust/orbtk/orbtk/Cargo.toml
workspace: /home/sebastian/develop/rust/orbtk/Cargo.toml
   Compiling sdl2-sys v0.34.5
error: failed to run custom build command for `sdl2-sys v0.34.5`

Caused by:
  process didn't exit successfully: `/home/sebastian/develop/rust/orbtk/target/debug/build/sdl2-sys-4a9723b1def6bd86/build-script-build` (exit status: 101)
  --- stdout
  running: "cmake" "/home/sebastian/develop/rust/orbtk/target/debug/build/sdl2-sys-f194a1df18ae280e/out/SDL2-2.0.14" "-DSDL_SHARED=OFF" "-DSDL_STATIC=ON" "-DCMAKE_INSTALL_PREFIX=/home/sebastian/develop/rust/orbtk/target/debug/build/sdl2-sys-f194a1df18ae280e/out" "-DCMAKE_C_FLAGS= -D__FLTUSED__ -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_C_COMPILER=/usr/bin/cc" "-DCMAKE_CXX_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_CXX_COMPILER=/usr/bin/c++" "-DCMAKE_ASM_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_ASM_COMPILER=/usr/bin/cc" "-DCMAKE_BUILD_TYPE=release"
  -- Checking for module 'jack'
  --   No package 'jack' found
  -- dynamic libpulse-simple -> libpulse-simple.so.0
  -- Checking for module 'esound'
  --   No package 'esound' found
  -- Checking for modules 'bcm_host;brcmegl'
  --   No package 'bcm_host' found
  --   No package 'brcmegl' found
  -- dynamic libX11 -> libX11.so.6
  -- dynamic libXext -> libXext.so.6
  -- dynamic libXcursor -> libXcursor.so.1
  -- dynamic libXinerama -> libXinerama.so.1
  -- dynamic libXi -> libXi.so.6
  -- dynamic libXrandr -> libXrandr.so.2
  -- dynamic libXrender -> libXrender.so.1
  -- dynamic libXss -> libXss.so.1
  -- dynamic libXxf86vm -> libXxf86vm.so.1
  -- Configuring incomplete, errors occurred!
  See also "/home/sebastian/develop/rust/orbtk/target/debug/build/sdl2-sys-f194a1df18ae280e/out/build/CMakeFiles/CMakeOutput.log".
  See also "/home/sebastian/develop/rust/orbtk/target/debug/build/sdl2-sys-f194a1df18ae280e/out/build/CMakeFiles/CMakeError.log".

  --- stderr
  CMake Error at cmake/macros.cmake:28 (message):
    *** ERROR: Missing Xext.h, maybe you need to install the libxext-dev
    package?
  Call Stack (most recent call first):
    cmake/sdlchecks.cmake:413 (message_error)
    CMakeLists.txt:1177 (CheckX11)


  thread 'main' panicked at '
  command did not execute successfully, got: exit status: 1

  build script failed, must exit now', /home/sebastian/.cargo/registry/src/github.com-1ecc6299db9ec823/cmake-0.1.45/src/lib.rs:894:5
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

libxext-dev version:

$ dpkg -l libxext-dev
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name              Version          Architecture Description
+++-=================-================-============-==========================================================
ii  libxext-dev:amd64 2:1.3.4-0ubuntu1 amd64        X11 miscellaneous extensions library (development headers)

Xext.h is present:

$ ls -alF /usr/include/X11/extensions
total 1004
drwxr-xr-x  2 root root  4096 Sep  7 19:50 ./
drwxr-xr-x 11 root root  4096 Sep  6 16:57 ../
-rw-r--r--  1 root root  1705 Mär  9  2020 ag.h
-rw-r--r--  1 root root  5005 Mär  9  2020 agproto.h
-rw-r--r--  1 root root  2900 Mär  9  2020 applewmconst.h
-rw-r--r--  1 root root  8098 Mär  9  2020 applewmproto.h
-rw-r--r--  1 root root  1909 Mär  9  2020 bigreqsproto.h
-rw-r--r--  1 root root   187 Mär  9  2020 bigreqstr.h
-rw-r--r--  1 root root  3130 Mär  9  2020 composite.h
-rw-r--r--  1 root root  5462 Mär  9  2020 compositeproto.h
-rw-r--r--  1 root root  1353 Mär  9  2020 cup.h
-rw-r--r--  1 root root  3065 Mär  9  2020 cupproto.h
-rw-r--r--  1 root root  3615 Mär  9  2020 damageproto.h
-rw-r--r--  1 root root  1893 Mär  9  2020 damagewire.h
-rw-r--r--  1 root root  2159 Mär  9  2020 dbe.h
-rw-r--r--  1 root root  7343 Mär  9  2020 dbeproto.h
-rw-r--r--  1 root root  2373 Mär  9  2020 dmx.h
-rw-r--r--  1 root root 13343 Mär  9  2020 dmxproto.h
-rw-r--r--  1 root root  1714 Mär  9  2020 dpmsconst.h
-rw-r--r--  1 root root  2161 Aug 24  2019 dpms.h
-rw-r--r--  1 root root  4687 Mär  9  2020 dpmsproto.h
-rw-r--r--  1 root root  8318 Mär  9  2020 dri2proto.h
-rw-r--r--  1 root root  2468 Mär  9  2020 dri2tokens.h
-rw-r--r--  1 root root  6129 Mär  9  2020 dri3proto.h
-rw-r--r--  1 root root  1563 Mär  9  2020 EVI.h
-rw-r--r--  1 root root  3006 Mär  9  2020 EVIproto.h
-rw-r--r--  1 root root  6096 Aug 24  2019 extutil.h
-rw-r--r--  1 root root  1782 Mär  9  2020 ge.h
-rw-r--r--  1 root root  2351 Mär  9  2020 geproto.h
-rw-r--r--  1 root root  2236 Mär  9  2020 lbx.h
-rw-r--r--  1 root root 24782 Mär  9  2020 lbxproto.h
-rw-r--r--  1 root root  1509 Mär  9  2020 mitmiscconst.h
-rw-r--r--  1 root root  1741 Aug 24  2019 MITMisc.h
-rw-r--r--  1 root root  2229 Mär  9  2020 mitmiscproto.h
-rw-r--r--  1 root root  2575 Mär  9  2020 multibufconst.h
-rw-r--r--  1 root root  5835 Aug 24  2019 multibuf.h
-rw-r--r--  1 root root  8600 Mär  9  2020 multibufproto.h
-rw-r--r--  1 root root  2893 Feb  8  2019 panoramiXext.h
-rw-r--r--  1 root root  5473 Mär  9  2020 panoramiXproto.h
-rw-r--r--  1 root root  5409 Mär  9  2020 presentproto.h
-rw-r--r--  1 root root  3597 Mär  9  2020 presenttokens.h
-rw-r--r--  1 root root  6909 Mär  9  2020 randr.h
-rw-r--r--  1 root root 25751 Mär  9  2020 randrproto.h
-rw-r--r--  1 root root  2064 Mär  9  2020 recordconst.h
-rw-r--r--  1 root root  7634 Mär  9  2020 recordproto.h
-rw-r--r--  1 root root   258 Mär  9  2020 recordstr.h
-rw-r--r--  1 root root  6933 Mär  9  2020 render.h
-rw-r--r--  1 root root 13218 Mär  9  2020 renderproto.h
-rw-r--r--  1 root root  1900 Mär  9  2020 saver.h
-rw-r--r--  1 root root  5132 Mär  9  2020 saverproto.h
-rw-r--r--  1 root root  4217 Sep  6  2018 scrnsaver.h
-rw-r--r--  1 root root  2141 Mär  9  2020 secur.h
-rw-r--r--  1 root root  2457 Aug 24  2019 security.h
-rw-r--r--  1 root root  3177 Mär  9  2020 securproto.h
-rw-r--r--  1 root root  1878 Mär  9  2020 shapeconst.h
-rw-r--r--  1 root root  4133 Aug 24  2019 shape.h
-rw-r--r--  1 root root  6730 Mär  9  2020 shapeproto.h
-rw-r--r--  1 root root   252 Mär  9  2020 shapestr.h
-rw-r--r--  1 root root  1645 Mär  9  2020 shm.h
-rw-r--r--  1 root root  6045 Mär  9  2020 shmproto.h
-rw-r--r--  1 root root  2123 Mär  9  2020 shmstr.h
-rw-r--r--  1 root root  6750 Mär  9  2020 syncconst.h
-rw-r--r--  1 root root  9676 Aug 24  2019 sync.h
-rw-r--r--  1 root root 11001 Mär  9  2020 syncproto.h
-rw-r--r--  1 root root  5606 Mär  9  2020 syncstr.h
-rw-r--r--  1 root root  2377 Aug 24  2019 Xag.h
-rw-r--r--  1 root root  3057 Mär  9  2020 xcmiscproto.h
-rw-r--r--  1 root root   185 Mär  9  2020 xcmiscstr.h
-rw-r--r--  1 root root  1710 Aug 24  2019 Xcup.h
-rw-r--r--  1 root root  4170 Aug 24  2019 Xdbe.h
-rw-r--r--  1 root root  2130 Aug 24  2019 XEVI.h
-rw-r--r--  1 root root  1655 Aug 24  2019 Xext.h
-rw-r--r--  1 root root   414 Mär  9  2020 xf86bigfont.h
-rw-r--r--  1 root root  2544 Mär  9  2020 xf86bigfproto.h
-rw-r--r--  1 root root   191 Mär  9  2020 xf86bigfstr.h
-rw-r--r--  1 root root   931 Mär  9  2020 xf86dga1const.h
-rw-r--r--  1 root root  4506 Mär  9  2020 xf86dga1proto.h
-rw-r--r--  1 root root   191 Mär  9  2020 xf86dga1str.h
-rw-r--r--  1 root root  2533 Mär  9  2020 xf86dgaconst.h
-rw-r--r--  1 root root   369 Mär  9  2020 xf86dga.h
-rw-r--r--  1 root root  7106 Mär  9  2020 xf86dgaproto.h
-rw-r--r--  1 root root   188 Mär  9  2020 xf86dgastr.h
-rw-r--r--  1 root root  2106 Mär  9  2020 xf86vm.h
-rw-r--r--  1 root root  7619 Sep  1  2019 xf86vmode.h
-rw-r--r--  1 root root 15700 Mär  9  2020 xf86vmproto.h
-rw-r--r--  1 root root   185 Mär  9  2020 xf86vmstr.h
-rw-r--r--  1 root root  7588 Apr 14  2020 Xfixes.h
-rw-r--r--  1 root root 12752 Mär  9  2020 xfixesproto.h
-rw-r--r--  1 root root  5396 Mär  9  2020 xfixeswire.h
-rw-r--r--  1 root root  1927 Aug 24  2019 Xge.h
-rw-r--r--  1 root root 10542 Mär  9  2020 XI2.h
-rw-r--r--  1 root root 37577 Mär  9  2020 XI2proto.h
-rw-r--r--  1 root root  9823 Mär  9  2020 XI.h
-rw-r--r--  1 root root  1964 Feb  8  2019 Xinerama.h
-rw-r--r--  1 root root 18788 Aug 24  2019 XInput2.h
-rw-r--r--  1 root root 36014 Aug 24  2019 XInput.h
-rw-r--r--  1 root root 41010 Mär  9  2020 XIproto.h
-rw-r--r--  1 root root 15808 Mai 19 19:07 XKBgeom.h
-rw-r--r--  1 root root 28211 Mär  9  2020 XKB.h
-rw-r--r--  1 root root 29105 Mär  9  2020 XKBproto.h
-rw-r--r--  1 root root 28018 Mär  9  2020 XKBsrv.h
-rw-r--r--  1 root root 19630 Mär  9  2020 XKBstr.h
-rw-r--r--  1 root root  1601 Aug 24  2019 XLbx.h
-rw-r--r--  1 root root 17120 Aug 24  2019 Xrandr.h
-rw-r--r--  1 root root 12805 Dez  5  2016 Xrender.h
-rw-r--r--  1 root root  5168 Mär  9  2020 XResproto.h
-rw-r--r--  1 root root  3735 Aug 24  2019 XShm.h
-rw-r--r--  1 root root  1392 Mär  9  2020 xtestconst.h
-rw-r--r--  1 root root  5439 Mär  9  2020 xtestext1const.h
-rw-r--r--  1 root root  3708 Aug 24  2019 xtestext1.h
-rw-r--r--  1 root root  7790 Mär  9  2020 xtestext1proto.h
-rw-r--r--  1 root root  3254 Mär  9  2020 xtestproto.h
-rw-r--r--  1 root root  3027 Mär  9  2020 Xv.h
-rw-r--r--  1 root root 10991 Dez  5  2016 Xvlib.h
-rw-r--r--  1 root root  3620 Mär  9  2020 XvMC.h
-rw-r--r--  1 root root  4484 Mär  9  2020 XvMCproto.h
-rw-r--r--  1 root root 12109 Mär  9  2020 Xvproto.h

swiesend avatar Sep 07 '21 17:09 swiesend

I think this may be related, as some cmake SDL checks seem to be done only once: https://discourse.urho3d.io/t/missing-xext-h-on-linux-mint-18-3/4025

Ok, so this really did the trick:

$ cargo clean
$ cargo build --examples

After that I ran into the problem of not running the examples from the root folder, as the showcase example uses a relative path to the root for the assets:

$ cargo run --example showcase
warning: profiles for the non root package will be ignored, specify profiles at the workspace root:
package:   /home/sebastian/develop/rust/orbtk/orbtk/Cargo.toml
workspace: /home/sebastian/develop/rust/orbtk/Cargo.toml
    Finished dev [unoptimized + debuginfo] target(s) in 0.07s
     Running `/home/sebastian/develop/rust/orbtk/target/debug/examples/showcase`
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: "Could not load image width path: \"orbtk/examples/assets/showcase/orbtk_logo.png\""', orbtk_tinyskia/src/tinyskia/image.rs:104:50
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Running from orbtk's root works, fine:

$ cargo run --example showcase
warning: profiles for the non root package will be ignored, specify profiles at the workspace root:
package:   /home/sebastian/develop/rust/orbtk/orbtk/Cargo.toml
workspace: /home/sebastian/develop/rust/orbtk/Cargo.toml
    Finished dev [unoptimized + debuginfo] target(s) in 0.09s
     Running `target/debug/examples/showcase`

gnome-shell-screenshot-3GGC90

swiesend avatar Sep 07 '21 18:09 swiesend

The showcase example works, but:

  • is slow (there is a huge delay of events)
  • the mouse cursor doesn't match the position within the window
  • resizing the window results in temporary glitches, when slowing down resizing. Once resized the components are rendered fine.

swiesend avatar Sep 07 '21 18:09 swiesend

@swiesend

sorry, quite delayed answer. But there will be a huge performance boot, once you compile with the --release profile. Please consider using branch develop, which is heading towards 0.3.1-alpha4 ...

$ cargo run --release --example showcase

rzerres avatar Jan 31 '22 12:01 rzerres