Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions winit-appkit/src/view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use std::rc::Rc;
use dpi::{LogicalPosition, PhysicalSize};
use objc2::rc::Retained;
use objc2::runtime::{AnyObject, Sel};
use objc2::{AnyThread, DefinedClass, MainThreadMarker, define_class, msg_send};
use objc2::{AnyThread, DefinedClass, MainThreadMarker, Message, define_class, msg_send};
use objc2_app_kit::{
NSApplication, NSCursor, NSDragOperation, NSDraggingSession, NSEvent, NSEventPhase,
NSResponder, NSTextInputClient, NSTrackingArea, NSTrackingAreaOptions, NSView,
Expand Down Expand Up @@ -887,13 +887,14 @@ impl WinitView {
});
}

fn surface_resized(&self) {
pub(super) fn surface_resized(&self) {
let Some(window) = (**self).window() else {
return;
};
let size = self.surface_size();
let window_id = window_id(&window);
let view = self.retain();
self.ivars().app_state.maybe_queue_with_handler(move |app, event_loop| {
let size = view.surface_size();
app.window_event(event_loop, window_id, WindowEvent::SurfaceResized(size));
});
}
Expand Down
2 changes: 1 addition & 1 deletion winit-appkit/src/window_delegate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1098,7 +1098,7 @@ impl WindowDelegate {
let size = NSSize::new(logical_size.width, logical_size.height);
window.setContentSize(size);
}
self.queue_event(WindowEvent::SurfaceResized(physical_size));
self.view().surface_resized();
}

fn emit_move_event(&self) {
Expand Down
2 changes: 2 additions & 0 deletions winit/src/changelog/unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ changelog entry.
- On macOS, fix borderless game presentation options not sticking after switching spaces.
- On macOS, fix IME being locked on (regardless of requests to disable) after being enabled once.
- On macOS, fix a panic and incorrect cursor position in Ime::Preedit when the preedit string contains special characters (ie. emojis) caused by incorrect UTF-16 to UTF-8 offset conversion.
- On macOS, prevent an older deferred surface resize from overriding newer sizes after AppKit
transitions.
- On Wayland, fix a protocol error when setting a custom cursor on compositors with `wl_surface` version below 3.
- On Redox, fix `run_app_on_demand` exiting immediately after a previous `run_app_on_demand` called `exit`.
- On Redox, fill in logical key for keyboard events rather than emitting a separate fake IME event.
Expand Down