chore: update libcosmic

fixes input clipping
This commit is contained in:
Ashley Wulber 2026-04-08 12:00:16 -04:00 committed by Jacob Kauffmann
parent 9a043e8b72
commit 619910c5cc
9 changed files with 388 additions and 85 deletions

View file

@ -1,5 +1,6 @@
use cosmic::{
app::{Core, Task},
iced::runtime::core::window::Id as SurfaceId,
iced::{
self, Rectangle, Size, Subscription,
core::SmolStr,
@ -9,7 +10,6 @@ use cosmic::{
},
keyboard::{Event as KeyEvent, Key, Modifiers},
},
iced_runtime::core::window::Id as SurfaceId,
widget,
};
use cosmic_config::{ConfigSet, CosmicConfigEntry};

View file

@ -9,13 +9,14 @@ use color_eyre::eyre::WrapErr;
use cosmic::app::{Core, Settings, Task};
use cosmic::cctk::wayland_protocols::xdg::shell::client::xdg_positioner::Gravity;
use cosmic::iced::event::listen_with;
use cosmic::iced::runtime::platform_specific::wayland::subsurface::SctkSubsurfaceSettings;
use cosmic::iced::{Point, Size, window};
use cosmic::iced_runtime::platform_specific::wayland::subsurface::SctkSubsurfaceSettings;
use cosmic::widget::{id_container, text};
use cosmic::{
Element,
cosmic_config::{self, ConfigSet},
executor,
iced::runtime::core::window::Id as SurfaceId,
iced::{
self, Alignment, Background, Border, Length, Subscription,
event::wayland::OutputEvent,
@ -28,7 +29,6 @@ use cosmic::{
shell::wayland::commands::subsurface::reposition_subsurface,
},
},
iced_runtime::core::window::Id as SurfaceId,
theme, widget,
};
use cosmic::{
@ -1159,10 +1159,7 @@ impl cosmic::Application for App {
})
.or_else(|| session_names.first().cloned())
.unwrap_or_default();
let data_idx = flags
.user_datas
.iter()
.position(|d| d.name == username);
let data_idx = flags.user_datas.iter().position(|d| d.name == username);
let selected_username = NameIndexPair { username, data_idx };
let accessibility = Accessibility {
helper: cosmic_settings_daemon_config::greeter::GreeterAccessibilityState::config()
@ -1501,7 +1498,7 @@ impl cosmic::Application for App {
// Start spinner animation if not already running
if self.spinner_handle.is_none() {
let (spinner_task, handle) =
cosmic::task::stream(cosmic::iced_futures::stream::channel(
cosmic::task::stream(cosmic::iced::stream::channel(
1,
|mut msg_tx: iced::futures::channel::mpsc::Sender<_>| async move {
let mut interval = time::interval(Duration::from_millis(16)); // ~60fps
@ -1624,24 +1621,23 @@ impl cosmic::Application for App {
});
if self.heartbeat_handle.is_none() {
let (heartbeat, handle) =
cosmic::task::stream(cosmic::iced_futures::stream::channel(
1,
|mut msg_tx: iced::futures::channel::mpsc::Sender<_>| async move {
let mut interval = time::interval(Duration::from_secs(1));
let (heartbeat, handle) = cosmic::task::stream(cosmic::iced::stream::channel(
1,
|mut msg_tx: iced::futures::channel::mpsc::Sender<_>| async move {
let mut interval = time::interval(Duration::from_secs(1));
loop {
// Send heartbeat once a second to update time
msg_tx
.send(cosmic::Action::App(Message::Heartbeat))
.await
.unwrap();
loop {
// Send heartbeat once a second to update time
msg_tx
.send(cosmic::Action::App(Message::Heartbeat))
.await
.unwrap();
interval.tick().await;
}
},
))
.abortable();
interval.tick().await;
}
},
))
.abortable();
self.heartbeat_handle = Some(handle);
return heartbeat;

View file

@ -39,7 +39,7 @@ fn greetd_error_to_message(error_type: greetd_ipc::ErrorType, description: &str)
pub fn subscription() -> Subscription<Message> {
struct GreetdSubscription;
Subscription::run_with(std::any::TypeId::of::<GreetdSubscription>(), |_| {
cosmic::iced_futures::stream::channel(
cosmic::iced::stream::channel(
1,
|mut sender: cosmic::iced::futures::channel::mpsc::Sender<_>| async move {
let (tx, mut rx) = mpsc::channel::<greetd_ipc::Request>(1);

View file

@ -4,11 +4,12 @@
use color_eyre::eyre::WrapErr;
use cosmic::app::{Core, Settings, Task};
use cosmic::cctk::wayland_protocols::xdg::shell::client::xdg_positioner::Gravity;
use cosmic::iced::runtime::platform_specific::wayland::subsurface::SctkSubsurfaceSettings;
use cosmic::iced::{Point, Rectangle, Size};
use cosmic::iced_runtime::platform_specific::wayland::subsurface::SctkSubsurfaceSettings;
use cosmic::surface;
use cosmic::{
Element, executor,
iced::runtime::core::window::Id as SurfaceId,
iced::{
self, Alignment, Background, Border, Length, Subscription,
event::wayland::{OutputEvent, SessionLockEvent},
@ -17,7 +18,6 @@ use cosmic::{
destroy_lock_surface, get_lock_surface, lock, unlock,
},
},
iced_runtime::core::window::Id as SurfaceId,
theme, widget,
};
use cosmic_config::CosmicConfigEntry;
@ -872,7 +872,7 @@ impl cosmic::Application for App {
let username = self.flags.user_data.name.clone();
let (locked_task, locked_handle) =
cosmic::task::stream(cosmic::iced_futures::stream::channel(
cosmic::task::stream(cosmic::iced::stream::channel(
16,
|mut msg_tx: futures::channel::mpsc::Sender<_>| async move {
// Send heartbeat once a second to update time.
@ -1058,7 +1058,7 @@ impl cosmic::Application for App {
// Start spinner animation if not already running
if self.spinner_handle.is_none() {
let (spinner_task, handle) =
cosmic::task::stream(cosmic::iced_futures::stream::channel(
cosmic::task::stream(cosmic::iced::stream::channel(
1,
|mut msg_tx: futures::channel::mpsc::Sender<_>| async move {
let mut interval =

View file

@ -47,7 +47,7 @@ pub fn subscription() -> Subscription<Message> {
struct LogindSubscription;
Subscription::run_with(TypeId::of::<LogindSubscription>(), |_| {
cosmic::iced_futures::stream::channel(16, |mut msg_tx| async move {
cosmic::iced::stream::channel(16, |mut msg_tx| async move {
match handler(&mut msg_tx).await {
Ok(()) => {}
Err(err) => {

View file

@ -37,7 +37,7 @@ pub fn subscription() -> Subscription<Option<&'static str>> {
struct NetworkSubscription;
Subscription::run_with(TypeId::of::<NetworkSubscription>(), |_| {
cosmic::iced_futures::stream::channel(16, |mut msg_tx| async move {
cosmic::iced::stream::channel(16, |mut msg_tx| async move {
match handler(&mut msg_tx).await {
Ok(()) => {}
Err(err) => {

View file

@ -2,9 +2,7 @@ use anyhow::bail;
use async_fn_stream::StreamEmitter;
use chrono::{Datelike, Timelike};
use cosmic::{
Task,
iced_core::Element,
style,
Element, Task, style,
widget::{column, text},
};
use futures_util::StreamExt;
@ -125,7 +123,7 @@ impl Time {
pub fn date_time_widget<'a, M: 'a>(&self, military_time: bool) -> cosmic::Element<'a, M> {
Element::from(
column()
column::with_capacity(2)
.padding(16.)
.spacing(12.0)
.push(text::title2(self.format_date(&self.now)).class(style::Text::Accent))

View file

@ -1,6 +1,7 @@
use cosmic::iced::{
Subscription,
futures::{SinkExt, StreamExt, channel::mpsc},
stream,
};
use futures_util::select;
use std::{any::TypeId, time::Duration};
@ -11,7 +12,7 @@ pub fn subscription() -> Subscription<Option<(f64, bool, bool)>> {
struct PowerSubscription;
Subscription::run_with(TypeId::of::<PowerSubscription>(), |_| {
cosmic::iced_futures::stream::channel(16, |mut msg_tx| async move {
stream::channel(16, |mut msg_tx| async move {
match handler(&mut msg_tx).await {
Ok(()) => {}
Err(err) => {