Skip to content

Commit

Permalink
reimplements HiDpiFactorChanged after rust-windowing#1173 merge
Browse files Browse the repository at this point in the history
  • Loading branch information
vbogaevsky committed Oct 14, 2019
1 parent 402a9f4 commit d2042a4
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/platform_impl/macos/app_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ impl Handler {
if let Some(ref mut callback) = *self.callback.lock().unwrap() {
match wrapper {
EventWrapper::StaticEvent(event)
=> self.execute_callback(event, callback),
=> callback.handle_nonuser_event(event, &mut *self.control_flow.lock().unwrap()),
EventWrapper::EventProxy(proxy) => self.handle_proxy(proxy, callback),
}
}
Expand Down Expand Up @@ -197,7 +197,7 @@ impl Handler {
},
};

self.execute_callback(event, callback);
callback.handle_nonuser_event(event, &mut *self.control_flow.lock().unwrap());

let physical_size = new_inner_size.unwrap_or(size);
let logical_size = physical_size.to_logical(hidpi_factor);
Expand All @@ -214,10 +214,6 @@ impl Handler {
} => self.handle_hidpi_factor_changed_event(callback, ns_window, suggested_size, hidpi_factor),
}
}

fn execute_callback(&self, event: Event<'static, Never>, callback: &mut Box<dyn EventHandler + 'static>) {
callback.handle_nonuser_event(event, &mut *self.control_flow.lock().unwrap());
}
}

pub enum AppState {}
Expand Down

0 comments on commit d2042a4

Please sign in to comment.