Previously, adding a new atom into the code required:
1. In <icc.h>, add the line `extern Atom my_new_atom;` declaring the new atom.
2. In <icc.c>, add the line `Atom my_new_atom;` defining the new atom.
3. In <icc.c>, add the line `my_new_atom = XInternAtom(dpy, "MY_NEW_ATOM", False);`
interning this new atom, and assigning the interned value to the variable.
Now, just add a line with the atom's name in the X-MACRO in <icc.h>, and
a XInternAtoms(3) and a set of macros will do the rest.
All new atoms will be referred to as an entry in the ATOMS[] array.
For example:
ATOMS[MY_NEW_ATOM]
The exception are for those REALLY OLD atoms that have already a
dedicated compile-time-known value defined at <X11/Xatom.h>. Those
do not need to be interned; and are referred to with a constant
beginning with the `XA_` prefix. For example:
XA_WM_CLASS
This commit implements the _NET_SUPPORTING_WM_CHECK property, defined
by the EWMH[1] (Extended Window Management Hints, aka wm-spec), which
indicates that a EWMH-compliant window manager is running.
A GTK application, when set to go fullscreen, first checks root window's
_NET_SUPPORTING_WM_CHECK property to determine whether a EWMH-compliant
window manager is running; and then checks the _NET_SUPPORTED property
to determine the supported protocols.
_NET_SUPPORTED was previously implemented, but _NET_SUPPORTING_WM_CHECK
was not.
This commit also fixes a misconception of the code related to screens.
The code deals with two different, unrelated concepts of screens: the
X11 screen, and the AmiWM screen.
The X11 screen, created by the X server independently of whether a
window manager is running, is a kind of “subdisplay”. A X11 display
structure, which describes a connection to the X server, has one or more
screens. Each X11 screen has its own root window and its own set of
clients that are specific to it, and cannot move to another X11 screen.
The user can even run two different window managers at the same time in
the same display, given that each is run in a different X11 screen.
Usually, there is only one X11 screen.
The _NET_SUPPORTING_WM_CHECK and _NET_SUPPORTED properties must be set
on the root window of each screen that AmiWM is managing. Previously,
however, they were set everytime an AmiWM screen (a totally different
concept) was realized. So, if i had 4 AmiWM screens configured in my
~/.amiwmrc file, setsupports() were called four times, even if i only
have a single X11 screen.
[1]: https://specifications.freedesktop.org/wm/latest/index.html
This is a pretty straight forward change to remove the global front
variable and instead use a couple of accessor functions.
This hopefully will make it easier to keep track and debug when
the front screen changes.