xapp-status applet: status icon labels are ellipsized to "..." when the panel zone is a fraction of a pixel short

Đang mở Phù hợp với người mới
#14,096 1 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

@Priyeshshrivastav đang làm issue này rồi.

Từ ngày 4/11/2026.

Đánh giá

Độ khó
1/5
Thời gian dự kiến
Dưới một giờ
Mức phù hợp với người mới
88/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ệ
javascript
Lĩnh vực
desktop

Hướng nghiên cứu

Mở files/usr/share/cinnamon/applets/[email protected]/applet.js và đọc phần thiết lập nhãn của XAppStatusIcon quanh dòng 131. So sánh với thiết lập TextIconApplet trong js/ui/applet.js; issue đưa ra một thay đổi một dòng để thử. Hoàn tất khi nhãn trạng thái XApp hiển thị đầy đủ văn bản dù chiều rộng panel thiếu một phần nhỏ.

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

Mô tả

Distribution

Linux Mint 22.3 (X11)

Package version

6.6.9

Graphics hardware in use

No response

Frequency

Always

Bug description

Hi, and thanks for Cinnamon!

The label of an XApp status icon (for example a counter like 3 or 12) is shown as only ... in the panel, although the panel has plenty of free space. Labels of applets built on TextIconApplet (such as the notifications counter) in the same panel are not affected.

Cause, as far as I can tell: if any applet in the right zone reports a fractional natural width (here multicore-sys-monitor, 173.48 px), Panel._calcBoxSizes() rounds the zone boundary to the nearest pixel, so the zone gets up to half a pixel less than it asked for (931 px for 931.48 px). The xapp-status label is the only child in the zone whose minimum width is smaller than its natural width, so the box layout takes the shortfall from it. Its ClutterText ellipsizes, and a label that gets 70 px instead of its natural 71 px is drawn as ....

TextIconApplet labels don't have this problem because js/ui/applet.js sets clutter_text.ellipsize = Pango.EllipsizeMode.NONE on them.

Steps to reproduce
  1. Have an applet with a fractional natural width in the right zone of the panel (for example multicore-sys-monitor@ccadeptic23). Its width can be checked in Looking Glass with actor.get_preferred_width(-1).
  2. Show an XApp status icon with a label, e.g.:
    import gi
    gi.require_version("XApp", "1.0"); gi.require_version("Gtk", "3.0")
    from gi.repository import XApp, Gtk
    icon = XApp.StatusIcon()
    icon.set_icon_name("dialog-information-symbolic")
    icon.set_label("12")
    Gtk.main()
    
  3. The label is shown as ... (or cut short, e.g. ↑12 ↓7 ✎3 as ↑12 ↓7 ...).
Expected behavior

The label is shown in full, like the labels of other applets.

Additional information

A one-line fix, the same setting TextIconApplet uses. I've been running it as a user override in ~/.local/share/cinnamon/applets/ and labels now render in full, with no other change in the panel:

--- a/files/usr/share/cinnamon/applets/[email protected]/applet.js
+++ b/files/usr/share/cinnamon/applets/[email protected]/applet.js
@@ -1,6 +1,7 @@
 const Cinnamon = imports.gi.Cinnamon;
 const Lang = imports.lang;
 const St = imports.gi.St;
+const Pango = imports.gi.Pango;
 const Gio = imports.gi.Gio;
 const Clutter = imports.gi.Clutter;
 const Interfaces = imports.misc.interfaces;
@@ -131,6 +132,7 @@ class XAppStatusIcon {
         this.label = new St.Label({
             'y-align': St.Align.END,
         });
+        this.label.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
 
         this.actor.add_actor(this.icon_holder);
         this.actor.add_actor(this.label);

The rounding in _calcBoxSizes() might be worth a look separately, but this alone fixes the visible problem.

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.