Files
amiwm-neo/icc.h
Lucas de Sena a8f92b4e5b Make fullscreen work on GTK applications
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
2026-01-10 02:58:39 +00:00

28 lines
740 B
C

#ifndef ICC_H
#define ICC_H
#include <X11/Xlib.h>
#include <X11/Xatom.h>
#include "client.h"
extern void init_atoms(void);
extern void setsupports(Window, Window);
extern void sendcmessage(Window, Atom, long);
extern void getproto(Client *c);
extern void getwmstate(Client *c);
extern void setwmstate(Client *c);
extern void setstringprop(Window, Atom, char *);
extern void propertychange(Client *, Atom);
extern long _getprop(Window, Atom, Atom, long, char **);
extern void getwflags(Client *);
extern Atom wm_state, wm_change_state, wm_protocols, wm_delete, wm_take_focus, wm_colormaps, wm_hints, amiwm_screen, swm_vroot;
#define Pdelete 1
#define Ptakefocus 2
#define Psizebottom 4
#define Psizeright 8
#define Psizetrans 16
#endif