Merge pull request #208 from pop-os/panel-sec-context_jammy

wayland: Privileged protocol security
This commit is contained in:
Victoria Brekenfeld 2023-11-07 16:01:00 +01:00 committed by GitHub
commit f7759a765b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 399 additions and 322 deletions

View file

@ -36,7 +36,7 @@ use smithay::{
use crate::{
config::{Config, KeyModifiers, KeyPattern},
state::client_has_security_context,
state::client_should_see_privileged_protocols,
utils::prelude::*,
wayland::protocols::{
toplevel_info::ToplevelInfoState,
@ -849,28 +849,22 @@ pub struct InvalidWorkspaceIndex;
impl Shell {
pub fn new(config: &Config, dh: &DisplayHandle) -> Self {
// TODO: Privileged protocols
let layer_shell_state = WlrLayerShellState::new::<State>(dh);
let xdg_shell_state = XdgShellState::new::<State>(dh);
let toplevel_info_state = ToplevelInfoState::new(
let layer_shell_state = WlrLayerShellState::new_with_filter::<State, _>(
dh,
//|client| client.get_data::<ClientState>().map_or(false, |s| s.privileged),
client_has_security_context,
client_should_see_privileged_protocols,
);
let xdg_shell_state = XdgShellState::new::<State>(dh);
let toplevel_info_state =
ToplevelInfoState::new(dh, client_should_see_privileged_protocols);
let toplevel_management_state = ToplevelManagementState::new::<State, _>(
dh,
vec![
ManagementCapabilities::Close,
ManagementCapabilities::Activate,
],
//|client| client.get_data::<ClientState>().map_or(false, |s| s.privileged),
client_has_security_context,
);
let workspace_state = WorkspaceState::new(
dh,
//|client| client.get_data::<ClientState>().map_or(false, |s| s.privileged),
client_has_security_context,
client_should_see_privileged_protocols,
);
let workspace_state = WorkspaceState::new(dh, client_should_see_privileged_protocols);
let theme = cosmic::theme::system_preference();
Shell {