-
Notifications
You must be signed in to change notification settings - Fork 48
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
refactor(client): bump to winit 0.30 & fixes #523
Conversation
ca18381
to
41917a9
Compare
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.
Clarification needed on cliprdr-native API change
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.
Many thanks!! Nice work.
Providing the andMask is not mandatory (https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-rdpbcgr/71fad4fc-6ad4-4c7f-8103-a442bebaf7d2) Signed-off-by: Marc-André Lureau <[email protected]>
Create a hidden window instead. This allows for easier setup of clipboard channels while the GUI may not be ready yet. Signed-off-by: Marc-André Lureau <[email protected]>
Signed-off-by: Marc-André Lureau <[email protected]>
Signed-off-by: Marc-André Lureau <[email protected]>
This solves broken/crashing display on wayland with HiDPI. Signed-off-by: Marc-André Lureau <[email protected]>
Signed-off-by: Marc-André Lureau <[email protected]>
It should now be done from an ActiveEventLoop, during ApplicationHandler callbacks, like resumed(). Signed-off-by: Marc-André Lureau <[email protected]>
Signed-off-by: Marc-André Lureau <[email protected]>
Signed-off-by: Marc-André Lureau <[email protected]>
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.
Looks good to me!
@elmarco Is PR ready to be merged?
yes! thanks |
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.
LGTM! Thank you!!
pub fn new( | ||
event_loop: &EventLoop<RdpOutputEvent>, | ||
input_event_sender: &mpsc::UnboundedSender<RdpInputEvent>, | ||
) -> anyhow::Result<Self> { | ||
// SAFETY: We drop the softbuffer context right before the event loop is stopped, thus making this safe. | ||
// FIXME: This is not a sufficient proof and the API is actually unsound as-is. | ||
let display_handle = unsafe { | ||
std::mem::transmute::<DisplayHandle<'_>, DisplayHandle<'static>>(event_loop.display_handle().unwrap()) | ||
}; | ||
let context = softbuffer::Context::new(display_handle) | ||
.map_err(|e| anyhow::anyhow!("unable to initialize softbuffer context: {e}"))?; |
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.
issue: We can’t actually guarantee that event_loop
is dropped after the context at this point, we are not the ones owning it. Only the owner can guarantee that, and thus it’s only possible to know that at the call site. As such, this API is unsound and the unsafe block may cause an undefined behavior in the future if we misuse the API. I don’t consider this a blocker since this is not part of the public API of the IronRDP crates, and we can address that in the future.
thanks! |
Update code to winit 0.30, various large refactoring necessary.
Related fixes.
My main motivation was fixeing a crash on wayland with HiDPI, and also use update to latest crates.
Fixes: #375
Fixes: #521
Fixes: #522