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

Added window-size example #186

Merged
merged 1 commit into from
Nov 19, 2023
Merged

Added window-size example #186

merged 1 commit into from
Nov 19, 2023

Conversation

dominikwilkowski
Copy link
Contributor

Added a new example for how to change the size of a window.
The main window and a new sub window.

Note the views could be reused with a more generic function but I thought in examples it's better to be explicit rather than super optimized.

Macos:
image

@AchilleBailly
Copy link

Hi, very helpful !

I encountered an issue on my end while trying to initially size the window with custom values. If the width and height are equal, creating the window fails. Have you had this issue ? I managed to counter it by forcing initial sizing of the surface in the tiny_skia::TinySkiaRenderer::new function but I could find the origin of the bug.

Message:  Must set size of surface before calling `buffer_mut()`
Location: /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/softbuffer-0.3.3/src/wayland/mod.rs:92

BACKTRACE :
  13: softbuffer::wayland::WaylandImpl::buffer_mut::h062e9457aae7dc0b
      at /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/softbuffer-0.3.3/src/wayland/mod.rs:90
  14: softbuffer::SurfaceDispatch::buffer_mut::hfe44f1da23120e69
      at /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/softbuffer-0.3.3/src/lib.rs:100
  15: softbuffer::Surface::buffer_mut::h905758547269e952
      at /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/softbuffer-0.3.3/src/lib.rs:387
  16: <floem_tiny_skia::TinySkiaRenderer as floem_renderer::Renderer>::finish::h1b0bae175d6a96d7
      at /home/devuser/fluid-sim/floem/tiny_skia/src/lib.rs:533
  17: <floem::renderer::Renderer as floem_renderer::Renderer>::finish::hbb22a3af58e7c2a3
      at /home/devuser/fluid-sim/floem/src/renderer.rs:242
  18: floem::window_handle::WindowHandle::paint::h12d2c6f1ac412895
      at /home/devuser/fluid-sim/floem/src/window_handle.rs:569
  19: floem::window_handle::WindowHandle::render_frame::hdaebaec4a616a7f7
      at /home/devuser/fluid-sim/floem/src/window_handle.rs:522
  20: floem::app_handle::ApplicationHandle::handle_window_event::h4d6070381927e7e3
      at /home/devuser/fluid-sim/floem/src/app_handle.rs:217
  21: floem::app::Application::run::{{closure}}::h8312915f8b8779a2
      at /home/devuser/fluid-sim/floem/src/app.rs:135```

@dzhou121 dzhou121 merged commit 05e68b1 into lapce:main Nov 19, 2023
7 checks passed
@dominikwilkowski dominikwilkowski deleted the dom-window-size-example branch November 19, 2023 20:50
@dominikwilkowski
Copy link
Contributor Author

Hey @AchilleBailly
I can't reproduce the error you're talking about. Maybe share a code example and add a new issue?

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.

3 participants