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

Đang mở Phù hợp với người mới
#14,133 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 8 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
78/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
linux, python
Lĩnh vực
desktop

Hướng nghiên cứu

Xác định mã nguồn của applet Sticky Notes và kiểm tra get_direction() và find_note_location(). Tái hiện với panel ở trên cùng, sau đó xác minh rằng phép tính vị trí cộng workarea.x/workarea.y và rằng kiểm tra biên dùng chiều rộng và chiều cao của note theo đúng thứ tự. Hoàn thành nghĩa là Top Right/Top Center mở bên dưới panel trên cùng và fallback không còn kích hoạt nữa.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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
Ngôn ngữ chính
JavaScript
Star
5.7k
Fork
941
Merge trung bình
6 ngày 18 giờ
Pull request đã merge (30 ngày)
12

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của linuxmint/cinnamon

Tất cả issue của linuxmint/cinnamon

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.