How to apply gsetting timeout settings only for a specific gnome shell rather than in the entire system?

107 Views Asked by At

I am developing an app and running in an Ubuntu 22.04, and started from a bash shell. It always gets these "App" is not-responding pop ups.

How can I apply org.gnome.mutter check-alive-timeout settings for my app specifically or from the shell it is being run from? Or is there another way?

To get rid of the pop-up, I followed this: https://www.reddit.com/r/gnome/comments/hzkuwx/how_gnome_treats_unresponsive_applications_can_i/

So I ran gsettings set org.gnome.mutter check-alive-timeout 10000 which works but this sets the settings on the overall system. I only want it to apply to my app.

1

There are 1 best solutions below

0
On

Such a per-app setting doesn't exist, and the global setting really shouldn't be messed with. Or at least, as a user, I would be pretty frustrated if an app was trying to change it behind my back :-)

What you need to understand is what GNOME does underneath: to prevent random applications freezing up, it regularly "pings" each window that is visible. Both X11 and Wayland provide such a pinging mechanism since this is such a common use case. If a window doesn't reply within the timeout defined by the check-alive-timeout setting, it's considered frozen and GNOME will show a dialog asking whether the app should be killed.

If your app is suffering from this problem, the real question becomes: why is your app unable to reply to such a ping in the first place? Normally this is taken care of by an underlying toolkit like GTK or Qt, so maybe you're blocking the UI thread for several seconds, preventing the toolkit to actually reply to it in time. Maybe it's something else even, but this depends on the app code.