grouped-window-list: thumbnail order depends on panel position when "Sort thumbnails according to the last focused windows" is enabled

未关闭 适合新手
#14,149 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 8 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
76/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
javascript
领域
desktop

调研方向

从 grouped-window-list 小程序的 menus.js 开始,重点查看 addThumbnail() 以及调用 set_child_at_index(...) 的刷新路径。比较已排序的 appThumbnails 顺序与各 actor 插入框中的顺序,然后在顶部和底部面板上启用排序来复现问题。完成标准是:最近获得焦点的窗口在两个位置都保持在最靠近小程序的位置。

由索引模型根据 Issue 内容生成。

描述

Environment

  • Cinnamon 6.6.7 (Gentoo, X11), applet [email protected]
  • Panel at the bottom of the screen (the common/default position)
  • Applet setting "Sort thumbnails according to the last focused windows" (sort-thumbnails) enabled (default is false)

Problem

With that setting enabled, the thumbnail popup of a grouped application behaves inconsistently with respect to the panel position:

  1. Panel at the bottom (default): the most recently focused window - the whole point of the sort setting - ends up at the far end of the thumbnail row, i.e. the end furthest from the applet button. Reaching it means sweeping the pointer across the entire row of thumbnails. (And with hover-peek enabled this additionally raises every window the pointer crosses on the way.)
  2. Panel moved to the top of the screen: the very same window is placed adjacent to the applet, first in the row, and is reachable immediately.

In other words, the ordering/flip direction of the thumbnail row changes with the panel position, so the most recently used window is not reliably next to the panel button. As a workaround I had to move my whole panel from the bottom to the top of the screen because of this one setting.

Expected behaviour

The visual order of the thumbnail row should be independent of where the panel sits: with sorting enabled, the last focused window should always be the thumbnail closest to the applet/entry point (or the fill direction should be a user-configurable option), so a user with the panel at the bottom can reach the recently used window without crossing the whole list.

Code-level observation

In addThumbnail() (menus.js) the appThumbnails array is sorted by user_time descending (b.user_time - a.user_time), but the thumbnail actor is inserted with this.box.insert_actor(thumbnail.actor, -1) - always appended at the end of the box layout; only the refresh path uses this.box.set_child_at_index(...) with the sorted index. The menu itself is anchored to the source actor (super._init.call(this, groupState.trigger('getActor'), state.orientation, 0.5)), so the visible row order depends on how the popup is placed relative to the panel. The array order and the visible box order therefore diverge, and the divergence flips with the panel position - which matches the behaviour described above.

Happy to provide more details (screenshots/repro steps) if useful.

主要语言
JavaScript
星标
5.7k
派生
941
平均合并
6 天 18 小时
30 天内合并 PR
12

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

linuxmint/cinnamon 的其他 Issue

查看 linuxmint/cinnamon 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。