"Top" default positions ignored when the panel is at the top of the screen – new notes always open top left

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

维护者通常 8 天内回复

还没有人认领这个 Issue。

评估

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

调研方向

定位 Sticky Notes 小程序源码,检查 get_direction() 和 find_note_location()。在面板位于顶部的情况下复现,然后验证位置计算加上了 workarea.x/workarea.y,并且边界检查按正确顺序使用便笺的宽度和高度。完成的标准是:Top Right/Top Center 在顶部面板下方打开,且 fallback 不再触发。

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

描述

BUG
Distribution

Linux Mint 22.3

Package version

Cinnamon 6.6.9

Graphics hardware in use

No response

Frequency

Always

Bug description

With the Cinnamon panel at the top of the screen, setting Preferences → Notes → Default position to "Top Right" (or "Top Center") has no effect: every new note opens in the top left corner. "Center Right" and "Bottom Right" work as expected.

Steps to reproduce
  1. Move the Cinnamon panel to the top of the screen (panel height > 20 px).
  2. In Sticky Notes, set Default position to "Top Right".
  3. Create a new note from the tray icon.
Expected behavior

Expected: the note opens in the top right corner, below the panel.
Actual: the note opens in the top left corner.

Additional information

Cause
In get_direction() the position is computed from the workarea size only, without the workarea origin:

else:
    y = 20

With a top panel, workarea.y equals the panel height, so y = 20 lies inside the panel. find_note_location() then fails the bounds check (y < min_y) and falls back to workarea.x + 20, workarea.y + 20, i.e. top left. The same applies to x with a panel on the left.

Suggested fix: add the workarea origin, e.g. x = workarea_rect.x + … and y = workarea_rect.y + 20.

Possibly related
In the bounds check of find_note_location(), width and height seem to be swapped:

x_end = x + default-height
y_end = y + default-width

System

  • Linux Mint 22.3
  • sticky 1.31
  • Panel position: top
主要语言
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 摘要。