Merge pull request #2051 from zed-industries/show-following-to-followed

Show following to followed
This commit is contained in:
Mikayla Maki
2023-01-20 09:23:34 -08:00
committed by GitHub
5 changed files with 31 additions and 3 deletions
+1 -1
View File
@@ -179,7 +179,7 @@ impl Default for Appearance {
}
}
#[derive(Copy, Clone, Debug)]
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub enum WindowKind {
Normal,
PopUp,
+15
View File
@@ -246,6 +246,11 @@ unsafe fn build_classes() {
do_command_by_selector as extern "C" fn(&Object, Sel, Sel),
);
decl.add_method(
sel!(acceptsFirstMouse:),
accepts_first_mouse as extern "C" fn(&Object, Sel, id) -> BOOL,
);
decl.register()
};
}
@@ -332,6 +337,7 @@ struct WindowState {
ime_state: ImeState,
//Retains the last IME Text
ime_text: Option<String>,
accepts_first_mouse: bool,
}
struct InsertText {
@@ -431,6 +437,7 @@ impl Window {
scene_to_render: Default::default(),
renderer: Renderer::new(true, fonts),
last_fresh_keydown: None,
accepts_first_mouse: options.kind == WindowKind::PopUp,
traffic_light_position: options
.titlebar
.as_ref()
@@ -1397,6 +1404,14 @@ extern "C" fn view_did_change_effective_appearance(this: &Object, _: Sel) {
}
}
extern "C" fn accepts_first_mouse(this: &Object, _: Sel, _: id) -> BOOL {
unsafe {
let state = get_window_state(this);
let state_borrow = state.as_ref().borrow();
return state_borrow.accepts_first_mouse as BOOL;
}
}
async fn synthetic_drag(
window_state: Weak<RefCell<WindowState>>,
drag_id: usize,
+1
View File
@@ -156,6 +156,7 @@ impl Presenter {
self.cursor_regions = scene.cursor_regions();
self.mouse_regions = scene.mouse_regions();
// window.is_topmost for the mouse moved event's postion?
if cx.window_is_active(self.window_id) {
if let Some(event) = self.last_mouse_moved_event.clone() {
self.dispatch_event(event, true, cx);