stack: formatting cleanup

This commit is contained in:
Victoria Brekenfeld 2023-12-11 16:14:00 +00:00 committed by Victoria Brekenfeld
parent c90fff7177
commit 1dfaef4874

View file

@ -649,10 +649,8 @@ impl Program for CosmicStackInternal {
match message { match message {
Message::DragStart => { Message::DragStart => {
if let Some((seat, serial)) = self.last_seat.lock().unwrap().clone() { if let Some((seat, serial)) = self.last_seat.lock().unwrap().clone() {
if let Some(surface) = self.windows.lock().unwrap() let active = self.active.load(Ordering::SeqCst);
[self.active.load(Ordering::SeqCst)] if let Some(surface) = self.windows.lock().unwrap()[active].wl_surface() {
.wl_surface()
{
loop_handle.insert_idle(move |state| { loop_handle.insert_idle(move |state| {
Shell::move_request( Shell::move_request(
state, state,
@ -687,10 +685,8 @@ impl Program for CosmicStackInternal {
} }
Message::Menu => { Message::Menu => {
if let Some((seat, serial)) = self.last_seat.lock().unwrap().clone() { if let Some((seat, serial)) = self.last_seat.lock().unwrap().clone() {
if let Some(surface) = self.windows.lock().unwrap() let active = self.active.load(Ordering::SeqCst);
[self.active.load(Ordering::SeqCst)] if let Some(surface) = self.windows.lock().unwrap()[active].wl_surface() {
.wl_surface()
{
loop_handle.insert_idle(move |state| { loop_handle.insert_idle(move |state| {
if let Some(mapped) = if let Some(mapped) =
state.common.shell.element_for_wl_surface(&surface).cloned() state.common.shell.element_for_wl_surface(&surface).cloned()