Using the vala programming language, can you detect when other applications are full screen or maximized, and suspend their own programs? Is there a similar Demo?
This is something that can only be done by asking the window manager/compositor, since that is the component that actually deals with this kind of thing. And depending on the session type, this will or will not work.
xwininfo
(see for more info https://stackoverflow.com/a/1018185/2921914). You can either directly call it and parse the result, or see which parts of the X protocol it uses by looking at its source code.Since you mentioned [gnome] as a tag, you might be able to do this by writing your own GNOME Shell extension, since this has direct access GNOME Shell's internals.