From f9bbdab458ae465c1828a5ecbaba9f15bf23284f Mon Sep 17 00:00:00 2001 From: leon332157 Date: Sat, 18 Sep 2021 11:59:22 -0400 Subject: [PATCH] attempt x11 fix (#964) * attempt x11 fix * formet code * trigger format check --- snap/snapcraft.yaml | 3 +++ src/bridge/events.rs | 31 ++++++++++++++----------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 8e53780..ef10ba1 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -114,5 +114,8 @@ apps: plugs: - desktop - desktop-legacy + - wayland + - unity7 + - x11 command-chain: - bin/desktop-launch diff --git a/src/bridge/events.rs b/src/bridge/events.rs index ad93d24..4c5a1ff 100644 --- a/src/bridge/events.rs +++ b/src/bridge/events.rs @@ -374,7 +374,9 @@ fn extract_values(values: Vec) -> Result<[Value; REQ]> } } -fn extract_values_with_optional(values: Vec) -> Result<([Value; REQ], [Option; OPT])> { +fn extract_values_with_optional( + values: Vec, +) -> Result<([Value; REQ], [Option; OPT])> { if REQ > values.len() { Err(ParseError::Format(format!("{:?}", values))) } else { @@ -389,7 +391,10 @@ fn extract_values_with_optional(values: Vec< } } - Ok((required_values.try_into().unwrap(), optional_values.try_into().unwrap())) + Ok(( + required_values.try_into().unwrap(), + optional_values.try_into().unwrap(), + )) } } @@ -430,8 +435,7 @@ fn parse_set_title(set_title_arguments: Vec) -> Result { } fn parse_mode_info_set(mode_info_set_arguments: Vec) -> Result { - let [_cursor_style_enabled, mode_info] = - extract_values(mode_info_set_arguments)?; + let [_cursor_style_enabled, mode_info] = extract_values(mode_info_set_arguments)?; let mode_info_values = parse_array(mode_info)?; let mut cursor_modes = Vec::with_capacity(mode_info_values.len()); @@ -510,8 +514,7 @@ fn parse_mode_change(mode_change_arguments: Vec) -> Result { } fn parse_grid_resize(grid_resize_arguments: Vec) -> Result { - let [grid_id, width, height] = - extract_values(grid_resize_arguments)?; + let [grid_id, width, height] = extract_values(grid_resize_arguments)?; Ok(RedrawEvent::Resize { grid: parse_u64(grid_id)?, @@ -570,8 +573,7 @@ fn parse_style(style_map: Value) -> Result