shell: Don't draw focus indicator during fullscreen animation
This commit is contained in:
parent
4e1c16c384
commit
63c073e3e5
1 changed files with 17 additions and 8 deletions
|
|
@ -85,6 +85,7 @@ pub struct Workspace {
|
||||||
pub pending_buffers: Vec<(ScreencopySession, BufferParams)>,
|
pub pending_buffers: Vec<(ScreencopySession, BufferParams)>,
|
||||||
pub screencopy_sessions: Vec<DropableSession>,
|
pub screencopy_sessions: Vec<DropableSession>,
|
||||||
pub(super) backdrop_id: Id,
|
pub(super) backdrop_id: Id,
|
||||||
|
pub dirty: AtomicBool,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
|
|
@ -144,6 +145,7 @@ impl Workspace {
|
||||||
pending_buffers: Vec::new(),
|
pending_buffers: Vec::new(),
|
||||||
screencopy_sessions: Vec::new(),
|
screencopy_sessions: Vec::new(),
|
||||||
backdrop_id: Id::new(),
|
backdrop_id: Id::new(),
|
||||||
|
dirty: AtomicBool::new(false),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -169,16 +171,18 @@ impl Workspace {
|
||||||
.fullscreen
|
.fullscreen
|
||||||
.values()
|
.values()
|
||||||
.any(|f| f.start_at.is_some() || f.ended_at.is_some())
|
.any(|f| f.start_at.is_some() || f.ended_at.is_some())
|
||||||
|
|| self.dirty.swap(false, Ordering::SeqCst)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn update_animations(&mut self) -> HashMap<ClientId, Client> {
|
pub fn update_animations(&mut self) -> HashMap<ClientId, Client> {
|
||||||
let mut clients = Vec::new();
|
let mut clients = HashMap::new();
|
||||||
|
|
||||||
for f in self.fullscreen.values_mut() {
|
for f in self.fullscreen.values_mut() {
|
||||||
if let Some(start) = f.start_at.as_ref() {
|
if let Some(start) = f.start_at.as_ref() {
|
||||||
let duration_since = Instant::now().duration_since(*start);
|
let duration_since = Instant::now().duration_since(*start);
|
||||||
if duration_since > FULLSCREEN_ANIMATION_DURATION {
|
if duration_since > FULLSCREEN_ANIMATION_DURATION {
|
||||||
f.start_at.take();
|
f.start_at.take();
|
||||||
|
self.dirty.store(true, Ordering::SeqCst);
|
||||||
}
|
}
|
||||||
if duration_since * 2 > FULLSCREEN_ANIMATION_DURATION {
|
if duration_since * 2 > FULLSCREEN_ANIMATION_DURATION {
|
||||||
if let Some(signal) = f.animation_signal.take() {
|
if let Some(signal) = f.animation_signal.take() {
|
||||||
|
|
@ -186,12 +190,14 @@ impl Workspace {
|
||||||
if let Some(client) =
|
if let Some(client) =
|
||||||
f.window.wl_surface().as_ref().and_then(Resource::client)
|
f.window.wl_surface().as_ref().and_then(Resource::client)
|
||||||
{
|
{
|
||||||
clients.push((client.id(), client));
|
clients.insert(client.id(), client);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let len = self.fullscreen.len();
|
||||||
self.fullscreen.retain(|_, f| match f.ended_at {
|
self.fullscreen.retain(|_, f| match f.ended_at {
|
||||||
None => true,
|
None => true,
|
||||||
Some(instant) => {
|
Some(instant) => {
|
||||||
|
|
@ -202,7 +208,7 @@ impl Workspace {
|
||||||
if let Some(client) =
|
if let Some(client) =
|
||||||
f.window.wl_surface().as_ref().and_then(Resource::client)
|
f.window.wl_surface().as_ref().and_then(Resource::client)
|
||||||
{
|
{
|
||||||
clients.push((client.id(), client));
|
clients.insert(client.id(), client);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -210,10 +216,12 @@ impl Workspace {
|
||||||
duration_since < FULLSCREEN_ANIMATION_DURATION
|
duration_since < FULLSCREEN_ANIMATION_DURATION
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
if len != self.fullscreen.len() {
|
||||||
|
self.dirty.store(true, Ordering::SeqCst);
|
||||||
|
}
|
||||||
|
|
||||||
let mut updates = self.tiling_layer.update_animation_state();
|
clients.extend(self.tiling_layer.update_animation_state());
|
||||||
updates.extend(clients);
|
clients
|
||||||
updates
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn commit(&mut self, surface: &WlSurface) {
|
pub fn commit(&mut self, surface: &WlSurface) {
|
||||||
|
|
@ -939,8 +947,9 @@ impl Workspace {
|
||||||
.map(|f| f.start_at.is_some() || f.ended_at.is_some())
|
.map(|f| f.start_at.is_some() || f.ended_at.is_some())
|
||||||
.unwrap_or(true)
|
.unwrap_or(true)
|
||||||
{
|
{
|
||||||
let focused =
|
let focused = draw_focus_indicator
|
||||||
draw_focus_indicator.and_then(|seat| self.focus_stack.get(seat).last().cloned());
|
.filter(|_| !self.fullscreen.contains_key(output))
|
||||||
|
.and_then(|seat| self.focus_stack.get(seat).last().cloned());
|
||||||
|
|
||||||
// floating surfaces
|
// floating surfaces
|
||||||
let alpha = match &overview.0 {
|
let alpha = match &overview.0 {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue