Commit ba0baa7e authored by Antenore Gatta's avatar Antenore Gatta

Reverted the notfication for the floating toolbar

parent 9a637822
......@@ -66,6 +66,9 @@ G_DEFINE_TYPE( RemminaConnectionWindow, remmina_connection_window, GTK_TYPE_WIND
#define MOTION_TIME 100
/* default timeout used to hide the floating toolbar wen switching profile */
#define TB_HIDE_TIME_TIME 1000
#define FLOATING_TOOLBAR_WIDGET (GTK_CHECK_VERSION(3, 10, 0))
typedef struct _RemminaConnectionHolder RemminaConnectionHolder;
......@@ -96,6 +99,9 @@ struct _RemminaConnectionWindowPriv
guint floating_toolbar_motion_handler;
/* Other event sources to remove when deleting the object */
guint ftb_hide_eventsource;
/* Timer to hide the toolbar */
guint hidetb_timer;
GtkWidget* toolbar;
GtkWidget* grid;
......@@ -591,6 +597,12 @@ static void remmina_connection_window_destroy(GtkWidget* widget, RemminaConnecti
priv->floating_toolbar_window = NULL;
}
#endif
/* Timer used to hide the toolbar */
if (priv->hidetb_timer)
{
g_source_remove(priv->hidetb_timer);
priv->hidetb_timer= 0;
}
if (priv->switch_page_handler)
{
g_source_remove(priv->switch_page_handler);
......@@ -2418,6 +2430,16 @@ static gboolean remmina_connection_window_on_leave(GtkWidget* widget, GdkEventCr
return FALSE;
}
static gboolean
remmina_connection_holder_floating_toolbar_hide(RemminaConnectionHolder* cnnhld)
{
TRACE_CALL("remmina_connection_holder_floating_toolbar_hide");
RemminaConnectionWindowPriv* priv = cnnhld->cnnwin->priv;
priv->hidetb_timer = 0;
remmina_connection_holder_floating_toolbar_show (cnnhld, FALSE);
return FALSE;
}
static gboolean remmina_connection_holder_floating_toolbar_on_scroll(GtkWidget* widget, GdkEventScroll* event,
RemminaConnectionHolder* cnnhld)
{
......@@ -2988,10 +3010,10 @@ static gboolean remmina_connection_holder_on_switch_page_real(gpointer data)
np = gtk_notebook_get_current_page(GTK_NOTEBOOK (priv->notebook));
page = gtk_notebook_get_nth_page (GTK_NOTEBOOK (priv->notebook), np);
currentpage_cnnobj = (RemminaConnectionObject*) g_object_get_data(G_OBJECT(page),"cnnobj");
/* send a desktop notification each time we switch to a new tab*/
remmina_public_send_notification ("remmina-proto-widget-enter-id",
_("Connected to: "),
remmina_file_get_string(currentpage_cnnobj->remmina_file, "server"));
remmina_connection_holder_floating_toolbar_show (cnnhld, TRUE);
if (!priv->hidetb_timer)
priv->hidetb_timer = g_timeout_add(TB_HIDE_TIME_TIME, (GSourceFunc)
remmina_connection_holder_floating_toolbar_hide, cnnhld);
remmina_connection_holder_update_toolbar(cnnhld);
remmina_connection_holder_grab_focus(GTK_NOTEBOOK(priv->notebook));
if (cnnhld->cnnwin->priv->view_mode != SCROLLED_WINDOW_MODE)
......
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