Skip to content

Commit 402ca0c

Browse files
committed
Using recent and unpatched GPUI crate
1 parent 3d11f3a commit 402ca0c

8 files changed

Lines changed: 485 additions & 724 deletions

File tree

Cargo.lock

Lines changed: 461 additions & 706 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ toml = { version = "0.9.5", features = ["serde"] }
1717
unicode-segmentation = "1.12.0"
1818
xflags = "0.3.2"
1919

20-
[patch."https://github.com/zed-industries/zed"]
21-
gpui = { git = "https://github.com/guibi1/zed.git", branch = "patched" }
22-
2320
[profile.release]
2421
codegen-units = 1
2522
lto = "thin"

src/ipc/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
pub mod client;
22
pub mod server;
33

4-
const SOCKET_PATH: &str = "/tmp/waystart-dev.sock";
4+
const SOCKET_PATH: &str = "/tmp/waystart.sock";
55

66
const MESSAGE_OPEN: &[u8] = b"open";
77
const MESSAGE_CLOSE: &[u8] = b"close";

src/ipc/server.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ impl SocketServer {
6666
let mut lines = reader.lines();
6767

6868
while let Some(Ok(message)) = lines.next().await {
69-
if let Err(e) = match message.as_bytes() {
69+
match message.as_bytes() {
7070
MESSAGE_OPEN => cx.update(|cx| {
7171
let mut window = window.borrow_mut();
7272
if window.map(|w| w.is_active(cx).is_none()).unwrap_or(true) {
@@ -100,9 +100,6 @@ impl SocketServer {
100100
eprintln!("Received unknown IPC message: {}", message);
101101
return;
102102
}
103-
} {
104-
eprintln!("Lost reference to app: {}", e);
105-
return;
106103
}
107104
}
108105
}

src/main.rs

100644100755
Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use gpui::{
2-
App, AppContext, Application, BorrowAppContext, Bounds, Entity, Focusable, TitlebarOptions,
3-
WindowBounds, WindowDecorations, WindowHandle, WindowKind, WindowOptions, point, px, size,
2+
App, AppContext, Application, BorrowAppContext, Bounds, Entity, Focusable, QuitMode,
3+
TitlebarOptions, WindowBounds, WindowDecorations, WindowHandle, WindowKind, WindowOptions,
4+
point, px, size,
45
};
56

67
use crate::config::Config;
@@ -54,7 +55,11 @@ fn main() {
5455

5556
Application::new()
5657
.with_assets(ui::Assets)
57-
.keep_running(daemon)
58+
.with_quit_mode(if daemon {
59+
QuitMode::Explicit
60+
} else {
61+
QuitMode::LastWindowClosed
62+
})
5863
.run(move |cx| {
5964
ui::init(cx);
6065
cx.set_global(SearchEntries::new());
@@ -111,7 +116,7 @@ pub fn open_window(cx: &mut App, waystart: Entity<Waystart>) -> WindowHandle<Way
111116
..Default::default()
112117
},
113118
|window, cx| {
114-
window.focus(&waystart.focus_handle(cx));
119+
window.focus(&waystart.focus_handle(cx), cx);
115120
waystart
116121
},
117122
)

src/ui/elements/dropdown.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ impl<M: ManagedView> Element for Dropdown<M> {
341341
if let Some(previous_focus_handle) =
342342
previously_focused.borrow_mut().take()
343343
{
344-
window.focus(&previous_focus_handle);
344+
window.focus(&previous_focus_handle, cx);
345345
}
346346
*content_view.borrow_mut() = None;
347347
window.refresh();
@@ -469,15 +469,15 @@ impl<M: ManagedView> Element for Dropdown<M> {
469469
&& let Some(previous_focus_handle) =
470470
previously_focused.borrow_mut().take()
471471
{
472-
window.focus(&previous_focus_handle);
472+
window.focus(&previous_focus_handle, cx);
473473
}
474474
*content_view.borrow_mut() = None;
475475
window.refresh();
476476
}
477477
})
478478
.detach();
479479

480-
window.focus(&new_content_view.focus_handle(cx));
480+
window.focus(&new_content_view.focus_handle(cx), cx);
481481
*content_view.borrow_mut() = Some(new_content_view);
482482
window.refresh();
483483
}

src/ui/elements/input.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -606,8 +606,15 @@ impl Element for TextElement {
606606
window.paint_quad(selection)
607607
}
608608
let line = prepaint.line.take().unwrap();
609-
line.paint(bounds.origin, window.line_height(), window, cx)
610-
.unwrap();
609+
line.paint(
610+
bounds.origin,
611+
window.line_height(),
612+
window.text_style().text_align,
613+
None,
614+
window,
615+
cx,
616+
)
617+
.unwrap();
611618

612619
if focus_handle.is_focused(window)
613620
&& let Some(cursor) = prepaint.cursor.take()

src/ui/waystart.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ impl Render for Waystart {
234234
.collect()
235235
}),
236236
)
237-
.track_scroll(self.list_scroll_handle.clone())
237+
.track_scroll(&self.list_scroll_handle)
238238
.flex_grow()
239239
.pb_2(),
240240
),

0 commit comments

Comments
 (0)