Skip to content

Commit d2995ff

Browse files
authored
Merge pull request #8 from typester/feature/remove-unfocused-output
changed!: remove unfocusedoutput from query
2 parents 5e64e26 + d1db623 commit d2995ff

File tree

1 file changed

+2
-20
lines changed

1 file changed

+2
-20
lines changed

src/gql.rs

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ impl From<&river::Event> for RiverEventType {
4242
pub struct RiverSnapshot {
4343
pub outputs: HashMap<String, OutputState>,
4444
pub seat_focused_output: Option<NamedOutputId>,
45-
pub seat_unfocused_output: Option<NamedOutputId>,
4645
pub seat_focused_view: Option<String>,
4746
pub seat_mode: Option<String>,
4847
}
@@ -186,11 +185,8 @@ impl RiverSnapshot {
186185
name: name.clone(),
187186
});
188187
}
189-
SeatUnfocusedOutput { id, name } => {
190-
self.seat_unfocused_output = Some(NamedOutputId {
191-
output_id: id_to_graphql(id),
192-
name: name.clone(),
193-
});
188+
SeatUnfocusedOutput { .. } => {
189+
// ignore this. only store focused output in the snapshot
194190
}
195191
SeatFocusedView { title } => {
196192
self.seat_focused_view = Some(title.clone());
@@ -494,20 +490,6 @@ impl QueryRoot {
494490
})
495491
}
496492

497-
async fn seat_unfocused_output(&self, ctx: &Context<'_>) -> Option<GSeatUnfocusedOutput> {
498-
let handle = ctx.data_unchecked::<RiverStateHandle>();
499-
let Ok(snapshot) = handle.read() else {
500-
return None;
501-
};
502-
snapshot
503-
.seat_unfocused_output
504-
.clone()
505-
.map(|named| GSeatUnfocusedOutput {
506-
output_id: named.output_id,
507-
name: named.name,
508-
})
509-
}
510-
511493
async fn seat_focused_view(&self, ctx: &Context<'_>) -> Option<GSeatFocusedView> {
512494
let handle = ctx.data_unchecked::<RiverStateHandle>();
513495
let Ok(snapshot) = handle.read() else {

0 commit comments

Comments
 (0)