Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to current-ish glazier. #118

Merged
merged 1 commit into from
Sep 11, 2023

Conversation

waywardmonkeys
Copy link
Contributor

This helps pave the way for updating Xilem to use pointer events.

Copy link
Contributor

@Philipp-M Philipp-M left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems straight-forward, LGTM, thanks!

@waywardmonkeys
Copy link
Contributor Author

I'd like to hear from someone that uses Unix... I've only run the basic example on Windows so far.

@waywardmonkeys
Copy link
Contributor Author

(I'm not in a big rush here as I'm looking at linebender/glazier#127...)

@Philipp-M
Copy link
Contributor

Philipp-M commented Jul 31, 2023

I'd like to hear from someone that uses Unix... I've only run the basic example on Windows so far.

Yeah, tested it on NixOS (Linux), so only OSX is remaining (and web) I guess?

@waywardmonkeys
Copy link
Contributor Author

Trying it out on macOS now.

@waywardmonkeys
Copy link
Contributor Author

Well, that's interesting.

On my (old-ish, x86_64) MacBook Pro, prior to the update, the example runs okay (not great). After the update, it is noticeably laggy and performs poorly.

I did install a system update today, so the system is still cleaning up after that and running a long backup cycle, but it doesn't feel like this is the reason.

If I run an example from the glazier repo, it runs fine. Running the vello with_winit example performs okay (and remains responsive, not laggy), but obviously, that's not using glazier.

@waywardmonkeys
Copy link
Contributor Author

Okay, the macOS issue is related to this commit by @lord: linebender/glazier@58cd5a4

In src/app_main.rs, we have:

    // TODO: temporary hack
    fn idle(&mut self, _: IdleToken) {
        self.app.paint();
        self.render();
        self.schedule_render();
    }

And below that:

    #[cfg(target_os = "macos")]
    fn schedule_render(&self) {
        self.handle
            .get_idle_handle()
            .unwrap()
            .schedule_idle(IdleToken::new(0));
    }

    #[cfg(not(target_os = "macos"))]
    fn schedule_render(&self) {
        self.handle.invalidate();
    }

And in the patch linked above, that was changed to remove most of that ... Making a similar update here fixes the macOS performance issue.

This is a good argument for updating Glazier more often here. :)

@waywardmonkeys
Copy link
Contributor Author

@Philipp-M The updated changes now work on both macOS and Windows. Can you give it another shot on Linux when you have the chance, please?

@Philipp-M
Copy link
Contributor

It panics now unfortunately:

Backtrace
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', /home/philm/.cargo/git/checkouts/glazier-3a172f69e2427c5a/04f71ee/src/backend/linux/menu.rs:16:52
stack backtrace:
   0:     0x55d41ddbb611 - std::backtrace_rs::backtrace::libunwind::trace::h757b492de7e38f51
                               at /rustc/500647fd8138cc09e87edb08d62f81654fbf6ef8/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x55d41ddbb611 - std::backtrace_rs::backtrace::trace_unsynchronized::he91e3190ab8d9c4f
                               at /rustc/500647fd8138cc09e87edb08d62f81654fbf6ef8/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x55d41ddbb611 - std::sys_common::backtrace::_print_fmt::h6e24477d644418e5
                               at /rustc/500647fd8138cc09e87edb08d62f81654fbf6ef8/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x55d41ddbb611 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h3878e1514fe266c9
                               at /rustc/500647fd8138cc09e87edb08d62f81654fbf6ef8/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x55d41dde778c - core::fmt::rt::Argument::fmt::h407ed1ed725edf0f
                               at /rustc/500647fd8138cc09e87edb08d62f81654fbf6ef8/library/core/src/fmt/rt.rs:138:9
   5:     0x55d41dde778c - core::fmt::write::h80ad66db775b495e
                               at /rustc/500647fd8138cc09e87edb08d62f81654fbf6ef8/library/core/src/fmt/mod.rs:1094:21
   6:     0x55d41ddb842e - std::io::Write::write_fmt::h535bb7b7a3791561
                               at /rustc/500647fd8138cc09e87edb08d62f81654fbf6ef8/library/std/src/io/mod.rs:1714:15
   7:     0x55d41ddbb425 - std::sys_common::backtrace::_print::hb86dcc235566a2df
                               at /rustc/500647fd8138cc09e87edb08d62f81654fbf6ef8/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x55d41ddbb425 - std::sys_common::backtrace::print::h720885d4d12f3280
                               at /rustc/500647fd8138cc09e87edb08d62f81654fbf6ef8/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x55d41ddbcbba - std::panicking::panic_hook_with_disk_dump::{{closure}}::h760a0ce73306965a
                               at /rustc/500647fd8138cc09e87edb08d62f81654fbf6ef8/library/std/src/panicking.rs:278:22
  10:     0x55d41ddbc853 - std::panicking::panic_hook_with_disk_dump::hd7987642ef347005
                               at /rustc/500647fd8138cc09e87edb08d62f81654fbf6ef8/library/std/src/panicking.rs:312:9
  11:     0x55d41ddbd1bb - std::panicking::default_hook::h98655ae08b3c983e
                               at /rustc/500647fd8138cc09e87edb08d62f81654fbf6ef8/library/std/src/panicking.rs:239:5
  12:     0x55d41ddbd1bb - std::panicking::rust_panic_with_hook::h917efb61d3f92bd6
                               at /rustc/500647fd8138cc09e87edb08d62f81654fbf6ef8/library/std/src/panicking.rs:729:13
  13:     0x55d41ddbd071 - std::panicking::begin_panic_handler::{{closure}}::haad6fd7fd7304435
                               at /rustc/500647fd8138cc09e87edb08d62f81654fbf6ef8/library/std/src/panicking.rs:619:13
  14:     0x55d41ddbba76 - std::sys_common::backtrace::__rust_end_short_backtrace::hfe68e06c05b03ef8
                               at /rustc/500647fd8138cc09e87edb08d62f81654fbf6ef8/library/std/src/sys_common/backtrace.rs:151:18
  15:     0x55d41ddbce02 - rust_begin_unwind
                               at /rustc/500647fd8138cc09e87edb08d62f81654fbf6ef8/library/std/src/panicking.rs:617:5
  16:     0x55d41d032e03 - core::panicking::panic_fmt::h17205bc5f2d82306
                               at /rustc/500647fd8138cc09e87edb08d62f81654fbf6ef8/library/core/src/panicking.rs:67:14
  17:     0x55d41d032e93 - core::panicking::panic::hc2c5fbfc857d41ce
                               at /rustc/500647fd8138cc09e87edb08d62f81654fbf6ef8/library/core/src/panicking.rs:117:5
  18:     0x55d41dbc4055 - core::option::Option<T>::unwrap::h378e91b113d681a4
                               at /rustc/500647fd8138cc09e87edb08d62f81654fbf6ef8/library/core/src/option.rs:935:21
  19:     0x55d41db84b73 - glazier::backend::linux::menu::Menu::new::haffd20e3e808de5f
                               at /home/philm/.cargo/git/checkouts/glazier-3a172f69e2427c5a/04f71ee/src/backend/linux/menu.rs:16:19
  20:     0x55d41db6fc76 - glazier::menu::Menu::new::hfd9f0060fa3cb1f1
                               at /home/philm/.cargo/git/checkouts/glazier-3a172f69e2427c5a/04f71ee/src/menu.rs:33:14
  21:     0x55d41d044684 - xilem::app_main::AppLauncher<T,V>::run::h4aad56f7506e841a
                               at /home/philm/dev/personal/rust/xilem/src/app_main.rs:66:29
  22:     0x55d41d047abc - hello::main::h955866ddfe8a9fd8
                               at /home/philm/dev/personal/rust/xilem/examples/hello.rs:44:5
  23:     0x55d41d06329b - core::ops::function::FnOnce::call_once::h69b8fc705dc9baf4
                               at /rustc/500647fd8138cc09e87edb08d62f81654fbf6ef8/library/core/src/ops/function.rs:250:5
  24:     0x55d41d053d1e - std::sys_common::backtrace::__rust_begin_short_backtrace::h4a05a4590e04554f
                               at /rustc/500647fd8138cc09e87edb08d62f81654fbf6ef8/library/std/src/sys_common/backtrace.rs:135:18
  25:     0x55d41d055320 - std::rt::lang_start::{{closure}}::h5b12d89126b13c32
                               at /rustc/500647fd8138cc09e87edb08d62f81654fbf6ef8/library/std/src/rt.rs:166:18
  26:     0x55d41ddb2f3b - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h99e95060f43c78ac
                               at /rustc/500647fd8138cc09e87edb08d62f81654fbf6ef8/library/core/src/ops/function.rs:284:13
  27:     0x55d41ddb2f3b - std::panicking::try::do_call::h3cef1827405a2577
                               at /rustc/500647fd8138cc09e87edb08d62f81654fbf6ef8/library/std/src/panicking.rs:524:40
  28:     0x55d41ddb2f3b - std::panicking::try::h5d8d821f0335baae
                               at /rustc/500647fd8138cc09e87edb08d62f81654fbf6ef8/library/std/src/panicking.rs:488:19
  29:     0x55d41ddb2f3b - std::panic::catch_unwind::ha5463415e12f4a65
                               at /rustc/500647fd8138cc09e87edb08d62f81654fbf6ef8/library/std/src/panic.rs:142:14
  30:     0x55d41ddb2f3b - std::rt::lang_start_internal::{{closure}}::hc512939764d89660
                               at /rustc/500647fd8138cc09e87edb08d62f81654fbf6ef8/library/std/src/rt.rs:148:48
  31:     0x55d41ddb2f3b - std::panicking::try::do_call::h0a008eb3dff59911
                               at /rustc/500647fd8138cc09e87edb08d62f81654fbf6ef8/library/std/src/panicking.rs:524:40
  32:     0x55d41ddb2f3b - std::panicking::try::h3e4b5db018856531
                               at /rustc/500647fd8138cc09e87edb08d62f81654fbf6ef8/library/std/src/panicking.rs:488:19
  33:     0x55d41ddb2f3b - std::panic::catch_unwind::h32073ca401bac123
                               at /rustc/500647fd8138cc09e87edb08d62f81654fbf6ef8/library/std/src/panic.rs:142:14
  34:     0x55d41ddb2f3b - std::rt::lang_start_internal::h99c8b71e273ffd0a
                               at /rustc/500647fd8138cc09e87edb08d62f81654fbf6ef8/library/std/src/rt.rs:148:20
  35:     0x55d41d0552fa - std::rt::lang_start::h01bcd67651c9bd38
                               at /rustc/500647fd8138cc09e87edb08d62f81654fbf6ef8/library/std/src/rt.rs:165:17
  36:     0x55d41d047aee - main
  37:     0x7f4080f6bace - __libc_start_call_main
  38:     0x7f4080f6bb89 - __libc_start_main@@GLIBC_2.34
  39:     0x55d41d033655 - _start
  40:                0x0 - <unknown>

@DJMcNab
Copy link
Member

DJMcNab commented Jul 31, 2023

That panic is kind of unavoidable with Glazier's current design of Menu as something backend specific. Menu code must be moved to after Application::new

I think we might end up with a straightforward AOS Menus type eventually, such that menus are not backend specific, or else they could require an Application reference.

@waywardmonkeys
Copy link
Contributor Author

Why didn’t that panic before then?

@DJMcNab
Copy link
Member

DJMcNab commented Aug 1, 2023

Because we only had one backend enabled at a time before, so there wasn't the ambiguity of which kind of menu needed to be created.

This is an API design problem in glazier - similar to the monitors API.

@waywardmonkeys
Copy link
Contributor Author

Okay, I understand now.

I've pushed an update to move the construction around a bit that should fix this panic for now.

@Philipp-M / @DJMcNab if either of you can confirm that it no longer crashes on Linux, then we can merge this?

@Philipp-M
Copy link
Contributor

Just tested it, while not panicking straight away, input didn't work (clicking) and after I have resized the window a little bit this panic came:

Backtrace
     Running `target/debug/examples/hello`
insert spacing 20
insert spacing 0
paint child!
paint child!
paint child!
paint child!
insert spacing 20
insert spacing 0
insert spacing 20
insert spacing 0
insert spacing 20
insert spacing 0
insert spacing 20
insert spacing 0
insert spacing 20
insert spacing 0
insert spacing 20
insert spacing 0
thread 'main' panicked at 'failed to acquire next swapchain texture: Outdated', /home/philm/dev/personal/rust/xilem/src/app_main.rs:226:18
stack backtrace:
   0:     0x55dcb6e3b611 - std::backtrace_rs::backtrace::libunwind::trace::h757b492de7e38f51
                               at /rustc/500647fd8138cc09e87edb08d62f81654fbf6ef8/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x55dcb6e3b611 - std::backtrace_rs::backtrace::trace_unsynchronized::he91e3190ab8d9c4f
                               at /rustc/500647fd8138cc09e87edb08d62f81654fbf6ef8/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x55dcb6e3b611 - std::sys_common::backtrace::_print_fmt::h6e24477d644418e5
                               at /rustc/500647fd8138cc09e87edb08d62f81654fbf6ef8/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x55dcb6e3b611 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h3878e1514fe266c9
                               at /rustc/500647fd8138cc09e87edb08d62f81654fbf6ef8/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x55dcb6e6778c - core::fmt::rt::Argument::fmt::h407ed1ed725edf0f
                               at /rustc/500647fd8138cc09e87edb08d62f81654fbf6ef8/library/core/src/fmt/rt.rs:138:9
   5:     0x55dcb6e6778c - core::fmt::write::h80ad66db775b495e
                               at /rustc/500647fd8138cc09e87edb08d62f81654fbf6ef8/library/core/src/fmt/mod.rs:1094:21
   6:     0x55dcb6e3842e - std::io::Write::write_fmt::h535bb7b7a3791561
                               at /rustc/500647fd8138cc09e87edb08d62f81654fbf6ef8/library/std/src/io/mod.rs:1714:15
   7:     0x55dcb6e3b425 - std::sys_common::backtrace::_print::hb86dcc235566a2df
                               at /rustc/500647fd8138cc09e87edb08d62f81654fbf6ef8/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x55dcb6e3b425 - std::sys_common::backtrace::print::h720885d4d12f3280
                               at /rustc/500647fd8138cc09e87edb08d62f81654fbf6ef8/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x55dcb6e3cbba - std::panicking::panic_hook_with_disk_dump::{{closure}}::h760a0ce73306965a
                               at /rustc/500647fd8138cc09e87edb08d62f81654fbf6ef8/library/std/src/panicking.rs:278:22
  10:     0x55dcb6e3c853 - std::panicking::panic_hook_with_disk_dump::hd7987642ef347005
                               at /rustc/500647fd8138cc09e87edb08d62f81654fbf6ef8/library/std/src/panicking.rs:312:9
  11:     0x55dcb6e3d1bb - std::panicking::default_hook::h98655ae08b3c983e
                               at /rustc/500647fd8138cc09e87edb08d62f81654fbf6ef8/library/std/src/panicking.rs:239:5
  12:     0x55dcb6e3d1bb - std::panicking::rust_panic_with_hook::h917efb61d3f92bd6
                               at /rustc/500647fd8138cc09e87edb08d62f81654fbf6ef8/library/std/src/panicking.rs:729:13
  13:     0x55dcb6e3d0b7 - std::panicking::begin_panic_handler::{{closure}}::haad6fd7fd7304435
                               at /rustc/500647fd8138cc09e87edb08d62f81654fbf6ef8/library/std/src/panicking.rs:621:13
  14:     0x55dcb6e3ba76 - std::sys_common::backtrace::__rust_end_short_backtrace::hfe68e06c05b03ef8
                               at /rustc/500647fd8138cc09e87edb08d62f81654fbf6ef8/library/std/src/sys_common/backtrace.rs:151:18
  15:     0x55dcb6e3ce02 - rust_begin_unwind
                               at /rustc/500647fd8138cc09e87edb08d62f81654fbf6ef8/library/std/src/panicking.rs:617:5
  16:     0x55dcb60b2e03 - core::panicking::panic_fmt::h17205bc5f2d82306
                               at /rustc/500647fd8138cc09e87edb08d62f81654fbf6ef8/library/core/src/panicking.rs:67:14
  17:     0x55dcb60b3353 - core::result::unwrap_failed::h722ddda03a9150a7
                               at /rustc/500647fd8138cc09e87edb08d62f81654fbf6ef8/library/core/src/result.rs:1651:5
  18:     0x55dcb60bb27c - core::result::Result<T,E>::expect::h76d4c6dfaaaef148
                               at /rustc/500647fd8138cc09e87edb08d62f81654fbf6ef8/library/core/src/result.rs:1033:23
  19:     0x55dcb60c423a - xilem::app_main::MainState<T,V>::render::hfb3e991d2a573767
                               at /home/philm/dev/personal/rust/xilem/src/app_main.rs:223:35
  20:     0x55dcb60c51c0 - <xilem::app_main::MainState<T,V> as glazier::window::WinHandler>::paint::h276e38ff7cd8f5e8
                               at /home/philm/dev/personal/rust/xilem/src/app_main.rs:102:9
  21:     0x55dcb6c778c8 - glazier::backend::x11::window::Window::render::{{closure}}::h73ca02f230de6138
                               at /home/philm/.cargo/git/checkouts/glazier-3a172f69e2427c5a/04f71ee/src/backend/x11/window.rs:584:13
  22:     0x55dcb6c75975 - glazier::backend::x11::window::Window::with_handler_and_dont_check_the_other_borrows::hfc5371e51b476bd1
                               at /home/philm/.cargo/git/checkouts/glazier-3a172f69e2427c5a/04f71ee/src/backend/x11/window.rs:521:31
  23:     0x55dcb6c77834 - glazier::backend::x11::window::Window::render::he95b27ffa26e23a9
                               at /home/philm/.cargo/git/checkouts/glazier-3a172f69e2427c5a/04f71ee/src/backend/x11/window.rs:583:9
  24:     0x55dcb6c7a6ae - glazier::backend::x11::window::Window::redraw_now::h47f1c6064af34475
                               at /home/philm/.cargo/git/checkouts/glazier-3a172f69e2427c5a/04f71ee/src/backend/x11/window.rs:689:9
  25:     0x55dcb6c814d4 - glazier::backend::x11::window::Window::run_idle::h8f1b6c7fada9bdc5
                               at /home/philm/.cargo/git/checkouts/glazier-3a172f69e2427c5a/04f71ee/src/backend/x11/window.rs:1050:29
  26:     0x55dcb6c146ea - glazier::backend::x11::application::AppInner::run_inner::h466af38072d7efaa
                               at /home/philm/.cargo/git/checkouts/glazier-3a172f69e2427c5a/04f71ee/src/backend/x11/application.rs:845:25
  27:     0x55dcb6c0617e - glazier::backend::x11::application::Application::run::h0222b14f3066fa37
                               at /home/philm/.cargo/git/checkouts/glazier-3a172f69e2427c5a/04f71ee/src/backend/x11/application.rs:241:25
  28:     0x55dcb6c06022 - glazier::backend::linux::application::Application::run::hc16f25d8979c5c66
                               at /home/philm/.cargo/git/checkouts/glazier-3a172f69e2427c5a/04f71ee/src/backend/linux/application.rs:68:17
  29:     0x55dcb6c4e081 - glazier::application::Application::run::h0b827b2409d1dec7
                               at /home/philm/.cargo/git/checkouts/glazier-3a172f69e2427c5a/04f71ee/src/application.rs:145:9
  30:     0x55dcb60c4bf9 - xilem::app_main::AppLauncher<T,V>::run::h4aad56f7506e841a
                               at /home/philm/dev/personal/rust/xilem/src/app_main.rs:88:9
  31:     0x55dcb60c7abc - hello::main::h955866ddfe8a9fd8
                               at /home/philm/dev/personal/rust/xilem/examples/hello.rs:44:5
  32:     0x55dcb60e329b - core::ops::function::FnOnce::call_once::h69b8fc705dc9baf4
                               at /rustc/500647fd8138cc09e87edb08d62f81654fbf6ef8/library/core/src/ops/function.rs:250:5
  33:     0x55dcb60d3d1e - std::sys_common::backtrace::__rust_begin_short_backtrace::h4a05a4590e04554f
                               at /rustc/500647fd8138cc09e87edb08d62f81654fbf6ef8/library/std/src/sys_common/backtrace.rs:135:18
  34:     0x55dcb60d5320 - std::rt::lang_start::{{closure}}::h5b12d89126b13c32
                               at /rustc/500647fd8138cc09e87edb08d62f81654fbf6ef8/library/std/src/rt.rs:166:18
  35:     0x55dcb6e32f3b - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h99e95060f43c78ac
                               at /rustc/500647fd8138cc09e87edb08d62f81654fbf6ef8/library/core/src/ops/function.rs:284:13
  36:     0x55dcb6e32f3b - std::panicking::try::do_call::h3cef1827405a2577
                               at /rustc/500647fd8138cc09e87edb08d62f81654fbf6ef8/library/std/src/panicking.rs:524:40
  37:     0x55dcb6e32f3b - std::panicking::try::h5d8d821f0335baae
                               at /rustc/500647fd8138cc09e87edb08d62f81654fbf6ef8/library/std/src/panicking.rs:488:19
  38:     0x55dcb6e32f3b - std::panic::catch_unwind::ha5463415e12f4a65
                               at /rustc/500647fd8138cc09e87edb08d62f81654fbf6ef8/library/std/src/panic.rs:142:14
  39:     0x55dcb6e32f3b - std::rt::lang_start_internal::{{closure}}::hc512939764d89660
                               at /rustc/500647fd8138cc09e87edb08d62f81654fbf6ef8/library/std/src/rt.rs:148:48
  40:     0x55dcb6e32f3b - std::panicking::try::do_call::h0a008eb3dff59911
                               at /rustc/500647fd8138cc09e87edb08d62f81654fbf6ef8/library/std/src/panicking.rs:524:40
  41:     0x55dcb6e32f3b - std::panicking::try::h3e4b5db018856531
                               at /rustc/500647fd8138cc09e87edb08d62f81654fbf6ef8/library/std/src/panicking.rs:488:19
  42:     0x55dcb6e32f3b - std::panic::catch_unwind::h32073ca401bac123
                               at /rustc/500647fd8138cc09e87edb08d62f81654fbf6ef8/library/std/src/panic.rs:142:14
  43:     0x55dcb6e32f3b - std::rt::lang_start_internal::h99c8b71e273ffd0a
                               at /rustc/500647fd8138cc09e87edb08d62f81654fbf6ef8/library/std/src/rt.rs:148:20
  44:     0x55dcb60d52fa - std::rt::lang_start::h01bcd67651c9bd38
                               at /rustc/500647fd8138cc09e87edb08d62f81654fbf6ef8/library/std/src/rt.rs:165:17
  45:     0x55dcb60c7aee - main
  46:     0x7fd0cd7daace - __libc_start_call_main
  47:     0x7fd0cd7dab89 - __libc_start_main@@GLIBC_2.34
  48:     0x55dcb60b3655 - _start
  49:                0x0 - <unknown>

@waywardmonkeys
Copy link
Contributor Author

Do you get input-related debug output from running the shello example in glazier? Wondering where the actual issues are ...

@Philipp-M
Copy link
Contributor

Yes I get output, something like this:

pointer_down PointerEvent { pointer_id: PointerId(13), is_primary: true, pointer_type: Mouse(MouseInfo { wheel_delta: Vec2 { x: 0.0, y: 0.0 } }), pos: (630.4565624999999, 321.59583984374996), buttons: PointerButtons(00000), modifiers: Modifiers((empty)), button: Primary, focus: false, count: 1 }
pointer_up PointerEvent { pointer_id: PointerId(13), is_primary: true, pointer_type: Mouse(MouseInfo { wheel_delta: Vec2 { x: 0.0, y: 0.0 } }), pos: (584.491171875, 303.87556640624996), buttons: PointerButtons(00000), modifiers: Modifiers((empty)), button: Primary, focus: false, count: 0 }

@waywardmonkeys
Copy link
Contributor Author

I don't want to boot up my Linux machine ... Not sure what my next step will be.

@xStrom
Copy link
Member

xStrom commented Sep 8, 2023

The failed to acquire next swapchain texture: Outdated panic when resizing is an older issue that also exists on Windows and is not related to this PR.


Input not working on Linux with this PR is because the glazier rev that this PR is updating to only supports the new pointer API on X11, but Xilem, even with this PR, still uses the old mouse API. Windows and macOS in this glazier rev also still use the old mouse API, with an additional compatibility shim to also support the new pointer API. However the Linux backend does not have a reverse shim for mouse API support. Hence it not working here.

Newer glazier revisions have continued the migration to the new pointer API. Specifically glazier#127 migrated the Windows and macOS backends to the newer pointer API as well. With that rev of glazier, input in Xilem would not work on those platforms either. Then glazier#132 removed the unutilized mouse API from glazier to make it clear that the pointer API must be used.


The next step for this PR would be to rebase on main and regenerate Cargo.lock. I think it's fine to merge this PR then as a milestone towards the full solution.

Ultimately, to have input working on all platforms, the solution is to refactor the Xilem code to use the new pointer API instead of the old mouse API. That would be the solution for both the glazier rev in this PR, and newer revisions.

@waywardmonkeys waywardmonkeys force-pushed the update-glazier branch 2 times, most recently from f6c833f to d040fec Compare September 10, 2023 14:53
@waywardmonkeys
Copy link
Contributor Author

Updated to the current glazier rev and updated xilem to use the pointer API from Glazier. It doesn't change the API within Xilem.

The change to `app_main.rs` matches a similar change made in the
Glazier examples.

Also, since we now have both x11 and wayland backends on some
platforms, we need to make sure that we create the application
prior to creating the menu. This will be improved in future
versions of Glazier.

This minimally updates to the PointerEvent API within Glazier
as that has replaced the MouseEvent API.
@waywardmonkeys
Copy link
Contributor Author

@xStrom Thanks for your work in pushing me to get this over the finish line!

Copy link
Contributor

@jaredoconnell jaredoconnell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on Fedora, Windows 10, and Mac OS. The hello example worked for all of them.

Copy link
Member

@xStrom xStrom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed working. Thanks for your efforts!

@waywardmonkeys waywardmonkeys merged commit e269143 into linebender:main Sep 11, 2023
3 checks passed
@waywardmonkeys waywardmonkeys deleted the update-glazier branch September 11, 2023 00:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants