Merge upstream/master (COSMIC 1.6) into main

Aligne le fork sur epoch-1.6.0 (63 commits amont) en preservant les 19
commits yoda.

Resolutions notables :
- les cfg `all(feature = "wayland", target_os = "linux")` deviennent
  l alias `wayland_platform` introduit en amont ; il exclut winit comme
  le faisait le patch yoda 45eaaf16, l intention est donc preservee ;
- les features iced `cctk` ont ete renommees `wayland` en amont, la
  feature `wayland` locale est adaptee ; `winit` reste un marqueur vide
  et `iced/winit` est liste explicitement ;
- cctk/ashpd gardent leurs chemins locaux dans la section conditionnelle
  unix introduite en amont ;
- la garde anti-crash c0b653f5 (context_menu non assigne) est conservee
  par-dessus la nouvelle structure amont ;
- traductions ca/oc restaurees depuis amont.

Le submodule iced suit (merge + correctif du cfg cctk residuel).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Lionel DARNIS 2026-08-19 21:55:00 +02:00
commit 9535ada4d0
60 changed files with 3187 additions and 1528 deletions

View file

@ -6,12 +6,7 @@ use std::sync::Arc;
use super::menu_bar::MenuBarState;
use super::menu_tree::MenuTree;
#[cfg(all(
feature = "multi-window",
feature = "wayland",
target_os = "linux",
feature = "surface-message"
))]
#[cfg(wayland_platform)]
use crate::app::cosmic::{WINDOWING_SYSTEM, WindowingSystem};
use crate::style::menu_bar::StyleSheet;
@ -242,7 +237,7 @@ pub(super) struct MenuSlice {
#[derive(Debug, Clone)]
/// Menu bounds in overlay space
pub struct MenuBounds {
child_positions: Vec<f32>,
pub(crate) child_positions: Vec<f32>,
child_sizes: Vec<Size>,
children_bounds: Rectangle,
pub parent_bounds: Rectangle,
@ -639,6 +634,10 @@ impl<'b, Message: Clone + 'static> Menu<'b, Message> {
shell,
);
if view_cursor.is_over(viewport) {
shell.request_redraw();
}
if self.is_overlay && view_cursor.is_over(viewport) {
shell.capture_event();
}
@ -676,12 +675,7 @@ impl<'b, Message: Clone + 'static> Menu<'b, Message> {
needs_reset |= self.close_condition.click_outside && !is_inside;
if needs_reset {
#[cfg(all(
feature = "multi-window",
feature = "wayland",
target_os = "linux",
feature = "surface-message"
))]
#[cfg(wayland_platform)]
if matches!(WINDOWING_SYSTEM.get(), Some(WindowingSystem::Wayland))
&& let Some(handler) = self.on_surface_action.as_ref()
{
@ -713,7 +707,7 @@ impl<'b, Message: Clone + 'static> Menu<'b, Message> {
}
_ => {}
};
}
None
}
@ -821,11 +815,11 @@ impl<'b, Message: Clone + 'static> Menu<'b, Message> {
let rad_0 = theme.cosmic().radius_0();
if start_index != end_index {
if 0 == i {
rad[0] = rad_0[0];
rad[1] = rad_0[1];
rad[2] = rad_0[0];
rad[3] = rad_0[1];
} else if i == end_index - start_index {
rad[2] = rad_0[2];
rad[3] = rad_0[3];
rad[0] = rad_0[2];
rad[1] = rad_0[3];
} else {
rad = rad_0;
}
@ -988,12 +982,7 @@ impl<Message: std::clone::Clone + 'static> Widget<Message, crate::Theme, crate::
) {
let new_root = self.update(event, layout, cursor, renderer, clipboard, shell);
#[cfg(all(
feature = "multi-window",
feature = "wayland",
feature = "surface-message",
target_os = "linux"
))]
#[cfg(wayland_platform)]
if matches!(WINDOWING_SYSTEM.get(), Some(WindowingSystem::Wayland))
&& let Some((new_root, _new_ms)) = new_root
{
@ -1268,12 +1257,7 @@ pub(crate) fn init_root_menu<Message: Clone>(
});
}
#[cfg(all(
feature = "multi-window",
feature = "wayland",
target_os = "linux",
feature = "surface-message"
))]
#[cfg(wayland_platform)]
pub(super) fn init_root_popup_menu<Message>(
menu: &mut Menu<'_, Message>,
renderer: &crate::Renderer,
@ -1522,7 +1506,9 @@ where
// cursor is outside
{
last_menu_state.index = None;
if last_menu_state.index.take().is_some() {
shell.request_redraw();
}
shell.capture_event();
return new_menu_root;
}
@ -1568,18 +1554,23 @@ where
.as_ref()
.is_some_and(|i| *i != new_index && !active_menu[*i].children.is_empty());
#[cfg(all(feature = "multi-window", feature = "wayland", target_os = "linux", feature = "surface-message"))]
if matches!(WINDOWING_SYSTEM.get(), Some(WindowingSystem::Wayland)) && remove
&& let Some(id) = state.popup_id.remove(&menu.window_id) {
#[cfg(wayland_platform)]
if matches!(WINDOWING_SYSTEM.get(), Some(WindowingSystem::Wayland)) && remove {
if let Some(id) = state.popup_id.remove(&menu.window_id) {
state.active_root.truncate(menu.depth + 1);
shell.publish((menu.on_surface_action.as_ref().unwrap())({
crate::surface::action::destroy_popup(id)
}));
}
}
let item = &active_menu[new_index];
// set new index
let old_index = last_menu_state.index.replace(new_index);
if old_index != Some(new_index) {
shell.request_redraw();
}
// get new active item
// * add new menu if the new item is a menu
if !item.children.is_empty() && old_index.is_none_or(|i| i != new_index) {
@ -1712,6 +1703,7 @@ fn process_scroll_events<Message>(
}
}
shell.capture_event();
shell.request_redraw();
});
}