git: d2892490ef74 - main - x11/ashell: Fix disappearance on HDMI display reconnect/power-on (take 2)

From: Hiroki Tagato <tagattie_at_FreeBSD.org>
Date: Sun, 18 Jan 2026 20:15:25 UTC
The branch main has been updated by tagattie:

URL: https://cgit.FreeBSD.org/ports/commit/?id=d2892490ef74d11f68af37fd228869a149b404fa

commit d2892490ef74d11f68af37fd228869a149b404fa
Author:     Hiroki Tagato <tagattie@FreeBSD.org>
AuthorDate: 2026-01-18 20:12:44 +0000
Commit:     Hiroki Tagato <tagattie@FreeBSD.org>
CommitDate: 2026-01-18 20:15:16 +0000

    x11/ashell: Fix disappearance on HDMI display reconnect/power-on (take 2)
    
    Sometimes status bar won't appear even after ff1cf76fa9ee (especially
    when HDMI display disconnected/powered-off for a longer
    time). Forceful state syncing one second after monitor was added
    appears to solves the problem.
---
 x11/ashell/Makefile               |  2 +-
 x11/ashell/files/patch-src_app.rs | 45 +++++++++++++++++++++++++++++++++++++--
 2 files changed, 44 insertions(+), 3 deletions(-)

diff --git a/x11/ashell/Makefile b/x11/ashell/Makefile
index 08e9d615f352..75d7ee8b575a 100644
--- a/x11/ashell/Makefile
+++ b/x11/ashell/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	ashell
 DISTVERSION=	0.7.0
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	x11 wayland
 
 MAINTAINER=	tagattie@FreeBSD.org
diff --git a/x11/ashell/files/patch-src_app.rs b/x11/ashell/files/patch-src_app.rs
index 9160c7ed19ef..5f8f939671cf 100644
--- a/x11/ashell/files/patch-src_app.rs
+++ b/x11/ashell/files/patch-src_app.rs
@@ -1,6 +1,14 @@
 --- src/app.rs.orig	2025-12-22 19:47:14 UTC
 +++ src/app.rs
-@@ -378,12 +378,9 @@ impl App {
+@@ -91,6 +91,7 @@ pub enum Message {
+     MediaPlayer(modules::media_player::Message),
+     OutputEvent((OutputEvent, WlOutput)),
+     CloseAllMenus,
++    DelayedSync,
+ }
+ 
+ impl App {
+@@ -378,21 +379,24 @@ impl App {
                  }
              },
              Message::OutputEvent((event, wl_output)) => match event {
@@ -14,5 +22,38 @@
 +                    info!("Output updated: {info:?}");
 +                    let name = info.description.as_deref().unwrap_or("");
  
-                     self.outputs.add(
+-                    self.outputs.add(
++                    let add_task = self.outputs.add(
                          self.theme.bar_style,
+                         &self.general_config.outputs,
+                         self.theme.bar_position,
+                         name,
+                         wl_output,
+                         self.theme.scale_factor,
+-                    )
++                    );
++                    let delay_task = Task::perform(
++                        async { tokio::time::sleep(std::time::Duration::from_millis(1000)).await },
++                        move |_| Message::DelayedSync,
++                    );
++
++                    Task::batch(vec![add_task, delay_task])
+                 }
+                 iced::event::wayland::OutputEvent::Removed => {
+                     info!("Output destroyed");
+@@ -416,6 +420,15 @@ impl App {
+                 } else {
+                     Task::none()
+                 }
++            }
++            Message::DelayedSync => {
++                info!("Delayed sync executed");
++                self.outputs.sync(
++                    self.theme.bar_style,
++                    &self.general_config.outputs,
++                    self.theme.bar_position,
++                    self.theme.scale_factor,
++                )
+             }
+         }
+     }