state: Become the source of layout choice
A redesign of popover was needed: it can no longer query the application state directly due to current state being its own actor, so instead the popover gets a dedicated copy of the relevant state. I'm not entirely happy with the extra complexity of having an extra actor just for 1 string, but at least the duplication between C and Rust and mutual calls have been reduced.
This commit is contained in:
22
src/state.rs
22
src/state.rs
@ -126,27 +126,6 @@ impl Outcome {
|
||||
/// The receivers of the commands bear the burden
|
||||
/// of checking if the commands end up being no-ops.
|
||||
pub fn get_commands_to_reach(&self, new_state: &Self) -> Commands {
|
||||
let layout_hint_set = match new_state {
|
||||
Outcome {
|
||||
panel: animation::Outcome::Visible{..},
|
||||
im: InputMethod::Active(hints),
|
||||
..
|
||||
} => Some(hints.clone()),
|
||||
|
||||
Outcome {
|
||||
panel: animation::Outcome::Visible{..},
|
||||
im: InputMethod::InactiveSince(_),
|
||||
..
|
||||
} => Some(InputMethodDetails {
|
||||
hint: ContentHint::NONE,
|
||||
purpose: ContentPurpose::Normal,
|
||||
}),
|
||||
|
||||
Outcome {
|
||||
panel: animation::Outcome::Hidden,
|
||||
..
|
||||
} => None,
|
||||
};
|
||||
// FIXME: handle switching outputs
|
||||
let (dbus_visible_set, panel_visibility) = match new_state.panel {
|
||||
animation::Outcome::Visible{output, height, ..}
|
||||
@ -179,7 +158,6 @@ impl Outcome {
|
||||
|
||||
Commands {
|
||||
panel_visibility,
|
||||
layout_hint_set,
|
||||
dbus_visible_set,
|
||||
layout_selection,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user