-
Notifications
You must be signed in to change notification settings - Fork 50
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
Fix examples by resizing the surface #247
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This directly conflicts with the idea introduced in #236 (CC @madsmtm) that creating a Surface
either infers a size from the given a window
and/orResized
event is always delivered somewhere in application startup before the first RedrawRequested
event.
Hacking that original misplaced .resize()
back in is unfortunately not going to fly. We need to instead debug what your Linux sample is doing, was this on Wayland or X11?
More context is available in #237, too. |
Analyzing the code, it seems that the Wayland backend would have crashed if softbuffer/src/backends/x11.rs Line 290 in fa3a918
|
Hmm, I'm fine with this PR? It does the same thing as the |
Then we should copy-paste that ugly edge-case, specific comment and all, to every other example? I completely missed that we inconsistently had a weird edge-case in one but not all examples. |
I think so, yeah |
(Or we should fix the underlying issue) |
(Guess why I initially "requested changes" 😉) |
X11 |
In fact, I modified it based on the example of I also think it's ugly to add such a paragraph to each example. It would be better to have one that can fix the underlying issue. |
When running some examples on my Linux system, I encountered an error:
This error occurred when attempting to perform array indexing write operations on the buffer generated by
surface.buffer_mut()
.I successfully resolved these issues by resizing the surface during initialization.