diff --git a/gnoemoe/widgets/gm-app-view.c b/gnoemoe/widgets/gm-app-view.c index e491679..7469fb5 100644 --- a/gnoemoe/widgets/gm-app-view.c +++ b/gnoemoe/widgets/gm-app-view.c @@ -61,6 +61,7 @@ void on_gm_app_view_check_button_search_sensitive_toggled( gboolean on_gm_app_view_tray_button_press(GmTray *tray, GdkEventButton *event, GmAppView *view); +void on_gm_app_view_tray_message_clicked(GmTray *tray, GmAppView *view); void on_gm_app_view_tray_destroy(GtkWidget *caller, GmAppView *view); void on_gm_app_view_world_mcp_package_created(GmMcpSession *session, @@ -543,7 +544,9 @@ gm_app_view_create_tray(GmAppView *view) { gm_pixbuf_get("tray/activity.svg")); gtk_widget_show(GTK_WIDGET(view->priv->tray)); - + + g_signal_connect(view->priv->tray, "message-clicked", + G_CALLBACK(on_gm_app_view_tray_message_clicked), view); g_signal_connect(view->priv->tray, "button-press-event", G_CALLBACK(on_gm_app_view_tray_button_press), view); g_signal_connect(view->priv->tray, "destroy", @@ -1772,6 +1775,16 @@ on_gm_app_view_tray_button_press(GmTray *tray, GdkEventButton *event, return FALSE; } +void +on_gm_app_view_tray_message_clicked(GmTray *tray, GmAppView *view) { + gboolean visible = GTK_WIDGET_VISIBLE(view); + + if (!visible || !gtk_window_is_active(GTK_WINDOW(view))) { + gm_app_view_toggle_visibility(view); + gdk_window_focus(GTK_WIDGET(view)->window, GDK_CURRENT_TIME); + } +} + gboolean idle_create_tray(gpointer user_data) { GmAppView *view = GM_APP_VIEW(user_data);