Bug 463201

Summary: Unable to display tooltips and repeated display requests when using a custom widget
Product: [Plasma] Breeze Reporter: Gaël Bonithon <trash.paradise>
Component: gtk themeAssignee: Plasma Bugs List <plasma-bugs-null>
Status: REPORTED ---    
Severity: normal CC: agrinev98, nate, uhhadd
Priority: NOR    
Version First Reported In: 5.26.4   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

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);
```