diff options
author | Antenore Gatta <antenore.gatta@kyndryl.com> | 2021-10-29 14:51:03 +0300 |
---|---|---|
committer | Antenore Gatta <antenore.gatta@kyndryl.com> | 2021-10-29 14:51:03 +0300 |
commit | d213873ca1da4e41b202671c1cb5d0a2d5fbb9d2 (patch) | |
tree | 886623cdd3e3fdc9face2f43ce7b497ed89e8392 | |
parent | 6eccc4844cb508d29afc1d503ae0df9816a99885 (diff) |
Compile time warning fixes
-rw-r--r-- | plugins/rdp/rdp_cliprdr.c | 2 | ||||
-rw-r--r-- | src/rcw.c | 22 | ||||
-rw-r--r-- | src/remmina_icon.c | 16 |
3 files changed, 25 insertions, 15 deletions
diff --git a/plugins/rdp/rdp_cliprdr.c b/plugins/rdp/rdp_cliprdr.c index f8de346b2..0cd22350a 100644 --- a/plugins/rdp/rdp_cliprdr.c +++ b/plugins/rdp/rdp_cliprdr.c @@ -711,8 +711,8 @@ CLIPRDR_FORMAT_LIST *remmina_rdp_cliprdr_get_client_format_list(RemminaProtocolW } *retp; formats = NULL; - retp = NULL; + loccount = 0; gtkClipboard = gtk_widget_get_clipboard(rfi->drawing_area, GDK_SELECTION_CLIPBOARD); if (gtkClipboard) @@ -427,7 +427,7 @@ static void rcw_kp_ungrab(RemminaConnectionWindow *cnnwin) TRACE_CALL(__func__); GdkDisplay *display; -#if GTK_CHECK_VERSION(3, 24, 0) +#if GTK_CHECK_VERSION(3, 20, 0) GdkSeat *seat; #else GdkDeviceManager *manager; @@ -444,7 +444,7 @@ static void rcw_kp_ungrab(RemminaConnectionWindow *cnnwin) } display = gtk_widget_get_display(GTK_WIDGET(cnnwin)); -#if GTK_CHECK_VERSION(3, 24, 0) +#if GTK_CHECK_VERSION(3, 20, 0) seat = gdk_display_get_default_seat(display); // keyboard = gdk_seat_get_pointer(seat); #else @@ -461,7 +461,7 @@ static void rcw_kp_ungrab(RemminaConnectionWindow *cnnwin) -#if GTK_CHECK_VERSION(3, 24, 0) +#if GTK_CHECK_VERSION(3, 20, 0) /* We can use gtk_seat_grab()/_ungrab() only after GTK 3.24 */ gdk_seat_ungrab(seat); #else @@ -492,7 +492,7 @@ static gboolean rcw_keyboard_grab_retry(gpointer user_data) static void rcw_pointer_ungrab(RemminaConnectionWindow *cnnwin) { -#if GTK_CHECK_VERSION(3, 24, 0) +#if GTK_CHECK_VERSION(3, 20, 0) GdkSeat *seat; GdkDisplay *display; if (!cnnwin->priv->pointer_captured) @@ -507,7 +507,7 @@ static void rcw_pointer_ungrab(RemminaConnectionWindow *cnnwin) static void rcw_pointer_grab(RemminaConnectionWindow *cnnwin) { TRACE_CALL(__func__); -#if GTK_CHECK_VERSION(3, 24, 0) +#if GTK_CHECK_VERSION(3, 20, 0) GdkSeat *seat; GdkDisplay *display; GdkGrabStatus ggs; @@ -538,7 +538,7 @@ static void rcw_keyboard_grab(RemminaConnectionWindow *cnnwin) TRACE_CALL(__func__); GdkDisplay *display; -#if GTK_CHECK_VERSION(3, 24, 0) +#if GTK_CHECK_VERSION(3, 20, 0) GdkSeat *seat; #else GdkDeviceManager *manager; @@ -554,7 +554,7 @@ static void rcw_keyboard_grab(RemminaConnectionWindow *cnnwin) } display = gtk_widget_get_display(GTK_WIDGET(cnnwin)); -#if GTK_CHECK_VERSION(3, 24, 0) +#if GTK_CHECK_VERSION(3, 20, 0) seat = gdk_display_get_default_seat(display); keyboard = gdk_seat_get_pointer(seat); #else @@ -588,14 +588,12 @@ static void rcw_keyboard_grab(RemminaConnectionWindow *cnnwin) * Therefore is important for GTK to use Xinput2 instead of core X events * by unsetting GDK_CORE_DEVICE_EVENTS */ -#if GTK_CHECK_VERSION(3, 24, 0) +#if GTK_CHECK_VERSION(3, 20, 0) ggs = gdk_seat_grab(seat, gtk_widget_get_window(GTK_WIDGET(cnnwin)), GDK_SEAT_CAPABILITY_KEYBOARD, TRUE, NULL, NULL, NULL, NULL); #else - G_GNUC_BEGIN_IGNORE_DEPRECATIONS - ggs = gdk_device_grab(keyboard, gtk_widget_get_window(GTK_WIDGET(cnnwin)), GDK_OWNERSHIP_WINDOW, - TRUE, GDK_KEY_PRESS | GDK_KEY_RELEASE, NULL, GDK_CURRENT_TIME); - G_GNUC_END_IGNORE_DEPRECATIONS + ggs = gdk_device_grab(keyboard, gtk_widget_get_window(GTK_WIDGET(cnnwin)), GDK_OWNERSHIP_WINDOW, + TRUE, GDK_KEY_PRESS | GDK_KEY_RELEASE, NULL, GDK_CURRENT_TIME); #endif if (ggs != GDK_GRAB_SUCCESS) { #if DEBUG_KB_GRABBING diff --git a/src/remmina_icon.c b/src/remmina_icon.c index 20fabab0a..e1bf80c94 100644 --- a/src/remmina_icon.c +++ b/src/remmina_icon.c @@ -40,7 +40,9 @@ #include "remmina_widget_pool.h" #include "remmina_pref.h" #include "remmina_exec.h" +#ifdef HAVE_LIBAVAHI_CLIENT #include "remmina_avahi.h" +#endif #include "remmina_applet_menu_item.h" #include "remmina_applet_menu.h" #include "rcw.h" @@ -60,7 +62,9 @@ typedef struct _RemminaIcon { AppIndicator * icon; gboolean indicator_connected; +#ifdef HAVE_LIBAVAHI_CLIENT RemminaAvahi * avahi; +#endif guint32 popup_time; gchar * autostart_file; } RemminaIcon; @@ -75,10 +79,12 @@ void remmina_icon_destroy(void) app_indicator_set_status(remmina_icon.icon, APP_INDICATOR_STATUS_PASSIVE); remmina_icon.icon = NULL; } +#ifdef HAVE_LIBAVAHI_CLIENT if (remmina_icon.avahi) { remmina_avahi_free(remmina_icon.avahi); remmina_icon.avahi = NULL; } +#endif if (remmina_icon.autostart_file) { g_free(remmina_icon.autostart_file); remmina_icon.autostart_file = NULL; @@ -103,6 +109,7 @@ static void remmina_icon_about(void) remmina_exec_command(REMMINA_COMMAND_ABOUT, NULL); } +#ifdef HAVE_LIBAVAHI_CLIENT static void remmina_icon_enable_avahi(GtkCheckMenuItem *checkmenuitem, gpointer data) { TRACE_CALL(__func__); @@ -119,6 +126,7 @@ static void remmina_icon_enable_avahi(GtkCheckMenuItem *checkmenuitem, gpointer } remmina_pref_save(); } +#endif static void remmina_icon_populate_additional_menu_item(GtkWidget *menu) { @@ -208,11 +216,12 @@ static void remmina_icon_populate_extra_menu_item(GtkWidget *menu) TRACE_CALL(__func__); GtkWidget *menuitem; gboolean new_ontop; - GHashTableIter iter; - gchar *tmp; new_ontop = remmina_pref.applet_new_ontop; +#ifdef HAVE_LIBAVAHI_CLIENT + GHashTableIter iter; + gchar *tmp; /* Iterate all discovered services from Avahi */ if (remmina_icon.avahi) { g_hash_table_iter_init(&iter, remmina_icon.avahi->discovered_services); @@ -222,6 +231,7 @@ static void remmina_icon_populate_extra_menu_item(GtkWidget *menu) remmina_applet_menu_add_item(REMMINA_APPLET_MENU(menu), REMMINA_APPLET_MENU_ITEM(menuitem)); } } +#endif /* New Connection */ menuitem = remmina_applet_menu_item_new(REMMINA_APPLET_MENU_ITEM_NEW); @@ -390,6 +400,7 @@ void remmina_icon_init(void) /* With libappindicator we can also change the icon on the fly */ app_indicator_set_icon(remmina_icon.icon, remmina_panel); } +#ifdef HAVE_LIBAVAHI_CLIENT if (!remmina_icon.avahi) remmina_icon.avahi = remmina_avahi_new(); if (remmina_icon.avahi) { @@ -400,6 +411,7 @@ void remmina_icon_init(void) remmina_avahi_stop(remmina_icon.avahi); } } +#endif if (!remmina_icon.autostart_file && !remmina_pref.disable_tray_icon) { remmina_icon.autostart_file = g_strdup_printf("%s/.config/autostart/remmina-applet.desktop", g_get_home_dir()); remmina_icon_create_autostart_file(); |