mga-partial-workaround-for-issue-41.patch 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334
  1. diff -Naurp lxpanel-0.10.1.orig/plugins/batt/batt.c lxpanel-0.10.1/plugins/batt/batt.c
  2. --- lxpanel-0.10.1.orig/plugins/batt/batt.c 2019-03-01 00:31:41.000000000 +0100
  3. +++ lxpanel-0.10.1/plugins/batt/batt.c 2022-10-14 11:14:57.009987046 +0200
  4. @@ -446,6 +446,23 @@ static void updateSizes(lx_battery *b)
  5. b->width = b->length;
  6. }
  7. +#if GTK_CHECK_VERSION(3, 0, 0)
  8. +static gboolean enable_query_tooltip(gpointer p_data)
  9. +{
  10. + GtkWidget *widget = p_data;
  11. + gtk_widget_set_has_tooltip(widget, TRUE);
  12. + return G_SOURCE_REMOVE;
  13. +}
  14. +
  15. +static gboolean batt_query_tooltip(GtkWidget *widget, gint x, gint y, gboolean keyboard_tip, GtkTooltip *tooltip, gpointer p_data)
  16. +{
  17. + gtk_widget_set_has_tooltip(widget, FALSE);
  18. + GtkWidget *parent = gtk_widget_get_toplevel(widget);
  19. + gtk_widget_set_tooltip_text(parent, gtk_widget_get_tooltip_text(widget));
  20. + g_timeout_add(2 * G_TIME_SPAN_MILLISECOND, enable_query_tooltip, widget);
  21. + return TRUE;
  22. +}
  23. +#endif
  24. static GtkWidget * constructor(LXPanel *panel, config_setting_t *settings)
  25. {
  26. @@ -564,6 +581,10 @@ static GtkWidget * constructor(LXPanel *
  27. /* Start the update loop */
  28. lx_b->timer = g_timeout_add_seconds( 9, (GSourceFunc) update_timout, (gpointer) lx_b);
  29. +#if GTK_CHECK_VERSION(3, 0, 0)
  30. + g_signal_connect(lx_b->drawingArea, "query-tooltip", G_CALLBACK(batt_query_tooltip), NULL);
  31. +#endif
  32. +
  33. RET(p);
  34. }
  35. diff -Naurp lxpanel-0.10.1.orig/plugins/launch-button.c lxpanel-0.10.1/plugins/launch-button.c
  36. --- lxpanel-0.10.1.orig/plugins/launch-button.c 2019-01-13 22:35:07.000000000 +0100
  37. +++ lxpanel-0.10.1/plugins/launch-button.c 2022-10-14 11:14:57.009987046 +0200
  38. @@ -39,6 +39,24 @@ struct _LaunchButton
  39. };
  40. +#if GTK_CHECK_VERSION(3, 0, 0)
  41. +static gboolean enable_query_tooltip(gpointer p_data)
  42. +{
  43. + GtkWidget *widget = p_data;
  44. + gtk_widget_set_has_tooltip(widget, TRUE);
  45. + return G_SOURCE_REMOVE;
  46. +}
  47. +
  48. +static gboolean launch_query_tooltip(GtkWidget *widget, gint x, gint y, gboolean keyboard_tip, GtkTooltip *tooltip, gpointer p_data)
  49. +{
  50. + gtk_widget_set_has_tooltip(widget, FALSE);
  51. + GtkWidget *parent = gtk_widget_get_toplevel(widget);
  52. + gtk_widget_set_tooltip_text(parent, gtk_widget_get_tooltip_text(widget));
  53. + g_timeout_add(2 * G_TIME_SPAN_MILLISECOND, enable_query_tooltip, widget);
  54. + return TRUE;
  55. +}
  56. +#endif
  57. +
  58. static void launch_button_job_finished(FmJob *job, LaunchButton *self)
  59. {
  60. GtkWidget *image;
  61. @@ -179,6 +197,9 @@ LaunchButton *launch_button_new(LXPanel
  62. return NULL;
  63. }
  64. }
  65. +#if GTK_CHECK_VERSION(3, 0, 0)
  66. + g_signal_connect(GTK_WIDGET(self), "query-tooltip", G_CALLBACK(launch_query_tooltip), NULL);
  67. +#endif
  68. return self;
  69. }
  70. diff -Naurp lxpanel-0.10.1.orig/plugins/monitors/monitors.c lxpanel-0.10.1/plugins/monitors/monitors.c
  71. --- lxpanel-0.10.1.orig/plugins/monitors/monitors.c 2019-01-13 22:37:42.000000000 +0100
  72. +++ lxpanel-0.10.1/plugins/monitors/monitors.c 2022-10-14 11:14:57.010987046 +0200
  73. @@ -220,6 +220,24 @@ monitor_set_foreground_color(MonitorsPlu
  74. * End of monitor functions *
  75. ******************************************************************************/
  76. +#if GTK_CHECK_VERSION(3, 0, 0)
  77. +static gboolean enable_query_tooltip(gpointer p_data)
  78. +{
  79. + GtkWidget *widget = p_data;
  80. + gtk_widget_set_has_tooltip(widget, TRUE);
  81. + return G_SOURCE_REMOVE;
  82. +}
  83. +
  84. +static gboolean monitor_query_tooltip(GtkWidget *widget, gint x, gint y, gboolean keyboard_tip, GtkTooltip *tooltip, gpointer p_data)
  85. +{
  86. + gtk_widget_set_has_tooltip(widget, FALSE);
  87. + GtkWidget *parent = gtk_widget_get_toplevel(widget);
  88. + gtk_widget_set_tooltip_text(parent, gtk_widget_get_tooltip_text(widget));
  89. + g_timeout_add(2 * G_TIME_SPAN_MILLISECOND, enable_query_tooltip, widget);
  90. + return TRUE;
  91. +}
  92. +#endif
  93. +
  94. /******************************************************************************
  95. * CPU monitor *
  96. ******************************************************************************/
  97. @@ -285,6 +303,9 @@ cpu_tooltip_update (Monitor *m)
  98. tooltip_text = g_strdup_printf(_("CPU usage: %.2f%%"),
  99. m->stats[ring_pos] * 100);
  100. gtk_widget_set_tooltip_text(m->da, tooltip_text);
  101. +#if GTK_CHECK_VERSION(3, 0, 0)
  102. + g_signal_connect(m->da, "query-tooltip", G_CALLBACK(monitor_query_tooltip), NULL);
  103. +#endif
  104. g_free(tooltip_text);
  105. }
  106. }
  107. @@ -387,6 +408,9 @@ mem_tooltip_update (Monitor *m)
  108. m->stats[ring_pos] * m->total / 1024,
  109. m->stats[ring_pos] * 100);
  110. gtk_widget_set_tooltip_text(m->da, tooltip_text);
  111. +#if GTK_CHECK_VERSION(3, 0, 0)
  112. + g_signal_connect(m->da, "query-tooltip", G_CALLBACK(monitor_query_tooltip), NULL);
  113. +#endif
  114. g_free(tooltip_text);
  115. }
  116. }
  117. diff -Naurp lxpanel-0.10.1.orig/plugins/netstat/statusicon.c lxpanel-0.10.1/plugins/netstat/statusicon.c
  118. --- lxpanel-0.10.1.orig/plugins/netstat/statusicon.c 2019-01-13 22:35:07.000000000 +0100
  119. +++ lxpanel-0.10.1/plugins/netstat/statusicon.c 2022-10-14 11:23:56.563275687 +0200
  120. @@ -26,6 +26,24 @@
  121. #include "statusicon.h"
  122. #include "misc.h"
  123. +#if GTK_CHECK_VERSION(3, 0, 0)
  124. +static gboolean enable_query_tooltip(gpointer p_data)
  125. +{
  126. + GtkWidget *widget = p_data;
  127. + gtk_widget_set_has_tooltip(widget, TRUE);
  128. + return G_SOURCE_REMOVE;
  129. +}
  130. +
  131. +static gboolean statusicon_query_tooltip(GtkWidget *widget, gint x, gint y, gboolean keyboard_tip, GtkTooltip *tooltip, gpointer p_data)
  132. +{
  133. + gtk_widget_set_has_tooltip(widget, FALSE);
  134. + GtkWidget *parent = gtk_widget_get_toplevel(widget);
  135. + gtk_widget_set_tooltip_text(parent, gtk_widget_get_tooltip_text(widget));
  136. + g_timeout_add(2 * G_TIME_SPAN_MILLISECOND, enable_query_tooltip, widget);
  137. + return TRUE;
  138. +}
  139. +#endif
  140. +
  141. struct statusicon *create_statusicon(LXPanel *panel, GtkWidget *box,
  142. const char *filename, const char *tooltips, const char* icon_name)
  143. {
  144. @@ -48,6 +66,10 @@ struct statusicon *create_statusicon(LXP
  145. /* tooltip */
  146. gtk_widget_set_tooltip_text(newicon->main, tooltips);
  147. +#if GTK_CHECK_VERSION(3, 0, 0)
  148. + g_signal_connect(newicon->main, "query-tooltip", G_CALLBACK(statusicon_query_tooltip), NULL);
  149. +#endif
  150. +
  151. return newicon;
  152. }
  153. diff -Naurp lxpanel-0.10.1.orig/plugins/task-button.c lxpanel-0.10.1/plugins/task-button.c
  154. --- lxpanel-0.10.1.orig/plugins/task-button.c 2022-10-12 13:07:42.368701277 +0200
  155. +++ lxpanel-0.10.1/plugins/task-button.c 2022-10-14 11:17:37.905073119 +0200
  156. @@ -1135,6 +1135,24 @@ static void task_update_icon(TaskButton
  157. task, NULL);
  158. }
  159. +#if GTK_CHECK_VERSION(3, 0, 0)
  160. +static gboolean enable_query_tooltip(gpointer p_data)
  161. +{
  162. + GtkWidget *widget = p_data;
  163. + gtk_widget_set_has_tooltip(widget, TRUE);
  164. + return G_SOURCE_REMOVE;
  165. +}
  166. +
  167. +static gboolean task_query_tooltip(GtkWidget *widget, gint x, gint y, gboolean keyboard_tip, GtkTooltip *tooltip, gpointer p_data)
  168. +{
  169. + gtk_widget_set_has_tooltip(widget, FALSE);
  170. + GtkWidget *parent = gtk_widget_get_toplevel(widget);
  171. + gtk_widget_set_tooltip_text(parent, gtk_widget_get_tooltip_text(widget));
  172. + g_timeout_add(2 * G_TIME_SPAN_MILLISECOND, enable_query_tooltip, widget);
  173. + return TRUE;
  174. +}
  175. +#endif
  176. +
  177. /* Draw the label and tooltip on a taskbar button. */
  178. static void task_draw_label(TaskButton *tb, gboolean bold_style, gboolean force)
  179. {
  180. @@ -1372,6 +1390,11 @@ static gboolean task_button_leave_notify
  181. {
  182. TaskButton *tb = PANEL_TASK_BUTTON(widget);
  183. +#if GTK_CHECK_VERSION(3, 0, 0)
  184. + GtkWidget *parent = gtk_widget_get_toplevel(widget);
  185. + gtk_widget_set_has_tooltip(parent, FALSE);
  186. +#endif
  187. +
  188. tb->entered_state = FALSE;
  189. task_draw_label(tb, FALSE, FALSE);
  190. if (tb->flags.flat_button)
  191. @@ -1499,6 +1522,9 @@ TaskButton *task_button_new(Window win,
  192. assemble_gui(self);
  193. /* and finally set visibility on it */
  194. gtk_widget_set_visible(GTK_WIDGET(self), self->n_visible > 0);
  195. +#if GTK_CHECK_VERSION(3, 0, 0)
  196. + g_signal_connect(GTK_WIDGET(self), "query-tooltip", G_CALLBACK(task_query_tooltip), NULL);
  197. +#endif
  198. return self;
  199. }
  200. diff -Naurp lxpanel-0.10.1.orig/plugins/weather/weatherwidget.c lxpanel-0.10.1/plugins/weather/weatherwidget.c
  201. --- lxpanel-0.10.1.orig/plugins/weather/weatherwidget.c 2019-02-22 22:21:13.000000000 +0100
  202. +++ lxpanel-0.10.1/plugins/weather/weatherwidget.c 2022-10-14 11:14:57.011987047 +0200
  203. @@ -452,6 +452,24 @@ gtk_weather_size_allocate(GtkWidget * wi
  204. gtk_widget_size_allocate(GTK_WIDGET(priv->hbox), &box_allocation);
  205. }
  206. +#if GTK_CHECK_VERSION(3, 0, 0)
  207. +static gboolean enable_query_tooltip(gpointer p_data)
  208. +{
  209. + GtkWidget *widget = p_data;
  210. + gtk_widget_set_has_tooltip(widget, TRUE);
  211. + return G_SOURCE_REMOVE;
  212. +}
  213. +
  214. +static gboolean weather_query_tooltip(GtkWidget *widget, gint x, gint y, gboolean keyboard_tip, GtkTooltip *tooltip, gpointer p_data)
  215. +{
  216. + gtk_widget_set_has_tooltip(widget, FALSE);
  217. + GtkWidget *parent = gtk_widget_get_toplevel(widget);
  218. + gtk_widget_set_tooltip_text(parent, gtk_widget_get_tooltip_text(widget));
  219. + g_timeout_add(2 * G_TIME_SPAN_MILLISECOND, enable_query_tooltip, widget);
  220. + return TRUE;
  221. +}
  222. +#endif
  223. +
  224. /**
  225. * Helper function to update the widget based on internal change.
  226. *
  227. @@ -530,6 +548,10 @@ gtk_weather_render(GtkWeather * weather)
  228. gtk_widget_set_tooltip_text(GTK_WIDGET(weather), tooltip_text);
  229. +#if GTK_CHECK_VERSION(3, 0, 0)
  230. + g_signal_connect(weather, "query-tooltip", G_CALLBACK(weather_query_tooltip), NULL);
  231. +#endif
  232. +
  233. g_free(tooltip_text);
  234. }
  235. diff -Naurp lxpanel-0.10.1.orig/src/misc.c lxpanel-0.10.1/src/misc.c
  236. --- lxpanel-0.10.1.orig/src/misc.c 2019-01-13 22:35:07.000000000 +0100
  237. +++ lxpanel-0.10.1/src/misc.c 2022-10-14 11:55:44.518153250 +0200
  238. @@ -1258,6 +1258,11 @@ static gboolean fb_button_enter(GtkImage
  239. /* Handler for "leave-notify-event" signal on image that has highlighting requested. */
  240. static gboolean fb_button_leave(GtkImage * widget, GdkEventCrossing * event, gpointer user_data)
  241. {
  242. +#if GTK_CHECK_VERSION(3, 0, 0)
  243. + GtkWidget *parent = gtk_widget_get_toplevel(GTK_WIDGET(widget));
  244. + gtk_widget_set_has_tooltip(parent, FALSE);
  245. +#endif
  246. +
  247. if (gtk_image_get_storage_type(widget) == GTK_IMAGE_PIXBUF)
  248. {
  249. ImgData * data = (ImgData *) g_object_get_qdata(G_OBJECT(widget), img_data_id);
  250. diff -Naurp lxpanel-0.10.1.orig/src/panel.c lxpanel-0.10.1/src/panel.c
  251. --- lxpanel-0.10.1.orig/src/panel.c 2022-10-12 13:07:42.360701278 +0200
  252. +++ lxpanel-0.10.1/src/panel.c 2022-10-14 11:14:57.012987047 +0200
  253. @@ -401,6 +401,14 @@ static gboolean lxpanel_button_press(Gtk
  254. return FALSE;
  255. }
  256. +#if GTK_CHECK_VERSION(3, 0, 0)
  257. +static gboolean lxpanel_enter_notify(GtkWidget* widget, GdkEventCrossing event, gpointer p_data)
  258. +{
  259. + gtk_widget_set_has_tooltip(widget, FALSE);
  260. + return FALSE;
  261. +}
  262. +#endif
  263. +
  264. static void lxpanel_class_init(PanelToplevelClass *klass)
  265. {
  266. GObjectClass *gobject_class = (GObjectClass *)klass;
  267. @@ -430,6 +438,7 @@ static void lxpanel_class_init(PanelTopl
  268. widget_class->button_press_event = lxpanel_button_press;
  269. widget_class->button_release_event = _lxpanel_button_release;
  270. widget_class->motion_notify_event = _lxpanel_motion_notify;
  271. + widget_class->enter_notify_event = lxpanel_enter_notify;
  272. signals[ICON_SIZE_CHANGED] =
  273. g_signal_new("icon-size-changed",
  274. diff -Naurp lxpanel-0.10.1.orig/src/plugin.c lxpanel-0.10.1/src/plugin.c
  275. --- lxpanel-0.10.1.orig/src/plugin.c 2021-01-29 23:28:51.000000000 +0100
  276. +++ lxpanel-0.10.1/src/plugin.c 2022-10-14 11:14:57.012987047 +0200
  277. @@ -499,6 +499,24 @@ static void on_size_allocate(GtkWidget *
  278. // _queue_panel_calculate_size(p);
  279. }
  280. +#if GTK_CHECK_VERSION(3, 0, 0)
  281. +static gboolean enable_query_tooltip(gpointer p_data)
  282. +{
  283. + GtkWidget *widget = p_data;
  284. + gtk_widget_set_has_tooltip(widget, TRUE);
  285. + return G_SOURCE_REMOVE;
  286. +}
  287. +
  288. +static gboolean plugin_query_tooltip(GtkWidget *widget, gint x, gint y, gboolean keyboard_tip, GtkTooltip *tooltip, gpointer p_data)
  289. +{
  290. + gtk_widget_set_has_tooltip(widget, FALSE);
  291. + GtkWidget *parent = gtk_widget_get_toplevel(widget);
  292. + gtk_widget_set_tooltip_text(parent, gtk_widget_get_tooltip_text(widget));
  293. + g_timeout_add(2 * G_TIME_SPAN_MILLISECOND, enable_query_tooltip, widget);
  294. + return TRUE;
  295. +}
  296. +#endif
  297. +
  298. GtkWidget *lxpanel_add_plugin(LXPanel *p, const char *name, config_setting_t *cfg, gint at)
  299. {
  300. const LXPanelPluginInit *init;
  301. @@ -587,6 +605,11 @@ GtkWidget *lxpanel_add_plugin(LXPanel *p
  302. g_object_set_qdata(G_OBJECT(widget), lxpanel_plugin_qinit, (gpointer)init);
  303. g_object_set_qdata_full(G_OBJECT(widget), lxpanel_plugin_qsize,
  304. g_new0(GdkRectangle, 1), g_free);
  305. +
  306. +#if GTK_CHECK_VERSION(3, 0, 0)
  307. + g_signal_connect(widget, "query-tooltip", G_CALLBACK(plugin_query_tooltip), NULL);
  308. +#endif
  309. +
  310. return widget;
  311. }