Commit 7c967abb authored by Giovanni Panozzo's avatar Giovanni Panozzo

GTK+ < 3.8 compatibility, fixes #299

parent b3fc48da
......@@ -297,7 +297,11 @@ static void remmina_connection_holder_update_toolbar_opacity(RemminaConnectionHo
if (priv->floating_toolbar)
{
#if GTK_CHECK_VERSION(3, 8, 0)
gtk_widget_set_opacity(GTK_WIDGET(priv->floating_toolbar), priv->floating_toolbar_opacity);
#else
gtk_window_set_opacity(GTK_WINDOW(priv->floating_toolbar), priv->floating_toolbar_opacity);
#endif
}
}
......@@ -335,8 +339,13 @@ static gboolean remmina_connection_holder_floating_toolbar_motion(RemminaConnect
gtk_window_move(GTK_WINDOW(priv->floating_toolbar), x, y);
if (remmina_pref.invisible_toolbar && !priv->pin_down)
{
#if GTK_CHECK_VERSION(3, 8, 0)
gtk_widget_set_opacity(GTK_WIDGET(priv->floating_toolbar),
(gdouble)(y - t) / (gdouble)(-t) * priv->floating_toolbar_opacity);
(gdouble)(y - t) / (gdouble)(-t) * priv->floating_toolbar_opacity);
#else
gtk_window_set_opacity(GTK_WINDOW(priv->floating_toolbar),
(gdouble)(y - t) / (gdouble)(-t) * priv->floating_toolbar_opacity);
#endif
}
if ((priv->floating_toolbar_motion_show && y >= 0) || (!priv->floating_toolbar_motion_show && y <= t))
{
......@@ -1757,13 +1766,18 @@ static void remmina_connection_holder_create_floating_toolbar(RemminaConnectionH
remmina_connection_holder_update_toolbar_opacity(cnnhld);
if (remmina_pref.invisible_toolbar && !priv->pin_down)
{
#if GTK_CHECK_VERSION(3, 8, 0)
gtk_widget_set_opacity(GTK_WIDGET(window), 0.0);
#else
gtk_window_set_opacity(GTK_WINDOW(window), 0.0);
#endif
}
else
{
g_signal_connect(G_OBJECT(window), "enter-notify-event", G_CALLBACK(remmina_connection_holder_toolbar_enter), cnnhld);
g_signal_connect(G_OBJECT(window), "leave-notify-event", G_CALLBACK(remmina_connection_holder_toolbar_leave), cnnhld);
g_signal_connect(G_OBJECT(window), "scroll-event", G_CALLBACK(remmina_connection_holder_toolbar_scroll), cnnhld);
gtk_widget_add_events(GTK_WIDGET(window), GDK_SCROLL_MASK);
}
if (cnnobj->connected)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment