parent
adcb591629
commit
e07192e4e3
1 changed files with 23 additions and 2 deletions
|
@ -303,6 +303,14 @@ unsafe fn build_window_class(name: &'static str, superclass: &Class) -> *const C
|
||||||
sel!(concludeDragOperation:),
|
sel!(concludeDragOperation:),
|
||||||
conclude_drag_operation as extern "C" fn(&Object, Sel, id),
|
conclude_drag_operation as extern "C" fn(&Object, Sel, id),
|
||||||
);
|
);
|
||||||
|
decl.add_method(
|
||||||
|
sel!(windowDidMiniaturize:),
|
||||||
|
window_did_miniaturize as extern "C" fn(&Object, Sel, id),
|
||||||
|
);
|
||||||
|
decl.add_method(
|
||||||
|
sel!(windowDidDeminiaturize:),
|
||||||
|
window_did_deminiaturize as extern "C" fn(&Object, Sel, id),
|
||||||
|
);
|
||||||
|
|
||||||
decl.register()
|
decl.register()
|
||||||
}
|
}
|
||||||
|
@ -342,6 +350,7 @@ struct MacWindowState {
|
||||||
input_during_keydown: Option<SmallVec<[ImeInput; 1]>>,
|
input_during_keydown: Option<SmallVec<[ImeInput; 1]>>,
|
||||||
previous_keydown_inserted_text: Option<String>,
|
previous_keydown_inserted_text: Option<String>,
|
||||||
external_files_dragged: bool,
|
external_files_dragged: bool,
|
||||||
|
mimized: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl MacWindowState {
|
impl MacWindowState {
|
||||||
|
@ -419,9 +428,8 @@ impl MacWindowState {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// todo(macos)
|
|
||||||
fn is_minimized(&self) -> bool {
|
fn is_minimized(&self) -> bool {
|
||||||
false
|
self.mimized
|
||||||
}
|
}
|
||||||
|
|
||||||
fn is_fullscreen(&self) -> bool {
|
fn is_fullscreen(&self) -> bool {
|
||||||
|
@ -599,6 +607,7 @@ impl MacWindow {
|
||||||
input_during_keydown: None,
|
input_during_keydown: None,
|
||||||
previous_keydown_inserted_text: None,
|
previous_keydown_inserted_text: None,
|
||||||
external_files_dragged: false,
|
external_files_dragged: false,
|
||||||
|
mimized: false,
|
||||||
})));
|
})));
|
||||||
|
|
||||||
(*native_window).set_ivar(
|
(*native_window).set_ivar(
|
||||||
|
@ -1818,6 +1827,18 @@ extern "C" fn conclude_drag_operation(this: &Object, _: Sel, _: id) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern "C" fn window_did_miniaturize(this: &Object, _: Sel, _: id) {
|
||||||
|
let window_state = unsafe { get_window_state(this) };
|
||||||
|
|
||||||
|
window_state.lock().mimized = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
extern "C" fn window_did_deminiaturize(this: &Object, _: Sel, _: id) {
|
||||||
|
let window_state = unsafe { get_window_state(this) };
|
||||||
|
|
||||||
|
window_state.lock().mimized = false;
|
||||||
|
}
|
||||||
|
|
||||||
async fn synthetic_drag(
|
async fn synthetic_drag(
|
||||||
window_state: Weak<Mutex<MacWindowState>>,
|
window_state: Weak<Mutex<MacWindowState>>,
|
||||||
drag_id: usize,
|
drag_id: usize,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue