Skip to content

Workaround for crashing when many tooltips are shown consecutively#563

Open
flodavid wants to merge 2 commits intoelementary:mainfrom
flodavid:wayland-crash-workaround
Open

Workaround for crashing when many tooltips are shown consecutively#563
flodavid wants to merge 2 commits intoelementary:mainfrom
flodavid:wayland-crash-workaround

Conversation

@flodavid
Copy link

@flodavid flodavid commented Jan 18, 2026

Add delay of 100ms before showing dock tooltips:
Fixes #559. After researching it, the culprit seems to be the Nvidia driver, which causes a problem with GTK.Popup, which is used as tooltips when hovering launchers in the doc since #441.

Adding a big enough delay before showing the tooltip seems to prevent the error (or at least making it very unlikely). I tried 1ms and it seemed to reduces the crashes quite a bit already, but I succeeded with 50ms by increasing the pointer speed, so I set it to 100ms.
This can also have a positive side effect: When rapidly hovering the launchers, every tooltip were briefly shown, but not long enough to be readable. So the delay makes it less distracting a restores the behaviour before #441.

I only added the delay to the Launcher class, and not the parent BaseItem. Feel free to rework the PR or close it to implement a cleaner fix. Maybe a proper fix should be added to GTK, but a simple workaround by adding a delay like here would not be acceptable I guess.

@danirabbit danirabbit mentioned this pull request Jan 21, 2026
2 tasks
@danirabbit danirabbit requested a review from a team February 3, 2026 18:12
@flodavid flodavid force-pushed the wayland-crash-workaround branch from 36e88cc to 4fc351d Compare February 7, 2026 16:40
@flodavid
Copy link
Author

flodavid commented Feb 7, 2026

I moved the code to BaseItem since existing code was moved out of Launcher (I tested with the latest changes and crash still happens without this PR), and rebased to fix conflicts

@flodavid flodavid force-pushed the wayland-crash-workaround branch from 4fc351d to 5c5b953 Compare March 2, 2026 22:05
this.wait_and_show_tooltip (100);
});
motion_controller.leave.connect (() => {
this.waiting_to_open_tooltip = false;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably you can use GLib.Source.remove () instead of a normal flag?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are probably right. I will do that soon

Copy link
Author

@flodavid flodavid Mar 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this what you had in mind ? b6968f1
Edit: I removed open_tooltip_timeout_id = 0; in leave () since I assume leave () cannot be called twice without enter () being called in between and the ID being modified by it. Is it safe to assume or am I risking race condition ? Even then, the event ID would need to be reassigned to another event for it to cause a problem. Is this enough to justify not needing the reset ?

@flodavid flodavid force-pushed the wayland-crash-workaround branch 2 times, most recently from 29b7319 to 9ed958f Compare March 13, 2026 12:54
@flodavid flodavid force-pushed the wayland-crash-workaround branch from 9ed958f to b6968f1 Compare March 13, 2026 18:42
@flodavid
Copy link
Author

I think the pipeline is not failing because of the modification in this PR, as it also fails in another PR.
The error seems to be:

../src/WindowSystem/WindowSystem.vala: In function 'dock_window_system_find_window':
../src/WindowSystem/WindowSystem.vala:46:53: error: passing argument 2 of 'g_ptr_array_find_with_equal_func' makes pointer from integer without a cast [-Wint-conversion]
   46 |         if (windows.find_custom (uid, (win, uid) => {
      |                                                     ^  
      |                                                     |
      |                                                     guint64 {aka long unsigned int}
In file included from /usr/include/glib-2.0/glib.h:33,
                 from /usr/include/glib-2.0/gobject/gbinding.h:30,
                 from /usr/include/glib-2.0/glib-object.h:24,
                 from src/io.elementary.dock.p/WindowSystem/WindowSystem.c:9:
/usr/include/glib-2.0/glib/garray.h:262:61: note: expected 'gconstpointer' {aka 'const void *'} but argument is of type 'guint64' {aka 'long unsigned int'}
  262 |                                              gconstpointer  needle,
      |                                              ~~~~~~~~~~~~~~~^~~~~~

and it is unrelated to my edits.

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

Successfully merging this pull request may close these issues.

Crash randomly when opening

2 participants