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

Aperta Adatta ai principianti
#14,133 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 8 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
78/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
linux, python
Ambito
desktop

Direzione di ricerca

Individua il codice sorgente dell'applet Sticky Notes e ispeziona get_direction() e find_note_location(). Riproduci con il pannello in alto, poi verifica che il calcolo della posizione aggiunga workarea.x/workarea.y e che il controllo dei limiti usi la larghezza e l'altezza della nota nell'ordine corretto. Fatto significa che Top Right/Top Center si aprono sotto il pannello superiore e il fallback non viene più attivato.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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
Lingua principale
JavaScript
Stelle
5.7k
Fork
941
Merge medio
7g 9h
PR unite (30g)
13

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di linuxmint/cinnamon

Tutte le issue di linuxmint/cinnamon

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.