summaryrefslogtreecommitdiff
path: root/plugins/fullscreen
diff options
context:
space:
mode:
authorrbuj <[email protected]>2021-10-25 00:28:08 +0200
committerLuke from DC <[email protected]>2022-09-11 17:51:44 +0000
commit23748971577ddff3731eab86de92f367c598cb70 (patch)
tree784201ccdf344e318016211689e5ca67c404a30e /plugins/fullscreen
parent11d56d5d0e8e3ccb7798cd3aac4ade4c2e066a1c (diff)
downloadeom-23748971577ddff3731eab86de92f367c598cb70.tar.bz2
eom-23748971577ddff3731eab86de92f367c598cb70.tar.xz
Use GLib's new g_clear_signal_handler() function to simplify code
Diffstat (limited to 'plugins/fullscreen')
-rw-r--r--plugins/fullscreen/eom-fullscreen-plugin.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/plugins/fullscreen/eom-fullscreen-plugin.c b/plugins/fullscreen/eom-fullscreen-plugin.c
index 653a725..b2565a1 100644
--- a/plugins/fullscreen/eom-fullscreen-plugin.c
+++ b/plugins/fullscreen/eom-fullscreen-plugin.c
@@ -119,8 +119,7 @@ eom_fullscreen_plugin_activate (EomWindowActivatable *activatable)
eom_debug (DEBUG_PLUGINS);
- plugin->signal_id = g_signal_connect (G_OBJECT (view),
- "button-press-event",
+ plugin->signal_id = g_signal_connect (view, "button-press-event",
G_CALLBACK (on_button_press),
plugin->window);
}
@@ -131,7 +130,14 @@ eom_fullscreen_plugin_deactivate (EomWindowActivatable *activatable)
EomFullscreenPlugin *plugin = EOM_FULLSCREEN_PLUGIN (activatable);
GtkWidget *view = eom_window_get_view (plugin->window);
- g_signal_handler_disconnect (view, plugin->signal_id);
+#if GLIB_CHECK_VERSION(2,62,0)
+ g_clear_signal_handler (&plugin->signal_id, view);
+#else
+ if (plugin->signal_id != 0) {
+ g_signal_handler_disconnect (view, plugin->signal_id);
+ plugin->signal_id = 0;
+ }
+#endif
}
static void