Add blur to vulkan and opengl render pipelines
This commit is contained in:
parent
6d3bff952e
commit
0701c4e4cf
41 changed files with 1990 additions and 47 deletions
|
|
@ -132,3 +132,40 @@ pub enum WindowCriterionStringField {
|
|||
XRole,
|
||||
Workspace,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Copy, Clone, Debug, Hash, Eq, PartialEq)]
|
||||
pub enum LayerKindIpc {
|
||||
Background,
|
||||
Bottom,
|
||||
Top,
|
||||
Overlay,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Clone, Debug)]
|
||||
pub struct LayerMatchIpc {
|
||||
pub namespace: Option<String>,
|
||||
pub layer: Option<LayerKindIpc>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Clone, Debug)]
|
||||
pub struct LayerRuleIpc {
|
||||
pub match_: LayerMatchIpc,
|
||||
pub blur: Option<bool>,
|
||||
pub blur_popups: Option<bool>,
|
||||
pub ignore_alpha: Option<f32>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Copy, Clone, Debug)]
|
||||
pub struct BlurConfigIpc {
|
||||
pub passes: u8,
|
||||
pub size: f32,
|
||||
}
|
||||
|
||||
impl Default for BlurConfigIpc {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
passes: 2,
|
||||
size: 8.0,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,9 +3,9 @@
|
|||
use {
|
||||
crate::{
|
||||
_private::{
|
||||
ClientCriterionIpc, ClientCriterionStringField, Config, ConfigEntry, ConfigEntryGen,
|
||||
GenericCriterionIpc, PollableId, VERSION, WindowCriterionIpc,
|
||||
WindowCriterionStringField, WireMode, bincode_ops,
|
||||
BlurConfigIpc, ClientCriterionIpc, ClientCriterionStringField, Config, ConfigEntry,
|
||||
ConfigEntryGen, GenericCriterionIpc, LayerRuleIpc, PollableId, VERSION,
|
||||
WindowCriterionIpc, WindowCriterionStringField, WireMode, bincode_ops,
|
||||
ipc::{
|
||||
ClientMessage, InitMessage, Response, ServerFeature, ServerMessage, WorkspaceSource,
|
||||
},
|
||||
|
|
@ -872,6 +872,14 @@ impl ConfigClient {
|
|||
self.send(&ClientMessage::TriggerGlobalShortcut { app_id, id })
|
||||
}
|
||||
|
||||
pub fn set_layer_rules(&self, rules: Vec<LayerRuleIpc>) {
|
||||
self.send(&ClientMessage::SetLayerRules { rules })
|
||||
}
|
||||
|
||||
pub fn set_blur_config(&self, config: BlurConfigIpc) {
|
||||
self.send(&ClientMessage::SetBlurConfig { config })
|
||||
}
|
||||
|
||||
pub fn switch_to_vt(&self, vtnr: u32) {
|
||||
self.send(&ClientMessage::SwitchTo { vtnr })
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
use {
|
||||
crate::{
|
||||
_private::{ClientCriterionIpc, PollableId, WindowCriterionIpc, WireMode},
|
||||
_private::{
|
||||
BlurConfigIpc, ClientCriterionIpc, LayerRuleIpc, PollableId, WindowCriterionIpc,
|
||||
WireMode,
|
||||
},
|
||||
Axis, Direction, PciId, Workspace,
|
||||
client::{Client, ClientCapabilities, ClientMatcher},
|
||||
input::{
|
||||
|
|
@ -916,6 +919,12 @@ pub enum ClientMessage<'a> {
|
|||
app_id: &'a str,
|
||||
id: &'a str,
|
||||
},
|
||||
SetLayerRules {
|
||||
rules: Vec<LayerRuleIpc>,
|
||||
},
|
||||
SetBlurConfig {
|
||||
config: BlurConfigIpc,
|
||||
},
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
|
|
|
|||
|
|
@ -397,6 +397,16 @@ pub fn set_corner_radius(radius: f32) {
|
|||
get!().set_corner_radius(radius)
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
pub fn _set_layer_rules(rules: Vec<crate::_private::LayerRuleIpc>) {
|
||||
get!().set_layer_rules(rules)
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
pub fn _set_blur_config(config: crate::_private::BlurConfigIpc) {
|
||||
get!().set_blur_config(config)
|
||||
}
|
||||
|
||||
/// Returns the current corner radius for window borders.
|
||||
pub fn get_corner_radius() -> f32 {
|
||||
get!(0.0).get_corner_radius()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue