Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System Monitor: no tooltips with updates faster than 500ms #642

Closed
fornellas opened this issue Sep 10, 2022 · 1 comment
Closed

System Monitor: no tooltips with updates faster than 500ms #642

fornellas opened this issue Sep 10, 2022 · 1 comment

Comments

@fornellas
Copy link

fornellas commented Sep 10, 2022

Expected behaviour

With update interval set to 500ms:

image

when we hover the mouse over, we can see tooltips:

Screenshot at 2022-09-10 14-59-10

With update interval below 500ms (eg: 490), no tooltip is shown.

Actual behaviour

No tooltip is shown for update interval below 500ms.

Steps to reproduce the behaviour

  • Set update interval to 500ms+.
  • Hover mouse over applet.
  • Observerve there's a tooltip.
  • Set update interval to 490ms.
  • Hover mouse over applet.
  • Observerve there's NO tooltip.

My wild guess here is that the tool tip delay is 500ms, and updating the applet faster, disturbs the tool tip trigger, so it never happens.

MATE general version

1.26.0

Package version

mate-applets-1.26.0-0ubuntu1~focal2.0

Linux Distribution

Linux Mint 20.3 Una

@zhuyaliang
Copy link
Member

Your guess is correct. Tooltip will no longer work when the time is less than 500 milliseconds.This is my test example:

static int count;

static gboolean
update_button_tooltip (GtkWidget *button)
{
    char *tooltip_text;

    tooltip_text = g_strdup_printf ("This is the %dth test", count),
    gtk_widget_set_tooltip_text (button, tooltip_text);

    g_free (tooltip_text);
    count ++;

    return TRUE;
}

int main (int argc,char *argv[])
{
    GtkWidget *window;
    GtkWidget *box;
    GtkWidget *button;

    gtk_init (&argc,&argv);

    window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
    gtk_window_set_default_size (GTK_WINDOW (window), 350, 220);
    g_signal_connect ((window), "delete_event", G_CALLBACK (gtk_main_quit), NULL);

    box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 2);
    gtk_container_add (GTK_CONTAINER (window), box);

    button = gtk_button_new_with_label ("test");
    gtk_box_pack_start (GTK_BOX (box), button, FALSE, FALSE, 6);

    g_timeout_add (500, (GSourceFunc) update_button_tooltip, button);

So this is a problem with GTK

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants