When using a menu bar without Wayland popup support, the menu items are
unclickable, as redrawing is never requested.
So, request a redraw after opening so the overlay menu is created and
drawn immediately.
It was found that dirs::data_dir conflicts with dirs::config_dir on
macOS and Windows.
This reverts commit 631c81b170 from
https://github.com/pop-os/libcosmic/pull/1172
- [x] I have disclosed use of any AI generated code in my commit
messages.
- If you are using an LLM, and do not fully understand the changes it is
making to the code base, do not create a PR.
- In our experience, AI generated code often results in overly complex
code that lacks enough context for a proper fix or feature inclusion.
This results in considerably longer code reviews. Due to this, AI
authored or partially authored PRs may be closed without comment.
- [x] I understand these changes in full and will be able to respond to
review comments.
- [x] My change is accurately described in the commit message.
- [x] My contribution is tested and working as described.
- [x] I have read the [Developer Certificate of
Origin](https://developercertificate.org/) and certify my contribution
under its conditions.
This works around issues with state config on macOS and Windows, where
there is no defined application state directory
---
- [x] I have disclosed use of any AI generated code in my commit
messages.
- If you are using an LLM, and do not fully understand the changes it is
making to the code base, do not create a PR.
- In our experience, AI generated code often results in overly complex
code that lacks enough context for a proper fix or feature inclusion.
This results in considerably longer code reviews. Due to this, AI
authored or partially authored PRs may be closed without comment.
- [x] I understand these changes in full and will be able to respond to
review comments.
- [x] My change is accurately described in the commit message.
- [x] My contribution is tested and working as described.
- [x] I have read the [Developer Certificate of
Origin](https://developercertificate.org/) and certify my contribution
under its conditions.
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>
The close button of closable tabs was pinned to the trailing edge, so
enabling macOS-style window controls left the window buttons on the
left and the tab crosses on the right.
Read crate::config::window_controls_position() and, when Start, place
the close button before the tab contents and shift them accordingly.
The hit-test, the text width and the drawn icon all derive from the
same position so they stay in sync.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`Dropdown::new` (the plain constructor used by any non-applet consumer) leaves `window_id`/`on_surface_action` unset, which routes the widget's `overlay()` impl to the in-window overlay path rather than the surface-action-based popup path. On that path, `update()`'s `open` closure and its close counterparts only ever requested a redraw inside the `#[cfg(wayland_platform)] if let Some(...)` block gated on those fields being set — so for the common case, opening or closing a dropdown flipped `is_open` with no redraw requested at all. The stale frame stuck around until some unrelated later event (e.g. cursor motion landing on the now-open/closed menu's bounds) forced a repaint,
making the menu appear to not open until the mouse moved, and not close until the same thing happened again on the way out.
Add an unconditional `shell.request_redraw()` at each of the three `is_open` transitions that don't already publish a Message of their own (an actual option selection already triggers a normal Message-driven redraw through the app's own update cycle, so that path needed no change):
- `open`: right after `is_open` is set true, ahead of the wayland-only surface-action block.
- the `close_operation` branch of the open/close operation state machine (`Id`-based programmatic close).
- the click-outside-closes-it branch of the mouse/touch press handler.
Fixes#1395
Cherry-pick of upstream fix (pop-os/libcosmic#1354).
The .enumerate().find_map() pattern counted ALL items (buttons +
dividers) but the resulting index was used to access a children
array containing only button entries. When a divider preceded the
target button (e.g. trash in nav bar), the index was off-by-N,
causing an out-of-bounds panic and crashing cosmic-files.
Fix: filter_map first to keep only buttons, then enumerate.