Make dock not eagerly steal focus from sub items
This commit is contained in:
parent
2d7cfb8c7c
commit
8d561d6408
2 changed files with 20 additions and 2 deletions
|
@ -3963,6 +3963,15 @@ impl Drop for AnyViewHandle {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Debug for AnyViewHandle {
|
||||||
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
|
f.debug_struct("AnyViewHandle")
|
||||||
|
.field("window_id", &self.window_id)
|
||||||
|
.field("view_id", &self.view_id)
|
||||||
|
.finish()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub struct AnyModelHandle {
|
pub struct AnyModelHandle {
|
||||||
model_id: usize,
|
model_id: usize,
|
||||||
model_type: TypeId,
|
model_type: TypeId,
|
||||||
|
@ -4072,12 +4081,20 @@ impl AnyWeakModelHandle {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Copy)]
|
#[derive(Copy)]
|
||||||
pub struct WeakViewHandle<T> {
|
pub struct WeakViewHandle<T> {
|
||||||
any_handle: AnyWeakViewHandle,
|
any_handle: AnyWeakViewHandle,
|
||||||
view_type: PhantomData<T>,
|
view_type: PhantomData<T>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<T> Debug for WeakViewHandle<T> {
|
||||||
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
|
f.debug_struct(&format!("WeakViewHandle<{}>", type_name::<T>()))
|
||||||
|
.field("any_handle", &self.any_handle)
|
||||||
|
.finish()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl<T> WeakHandle for WeakViewHandle<T> {
|
impl<T> WeakHandle for WeakViewHandle<T> {
|
||||||
fn id(&self) -> usize {
|
fn id(&self) -> usize {
|
||||||
self.view_id
|
self.view_id
|
||||||
|
|
|
@ -1600,8 +1600,9 @@ impl Workspace {
|
||||||
});
|
});
|
||||||
self.active_item_path_changed(cx);
|
self.active_item_path_changed(cx);
|
||||||
|
|
||||||
|
|
||||||
if &pane == self.dock_pane() {
|
if &pane == self.dock_pane() {
|
||||||
Dock::show(self, true, cx);
|
Dock::show(self, false, cx);
|
||||||
} else {
|
} else {
|
||||||
self.last_active_center_pane = Some(pane.downgrade());
|
self.last_active_center_pane = Some(pane.downgrade());
|
||||||
if self.dock.is_anchored_at(DockAnchor::Expanded) {
|
if self.dock.is_anchored_at(DockAnchor::Expanded) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue