Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,16 @@ $(TARGET)-universal:
@lipo target/{x86_64,aarch64}-apple-darwin/release/$(TARGET) -create -output $(APP_BINARY)

app-universal: $(APP_NAME)-universal ## Create a universal Rio.app

app-aarch64: ## Create an Apple Silicon-only Rio.app
RUSTFLAGS='-C link-arg=-s' MACOSX_DEPLOYMENT_TARGET="11.0" cargo build --release --target=aarch64-apple-darwin
@mkdir -p $(APP_BINARY_DIR)
@mkdir -p $(APP_EXTRAS_DIR)
@cp -fRp $(APP_TEMPLATE) $(TARGET_DIR_OSX)
@cp -fp target/aarch64-apple-darwin/release/$(TARGET) $(APP_BINARY_DIR)
@touch -r "target/aarch64-apple-darwin/release/$(TARGET)" "$(TARGET_DIR_OSX)/$(APP_NAME)"
@echo "Created '$(APP_NAME)' in '$(TARGET_DIR_OSX)'"

$(APP_NAME)-%: $(TARGET)-%
@mkdir -p $(APP_BINARY_DIR)
@mkdir -p $(APP_EXTRAS_DIR)
Expand Down
1 change: 1 addition & 0 deletions frontends/rioterm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ image_rs = { workspace = true }
libc = { workspace = true }
parking_lot = { workspace = true }
serde = { workspace = true }
serde_json = "1.0"
taffy = { version = "0.10.1", features = ["flexbox","grid"] }
teletypewriter = { workspace = true }
rio-unicode = { workspace = true }
Expand Down
52 changes: 52 additions & 0 deletions frontends/rioterm/src/application.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1361,6 +1361,15 @@ impl ApplicationHandler<EventPayload> for Application<'_> {
let chrome_press = route.window.screen.take_chrome_press();

if let MouseButton::Left = button {
if route
.window
.screen
.handle_workspace_click(&mut self.router.clipboard)
{
route.request_redraw();
return;
}

// Check if clicking on a panel border to start resize
{
let mx = route.window.screen.mouse.x as f32;
Expand Down Expand Up @@ -1531,6 +1540,13 @@ impl ApplicationHandler<EventPayload> for Application<'_> {
.process_mouse_bindings(button, &mut self.router.clipboard);
}
ElementState::Released => {
if button == MouseButton::Left
&& route.window.screen.finish_workspace_drag()
{
route.request_redraw();
return;
}

// Stop selection auto-scroll on button release.
if let MouseButton::Left | MouseButton::Right = button {
let scroll_timer_id =
Expand Down Expand Up @@ -1684,6 +1700,22 @@ impl ApplicationHandler<EventPayload> for Application<'_> {
return;
}

let scale_factor = route.window.screen.sugarloaf.scale_factor();
if route.window.screen.workspace_interaction_active() {
route
.window
.screen
.update_workspace_drawer_width(x as f32 / scale_factor);
route.window.winit_window.set_cursor(
if route.window.screen.workspace_resize_active() {
CursorIcon::ColResize
} else {
CursorIcon::Default
},
);
route.request_redraw();
return;
}
// Handle assistant overlay hover
if route.window.screen.renderer.assistant.is_active() {
let scale = route.window.screen.sugarloaf.scale_factor();
Expand Down Expand Up @@ -1782,6 +1814,14 @@ impl ApplicationHandler<EventPayload> for Application<'_> {
return;
}

if let Some(cursor) = route.window.screen.workspace_cursor_icon() {
if route.window.screen.clear_close_button_hover() {
route.request_redraw();
}
route.window.winit_window.set_cursor(cursor);
return;
}

if route.window.screen.update_close_button_hover(x, y) {
route.request_redraw();
}
Expand Down Expand Up @@ -2332,6 +2372,10 @@ impl ApplicationHandler<EventPayload> for Application<'_> {
}

fn about_to_wait(&mut self, event_loop: &ActiveEventLoop) {
for route in self.router.routes.values_mut() {
route.window.screen.context_manager.save_workspace_state();
}

// A confirmed quit can be set from any input path (keys today,
// a future mouse or menu handler tomorrow); honoring it here,
// once per event batch, keeps the exit independent of which
Expand Down Expand Up @@ -2401,6 +2445,14 @@ impl ApplicationHandler<EventPayload> for Application<'_> {
// This is irreversible - if this event is emitted, it is guaranteed to be the last event that gets emitted.
// You generally want to treat this as an “do on quit” event.
fn exiting(&mut self, _event_loop: &ActiveEventLoop) {
for route in self.router.routes.values_mut() {
route
.window
.screen
.context_manager
.save_workspace_state_now();
}

// Ensure that all the windows are dropped, so the destructors for
// Renderer and contexts ran.
self.router.routes.clear();
Expand Down
Loading
Loading