Skip to content

Use xfce4::connect instead of the less safe g_signal_connect

Ghost User requested to merge (removed):master into master

In this patch, the type-safe GTK wrapper functions (new file gtk.cc) have been copied from the most recent version of xfce4-cpugraph-plugin, and several new type-safe wrappers have been added as required by xfce4-sensors-plugin.

The conversion from a less safe C code to a more safe C++ code revealed several issues that were missed because of the simplicity of C's type system. Slider value handlers in the UI-style panel (in the properties dialog when tachos are selected) were returning void, instead of gboolean, which means that the sliders were being updated according to the pseudo-random value present [in the case of an AMD64 binary] in the %rax register when the handler function returned to its caller (the caller was expecting a non-random gboolean in the %rax register).

Configuration dialog changes:

  • Align elements in the UI-style panel when configuring tachos (see the screenshots below)

Before: Screenshot_20211106_022103

After: Screenshot_20211106_021815

See also: https://gitlab.xfce.org/panel-plugins/xfce4-cpugraph-plugin/-/tree/5a33de908bbed4c71648e2d60e1614c0959e9923/xfce4%2B%2B/util

Merge request reports

Loading