diff --git a/x11/ashell/Makefile b/x11/ashell/Makefile index 08e9d615f352..75d7ee8b575a 100644 --- a/x11/ashell/Makefile +++ b/x11/ashell/Makefile @@ -1,54 +1,54 @@ PORTNAME= ashell DISTVERSION= 0.7.0 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= x11 wayland MAINTAINER= tagattie@FreeBSD.org COMMENT= Ready to go Wayland status bar for Hyprland WWW= https://malpenzibo.github.io/ashell/ LICENSE= MIT LICENSE_FILE= ${WRKSRC}/LICENSE LIB_DEPENDS= libpulse.so:audio/pulseaudio \ libudev.so:devel/libudev-devd \ libpipewire-0.3.so:multimedia/pipewire \ libxkbcommon.so:x11/libxkbcommon USES= cargo llvm USE_GITHUB= yes GH_ACCOUNT= MalpenZibo PORTSCOUT= limit:^[0-9]\. PLIST_FILES= bin/${PORTNAME} PORTDOCS= CHANGELOG.md README.md OPTIONS_DEFINE= DOCS # XXX Drop after FreeBSD 14.* EOL around 2028-11-30 # https://cgit.freebsd.org/src/commit/?id=3965de642c29 .if !exists(/usr/include/sys/inotify.h) LIB_DEPENDS+= libinotify.so:devel/libinotify USES+= localbase:ldflags LDFLAGS+= -linotify .endif post-patch: @${BSDMAKE} PATCHDIR=${PATCHDIR}/iced WRKSRC=${WRKSRC_crate_iced} \ do-patch # https://github.com/RazrFalcon/fontdb/issues/61 @${REINPLACE_CMD} -e 's|/etc|${LOCALBASE}&|g' \ ${WRKSRC_crate_fontdb-0.18.0}/src/lib.rs \ ${WRKSRC_crate_fontdb-0.23.0}/src/lib.rs # temporary hack to avoid the following error in configure phase # error: failed to select a version for the requirement `redox_syscall = "^0.4"` @${REINPLACE_CMD} -E '/redox_syscall =/s/0\.4(\.[0-9])?/0\.5/' \ ${WRKSRC_crate_softbuffer}/Cargo.toml post-install-DOCS-on: @${MKDIR} ${STAGEDIR}${DOCSDIR} ${INSTALL_MAN} ${PORTDOCS:S|^|${WRKSRC}/|} ${STAGEDIR}${DOCSDIR} .include 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,18 +1,59 @@ --- 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 { - iced::event::wayland::OutputEvent::Created(info) => { - info!("Output created: {info:?}"); - let name = info - .as_ref() - .and_then(|info| info.description.as_deref()) - .unwrap_or(""); + iced::event::wayland::OutputEvent::InfoUpdate(info) => { + 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, ++ ) + } + } + }