Bug 463201 - Unable to display tooltips and repeated display requests when using a custom widget
Summary: Unable to display tooltips and repeated display requests when using a custom ...
Status: REPORTED
Alias: None
Product: Breeze
Classification: Plasma
Component: gtk theme (show other bugs)
Version: 5.26.4
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-12-18 18:01 UTC by Gaël Bonithon
Modified: 2023-01-05 19:06 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gaël Bonithon 2022-12-18 18:01:58 UTC
SUMMARY
***
A recent change in the Xfce4-panel code brought up a bug [1] that I think comes from this theme. The other tested themes do not have this problem, I don't think anything bad is done in the GtkWidget::query-tooltip signal handler [2], and simply replacing `gtk_tooltip_set_custom()` with `gtk_tooltip_set_text/icon()` allows the tooltip to be displayed again (however `gtk_tooltip_set_custom()` is required here).

[1] https://gitlab.xfce.org/xfce/xfce4-panel/-/issues/674
[2] https://gitlab.xfce.org/xfce/xfce4-panel/-/blob/7dca229573ae38adb5440841d346c57b674730ec/plugins/launcher/launcher.c#L2397
***

STEPS TO REPRODUCE
1. Hover over a panel launcher

OBSERVED RESULT
Flickering, high CPU usage, no tooltip display

EXPECTED RESULT
Tooltip display with reasonable CPU usage

SOFTWARE/OS VERSIONS
Already specified above

ADDITIONAL INFORMATION
Comment 1 Gaël Bonithon 2022-12-19 11:01:42 UTC
More precisely, the problem seems to occur only when using a box: this code put in the GtkWidget::query-tooltip signal handler works correctly:
```
gtk_tooltip_set_custom (tooltip, gtk_label_new ("test"));
```

while this one allows to reproduce the bug:
```
GtkWidget *label = gtk_label_new ("test");
GtkWidget *box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_box_pack_start (GTK_BOX (box), label, TRUE, FALSE, 0);
gtk_widget_show_all (box);
gtk_tooltip_set_custom (tooltip, box);
```