Skip to content

Commit 7ce90c2

Browse files
committed
Capture first mouse event on macOS.
1 parent b7619d6 commit 7ce90c2

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

druid-shell/src/platform/mac/window.rs

+7
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,13 @@ lazy_static! {
229229
extern "C" fn acceptsFirstResponder(_this: &Object, _sel: Sel) -> BOOL {
230230
YES
231231
}
232+
decl.add_method(
233+
sel!(acceptsFirstMouse:),
234+
acceptsFirstMouse as extern "C" fn(&Object, Sel, id) -> BOOL,
235+
);
236+
extern "C" fn acceptsFirstMouse(_this: &Object, _sel: Sel, _nsevent: id) -> BOOL {
237+
YES
238+
}
232239
decl.add_method(sel!(dealloc), dealloc as extern "C" fn(&Object, Sel));
233240
extern "C" fn dealloc(this: &Object, _sel: Sel) {
234241
info!("view is dealloc'ed");

0 commit comments

Comments
 (0)