Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 51 additions & 31 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -143,5 +143,5 @@ inherits = "release"
lto = "fat"

[patch.crates-io]
smithay = { git = "https://github.com/smithay/smithay.git", rev = "8a27023" }
smithay = { git = "https://github.com/smithay/smithay.git", rev = "4d80d1c" }
smithay-egui = { git = "https://github.com/Smithay/smithay-egui.git", rev = "6511552" }
25 changes: 7 additions & 18 deletions src/backend/render/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -681,20 +681,18 @@ where
.map(|((w, start), idx)| (w.handle, idx, start));
let workspace = (workspace.handle, idx);

std::mem::drop(shell_guard);

let element_filter = if workspace_overview_is_open(output) {
ElementFilter::LayerShellOnly
} else {
ElementFilter::All
};
let zoom_state = shell.read().zoom_state().cloned();
let zoom_state = shell_guard.zoom_state().cloned();

#[allow(unused_mut)]
let workspace_elements = workspace_elements(
_gpu,
renderer,
shell,
&shell_guard,
zoom_state.as_ref(),
now,
output,
Expand All @@ -718,7 +716,7 @@ where
pub fn workspace_elements<R>(
_gpu: Option<&DrmNode>,
renderer: &mut R,
shell: &Arc<parking_lot::RwLock<Shell>>,
shell: &Shell,
zoom_level: Option<&ZoomState>,
now: Time<Monotonic>,
output: &Output,
Expand All @@ -736,21 +734,13 @@ where
{
let mut elements = Vec::<CosmicElement<R>>::new();

let shell_ref = shell.read();
let seats = shell_ref.seats.iter().cloned().collect::<Vec<_>>();
if seats.is_empty() {
return Ok(Vec::new());
}
let theme = shell_ref.theme().clone();
let theme = shell.theme().clone();
let blur_strength = (theme.cosmic().frosted as u8 + 1) as usize;
let scale = output.current_scale().fractional_scale();
// we don't want to hold a shell lock across `cursor_elements`,
// that is prone to deadlock with the main-thread on some grabs.
std::mem::drop(shell_ref);

cursor_elements(
renderer,
seats.iter(),
shell.seats.iter(),
zoom_level,
&theme,
blur_strength,
Expand All @@ -762,7 +752,6 @@ where
&mut |elem| elements.push(elem),
);

let shell = shell.read();
let overview = shell.overview_mode();
let (resize_mode, resize_indicator) = shell.resize_mode();
let resize_indicator = resize_indicator.map(|indicator| (resize_mode, indicator));
Expand Down Expand Up @@ -833,7 +822,7 @@ where
)
};

render_input_order::<()>(&shell, output, previous, current, element_filter, |stage| {
render_input_order::<()>(shell, output, previous, current, element_filter, |stage| {
match stage {
Stage::ZoomUI => {
ZoomState::render(renderer, output, &mut |elem| {
Expand Down Expand Up @@ -1584,7 +1573,7 @@ where
elements.extend(workspace_elements(
gpu,
renderer,
shell,
&shell.read(),
zoom_level,
now,
output,
Expand Down
Loading
Loading