Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to tell if a full-screen application is running?

Tags:

python

linux

x11

Is it possible in python to tell if a full screen application on linux is running? I have a feeling it might be possible using Xlib but I haven't found a way.

EDIT: By full screen I mean the WHOLE screen nothing else but the application, such as a full-screen game.

like image 587
Isaiah Avatar asked Aug 30 '09 23:08

Isaiah


People also ask

What is fullscreen application?

Full! screen lets you hide the system navigation bar and notification area on your Android phone or tablet so you can use that space for apps and games in full screen mode. It's not just crashing your system UI, though. Full! screen places minimalist replacement buttons tucked away in the corners.

Do games run better in fullscreen?

When an application is open in fullscreen mode, Windows grants it full control of the screen's output. Assuming a game is optimized for the system and display being used, fullscreen mode has the potential to boost performance when compared to borderless windowed mode.


1 Answers

If all Window Managers you're interested in running under support EWMH, the Extended Window Manager Hints standard, there are elegant ways to perform this (speaking to Xlib via ctypes, for example). The _NET_ACTIVE_WINDOW property of the root window (see here) tells you which window is active (if any); the _NET_WM_STATE property of the active window is then a list of atoms describing its state which will include _NET_WM_STATE_FULLSCREEN if that window is fullscreen. (If you have multiple monitors of course a window could be fullscreen on one of them without being active; I believe other cases may exist in which a window may be fullscreen without being active -- I don't think there's any way to cover them all without essentially checking _NET_WM_STATE for every window, though).

like image 199
Alex Martelli Avatar answered Sep 28 '22 17:09

Alex Martelli