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

Upgrade SCTK to 0.18 #5044

Merged
merged 3 commits into from
Mar 25, 2024
Merged

Upgrade SCTK to 0.18 #5044

merged 3 commits into from
Mar 25, 2024

Conversation

tmccombs
Copy link
Contributor

No description provided.

@@ -2,6 +2,8 @@
//! in smithay_client_toolkit 0.11 which is Copyright (c) 2018 Victor Berger
//! and provided under the terms of the MIT license.

// TODO: update this for SCTK 0.18 and use this instead of the FallbackFrame
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Alternatively, instead of using a built in implementation should we use sctk-adwaita instead? Possibly as an optional dependency?

@wez wez merged commit 3938d1a into wez:main Mar 25, 2024
13 of 17 checks passed
wez added a commit that referenced this pull request Mar 25, 2024
panics on startup under weston with no obvious fix.

This reverts commit 3938d1a.
This reverts commit aab3835.
This reverts commit 0c97ace.

refs: #5044
@wez
Copy link
Owner

wez commented Mar 25, 2024

Thanks for this! However, it needs some more work; here's what I see when I try to launch under weston:

[2462346.573]  -> wl_display@1.get_registry(new id wl_registry@2)
[2462346.602]  -> wl_display@1.sync(new id wl_callback@3)
[2462346.659] wl_display@1.delete_id(3)
[2462346.670] wl_registry@2.global(1, "wl_compositor", 4)
[2462346.733] wl_registry@2.global(2, "wl_subcompositor", 1)
[2462346.743] wl_registry@2.global(3, "wp_viewporter", 1)
[2462346.753] wl_registry@2.global(4, "zxdg_output_manager_v1", 2)
[2462346.766] wl_registry@2.global(5, "wp_presentation", 1)
[2462346.779] wl_registry@2.global(6, "zwp_relative_pointer_manager_v1", 1)
[2462346.793] wl_registry@2.global(7, "zwp_pointer_constraints_v1", 1)
[2462346.804] wl_registry@2.global(8, "zwp_input_timestamps_manager_v1", 1)
[2462346.816] wl_registry@2.global(9, "wl_data_device_manager", 3)
[2462346.827] wl_registry@2.global(10, "wl_shm", 1)
[2462346.841] wl_registry@2.global(11, "wl_drm", 2)
[2462346.855] wl_registry@2.global(12, "wl_seat", 7)
[2462346.869] wl_registry@2.global(13, "zwp_linux_dmabuf_v1", 3)
[2462346.881] wl_registry@2.global(14, "zwp_linux_explicit_synchronization_v1", 2)
[2462346.897] wl_registry@2.global(15, "wl_output", 3)
[2462346.909] wl_registry@2.global(16, "zwp_input_panel_v1", 1)
[2462346.920] wl_registry@2.global(17, "zwp_input_method_v1", 1)
[2462346.937] wl_registry@2.global(18, "zwp_text_input_manager_v1", 1)
[2462346.950] wl_registry@2.global(19, "xdg_wm_base", 1)
[2462346.964] wl_registry@2.global(20, "zxdg_shell_v6", 1)
[2462346.976] wl_registry@2.global(21, "wl_shell", 1)
[2462346.993] wl_registry@2.global(22, "weston_desktop_shell", 1)
[2462347.005] wl_registry@2.global(23, "weston_screenshooter", 1)
[2462347.018] wl_callback@3.done(1548)
[2462347.047]  -> wl_registry@2.bind(10, "wl_shm", 1, new id [unknown]@3)
[2462347.097]  -> wl_shm@3.create_pool(new id wl_shm_pool@4, fd 14, 1)
[2462347.135]  -> wl_registry@2.bind(1, "wl_compositor", 4, new id [unknown]@5)
[2462347.161]  -> wl_registry@2.bind(2, "wl_subcompositor", 1, new id [unknown]@6)
[2462347.187]  -> wl_registry@2.bind(15, "wl_output", 3, new id [unknown]@7)
[2462347.208]  -> wl_registry@2.bind(4, "zxdg_output_manager_v1", 2, new id [unknown]@8)
[2462347.246]  -> zxdg_output_manager_v1@8.get_xdg_output(new id zxdg_output_v1@9, wl_output@7)
[2462347.276]  -> wl_registry@2.bind(12, "wl_seat", 7, new id [unknown]@10)
[2462347.303]  -> wl_registry@2.bind(19, "xdg_wm_base", 1, new id [unknown]@11)
[2462347.327]  -> wl_registry@2.bind(9, "wl_data_device_manager", 3, new id [unknown]@12)
[2463601.555] wl_shm@3.format(0)
[2463601.574] wl_shm@3.format(1)
[2463601.578] wl_shm@3.format(909199186)
[2463601.582] wl_shm@3.format(842093913)
[2463601.585] wl_shm@3.format(842094158)
[2463601.591] wl_shm@3.format(1448695129)
[2463601.595] wl_output@7.geometry(0, 0, 270, 203, 0, "weston-X11", "none", 0)
[2463601.616] wl_output@7.scale(1)
[2463601.621] wl_output@7.mode(3, 1497, 1238, 60000)
[2463601.632] wl_output@7.done()
[2463601.634] zxdg_output_v1@9.logical_position(0, 0)
[2463601.641] zxdg_output_v1@9.logical_size(1497, 1238)
[2463601.647] zxdg_output_v1@9.name("X1")
[2463601.651] zxdg_output_v1@9.done()
[2463601.654] wl_seat@10.capabilities(3)
[2463601.659] wl_seat@10.name("default")
[2463601.957]  -> wl_seat@10.get_keyboard(new id wl_keyboard@13)
[2463601.984]  -> wl_compositor@5.create_surface(new id wl_surface@14)
[2463601.998]  -> wl_seat@10.get_pointer(new id wl_pointer@15)
[2463602.016]  -> wl_data_device_manager@12.get_data_device(new id wl_data_device@16, wl_seat@10)
[2463602.113] wl_keyboard@13.repeat_info(40, 400)
[2463602.124] wl_keyboard@13.keymap(1, fd 28, 68003)
[2463769.444]  -> wl_compositor@5.create_surface(new id wl_surface@17)
[2463769.523]  -> xdg_wm_base@11.get_xdg_surface(new id xdg_surface@18, wl_surface@17)
[2463769.541]  -> xdg_surface@18.get_toplevel(new id xdg_toplevel@19)
[2463769.556]  -> xdg_toplevel@19.set_app_id("org.wezfurlong.wezterm")
[2463769.565]  -> xdg_toplevel@19.set_title("wezterm")
[2463769.573]  -> xdg_toplevel@19.set_min_size(32, 32)
[2463769.584]  -> xdg_surface@18.set_window_geometry(0, 0, 902, 557)
[2463769.603]  -> wl_surface@17.commit()
[2463769.799] xdg_toplevel@19.configure(0, 0, array[0])
[2463769.815] xdg_surface@18.configure(1549)
[2463769.877]  -> xdg_surface@18.ack_configure(1549)
[2463770.083]  -> wl_shm@3.create_pool(new id wl_shm_pool@20, fd 29, 1)
[2463770.116]  -> wl_compositor@5.create_surface(new id wl_surface@21)
[2463770.129]  -> wl_subcompositor@6.get_subsurface(new id wl_subsurface@22, wl_surface@21, wl_surface@17)
[2463770.144]  -> wl_subsurface@22.set_sync()
[2463770.149]  -> wl_compositor@5.create_surface(new id wl_surface@23)
[2463770.159]  -> wl_subcompositor@6.get_subsurface(new id wl_subsurface@24, wl_surface@23, wl_surface@17)
[2463770.172]  -> wl_subsurface@24.set_sync()
[2463770.177]  -> wl_compositor@5.create_surface(new id wl_surface@25)
[2463770.187]  -> wl_subcompositor@6.get_subsurface(new id wl_subsurface@26, wl_surface@25, wl_surface@17)
[2463770.202]  -> wl_subsurface@26.set_sync()
[2463770.207]  -> wl_compositor@5.create_surface(new id wl_surface@27)
[2463770.216]  -> wl_subcompositor@6.get_subsurface(new id wl_subsurface@28, wl_surface@27, wl_surface@17)
[2463770.233]  -> wl_subsurface@28.set_sync()
[2463770.239]  -> wl_compositor@5.create_surface(new id wl_surface@29)
[2463770.250]  -> wl_subcompositor@6.get_subsurface(new id wl_subsurface@30, wl_surface@29, wl_surface@17)
[2463770.277]  -> wl_subsurface@30.set_sync()
09:22:03.644  ERROR  env_bootstrap > panic at window/src/os/wayland/window.rs:1376:14 - !?
   0: env_bootstrap::register_panic_hook::{{closure}}
             at env-bootstrap/src/lib.rs:176:18
   1: <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/alloc/src/boxed.rs:2029:9
      std::panicking::rust_panic_with_hook
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:783:13
   2: std::panicking::begin_panic_handler::{{closure}}
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:657:13
   3: std::sys_common::backtrace::__rust_end_short_backtrace
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:171:18
   4: rust_begin_unwind
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:645:5
   5: core::panicking::panic_fmt
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/panicking.rs:72:14
   6: core::panicking::panic_display
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/panicking.rs:196:5
      core::panicking::panic_str
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/panicking.rs:171:5
      core::option::expect_failed
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/option.rs:1980:5
   7: core::option::Option<T>::expect
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/option.rs:894:21
   8: <window::os::wayland::window::WaylandWindow as raw_window_handle::HasRawDisplayHandle>::raw_display_handle
             at window/src/os/wayland/window.rs:1370:26
   9: <window::os::x_and_wayland::Window as raw_window_handle::HasRawDisplayHandle>::raw_display_handle
             at window/src/os/x_and_wayland.rs:210:33
  10: wezterm_gui::termwindow::webgpu::RawHandlePair::new
             at wezterm-gui/src/termwindow/webgpu.rs:48:22
  11: wezterm_gui::termwindow::webgpu::WebGpuState::new::{{closure}}
             at wezterm-gui/src/termwindow/webgpu.rs:215:22
  12: wezterm_gui::termwindow::TermWindow::new_window::{{closure}}
             at wezterm-gui/src/termwindow/mod.rs:852:68
  13: wezterm_gui::frontend::GuiFrontEnd::reconcile_workspace::{{closure}}
             at wezterm-gui/src/frontend.rs:422:73
  14: <async_task::runnable::Builder<M>::spawn_local::Checked<F> as core::future::future::Future>::poll
             at /home/wez/.cargo/registry/src/index.crates.io-6f17d22bba15001f/async-task-4.7.0/src/runnable.rs:455:26
  15: async_task::raw::RawTask<F,T,S,M>::run
             at /home/wez/.cargo/registry/src/index.crates.io-6f17d22bba15001f/async-task-4.7.0/src/raw.rs:557:17
  16: async_task::runnable::Runnable<M>::run
             at /home/wez/.cargo/registry/src/index.crates.io-6f17d22bba15001f/async-task-4.7.0/src/runnable.rs:781:18
  17: window::spawn::schedule_with_pri::{{closure}}
             at window/src/spawn.rs:40:13
  18: core::ops::function::FnOnce::call_once{{vtable.shim}}
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/ops/function.rs:250:5
  19: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/alloc/src/boxed.rs:2015:9
  20: window::spawn::SpawnQueue::run_impl
             at window/src/spawn.rs:169:13
  21: window::spawn::SpawnQueue::run
             at window/src/spawn.rs:63:9
  22: window::os::wayland::connection::WaylandConnection::run_message_loop_impl
             at window/src/os/wayland/connection.rs:78:30
  23: <window::os::wayland::connection::WaylandConnection as window::connection::ConnectionOps>::run_message_loop
             at window/src/os/wayland/connection.rs:171:19
  24: <window::os::x_and_wayland::Connection as window::connection::ConnectionOps>::run_message_loop
             at window/src/os/x_and_wayland.rs:150:33
  25: wezterm_gui::frontend::GuiFrontEnd::run_forever
             at wezterm-gui/src/frontend.rs:324:9
  26: wezterm_gui::run_terminal_gui
             at wezterm-gui/src/main.rs:791:5
  27: wezterm_gui::run
             at wezterm-gui/src/main.rs:1253:23
  28: wezterm_gui::main
             at wezterm-gui/src/main.rs:837:21
  29: core::ops::function::FnOnce::call_once
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/ops/function.rs:250:5
  30: std::sys_common::backtrace::__rust_begin_short_backtrace
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:155:18
  31: std::rt::lang_start::{{closure}}
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/rt.rs:166:18
  32: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/ops/function.rs:284:13
      std::panicking::try::do_call
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:552:40
      std::panicking::try
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:516:19
      std::panic::catch_unwind
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panic.rs:142:14
      std::rt::lang_start_internal::{{closure}}
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/rt.rs:148:48
      std::panicking::try::do_call
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:552:40
      std::panicking::try
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:516:19
      std::panic::catch_unwind
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panic.rs:142:14
      std::rt::lang_start_internal
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/rt.rs:148:20
  33: std::rt::lang_start
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/rt.rs:165:17
  34: main
  35: __libc_start_call_main
             at ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
  36: __libc_start_main_impl
             at ./csu/../csu/libc-start.c:392:3
  37: _start

thread 'main' panicked at window/src/os/wayland/window.rs:1376:14:
to have WlDisplay
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread panicked while processing panic. aborting.
[1]    416933 IOT instruction (core dumped)  WAYLAND_DEBUG=1 WAYLAND_DISPLAY=wayland-0 DISPLAY=bah ./target/debug/wezterm

This is with webgpu as the front end. I get a similar issue with opengl.

I couldn't find an easy and quick fix within about an hour of looking at this, so I've reverted it out for now.

@tmccombs tmccombs deleted the sctk-18 branch March 25, 2024 17:58
@tmccombs
Copy link
Contributor Author

tmccombs commented Apr 2, 2024

How did you reproduce this error?

@tmccombs
Copy link
Contributor Author

tmccombs commented Apr 2, 2024

so I think that is from this line.

And to be honest, I'm not entirely sure if I am doing the right thing there.

But I don't know why that pointer would be None.

And if I add logging to that function, I can't figure out how to get any output.

@wez
Copy link
Owner

wez commented Apr 2, 2024

I ran weston to start a separate compositor (I use X11 as my main system), then I started wezterm like this to launch it into that compositor:

WAYLAND_DEBUG=1 WAYLAND_DISPLAY=wayland-0 ./target/debug/wezterm

re: the raw window pointer issue, yeah, I tried to re-structure that code to avoid the unwraps but the issue is that somehow the pointer value is null, and I don't know why. :-/

@tmccombs
Copy link
Contributor Author

tmccombs commented Apr 3, 2024

hmmm, so when I try to run it in weston, started directly, I get a different error:

[2529000.882] wl_display@1.error(wl_shm_pool@22, 1, "invalid width, height or stride (0x24, 0)")
wl_shm_pool@22: error 1: invalid width, height or stride (0x24, 0)
Protocol error 1 on object wl_shm_pool@22: 
23:35:22.083  ERROR  wezterm_gui > running message loop: Protocol error 1 on object wl_shm_pool@22: ; terminating

I think this is caused by trying to draw the client side decorations before we have gotten the configuration call with the actual coordinates. Or it is just a bug in sctk, (actually either way it is probably a bug there, since it probably should avoid allocating buffers with invalid coordinates).

IDK, why I get a different error than you though.

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.

2 participants