mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-27 04:44:30 +00:00
Merge pull request #132 from zed-industries/fix-key-window
Ensure key window is a GPUIWindow before returning its id
This commit is contained in:
commit
c3f1d43861
1 changed files with 3 additions and 3 deletions
|
@ -245,11 +245,11 @@ impl Window {
|
||||||
unsafe {
|
unsafe {
|
||||||
let app = NSApplication::sharedApplication(nil);
|
let app = NSApplication::sharedApplication(nil);
|
||||||
let key_window: id = msg_send![app, keyWindow];
|
let key_window: id = msg_send![app, keyWindow];
|
||||||
if key_window.is_null() {
|
if msg_send![key_window, isKindOfClass: WINDOW_CLASS] {
|
||||||
None
|
|
||||||
} else {
|
|
||||||
let id = get_window_state(&*key_window).borrow().id;
|
let id = get_window_state(&*key_window).borrow().id;
|
||||||
Some(id)
|
Some(id)
|
||||||
|
} else {
|
||||||
|
None
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue