Skip to content

Commit 207baea

Browse files
committed
drop snapshots
1 parent 503b312 commit 207baea

File tree

8 files changed

+177
-463
lines changed

8 files changed

+177
-463
lines changed

frontends/rioterm/src/application.rs

Lines changed: 16 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,17 @@ impl ApplicationHandler<EventPayload> for Application<'_> {
201201
route.window.needs_render_after_occlusion = false;
202202
}
203203

204+
// Mark the renderable content as needing to render
205+
if let Some(ctx_item) =
206+
route.window.screen.ctx_mut().get_mut(route_id)
207+
{
208+
ctx_item
209+
.val
210+
.renderable_content
211+
.pending_update
212+
.set_dirty();
213+
}
214+
204215
// Check if we need to throttle based on timing
205216
if let Some(wait_duration) = route.window.wait_until() {
206217
// We need to wait before rendering again
@@ -226,45 +237,7 @@ impl ApplicationHandler<EventPayload> for Application<'_> {
226237
}
227238
}
228239
}
229-
RioEventType::Rio(RioEvent::TerminalDamaged { route_id, damage }) => {
230-
if self.config.renderer.strategy.is_event_based() {
231-
if let Some(route) = self.router.routes.get_mut(&window_id) {
232-
// Skip rendering for unfocused windows if configured
233-
if self.config.renderer.disable_unfocused_render
234-
&& !route.window.is_focused
235-
{
236-
return;
237-
}
238-
239-
// Skip rendering for occluded windows if configured
240-
if self.config.renderer.disable_occluded_render
241-
&& route.window.is_occluded
242-
&& !route.window.needs_render_after_occlusion
243-
{
244-
return;
245-
}
246-
247-
// We received a damage event, so we should render
248-
// Don't second-guess the damage event by checking needs_render()
249-
250-
// Clear the one-time render flag if it was set
251-
if route.window.needs_render_after_occlusion {
252-
route.window.needs_render_after_occlusion = false;
253-
}
254240

255-
if let Some(ctx_item) =
256-
route.window.screen.ctx_mut().get_mut(route_id)
257-
{
258-
ctx_item
259-
.val
260-
.renderable_content
261-
.pending_update
262-
.invalidate(damage, &ctx_item.val.terminal);
263-
route.schedule_redraw(&mut self.scheduler, route_id);
264-
}
265-
}
266-
}
267-
}
268241
RioEventType::Rio(RioEvent::Wakeup(route_id)) => {
269242
if self.config.renderer.strategy.is_event_based() {
270243
if let Some(route) = self.router.routes.get_mut(&window_id) {
@@ -299,7 +272,7 @@ impl ApplicationHandler<EventPayload> for Application<'_> {
299272
.val
300273
.renderable_content
301274
.pending_update
302-
.mark_for_damage_check();
275+
.set_dirty();
303276
route.schedule_redraw(&mut self.scheduler, route_id);
304277
}
305278
}
@@ -1302,16 +1275,12 @@ impl ApplicationHandler<EventPayload> for Application<'_> {
13021275
.pending_update
13031276
.is_dirty()
13041277
{
1305-
route.request_redraw();
1278+
route.schedule_redraw(
1279+
&mut self.scheduler,
1280+
route.window.screen.ctx().current_route(),
1281+
);
13061282
}
13071283

1308-
// route.request_redraw();
1309-
1310-
// route.schedule_redraw(
1311-
// &mut self.scheduler,
1312-
// route.window.screen.ctx().current_route(),
1313-
// );
1314-
13151284
event_loop.set_control_flow(ControlFlow::Wait);
13161285
}
13171286
_ => {}

frontends/rioterm/src/context/mod.rs

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -69,26 +69,29 @@ impl<T: EventListener> Context<T> {
6969
let has_updated = self.renderable_content.selection_range != selection_range;
7070

7171
if has_updated {
72-
let mut terminal = self.terminal.lock();
73-
let display_offset = terminal.display_offset();
74-
terminal.update_selection_damage(selection_range, display_offset);
75-
drop(terminal);
76-
77-
// Mark pending update as dirty so the selection change is rendered
72+
// Selection is a UI-level change, so we use UI damage tracking
73+
// Use full damage for selections since they can span multiple lines
74+
// and change frequently (during dragging)
7875
self.renderable_content
7976
.pending_update
80-
.invalidate_full(&self.terminal);
77+
.set_ui_damage(rio_backend::event::TerminalDamage::Full);
8178
}
8279

8380
self.renderable_content.selection_range = selection_range;
8481
}
8582

8683
#[inline]
8784
pub fn set_hyperlink_range(&mut self, hyperlink_range: Option<SelectionRange>) {
85+
let old_hyperlink = self.renderable_content.hyperlink_range.clone();
86+
87+
if old_hyperlink != hyperlink_range {
88+
// For hyperlinks, use full damage as they're less frequent
89+
self.renderable_content
90+
.pending_update
91+
.set_ui_damage(rio_backend::event::TerminalDamage::Full);
92+
}
93+
8894
self.renderable_content.hyperlink_range = hyperlink_range;
89-
self.renderable_content
90-
.pending_update
91-
.invalidate_full(&self.terminal);
9295
}
9396

9497
#[inline]
@@ -283,8 +286,13 @@ impl<T: EventListener + Clone + std::marker::Send + 'static> ContextManager<T> {
283286
}
284287
}
285288

286-
let machine =
287-
Machine::new(Arc::clone(&terminal), pty, event_proxy.clone(), window_id, route_id)?;
289+
let machine = Machine::new(
290+
Arc::clone(&terminal),
291+
pty,
292+
event_proxy.clone(),
293+
window_id,
294+
route_id,
295+
)?;
288296
let channel = machine.channel();
289297
let io_thread = if config.spawn_performer {
290298
Some(machine.spawn())

0 commit comments

Comments
 (0)