summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorColomban Wendling <[email protected]>2024-02-21 19:13:36 +0100
committerColomban Wendling <[email protected]>2024-02-26 20:43:18 +0100
commit2d3cec67ab41e70479d75beb5f884e1a4551ea92 (patch)
tree7261a16a23a5aa8e19da95685010a29fa257f310 /src
parent5367553db0e3f22deb05dab65a79c79634dae327 (diff)
downloadmarco-2d3cec67ab41e70479d75beb5f884e1a4551ea92.tar.bz2
marco-2d3cec67ab41e70479d75beb5f884e1a4551ea92.tar.xz
tabpopup: Stop spamming the ATs with label changes at startupHEADmaster
Diffstat (limited to 'src')
-rw-r--r--src/ui/tabpopup.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/ui/tabpopup.c b/src/ui/tabpopup.c
index 9f0cc236..892de65b 100644
--- a/src/ui/tabpopup.c
+++ b/src/ui/tabpopup.c
@@ -408,13 +408,6 @@ meta_ui_tab_popup_new (const MetaTabEntry *entries,
popup->label = gtk_label_new ("");
- /* Set the accessible role of the label to a status bar so it
- * will emit name changed events that can be used by screen
- * readers.
- */
- obj = gtk_widget_get_accessible (popup->label);
- atk_object_set_role (obj, ATK_ROLE_STATUSBAR);
-
gtk_widget_set_margin_start (popup->label, 16);
gtk_widget_set_margin_end (popup->label, 16);
gtk_widget_set_margin_top (popup->label, 0);
@@ -489,6 +482,15 @@ meta_ui_tab_popup_new (const MetaTabEntry *entries,
/* Make it so that we ellipsize if the text is too long */
gtk_label_set_ellipsize (GTK_LABEL (popup->label), PANGO_ELLIPSIZE_END);
+ /* Set the accessible role of the label to a status bar so it
+ * will emit name changed events that can be used by screen
+ * readers.
+ * We do this *after* messing with the label content for computing the size
+ * not to send a change even for each entry at start.
+ */
+ obj = gtk_widget_get_accessible (popup->label);
+ atk_object_set_role (obj, ATK_ROLE_STATUSBAR);
+
int default_window_width = 0; /* 0 == small as possible, truncate label */
if (expand_for_titles && top <= 1 && left < width)