F_SHADED = (1 << 4),
F_NO_FRAME = (1 << 5),
- F_STATE_MODAL = (1 << 0),
- F_STATE_STICKY = (1 << 1),
- F_STATE_MAXIMIZED_VERT = (1 << 2),
- F_STATE_MAXIMIZED_HORZ = (1 << 3),
- F_STATE_SHADED = (1 << 4),
- F_STATE_SKIP_TASKBAR = (1 << 5),
- F_STATE_SKIP_PAGER = (1 << 6),
- F_STATE_HIDDEN = (1 << 7),
- F_STATE_FULLSCREEN = (1 << 8),
- F_STATE_ABOVE = (1 << 9),
- F_STATE_BELOW = (1 << 10),
- F_STATE_DEMANDS_ATTENTION = (1 << 11),
+// F_STATE_MODAL = (1 << 0),
+// F_STATE_STICKY = (1 << 1),
+// F_STATE_MAXIMIZED_VERT = (1 << 2),
+// F_STATE_MAXIMIZED_HORZ = (1 << 3),
+// F_STATE_SHADED = (1 << 4),
+// F_STATE_SKIP_TASKBAR = (1 << 5),
+// F_STATE_SKIP_PAGER = (1 << 6),
+// F_STATE_HIDDEN = (1 << 7),
+// F_STATE_FULLSCREEN = (1 << 8),
+// F_STATE_ABOVE = (1 << 9),
+// F_STATE_BELOW = (1 << 10),
+// F_STATE_DEMANDS_ATTENTION = (1 << 11),
};
typedef struct Node {
struct Client* col_prev;
char* name;
Window frame, win, transient_for;
- int wm_types;
- int wm_state;
- int state, flags, wspace, x, y, w, h, rel_x, rel_y;
+ int client_state; // ICCM Client State Flag
+ int wm_types; // EWMH Window Type Flags
+ int wm_state; // EWMH Window State Flags
+ int wm_protos; // ICCM/EWMH Protocols
+
+ int flags, wspace, x, y, w, h, rel_x, rel_y;
long hint_flags, wm_flags;
XWMHints hints;
XSizeHints size_hints;
extern Atom _NET_WM_STATE_DEMANDS_ATTENTION;
extern Atom WindowType[8];
+
+enum WindowType {
+ F_NET_WM_WINDOW_TYPE_DESKTOP = (1 << 0),
+ F_NET_WM_WINDOW_TYPE_DOCK = (1 << 1),
+ F_NET_WM_WINDOW_TYPE_TOOLBAR = (1 << 2),
+ F_NET_WM_WINDOW_TYPE_MENU = (1 << 3),
+ F_NET_WM_WINDOW_TYPE_UTILITY = (1 << 4),
+ F_NET_WM_WINDOW_TYPE_SPLASH = (1 << 5),
+ F_NET_WM_WINDOW_TYPE_DIALOG = (1 << 6),
+ F_NET_WM_WINDOW_TYPE_NORMAL = (1 << 7),
+};
+
extern Atom WindowState[12];
+enum WindowState {
+ F_NET_WM_STATE_MODAL = (1 << 0),
+ F_NET_WM_STATE_STICKY = (1 << 1),
+ F_NET_WM_STATE_MAXIMIZED_VERT = (1 << 2),
+ F_NET_WM_STATE_MAXIMIZED_HORZ = (1 << 3),
+ F_NET_WM_STATE_SHADED = (1 << 4),
+ F_NET_WM_STATE_SKIP_TASKBAR = (1 << 5),
+ F_NET_WM_STATE_SKIP_PAGER = (1 << 6),
+ F_NET_WM_STATE_HIDDEN = (1 << 7),
+ F_NET_WM_STATE_FULLSCREEN = (1 << 8),
+ F_NET_WM_STATE_ABOVE = (1 << 9),
+ F_NET_WM_STATE_BELOW = (1 << 10),
+ F_NET_WM_STATE_DEMANDS_ATTENTION = (1 << 11),
+};
+
+
void Atoms_Init(void);
int wspace_active = ((wspace_mask & (1 << c->wspace)) != 0);
printf("(0x%x & 0x%x) != 0 == %d\n", wspace_mask, (1 << c->wspace), wspace_active);
- if (wspace_active && (c->state != WithdrawnState))
+ if (wspace_active && (c->client_state != WithdrawnState))
{
printf("Show 0x%lx\n", c->win);
Client_Show(c);
static void SetWMState(Client *c, int state)
{
CARD32 data[2] = {state, None};
- c->state = state;
+ c->client_state = state;
XChangeProperty(X.disp, c->win, WM_STATE, WM_STATE, 32, PropModeReplace, (unsigned char *)data, 2);
}
// NetWMWindowTypeDialog,
// NetClientList,
-//static Atom* WindowTypes[] = {
-// &_NET_WM_WINDOW_TYPE,
-// &_NET_WM_WINDOW_TYPE_DESKTOP,
-// &_NET_WM_WINDOW_TYPE_DOCK,
-// &_NET_WM_WINDOW_TYPE_TOOLBAR,
-// &_NET_WM_WINDOW_TYPE_MENU,
-// &_NET_WM_WINDOW_TYPE_UTILITY,
-// &_NET_WM_WINDOW_TYPE_SPLASH,
-// &_NET_WM_WINDOW_TYPE_DIALOG,
-// &_NET_WM_WINDOW_TYPE_NORMAL,
-//};
-
-//static Atom* WindowStates[] = {
-// &_NET_WM_STATE_MODAL,
-// &_NET_WM_STATE_STICKY,
-// &_NET_WM_STATE_MAXIMIZED_VERT,
-// &_NET_WM_STATE_MAXIMIZED_HORZ,
-// &_NET_WM_STATE_SHADED,
-// &_NET_WM_STATE_SKIP_TASKBAR,
-// &_NET_WM_STATE_SKIP_PAGER,
-// &_NET_WM_STATE_HIDDEN,
-// &_NET_WM_STATE_FULLSCREEN,
-// &_NET_WM_STATE_ABOVE,
-// &_NET_WM_STATE_BELOW,
-// &_NET_WM_STATE_DEMANDS_ATTENTION,
-//};
-
static void ReplaceProp(Window w, Atom prop, Atom type, void* elems, int nelems, int format)
{
XChangeProperty(
}
}
-/*
- We might not use these properties?
-
- _NET_VIRTUAL_ROOTS
- _NET_DESKTOP_LAYOUT
- _NET_SHOWING_DESKTOP
-*/
-
/*
Client messages to root we may need to listen for
*/
-/*
- Protocols we do not intend to support...
-
- _NET_WM_PING
- _NET_WM_SYNC_REQUEST
-*/
-
-
void EWMH_Init(void)
{
// Write _NET_SUPPORTED - array of all hints we support...
- // Write _NET_NUMBER_OF_DESKTOPS - total number of workspaces (10)
- // Write _NET_DESKTOP_NAMES - names of workspaces...
- // Write _NET_DESKTOP_VIEWPORT - always 0,0. write it here
-
- // _NET_SUPPORTING_WM_CHECK
- // Set this to the id of a window we create and own
- // Set _NET_WM_NAME on said window to name of WM
- // Tells clients we are alive and kicking...
}
void EWMH_SetClientList(void)
{
// Write _NET_CLIENT_LIST - initial mapping order
- // Write _NET_CLIENT_LIST_Stacking - bottom-to-top order
}
void EWMH_SetActiveWindow(Window w)
HDR.puts ""
$cats.each do |cat, vals|
HDR.puts "extern Atom #{cat}[#{vals.length}];"
+ HDR.puts "\nenum #{cat} {"
+ vals.each_with_index {|e,i| HDR.puts " F#{e} = (1 << #{i})," }
+ HDR.puts "};\n\n"
+
SRC.puts "Atom #{cat}[#{vals.length}];"
end
SRC.puts ""
end
SRC.puts "}"
-
-
-SRC
-
-
-pp $atoms
-pp $cats