Gray out background window when a modal window is open

Hello all,

Is there a way to gray out a background window in GTK3 when a modal window is open as shown below:

*Image source: https://i.stack.imgur.com/bvThf.png

I have tried to use some level of opacity in my css but it doesn’t work as expected.

Thanks.

This style of tweak is typically provided by the compositor. The application just sets the dialog as modal and transient for the parent window, and then the compositor is expected to make appropriate changes to the appearance. That is how it works for gnome, at least.