static gboolean si_popup_show(gpointer icon) { GdkRectangle area; gint x, y; static gint count = 0; audgui_get_mouse_coords (NULL, & x, & y); gtk_status_icon_get_geometry (icon, NULL, & area, NULL); if (x < area.x || x > area.x + area.width || y < area.y || y > area.y + area.width) { si_popup_timer_stop(icon); si_popup_hide(icon); count = 0; return TRUE; } if (!POPUP_IS_ACTIVE) { if (count < 10) { count++; return TRUE; } else count = 0; audgui_infopopup_show_current(); g_object_set_data(G_OBJECT(icon), "popup_active", GINT_TO_POINTER(1)); } return TRUE; }
void ui_playlist_widget_scroll (GtkWidget * widget) { PlaylistWidgetData * data = audgui_list_get_user (widget); g_return_if_fail (data); gint row = -1; if (gtk_widget_get_realized (widget)) { gint x, y; audgui_get_mouse_coords (widget, & x, & y); row = audgui_list_row_at_point (widget, x, y); } /* Only update the info popup if it is already shown or about to be shown; * this makes sure that it doesn't pop up when the Audacious window isn't * even visible. */ if (row >= 0 && (data->popup_source || data->popup_shown)) popup_trigger (data, row); else popup_hide (data); }