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.
		
			
				
	
	
		
			23 lines
		
	
	
		
			804 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			23 lines
		
	
	
		
			804 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
/* Copyright (C) 2022 Purism SPC
 | 
						|
 * SPDX-License-Identifier: GPL-3.0+
 | 
						|
 */
 | 
						|
 | 
						|
/*! Actors are parts of Squeekboard containing state independent from the main application state.
 | 
						|
 | 
						|
Because main application state is meant to be immutable,
 | 
						|
it cannot be referenced directly by pieces of logic
 | 
						|
interacting with the environment.
 | 
						|
 | 
						|
Such impure logic is split away (actor's logic)
 | 
						|
and combined with relevant pieces of state (actor state),
 | 
						|
thus preserving the purity (and sometimes simplicity) of the main state.
 | 
						|
 | 
						|
Actors can communicate with the main state by sending it messages,
 | 
						|
and by receiving updates from it.
 | 
						|
*/
 | 
						|
 | 
						|
// TODO: move crate::panel into crate::actors::panel.
 | 
						|
// Panel contains state and logic to protect the main state from getting flooded
 | 
						|
// with low-level wayland and gtk sizing events.
 | 
						|
 | 
						|
pub mod popover; |