diff options
author | rbuj <[email protected]> | 2021-02-01 17:43:38 +0100 |
---|---|---|
committer | Luke from DC <[email protected]> | 2021-02-23 06:01:06 +0000 |
commit | 693598303950a7ad75bbfb7c0b201ed79da45530 (patch) | |
tree | 8a9172c2ba79a53c9d5a1122fc9a64ccecc1e652 /plugins/xsettings | |
parent | 0f11f68f2a7e107415e6a53992582b656f13be59 (diff) | |
download | mate-settings-daemon-693598303950a7ad75bbfb7c0b201ed79da45530.tar.bz2 mate-settings-daemon-693598303950a7ad75bbfb7c0b201ed79da45530.tar.xz |
xsettings: Remove warning -Wcast-function-type
Diffstat (limited to 'plugins/xsettings')
-rw-r--r-- | plugins/xsettings/msd-xsettings-manager.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/plugins/xsettings/msd-xsettings-manager.c b/plugins/xsettings/msd-xsettings-manager.c index 33dd16d..7e4f743 100644 --- a/plugins/xsettings/msd-xsettings-manager.c +++ b/plugins/xsettings/msd-xsettings-manager.c @@ -82,6 +82,9 @@ * apps to work, and it's better to just be tiny */ #define HIDPI_MIN_HEIGHT 1500 +#define GPOINTER_TO_BOOLEAN(i) ((gboolean) ((GPOINTER_TO_INT(i) == 2) ? TRUE : FALSE)) +#define GBOOLEAN_TO_POINTER(i) (GINT_TO_POINTER ((i) ? 2 : 1)) + typedef struct _TranslationEntry TranslationEntry; typedef void (* TranslationFunc) (MateXSettingsManager *manager, TranslationEntry *trans, @@ -505,15 +508,15 @@ update_user_env_variable (const gchar *variable, } static gboolean -delayed_toggle_bg_draw (gboolean value) +delayed_toggle_bg_draw (gpointer value) { GSettings *settings; settings = g_settings_new ("org.mate.background"); - g_settings_set_boolean (settings, "show-desktop-icons", value); + g_settings_set_boolean (settings, "show-desktop-icons", GPOINTER_TO_BOOLEAN (value)); g_object_unref (settings); - return FALSE; + return G_SOURCE_REMOVE; } static void @@ -574,8 +577,8 @@ scale_change_workarounds (MateXSettingsManager *manager, int new_scale) desktop_settings = g_settings_new ("org.mate.background"); if (g_settings_get_boolean (desktop_settings, "show-desktop-icons")) { /* Delay the toggle to allow enough time for the desktop to redraw */ - g_timeout_add_seconds (1, (GSourceFunc) delayed_toggle_bg_draw, (gpointer) FALSE); - g_timeout_add_seconds (2, (GSourceFunc) delayed_toggle_bg_draw, (gpointer) TRUE); + g_timeout_add_seconds (1, delayed_toggle_bg_draw, GBOOLEAN_TO_POINTER (FALSE)); + g_timeout_add_seconds (2, delayed_toggle_bg_draw, GBOOLEAN_TO_POINTER (TRUE)); } g_object_unref (desktop_settings); } |