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

Abierto Apto para principiantes
#14,133 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 8 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
78/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
linux, python
Área
desktop

Línea de trabajo

Localiza el código fuente del applet Sticky Notes e inspecciona get_direction() y find_note_location(). Reproduce con el panel en la parte superior y luego verifica que el cálculo de posición sume workarea.x/workarea.y y que la comprobación de límites use el ancho y el alto de la nota en el orden correcto. Hecho significa que Top Right/Top Center se abren debajo del panel superior y el fallback ya no se dispara.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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
Lenguaje dominante
JavaScript
Estrellas
5.7k
Forks
941
Merge medio
7 d 9 h
PR fusionados (30 d)
13

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de linuxmint/cinnamon

Todos los issues de linuxmint/cinnamon

Issues similares

Más issues de JavaScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.