Refactor atoms handling
Makes adding/changing atom stuff much easier.
This commit is contained in:
parent
c4c457d607
commit
0aa2f07e6b
|
@ -104,7 +104,7 @@ e16_SOURCES = \
|
|||
util.h \
|
||||
warp.c \
|
||||
windowmatch.c windowmatch.h \
|
||||
xprop.c xprop.h \
|
||||
xprop.c xprop.h xpropdefs.h \
|
||||
x.c xwin.h \
|
||||
xtypes.h \
|
||||
$(SRCS_SOUND) \
|
||||
|
|
11
src/comms.c
11
src/comms.c
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Copyright (C) 2000-2007 Carsten Haitzler, Geoff Harrison and various contributors
|
||||
* Copyright (C) 2004-2018 Kim Woelders
|
||||
* Copyright (C) 2004-2021 Kim Woelders
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to
|
||||
|
@ -155,7 +155,7 @@ ClientCommsGet(Client ** c, XClientMessageEvent * ev)
|
|||
|
||||
if ((!ev) || (!c))
|
||||
return NULL;
|
||||
if (ev->message_type != E16_ATOM_COMMS_MSG)
|
||||
if (ev->message_type != ea_m.ENL_MSG)
|
||||
return NULL;
|
||||
|
||||
s[12] = 0;
|
||||
|
@ -297,8 +297,9 @@ CommsInit(void)
|
|||
EventCallbackRegister(VROOT, ClientHandleRootEvents, NULL);
|
||||
|
||||
Esnprintf(s, sizeof(s), "WINID %8x", WinGetXwin(comms_win));
|
||||
ex_window_prop_string_set(WinGetXwin(comms_win), E16_ATOM_COMMS_WIN, s);
|
||||
ex_window_prop_string_set(WinGetXwin(VROOT), E16_ATOM_COMMS_WIN, s);
|
||||
ex_window_prop_string_set(WinGetXwin(comms_win), ea_m.ENLIGHTENMENT_COMMS,
|
||||
s);
|
||||
ex_window_prop_string_set(WinGetXwin(VROOT), ea_m.ENLIGHTENMENT_COMMS, s);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -316,7 +317,7 @@ CommsDoSend(EX_Window win, const char *s)
|
|||
ev.xclient.serial = 0;
|
||||
ev.xclient.send_event = True;
|
||||
ev.xclient.window = win;
|
||||
ev.xclient.message_type = E16_ATOM_COMMS_MSG;
|
||||
ev.xclient.message_type = ea_m.ENL_MSG;
|
||||
ev.xclient.format = 8;
|
||||
for (i = 0; i < len + 1; i += 12)
|
||||
{
|
||||
|
|
|
@ -2070,7 +2070,7 @@ DeskPropertyChange(Desk * dsk, XEvent * ev)
|
|||
{
|
||||
EX_Pixmap pmap;
|
||||
|
||||
if (ev->xproperty.atom == E_XROOTPMAP_ID)
|
||||
if (ev->xproperty.atom == ea_m._XROOTPMAP_ID)
|
||||
{
|
||||
/* Possible race here? */
|
||||
pmap = HintsGetRootPixmap(EoGetWin(dsk));
|
||||
|
@ -2087,7 +2087,7 @@ DeskPropertyChange(Desk * dsk, XEvent * ev)
|
|||
Mode.root.ext_pmap_valid = EXDrawableOk(pmap);
|
||||
DesksBackgroundRefresh(NULL, DESK_BG_REFRESH);
|
||||
}
|
||||
else if (ev->xproperty.atom == E_XROOTCOLOR_PIXEL)
|
||||
else if (ev->xproperty.atom == ea_m._XROOTCOLOR_PIXEL)
|
||||
{
|
||||
if (EDebug(EDBUG_TYPE_DESKS))
|
||||
Eprintf("%s: win=%#lx _XROOTCOLOR_PIXEL\n", __func__,
|
||||
|
|
313
src/ewmh.c
313
src/ewmh.c
|
@ -84,81 +84,81 @@ EWMH_Init(EX_Window win_wm_check)
|
|||
|
||||
atom_count = 0;
|
||||
|
||||
atom_list[atom_count++] = EX_ATOM_NET_SUPPORTED;
|
||||
atom_list[atom_count++] = EX_ATOM_NET_SUPPORTING_WM_CHECK;
|
||||
atom_list[atom_count++] = ea_n._NET_SUPPORTED;
|
||||
atom_list[atom_count++] = ea_n._NET_SUPPORTING_WM_CHECK;
|
||||
|
||||
atom_list[atom_count++] = EX_ATOM_NET_NUMBER_OF_DESKTOPS;
|
||||
atom_list[atom_count++] = EX_ATOM_NET_DESKTOP_GEOMETRY;
|
||||
atom_list[atom_count++] = EX_ATOM_NET_DESKTOP_NAMES;
|
||||
atom_list[atom_count++] = EX_ATOM_NET_CURRENT_DESKTOP;
|
||||
atom_list[atom_count++] = EX_ATOM_NET_DESKTOP_VIEWPORT;
|
||||
atom_list[atom_count++] = EX_ATOM_NET_WORKAREA;
|
||||
atom_list[atom_count++] = EX_ATOM_NET_VIRTUAL_ROOTS;
|
||||
atom_list[atom_count++] = EX_ATOM_NET_SHOWING_DESKTOP;
|
||||
atom_list[atom_count++] = ea_n._NET_NUMBER_OF_DESKTOPS;
|
||||
atom_list[atom_count++] = ea_n._NET_DESKTOP_GEOMETRY;
|
||||
atom_list[atom_count++] = ea_n._NET_DESKTOP_NAMES;
|
||||
atom_list[atom_count++] = ea_n._NET_CURRENT_DESKTOP;
|
||||
atom_list[atom_count++] = ea_n._NET_DESKTOP_VIEWPORT;
|
||||
atom_list[atom_count++] = ea_n._NET_WORKAREA;
|
||||
atom_list[atom_count++] = ea_n._NET_VIRTUAL_ROOTS;
|
||||
atom_list[atom_count++] = ea_n._NET_SHOWING_DESKTOP;
|
||||
|
||||
atom_list[atom_count++] = EX_ATOM_NET_ACTIVE_WINDOW;
|
||||
atom_list[atom_count++] = EX_ATOM_NET_CLIENT_LIST;
|
||||
atom_list[atom_count++] = EX_ATOM_NET_CLIENT_LIST_STACKING;
|
||||
atom_list[atom_count++] = ea_n._NET_ACTIVE_WINDOW;
|
||||
atom_list[atom_count++] = ea_n._NET_CLIENT_LIST;
|
||||
atom_list[atom_count++] = ea_n._NET_CLIENT_LIST_STACKING;
|
||||
|
||||
atom_list[atom_count++] = EX_ATOM_NET_CLOSE_WINDOW;
|
||||
atom_list[atom_count++] = EX_ATOM_NET_MOVERESIZE_WINDOW;
|
||||
atom_list[atom_count++] = EX_ATOM_NET_WM_MOVERESIZE;
|
||||
atom_list[atom_count++] = ea_n._NET_CLOSE_WINDOW;
|
||||
atom_list[atom_count++] = ea_n._NET_MOVERESIZE_WINDOW;
|
||||
atom_list[atom_count++] = ea_n._NET_WM_MOVERESIZE;
|
||||
|
||||
atom_list[atom_count++] = EX_ATOM_NET_WM_NAME;
|
||||
atom_list[atom_count++] = EX_ATOM_NET_WM_ICON_NAME;
|
||||
atom_list[atom_count++] = EX_ATOM_NET_WM_DESKTOP;
|
||||
atom_list[atom_count++] = ea_n._NET_WM_NAME;
|
||||
atom_list[atom_count++] = ea_n._NET_WM_ICON_NAME;
|
||||
atom_list[atom_count++] = ea_n._NET_WM_DESKTOP;
|
||||
|
||||
atom_list[atom_count++] = EX_ATOM_NET_WM_WINDOW_TYPE;
|
||||
atom_list[atom_count++] = EX_ATOM_NET_WM_WINDOW_TYPE_DESKTOP;
|
||||
atom_list[atom_count++] = EX_ATOM_NET_WM_WINDOW_TYPE_DOCK;
|
||||
atom_list[atom_count++] = EX_ATOM_NET_WM_WINDOW_TYPE_TOOLBAR;
|
||||
atom_list[atom_count++] = EX_ATOM_NET_WM_WINDOW_TYPE_MENU;
|
||||
atom_list[atom_count++] = EX_ATOM_NET_WM_WINDOW_TYPE_UTILITY;
|
||||
atom_list[atom_count++] = EX_ATOM_NET_WM_WINDOW_TYPE_SPLASH;
|
||||
atom_list[atom_count++] = EX_ATOM_NET_WM_WINDOW_TYPE_DIALOG;
|
||||
atom_list[atom_count++] = EX_ATOM_NET_WM_WINDOW_TYPE_NORMAL;
|
||||
atom_list[atom_count++] = ea_n._NET_WM_WINDOW_TYPE;
|
||||
atom_list[atom_count++] = ea_n._NET_WM_WINDOW_TYPE_DESKTOP;
|
||||
atom_list[atom_count++] = ea_n._NET_WM_WINDOW_TYPE_DOCK;
|
||||
atom_list[atom_count++] = ea_n._NET_WM_WINDOW_TYPE_TOOLBAR;
|
||||
atom_list[atom_count++] = ea_n._NET_WM_WINDOW_TYPE_MENU;
|
||||
atom_list[atom_count++] = ea_n._NET_WM_WINDOW_TYPE_UTILITY;
|
||||
atom_list[atom_count++] = ea_n._NET_WM_WINDOW_TYPE_SPLASH;
|
||||
atom_list[atom_count++] = ea_n._NET_WM_WINDOW_TYPE_DIALOG;
|
||||
atom_list[atom_count++] = ea_n._NET_WM_WINDOW_TYPE_NORMAL;
|
||||
|
||||
atom_list[atom_count++] = EX_ATOM_NET_WM_STATE;
|
||||
atom_list[atom_count++] = EX_ATOM_NET_WM_STATE_MODAL;
|
||||
atom_list[atom_count++] = EX_ATOM_NET_WM_STATE_STICKY;
|
||||
atom_list[atom_count++] = EX_ATOM_NET_WM_STATE_MAXIMIZED_VERT;
|
||||
atom_list[atom_count++] = EX_ATOM_NET_WM_STATE_MAXIMIZED_HORZ;
|
||||
atom_list[atom_count++] = EX_ATOM_NET_WM_STATE_SHADED;
|
||||
atom_list[atom_count++] = EX_ATOM_NET_WM_STATE_SKIP_TASKBAR;
|
||||
atom_list[atom_count++] = EX_ATOM_NET_WM_STATE_SKIP_PAGER;
|
||||
atom_list[atom_count++] = EX_ATOM_NET_WM_STATE_HIDDEN;
|
||||
atom_list[atom_count++] = EX_ATOM_NET_WM_STATE_FULLSCREEN;
|
||||
atom_list[atom_count++] = EX_ATOM_NET_WM_STATE_ABOVE;
|
||||
atom_list[atom_count++] = EX_ATOM_NET_WM_STATE_BELOW;
|
||||
atom_list[atom_count++] = EX_ATOM_NET_WM_STATE_DEMANDS_ATTENTION;
|
||||
atom_list[atom_count++] = EX_ATOM_NET_WM_STATE_FOCUSED;
|
||||
atom_list[atom_count++] = ea_n._NET_WM_STATE;
|
||||
atom_list[atom_count++] = ea_n._NET_WM_STATE_MODAL;
|
||||
atom_list[atom_count++] = ea_n._NET_WM_STATE_STICKY;
|
||||
atom_list[atom_count++] = ea_n._NET_WM_STATE_MAXIMIZED_VERT;
|
||||
atom_list[atom_count++] = ea_n._NET_WM_STATE_MAXIMIZED_HORZ;
|
||||
atom_list[atom_count++] = ea_n._NET_WM_STATE_SHADED;
|
||||
atom_list[atom_count++] = ea_n._NET_WM_STATE_SKIP_TASKBAR;
|
||||
atom_list[atom_count++] = ea_n._NET_WM_STATE_SKIP_PAGER;
|
||||
atom_list[atom_count++] = ea_n._NET_WM_STATE_HIDDEN;
|
||||
atom_list[atom_count++] = ea_n._NET_WM_STATE_FULLSCREEN;
|
||||
atom_list[atom_count++] = ea_n._NET_WM_STATE_ABOVE;
|
||||
atom_list[atom_count++] = ea_n._NET_WM_STATE_BELOW;
|
||||
atom_list[atom_count++] = ea_n._NET_WM_STATE_DEMANDS_ATTENTION;
|
||||
atom_list[atom_count++] = ea_n._NET_WM_STATE_FOCUSED;
|
||||
|
||||
atom_list[atom_count++] = EX_ATOM_NET_WM_ALLOWED_ACTIONS;
|
||||
atom_list[atom_count++] = EX_ATOM_NET_WM_ACTION_MOVE;
|
||||
atom_list[atom_count++] = EX_ATOM_NET_WM_ACTION_RESIZE;
|
||||
atom_list[atom_count++] = EX_ATOM_NET_WM_ACTION_MINIMIZE;
|
||||
atom_list[atom_count++] = EX_ATOM_NET_WM_ACTION_SHADE;
|
||||
atom_list[atom_count++] = EX_ATOM_NET_WM_ACTION_STICK;
|
||||
atom_list[atom_count++] = EX_ATOM_NET_WM_ACTION_MAXIMIZE_HORZ;
|
||||
atom_list[atom_count++] = EX_ATOM_NET_WM_ACTION_MAXIMIZE_VERT;
|
||||
atom_list[atom_count++] = EX_ATOM_NET_WM_ACTION_FULLSCREEN;
|
||||
atom_list[atom_count++] = EX_ATOM_NET_WM_ACTION_CHANGE_DESKTOP;
|
||||
atom_list[atom_count++] = EX_ATOM_NET_WM_ACTION_CLOSE;
|
||||
atom_list[atom_count++] = EX_ATOM_NET_WM_ACTION_ABOVE;
|
||||
atom_list[atom_count++] = EX_ATOM_NET_WM_ACTION_BELOW;
|
||||
atom_list[atom_count++] = ea_n._NET_WM_ALLOWED_ACTIONS;
|
||||
atom_list[atom_count++] = ea_n._NET_WM_ACTION_MOVE;
|
||||
atom_list[atom_count++] = ea_n._NET_WM_ACTION_RESIZE;
|
||||
atom_list[atom_count++] = ea_n._NET_WM_ACTION_MINIMIZE;
|
||||
atom_list[atom_count++] = ea_n._NET_WM_ACTION_SHADE;
|
||||
atom_list[atom_count++] = ea_n._NET_WM_ACTION_STICK;
|
||||
atom_list[atom_count++] = ea_n._NET_WM_ACTION_MAXIMIZE_HORZ;
|
||||
atom_list[atom_count++] = ea_n._NET_WM_ACTION_MAXIMIZE_VERT;
|
||||
atom_list[atom_count++] = ea_n._NET_WM_ACTION_FULLSCREEN;
|
||||
atom_list[atom_count++] = ea_n._NET_WM_ACTION_CHANGE_DESKTOP;
|
||||
atom_list[atom_count++] = ea_n._NET_WM_ACTION_CLOSE;
|
||||
atom_list[atom_count++] = ea_n._NET_WM_ACTION_ABOVE;
|
||||
atom_list[atom_count++] = ea_n._NET_WM_ACTION_BELOW;
|
||||
|
||||
atom_list[atom_count++] = EX_ATOM_NET_WM_STRUT_PARTIAL;
|
||||
atom_list[atom_count++] = EX_ATOM_NET_WM_STRUT;
|
||||
atom_list[atom_count++] = ea_n._NET_WM_STRUT_PARTIAL;
|
||||
atom_list[atom_count++] = ea_n._NET_WM_STRUT;
|
||||
|
||||
atom_list[atom_count++] = EX_ATOM_NET_FRAME_EXTENTS;
|
||||
atom_list[atom_count++] = ea_n._NET_FRAME_EXTENTS;
|
||||
|
||||
atom_list[atom_count++] = EX_ATOM_NET_WM_USER_TIME;
|
||||
atom_list[atom_count++] = EX_ATOM_NET_WM_USER_TIME_WINDOW;
|
||||
atom_list[atom_count++] = ea_n._NET_WM_USER_TIME;
|
||||
atom_list[atom_count++] = ea_n._NET_WM_USER_TIME_WINDOW;
|
||||
|
||||
atom_list[atom_count++] = EX_ATOM_NET_WM_WINDOW_OPACITY;
|
||||
atom_list[atom_count++] = ea_n._NET_WM_WINDOW_OPACITY;
|
||||
|
||||
ex_window_prop_atom_set(WinGetXwin(VROOT),
|
||||
EX_ATOM_NET_SUPPORTED, atom_list, atom_count);
|
||||
ea_n._NET_SUPPORTED, atom_list, atom_count);
|
||||
|
||||
/* Set WM info properties */
|
||||
ex_netwm_wm_identify(WinGetXwin(VROOT), win_wm_check, e_wm_name);
|
||||
|
@ -371,26 +371,26 @@ EWMH_SetWindowState(const EWin * ewin)
|
|||
atom_count = 0;
|
||||
atom_mask = atom_bit = 0;
|
||||
|
||||
ATOM_ADD_IF(EX_ATOM_NET_WM_STATE_MODAL, ewin->state.modal);
|
||||
ATOM_ADD_IF(EX_ATOM_NET_WM_STATE_STICKY, EoIsSticky(ewin));
|
||||
ATOM_ADD_IF(EX_ATOM_NET_WM_STATE_SHADED, ewin->state.shaded);
|
||||
ATOM_ADD_IF(EX_ATOM_NET_WM_STATE_SKIP_TASKBAR, ewin->props.skip_ext_task);
|
||||
ATOM_ADD_IF(EX_ATOM_NET_WM_STATE_HIDDEN,
|
||||
ewin->state.iconified || ewin->state.shaded);
|
||||
ATOM_ADD_IF(EX_ATOM_NET_WM_STATE_MAXIMIZED_VERT, ewin->state.maximized_vert);
|
||||
ATOM_ADD_IF(EX_ATOM_NET_WM_STATE_MAXIMIZED_HORZ, ewin->state.maximized_horz);
|
||||
ATOM_ADD_IF(EX_ATOM_NET_WM_STATE_FULLSCREEN, ewin->state.fullscreen);
|
||||
ATOM_ADD_IF(EX_ATOM_NET_WM_STATE_SKIP_PAGER, ewin->props.skip_ext_pager);
|
||||
ATOM_ADD_IF(EX_ATOM_NET_WM_STATE_ABOVE, EoGetLayer(ewin) >= 6);
|
||||
ATOM_ADD_IF(EX_ATOM_NET_WM_STATE_BELOW, EoGetLayer(ewin) <= 2);
|
||||
ATOM_ADD_IF(EX_ATOM_NET_WM_STATE_DEMANDS_ATTENTION, ewin->state.attention);
|
||||
ATOM_ADD_IF(EX_ATOM_NET_WM_STATE_FOCUSED, ewin->state.active);
|
||||
ATOM_ADD_IF(ea_n._NET_WM_STATE_MODAL, ewin->state.modal);
|
||||
ATOM_ADD_IF(ea_n._NET_WM_STATE_STICKY, EoIsSticky(ewin));
|
||||
ATOM_ADD_IF(ea_n._NET_WM_STATE_SHADED, ewin->state.shaded);
|
||||
ATOM_ADD_IF(ea_n._NET_WM_STATE_SKIP_TASKBAR, ewin->props.skip_ext_task);
|
||||
ATOM_ADD_IF(ea_n._NET_WM_STATE_HIDDEN, ewin->state.iconified
|
||||
|| ewin->state.shaded);
|
||||
ATOM_ADD_IF(ea_n._NET_WM_STATE_MAXIMIZED_VERT, ewin->state.maximized_vert);
|
||||
ATOM_ADD_IF(ea_n._NET_WM_STATE_MAXIMIZED_HORZ, ewin->state.maximized_horz);
|
||||
ATOM_ADD_IF(ea_n._NET_WM_STATE_FULLSCREEN, ewin->state.fullscreen);
|
||||
ATOM_ADD_IF(ea_n._NET_WM_STATE_SKIP_PAGER, ewin->props.skip_ext_pager);
|
||||
ATOM_ADD_IF(ea_n._NET_WM_STATE_ABOVE, EoGetLayer(ewin) >= 6);
|
||||
ATOM_ADD_IF(ea_n._NET_WM_STATE_BELOW, EoGetLayer(ewin) <= 2);
|
||||
ATOM_ADD_IF(ea_n._NET_WM_STATE_DEMANDS_ATTENTION, ewin->state.attention);
|
||||
ATOM_ADD_IF(ea_n._NET_WM_STATE_FOCUSED, ewin->state.active);
|
||||
|
||||
if (ewin->ewmh.current_state == atom_mask)
|
||||
return;
|
||||
((EWin *) ewin)->ewmh.current_state = atom_mask;
|
||||
|
||||
ex_window_prop_atom_set(EwinGetClientXwin(ewin), EX_ATOM_NET_WM_STATE,
|
||||
ex_window_prop_atom_set(EwinGetClientXwin(ewin), ea_n._NET_WM_STATE,
|
||||
atom_list, atom_count);
|
||||
}
|
||||
|
||||
|
@ -413,7 +413,7 @@ EWMH_SetWindowBorder(const EWin * ewin)
|
|||
val[0] = val[1] = val[2] = val[3] = 0;
|
||||
|
||||
ex_window_prop_card32_set(EwinGetClientXwin(ewin),
|
||||
EX_ATOM_NET_FRAME_EXTENTS, val, 4);
|
||||
ea_n._NET_FRAME_EXTENTS, val, 4);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -440,9 +440,9 @@ EWMH_SetWindowOpacity(EWin * ewin)
|
|||
{
|
||||
ewin->ewmh.opacity = opacity;
|
||||
ex_window_prop_del(EwinGetClientXwin(ewin),
|
||||
EX_ATOM_NET_WM_WINDOW_OPACITY);
|
||||
ea_n._NET_WM_WINDOW_OPACITY);
|
||||
}
|
||||
ex_window_prop_del(EoGetXwin(ewin), EX_ATOM_NET_WM_WINDOW_OPACITY);
|
||||
ex_window_prop_del(EoGetXwin(ewin), ea_n._NET_WM_WINDOW_OPACITY);
|
||||
ewin->ewmh.opacity_update = 0;
|
||||
}
|
||||
}
|
||||
|
@ -514,7 +514,7 @@ EWMH_GetWindowState(EWin * ewin)
|
|||
int i, n_atoms;
|
||||
|
||||
n_atoms = ex_window_prop_atom_list_get(EwinGetClientXwin(ewin),
|
||||
EX_ATOM_NET_WM_STATE, &p_atoms);
|
||||
ea_n._NET_WM_STATE, &p_atoms);
|
||||
if (n_atoms <= 0)
|
||||
return;
|
||||
|
||||
|
@ -530,29 +530,29 @@ EWMH_GetWindowState(EWin * ewin)
|
|||
for (i = 0; i < n_atoms; i++)
|
||||
{
|
||||
atom = p_atoms[i];
|
||||
if (atom == EX_ATOM_NET_WM_STATE_MODAL)
|
||||
if (atom == ea_n._NET_WM_STATE_MODAL)
|
||||
ewin->state.modal = 1;
|
||||
else if (atom == EX_ATOM_NET_WM_STATE_STICKY)
|
||||
else if (atom == ea_n._NET_WM_STATE_STICKY)
|
||||
EoSetSticky(ewin, 1);
|
||||
else if (atom == EX_ATOM_NET_WM_STATE_SHADED)
|
||||
else if (atom == ea_n._NET_WM_STATE_SHADED)
|
||||
ewin->state.shaded = 1;
|
||||
else if (atom == EX_ATOM_NET_WM_STATE_SKIP_TASKBAR)
|
||||
else if (atom == ea_n._NET_WM_STATE_SKIP_TASKBAR)
|
||||
ewin->props.skip_ext_task = 1;
|
||||
else if (atom == EX_ATOM_NET_WM_STATE_SKIP_PAGER)
|
||||
else if (atom == ea_n._NET_WM_STATE_SKIP_PAGER)
|
||||
ewin->props.skip_ext_pager = 1;
|
||||
else if (atom == EX_ATOM_NET_WM_STATE_HIDDEN)
|
||||
else if (atom == ea_n._NET_WM_STATE_HIDDEN)
|
||||
; /* ewin->state.iconified = 1; No - WM_STATE does this */
|
||||
else if (atom == EX_ATOM_NET_WM_STATE_MAXIMIZED_VERT)
|
||||
else if (atom == ea_n._NET_WM_STATE_MAXIMIZED_VERT)
|
||||
ewin->state.maximized_vert = 1;
|
||||
else if (atom == EX_ATOM_NET_WM_STATE_MAXIMIZED_HORZ)
|
||||
else if (atom == ea_n._NET_WM_STATE_MAXIMIZED_HORZ)
|
||||
ewin->state.maximized_horz = 1;
|
||||
else if (atom == EX_ATOM_NET_WM_STATE_FULLSCREEN)
|
||||
else if (atom == ea_n._NET_WM_STATE_FULLSCREEN)
|
||||
ewin->state.fullscreen = 1;
|
||||
else if (atom == EX_ATOM_NET_WM_STATE_ABOVE)
|
||||
else if (atom == ea_n._NET_WM_STATE_ABOVE)
|
||||
EoSetLayer(ewin, 6);
|
||||
else if (atom == EX_ATOM_NET_WM_STATE_BELOW)
|
||||
else if (atom == ea_n._NET_WM_STATE_BELOW)
|
||||
EoSetLayer(ewin, 2);
|
||||
else if (atom == EX_ATOM_NET_WM_STATE_DEMANDS_ATTENTION)
|
||||
else if (atom == ea_n._NET_WM_STATE_DEMANDS_ATTENTION)
|
||||
ewin->state.attention = 1;
|
||||
}
|
||||
Efree(p_atoms);
|
||||
|
@ -567,7 +567,7 @@ EWMH_GetWindowType(EWin * ewin)
|
|||
ewin->ewmh.type.all = 0;
|
||||
|
||||
n_atoms = ex_window_prop_atom_list_get(EwinGetClientXwin(ewin),
|
||||
EX_ATOM_NET_WM_WINDOW_TYPE, &p_atoms);
|
||||
ea_n._NET_WM_WINDOW_TYPE, &p_atoms);
|
||||
if (n_atoms <= 0)
|
||||
{
|
||||
if (EwinIsTransient(ewin))
|
||||
|
@ -580,21 +580,21 @@ EWMH_GetWindowType(EWin * ewin)
|
|||
for (i = 0; i < n_atoms; i++)
|
||||
{
|
||||
atom = p_atoms[i];
|
||||
if (atom == EX_ATOM_NET_WM_WINDOW_TYPE_DESKTOP)
|
||||
if (atom == ea_n._NET_WM_WINDOW_TYPE_DESKTOP)
|
||||
ewin->ewmh.type.b.desktop = 1;
|
||||
else if (atom == EX_ATOM_NET_WM_WINDOW_TYPE_DOCK)
|
||||
else if (atom == ea_n._NET_WM_WINDOW_TYPE_DOCK)
|
||||
ewin->ewmh.type.b.dock = 1;
|
||||
else if (atom == EX_ATOM_NET_WM_WINDOW_TYPE_UTILITY)
|
||||
else if (atom == ea_n._NET_WM_WINDOW_TYPE_UTILITY)
|
||||
ewin->ewmh.type.b.utility = 1;
|
||||
else if (atom == EX_ATOM_NET_WM_WINDOW_TYPE_TOOLBAR)
|
||||
else if (atom == ea_n._NET_WM_WINDOW_TYPE_TOOLBAR)
|
||||
ewin->ewmh.type.b.toolbar = 1;
|
||||
else if (atom == EX_ATOM_NET_WM_WINDOW_TYPE_MENU)
|
||||
else if (atom == ea_n._NET_WM_WINDOW_TYPE_MENU)
|
||||
ewin->ewmh.type.b.menu = 1;
|
||||
else if (atom == EX_ATOM_NET_WM_WINDOW_TYPE_SPLASH)
|
||||
else if (atom == ea_n._NET_WM_WINDOW_TYPE_SPLASH)
|
||||
ewin->ewmh.type.b.splash = 1;
|
||||
else if (atom == EX_ATOM_NET_WM_WINDOW_TYPE_DIALOG)
|
||||
else if (atom == ea_n._NET_WM_WINDOW_TYPE_DIALOG)
|
||||
ewin->ewmh.type.b.dialog = 1;
|
||||
else if (atom == EX_ATOM_NET_WM_WINDOW_TYPE_NORMAL)
|
||||
else if (atom == ea_n._NET_WM_WINDOW_TYPE_NORMAL)
|
||||
ewin->ewmh.type.b.normal = 1;
|
||||
}
|
||||
|
||||
|
@ -610,7 +610,7 @@ EWMH_GetWindowIcons(EWin * ewin)
|
|||
EFREE_NULL(ewin->ewmh.wm_icon);
|
||||
|
||||
num = ex_window_prop_card32_list_get(EwinGetClientXwin(ewin),
|
||||
EX_ATOM_NET_WM_ICON, &val);
|
||||
ea_n._NET_WM_ICON, &val);
|
||||
ewin->ewmh.wm_icon_len = num;
|
||||
if (num <= 0)
|
||||
return;
|
||||
|
@ -669,7 +669,7 @@ EWMH_GetWindowMisc(EWin * ewin)
|
|||
EX_Window win;
|
||||
|
||||
num = ex_window_prop_window_get(EwinGetClientXwin(ewin),
|
||||
EX_ATOM_NET_SUPPORTING_WM_CHECK, &win, 1);
|
||||
ea_n._NET_SUPPORTING_WM_CHECK, &win, 1);
|
||||
if (num <= 0)
|
||||
return;
|
||||
|
||||
|
@ -701,11 +701,11 @@ EWMH_GetWindowStrut(EWin * ewin)
|
|||
unsigned int val[12];
|
||||
|
||||
num = ex_window_prop_card32_get(EwinGetClientXwin(ewin),
|
||||
EX_ATOM_NET_WM_STRUT_PARTIAL, val, 12);
|
||||
ea_n._NET_WM_STRUT_PARTIAL, val, 12);
|
||||
|
||||
if (num < 4)
|
||||
num = ex_window_prop_card32_get(EwinGetClientXwin(ewin),
|
||||
EX_ATOM_NET_WM_STRUT, val, 4);
|
||||
ea_n._NET_WM_STRUT, val, 4);
|
||||
if (num < 4)
|
||||
return;
|
||||
|
||||
|
@ -737,30 +737,27 @@ EWMH_SetWindowActions(const EWin * ewin)
|
|||
atom_count = 0;
|
||||
atom_mask = atom_bit = 0;
|
||||
|
||||
ATOM_ADD_IF(EX_ATOM_NET_WM_ACTION_MOVE, !ewin->state.inhibit_move);
|
||||
ATOM_ADD_IF(EX_ATOM_NET_WM_ACTION_RESIZE, !ewin->state.inhibit_resize);
|
||||
ATOM_ADD_IF(EX_ATOM_NET_WM_ACTION_MINIMIZE, !ewin->state.inhibit_iconify);
|
||||
ATOM_ADD_IF(EX_ATOM_NET_WM_ACTION_SHADE, !ewin->state.inhibit_shade);
|
||||
ATOM_ADD_IF(EX_ATOM_NET_WM_ACTION_STICK, !ewin->state.inhibit_stick);
|
||||
ATOM_ADD_IF(EX_ATOM_NET_WM_ACTION_MAXIMIZE_HORZ,
|
||||
!ewin->state.inhibit_max_hor);
|
||||
ATOM_ADD_IF(EX_ATOM_NET_WM_ACTION_MAXIMIZE_VERT,
|
||||
!ewin->state.inhibit_max_ver);
|
||||
ATOM_ADD_IF(EX_ATOM_NET_WM_ACTION_FULLSCREEN,
|
||||
ATOM_ADD_IF(ea_n._NET_WM_ACTION_MOVE, !ewin->state.inhibit_move);
|
||||
ATOM_ADD_IF(ea_n._NET_WM_ACTION_RESIZE, !ewin->state.inhibit_resize);
|
||||
ATOM_ADD_IF(ea_n._NET_WM_ACTION_MINIMIZE, !ewin->state.inhibit_iconify);
|
||||
ATOM_ADD_IF(ea_n._NET_WM_ACTION_SHADE, !ewin->state.inhibit_shade);
|
||||
ATOM_ADD_IF(ea_n._NET_WM_ACTION_STICK, !ewin->state.inhibit_stick);
|
||||
ATOM_ADD_IF(ea_n._NET_WM_ACTION_MAXIMIZE_HORZ, !ewin->state.inhibit_max_hor);
|
||||
ATOM_ADD_IF(ea_n._NET_WM_ACTION_MAXIMIZE_VERT, !ewin->state.inhibit_max_ver);
|
||||
ATOM_ADD_IF(ea_n._NET_WM_ACTION_FULLSCREEN,
|
||||
!ewin->state.inhibit_fullscreeen);
|
||||
ATOM_ADD_IF(EX_ATOM_NET_WM_ACTION_CHANGE_DESKTOP,
|
||||
ATOM_ADD_IF(ea_n._NET_WM_ACTION_CHANGE_DESKTOP,
|
||||
!ewin->state.inhibit_change_desk);
|
||||
ATOM_ADD_IF(EX_ATOM_NET_WM_ACTION_CLOSE, !ewin->state.inhibit_close);
|
||||
ATOM_ADD_IF(EX_ATOM_NET_WM_ACTION_ABOVE, !ewin->state.inhibit_stacking);
|
||||
ATOM_ADD_IF(EX_ATOM_NET_WM_ACTION_BELOW, !ewin->state.inhibit_stacking);
|
||||
ATOM_ADD_IF(ea_n._NET_WM_ACTION_CLOSE, !ewin->state.inhibit_close);
|
||||
ATOM_ADD_IF(ea_n._NET_WM_ACTION_ABOVE, !ewin->state.inhibit_stacking);
|
||||
ATOM_ADD_IF(ea_n._NET_WM_ACTION_BELOW, !ewin->state.inhibit_stacking);
|
||||
|
||||
if (ewin->ewmh.current_actions == atom_mask)
|
||||
return;
|
||||
((EWin *) ewin)->ewmh.current_actions = atom_mask;
|
||||
|
||||
ex_window_prop_atom_set(EwinGetClientXwin(ewin),
|
||||
EX_ATOM_NET_WM_ALLOWED_ACTIONS, atom_list,
|
||||
atom_count);
|
||||
ea_n._NET_WM_ALLOWED_ACTIONS, atom_list, atom_count);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -785,8 +782,8 @@ EWMH_GetWindowHints(EWin * ewin)
|
|||
void
|
||||
EWMH_DelWindowHints(const EWin * ewin)
|
||||
{
|
||||
ex_window_prop_del(EwinGetClientXwin(ewin), EX_ATOM_NET_WM_DESKTOP);
|
||||
ex_window_prop_del(EwinGetClientXwin(ewin), EX_ATOM_NET_WM_STATE);
|
||||
ex_window_prop_del(EwinGetClientXwin(ewin), ea_n._NET_WM_DESKTOP);
|
||||
ex_window_prop_del(EwinGetClientXwin(ewin), ea_n._NET_WM_STATE);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -795,28 +792,28 @@ EWMH_DelWindowHints(const EWin * ewin)
|
|||
int
|
||||
EWMH_ProcessPropertyChange(EWin * ewin, EX_Atom atom_change)
|
||||
{
|
||||
if (atom_change == EX_ATOM_NET_WM_NAME)
|
||||
if (atom_change == ea_n._NET_WM_NAME)
|
||||
{
|
||||
EWMH_GetWindowName(ewin);
|
||||
return 1;
|
||||
}
|
||||
if (atom_change == EX_ATOM_NET_WM_ICON_NAME)
|
||||
if (atom_change == ea_n._NET_WM_ICON_NAME)
|
||||
{
|
||||
EWMH_GetWindowIconName(ewin);
|
||||
return 1;
|
||||
}
|
||||
if (atom_change == EX_ATOM_NET_WM_STRUT_PARTIAL ||
|
||||
atom_change == EX_ATOM_NET_WM_STRUT)
|
||||
if (atom_change == ea_n._NET_WM_STRUT_PARTIAL ||
|
||||
atom_change == ea_n._NET_WM_STRUT)
|
||||
{
|
||||
EWMH_GetWindowStrut(ewin);
|
||||
return 1;
|
||||
}
|
||||
if (atom_change == EX_ATOM_NET_WM_WINDOW_OPACITY)
|
||||
if (atom_change == ea_n._NET_WM_WINDOW_OPACITY)
|
||||
{
|
||||
EWMH_GetWindowOpacity(ewin);
|
||||
return 1;
|
||||
}
|
||||
if (atom_change == EX_ATOM_NET_WM_USER_TIME)
|
||||
if (atom_change == ea_n._NET_WM_USER_TIME)
|
||||
{
|
||||
#if 0 /* Remove? */
|
||||
EWMH_GetWindowUserTime(ewin);
|
||||
|
@ -852,7 +849,7 @@ EWMH_ProcessClientClientMessage(EWin * ewin, XClientMessageEvent * ev)
|
|||
|
||||
/* EX_Time ts; */
|
||||
|
||||
if (ev->message_type == EX_ATOM_NET_ACTIVE_WINDOW)
|
||||
if (ev->message_type == ea_n._NET_ACTIVE_WINDOW)
|
||||
{
|
||||
source = OPSRC(ev->data.l[0]);
|
||||
/* ts = ev->data.l[1]; */
|
||||
|
@ -860,14 +857,14 @@ EWMH_ProcessClientClientMessage(EWin * ewin, XClientMessageEvent * ev)
|
|||
EwinOpActivate(ewin, source, 1);
|
||||
return 1;
|
||||
}
|
||||
if (ev->message_type == EX_ATOM_NET_CLOSE_WINDOW)
|
||||
if (ev->message_type == ea_n._NET_CLOSE_WINDOW)
|
||||
{
|
||||
/* ts = ev->data.l[0]; */
|
||||
source = OPSRC(ev->data.l[1]);
|
||||
EwinOpClose(ewin, source);
|
||||
return 1;
|
||||
}
|
||||
if (ev->message_type == EX_ATOM_NET_WM_DESKTOP)
|
||||
if (ev->message_type == ea_n._NET_WM_DESKTOP)
|
||||
{
|
||||
source = OPSRC(ev->data.l[1]);
|
||||
if ((unsigned)ev->data.l[0] == 0xFFFFFFFF)
|
||||
|
@ -884,7 +881,7 @@ EWMH_ProcessClientClientMessage(EWin * ewin, XClientMessageEvent * ev)
|
|||
}
|
||||
return 1;
|
||||
}
|
||||
if (ev->message_type == EX_ATOM_NET_WM_STATE)
|
||||
if (ev->message_type == ea_n._NET_WM_STATE)
|
||||
{
|
||||
/*
|
||||
* It is assumed(!) that only the MAXIMIZE H/V ones can be set
|
||||
|
@ -897,49 +894,49 @@ EWMH_ProcessClientClientMessage(EWin * ewin, XClientMessageEvent * ev)
|
|||
atom = ev->data.l[1];
|
||||
atom2 = ev->data.l[2];
|
||||
source = OPSRC(ev->data.l[3]);
|
||||
if (atom == EX_ATOM_NET_WM_STATE_MODAL)
|
||||
if (atom == ea_n._NET_WM_STATE_MODAL)
|
||||
{
|
||||
action = do_set(ewin->state.modal, action);
|
||||
/* TBD */
|
||||
ewin->state.modal = action;
|
||||
}
|
||||
else if (atom == EX_ATOM_NET_WM_STATE_STICKY)
|
||||
else if (atom == ea_n._NET_WM_STATE_STICKY)
|
||||
{
|
||||
action = do_set(EoIsSticky(ewin), action);
|
||||
EwinOpStick(ewin, source, action);
|
||||
}
|
||||
else if (atom == EX_ATOM_NET_WM_STATE_SHADED)
|
||||
else if (atom == ea_n._NET_WM_STATE_SHADED)
|
||||
{
|
||||
action = do_set(ewin->state.shaded, action);
|
||||
EwinOpShade(ewin, source, action);
|
||||
}
|
||||
else if (atom == EX_ATOM_NET_WM_STATE_SKIP_TASKBAR)
|
||||
else if (atom == ea_n._NET_WM_STATE_SKIP_TASKBAR)
|
||||
{
|
||||
action = do_set(ewin->props.skip_ext_task, action);
|
||||
ewin->props.skip_ext_task = action;
|
||||
EWMH_SetWindowState(ewin);
|
||||
}
|
||||
else if (atom == EX_ATOM_NET_WM_STATE_SKIP_PAGER)
|
||||
else if (atom == ea_n._NET_WM_STATE_SKIP_PAGER)
|
||||
{
|
||||
action = do_set(ewin->props.skip_ext_pager, action);
|
||||
ewin->props.skip_ext_pager = action;
|
||||
EWMH_SetWindowState(ewin);
|
||||
}
|
||||
else if (atom == EX_ATOM_NET_WM_STATE_MAXIMIZED_VERT ||
|
||||
atom == EX_ATOM_NET_WM_STATE_MAXIMIZED_HORZ)
|
||||
else if (atom == ea_n._NET_WM_STATE_MAXIMIZED_VERT ||
|
||||
atom == ea_n._NET_WM_STATE_MAXIMIZED_HORZ)
|
||||
{
|
||||
int maxh, maxv;
|
||||
|
||||
maxh = ewin->state.maximized_horz;
|
||||
maxv = ewin->state.maximized_vert;
|
||||
if (atom2 == EX_ATOM_NET_WM_STATE_MAXIMIZED_VERT ||
|
||||
atom2 == EX_ATOM_NET_WM_STATE_MAXIMIZED_HORZ)
|
||||
if (atom2 == ea_n._NET_WM_STATE_MAXIMIZED_VERT ||
|
||||
atom2 == ea_n._NET_WM_STATE_MAXIMIZED_HORZ)
|
||||
{
|
||||
/* (ok - ok) */
|
||||
maxh = do_set(maxh, action);
|
||||
maxv = do_set(maxv, action);
|
||||
}
|
||||
else if (atom == EX_ATOM_NET_WM_STATE_MAXIMIZED_VERT)
|
||||
else if (atom == ea_n._NET_WM_STATE_MAXIMIZED_VERT)
|
||||
{
|
||||
maxv = do_set(maxv, action);
|
||||
}
|
||||
|
@ -956,13 +953,13 @@ EWMH_ProcessClientClientMessage(EWin * ewin, XClientMessageEvent * ev)
|
|||
EWMH_SetWindowState(ewin);
|
||||
}
|
||||
}
|
||||
else if (atom == EX_ATOM_NET_WM_STATE_FULLSCREEN)
|
||||
else if (atom == ea_n._NET_WM_STATE_FULLSCREEN)
|
||||
{
|
||||
action = do_set(ewin->state.fullscreen, action);
|
||||
if (ewin->state.fullscreen != action)
|
||||
EwinOpFullscreen(ewin, source, action);
|
||||
}
|
||||
else if (atom == EX_ATOM_NET_WM_STATE_ABOVE)
|
||||
else if (atom == ea_n._NET_WM_STATE_ABOVE)
|
||||
{
|
||||
action = do_set(EoGetLayer(ewin) >= 6, action);
|
||||
if (action)
|
||||
|
@ -976,7 +973,7 @@ EWMH_ProcessClientClientMessage(EWin * ewin, XClientMessageEvent * ev)
|
|||
EwinOpSetLayer(ewin, source, 4);
|
||||
}
|
||||
}
|
||||
else if (atom == EX_ATOM_NET_WM_STATE_BELOW)
|
||||
else if (atom == ea_n._NET_WM_STATE_BELOW)
|
||||
{
|
||||
action = do_set(EoGetLayer(ewin) <= 2, action);
|
||||
if (action)
|
||||
|
@ -990,7 +987,7 @@ EWMH_ProcessClientClientMessage(EWin * ewin, XClientMessageEvent * ev)
|
|||
EwinOpSetLayer(ewin, source, 4);
|
||||
}
|
||||
}
|
||||
else if (atom == EX_ATOM_NET_WM_STATE_DEMANDS_ATTENTION)
|
||||
else if (atom == ea_n._NET_WM_STATE_DEMANDS_ATTENTION)
|
||||
{
|
||||
action = do_set(ewin->state.attention, action);
|
||||
ewin->state.attention = action;
|
||||
|
@ -998,7 +995,7 @@ EWMH_ProcessClientClientMessage(EWin * ewin, XClientMessageEvent * ev)
|
|||
}
|
||||
return 1;
|
||||
}
|
||||
if (ev->message_type == EX_ATOM_NET_MOVERESIZE_WINDOW)
|
||||
if (ev->message_type == ea_n._NET_MOVERESIZE_WINDOW)
|
||||
{
|
||||
int flags, grav, x, y, w, h;
|
||||
|
||||
|
@ -1012,7 +1009,7 @@ EWMH_ProcessClientClientMessage(EWin * ewin, XClientMessageEvent * ev)
|
|||
EwinMoveResizeWithGravity(ewin, x, y, w, h, grav);
|
||||
return 1;
|
||||
}
|
||||
if (ev->message_type == EX_ATOM_NET_WM_MOVERESIZE)
|
||||
if (ev->message_type == ea_n._NET_WM_MOVERESIZE)
|
||||
{
|
||||
/* source = OPSRC(ev->data.l[4]); */
|
||||
|
||||
|
@ -1051,7 +1048,7 @@ EWMH_ProcessClientClientMessage(EWin * ewin, XClientMessageEvent * ev)
|
|||
}
|
||||
return 1;
|
||||
}
|
||||
if (ev->message_type == EX_ATOM_NET_RESTACK_WINDOW)
|
||||
if (ev->message_type == ea_n._NET_RESTACK_WINDOW)
|
||||
{
|
||||
/* source = OPSRC(ev->data.l[0]); */
|
||||
/* FIXME - Implement */
|
||||
|
@ -1064,32 +1061,32 @@ EWMH_ProcessClientClientMessage(EWin * ewin, XClientMessageEvent * ev)
|
|||
int
|
||||
EWMH_ProcessRootClientMessage(XClientMessageEvent * ev)
|
||||
{
|
||||
if (ev->message_type == EX_ATOM_NET_CURRENT_DESKTOP)
|
||||
if (ev->message_type == ea_n._NET_CURRENT_DESKTOP)
|
||||
{
|
||||
DeskGotoNum(ev->data.l[0]);
|
||||
return 1;
|
||||
}
|
||||
if (ev->message_type == EX_ATOM_NET_DESKTOP_VIEWPORT)
|
||||
if (ev->message_type == ea_n._NET_DESKTOP_VIEWPORT)
|
||||
{
|
||||
DeskCurrentGotoArea(ev->data.l[0] / WinGetW(VROOT),
|
||||
ev->data.l[1] / WinGetH(VROOT));
|
||||
return 1;
|
||||
}
|
||||
if (ev->message_type == EX_ATOM_NET_SHOWING_DESKTOP)
|
||||
if (ev->message_type == ea_n._NET_SHOWING_DESKTOP)
|
||||
{
|
||||
EwinsShowDesktop(ev->data.l[0]);
|
||||
return 1;
|
||||
}
|
||||
#if 0 /* These messages are sent to dedicated window */
|
||||
if (ev->message_type == EX_ATOM_NET_STARTUP_INFO_BEGIN)
|
||||
if (ev->message_type == ea_n._NET_STARTUP_INFO_BEGIN)
|
||||
{
|
||||
Eprintf("EX_ATOM_NET_STARTUP_INFO_BEGIN: %lx: %s\n",
|
||||
Eprintf("ea_n._NET_STARTUP_INFO_BEGIN: %lx: %s\n",
|
||||
ev->window, (char *)ev->data.l);
|
||||
return 1;
|
||||
}
|
||||
if (ev->message_type == EX_ATOM_NET_STARTUP_INFO)
|
||||
if (ev->message_type == ea_n._NET_STARTUP_INFO)
|
||||
{
|
||||
Eprintf("EX_ATOM_NET_STARTUP_INFO : %lx: %s\n",
|
||||
Eprintf("ea_n._NET_STARTUP_INFO : %lx: %s\n",
|
||||
ev->window, (char *)ev->data.l);
|
||||
return 1;
|
||||
}
|
||||
|
|
30
src/hints.c
30
src/hints.c
|
@ -58,7 +58,8 @@ HintsInit(void)
|
|||
#endif
|
||||
EWMH_Init(win);
|
||||
|
||||
ex_window_prop_string_set(WinGetXwin(VROOT), E16_ATOM_VERSION, e_wm_version);
|
||||
ex_window_prop_string_set(WinGetXwin(VROOT), ea_m.ENLIGHTENMENT_VERSION,
|
||||
e_wm_version);
|
||||
|
||||
if (Mode.wm.window)
|
||||
{
|
||||
|
@ -297,7 +298,8 @@ HintsGetRootPixmap(Win win)
|
|||
EX_Pixmap pm;
|
||||
|
||||
pm = NoXID;
|
||||
ex_window_prop_xid_get(WinGetXwin(win), E_XROOTPMAP_ID, XA_PIXMAP, &pm, 1);
|
||||
ex_window_prop_xid_get(WinGetXwin(win), ea_m._XROOTPMAP_ID, XA_PIXMAP, &pm,
|
||||
1);
|
||||
|
||||
return pm;
|
||||
}
|
||||
|
@ -308,9 +310,11 @@ HintsSetRootInfo(Win win, EX_Pixmap pmap, unsigned int color)
|
|||
EX_Pixmap pm;
|
||||
|
||||
pm = pmap;
|
||||
ex_window_prop_xid_set(WinGetXwin(win), E_XROOTPMAP_ID, XA_PIXMAP, &pm, 1);
|
||||
ex_window_prop_xid_set(WinGetXwin(win), ea_m._XROOTPMAP_ID, XA_PIXMAP, &pm,
|
||||
1);
|
||||
|
||||
ex_window_prop_card32_set(WinGetXwin(win), E_XROOTCOLOR_PIXEL, &color, 1);
|
||||
ex_window_prop_card32_set(WinGetXwin(win), ea_m._XROOTCOLOR_PIXEL, &color,
|
||||
1);
|
||||
}
|
||||
|
||||
typedef union {
|
||||
|
@ -356,10 +360,10 @@ EHintsSetInfo(const EWin * ewin)
|
|||
c[10] = ewin->save_fs.h;
|
||||
c[11] = ewin->save_fs.layer;
|
||||
|
||||
ex_window_prop_card32_set(EwinGetClientXwin(ewin), E16_ATOM_WIN_DATA,
|
||||
ex_window_prop_card32_set(EwinGetClientXwin(ewin), ea_m.ENL_WIN_DATA,
|
||||
(unsigned int *)c, ENL_DATA_ITEMS);
|
||||
|
||||
ex_window_prop_string_set(EwinGetClientXwin(ewin), E16_ATOM_WIN_BORDER,
|
||||
ex_window_prop_string_set(EwinGetClientXwin(ewin), ea_m.ENL_WIN_BORDER,
|
||||
BorderGetName(ewin->normal_border));
|
||||
|
||||
if (EDebug(EDBUG_TYPE_SNAPS))
|
||||
|
@ -385,7 +389,7 @@ EHintsGetInfo(EWin * ewin)
|
|||
ewin->client.x -= WinGetW(VROOT);
|
||||
|
||||
num =
|
||||
ex_window_prop_card32_get(EwinGetClientXwin(ewin), E16_ATOM_WIN_DATA,
|
||||
ex_window_prop_card32_get(EwinGetClientXwin(ewin), ea_m.ENL_WIN_DATA,
|
||||
(unsigned int *)c, ENL_DATA_ITEMS + 1);
|
||||
if (num < 0)
|
||||
return;
|
||||
|
@ -420,7 +424,7 @@ EHintsGetInfo(EWin * ewin)
|
|||
}
|
||||
|
||||
str =
|
||||
ex_window_prop_string_get(EwinGetClientXwin(ewin), E16_ATOM_WIN_BORDER);
|
||||
ex_window_prop_string_get(EwinGetClientXwin(ewin), ea_m.ENL_WIN_BORDER);
|
||||
if (str)
|
||||
EwinBorderSetInitially(ewin, str);
|
||||
Efree(str);
|
||||
|
@ -457,7 +461,7 @@ EHintsSetDeskInfo(void)
|
|||
c[0] = DesksGetCurrentNum();
|
||||
c[1] = Mode.wm.exiting ? 0 : desk_pos_info;
|
||||
ex_window_prop_card32_set(WinGetXwin(VROOT),
|
||||
E16_ATOM_INTERNAL_DESK_DATA, c, 2);
|
||||
ea_m.ENL_INTERNAL_DESK_DATA, c, 2);
|
||||
|
||||
if (Mode.wm.exiting && Mode.root.ext_pmap_valid)
|
||||
{
|
||||
|
@ -490,7 +494,7 @@ EHintsSetAreaInfo(void)
|
|||
}
|
||||
|
||||
ex_window_prop_card32_set(WinGetXwin(VROOT),
|
||||
E16_ATOM_INTERNAL_AREA_DATA, c, 2 * n_desks);
|
||||
ea_m.ENL_INTERNAL_AREA_DATA, c, 2 * n_desks);
|
||||
|
||||
Efree(c);
|
||||
}
|
||||
|
@ -508,7 +512,7 @@ EHintsGetDeskInfo(void)
|
|||
return;
|
||||
|
||||
num = ex_window_prop_card32_get(WinGetXwin(VROOT),
|
||||
E16_ATOM_INTERNAL_AREA_DATA, c, 2 * n_desks);
|
||||
ea_m.ENL_INTERNAL_AREA_DATA, c, 2 * n_desks);
|
||||
if (num > 0)
|
||||
{
|
||||
for (i = 0; i < (num / 2); i++)
|
||||
|
@ -516,7 +520,7 @@ EHintsGetDeskInfo(void)
|
|||
}
|
||||
|
||||
num = ex_window_prop_card32_get(WinGetXwin(VROOT),
|
||||
E16_ATOM_INTERNAL_DESK_DATA, c, 2);
|
||||
ea_m.ENL_INTERNAL_DESK_DATA, c, 2);
|
||||
if (num > 0)
|
||||
{
|
||||
DesksSetCurrent(DeskGet(c[0]));
|
||||
|
@ -596,7 +600,7 @@ SelectionAcquire(const char *name, EventCallbackFunc * func, void *data)
|
|||
EventCallbackRegister(sel->win, sel->func, sel->data);
|
||||
}
|
||||
|
||||
ex_client_message32_send(WinGetXwin(VROOT), E_XA_MANAGER,
|
||||
ex_client_message32_send(WinGetXwin(VROOT), ea_m.MANAGER,
|
||||
StructureNotifyMask, CurrentTime, sel->atom,
|
||||
WinGetXwin(sel->win), 0, 0);
|
||||
|
||||
|
|
72
src/icccm.c
72
src/icccm.c
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Copyright (C) 2000-2007 Carsten Haitzler, Geoff Harrison and various contributors
|
||||
* Copyright (C) 2004-2018 Kim Woelders
|
||||
* Copyright (C) 2004-2021 Kim Woelders
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to
|
||||
|
@ -52,8 +52,8 @@ ICCCM_Init(void)
|
|||
{
|
||||
EX_Atom wm_props[1];
|
||||
|
||||
wm_props[0] = EX_ATOM_WM_DELETE_WINDOW;
|
||||
ex_window_prop_atom_set(WinGetXwin(VROOT), EX_ATOM_WM_PROTOCOLS,
|
||||
wm_props[0] = ea_i.WM_DELETE_WINDOW;
|
||||
ex_window_prop_atom_set(WinGetXwin(VROOT), ea_i.WM_PROTOCOLS,
|
||||
wm_props, 1);
|
||||
}
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ ICCCM_Init(void)
|
|||
int
|
||||
ICCCM_ProcessClientClientMessage(EWin * ewin, XClientMessageEvent * event)
|
||||
{
|
||||
if (event->message_type == EX_ATOM_WM_CHANGE_STATE)
|
||||
if (event->message_type == ea_i.WM_CHANGE_STATE)
|
||||
{
|
||||
if (event->data.l[0] == IconicState)
|
||||
{
|
||||
|
@ -78,10 +78,10 @@ ICCCM_ProcessRootClientMessage(XClientMessageEvent * event)
|
|||
{
|
||||
EX_Atom a;
|
||||
|
||||
if (event->message_type == EX_ATOM_WM_PROTOCOLS)
|
||||
if (event->message_type == ea_i.WM_PROTOCOLS)
|
||||
{
|
||||
a = event->data.l[0];
|
||||
if (a == EX_ATOM_WM_DELETE_WINDOW)
|
||||
if (a == ea_i.WM_DELETE_WINDOW)
|
||||
SessionExit(EEXIT_EXIT, NULL);
|
||||
return 1;
|
||||
}
|
||||
|
@ -353,7 +353,7 @@ ICCCM_Cmap(EWin * ewin)
|
|||
goto set_cmap;
|
||||
|
||||
num = ex_window_prop_window_list_get(EwinGetClientXwin(ewin),
|
||||
EX_ATOM_WM_COLORMAP_WINDOWS, &wlist);
|
||||
ea_i.WM_COLORMAP_WINDOWS, &wlist);
|
||||
if (num > 0)
|
||||
{
|
||||
for (i = 0; i < num; i++)
|
||||
|
@ -575,10 +575,10 @@ ICCCM_GetWmCommand(EWin * ewin)
|
|||
EFREE_NULL(ewin->icccm.wm_command);
|
||||
|
||||
argc = ex_window_prop_string_list_get(EwinGetClientXwin(ewin),
|
||||
EX_ATOM_WM_COMMAND, &argv);
|
||||
ea_i.WM_COMMAND, &argv);
|
||||
if ((argc < 0) && TryGroup(ewin))
|
||||
argc = ex_window_prop_string_list_get(ewin->icccm.group,
|
||||
EX_ATOM_WM_COMMAND, &argv);
|
||||
ea_i.WM_COMMAND, &argv);
|
||||
|
||||
ss = StrlistEncodeEscaped(s, sizeof(s), argv, argc);
|
||||
ewin->icccm.wm_command = Estrdup(ss);
|
||||
|
@ -592,11 +592,10 @@ ICCCM_GetWmClientMachine(EWin * ewin)
|
|||
|
||||
ewin->icccm.wm_machine =
|
||||
ex_window_prop_string_get(EwinGetClientXwin(ewin),
|
||||
EX_ATOM_WM_CLIENT_MACHINE);
|
||||
ea_i.WM_CLIENT_MACHINE);
|
||||
if (!ewin->icccm.wm_machine && TryGroup(ewin))
|
||||
ewin->icccm.wm_machine =
|
||||
ex_window_prop_string_get(ewin->icccm.group,
|
||||
EX_ATOM_WM_CLIENT_MACHINE);
|
||||
ex_window_prop_string_get(ewin->icccm.group, ea_i.WM_CLIENT_MACHINE);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -605,10 +604,10 @@ ICCCM_GetWmIconName(EWin * ewin)
|
|||
EFREE_NULL(ewin->icccm.wm_icon_name);
|
||||
|
||||
ewin->icccm.wm_icon_name =
|
||||
ex_window_prop_string_get(EwinGetClientXwin(ewin), EX_ATOM_WM_ICON_NAME);
|
||||
ex_window_prop_string_get(EwinGetClientXwin(ewin), ea_i.WM_ICON_NAME);
|
||||
if (!ewin->icccm.wm_icon_name && TryGroup(ewin))
|
||||
ewin->icccm.wm_icon_name =
|
||||
ex_window_prop_string_get(ewin->icccm.group, EX_ATOM_WM_ICON_NAME);
|
||||
ex_window_prop_string_get(ewin->icccm.group, ea_i.WM_ICON_NAME);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -616,8 +615,7 @@ ICCCM_GetWmWindowRole(EWin * ewin)
|
|||
{
|
||||
EFREE_NULL(ewin->icccm.wm_role);
|
||||
ewin->icccm.wm_role =
|
||||
ex_window_prop_string_get(EwinGetClientXwin(ewin),
|
||||
EX_ATOM_WM_WINDOW_ROLE);
|
||||
ex_window_prop_string_get(EwinGetClientXwin(ewin), ea_i.WM_WINDOW_ROLE);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -710,7 +708,7 @@ ICCCM_GetWmProtocols(EWin * ewin)
|
|||
EX_Atom prop[64]; /* More is unlikely */
|
||||
int i, num;
|
||||
|
||||
num = ex_window_prop_atom_get(EwinGetClientXwin(ewin), EX_ATOM_WM_PROTOCOLS,
|
||||
num = ex_window_prop_atom_get(EwinGetClientXwin(ewin), ea_i.WM_PROTOCOLS,
|
||||
prop, 64);
|
||||
if (num < 0)
|
||||
return;
|
||||
|
@ -719,18 +717,18 @@ ICCCM_GetWmProtocols(EWin * ewin)
|
|||
ewin->icccm.delete_window = 0;
|
||||
for (i = 0; i < num; i++)
|
||||
{
|
||||
if (prop[i] == EX_ATOM_WM_TAKE_FOCUS)
|
||||
if (prop[i] == ea_i.WM_TAKE_FOCUS)
|
||||
ewin->icccm.take_focus = 1;
|
||||
else if (prop[i] == EX_ATOM_WM_DELETE_WINDOW)
|
||||
else if (prop[i] == ea_i.WM_DELETE_WINDOW)
|
||||
ewin->icccm.delete_window = 1;
|
||||
#if USE_XSYNC
|
||||
else if (prop[i] == EX_ATOM_NET_WM_SYNC_REQUEST)
|
||||
else if (prop[i] == ea_n._NET_WM_SYNC_REQUEST)
|
||||
{
|
||||
unsigned int c;
|
||||
|
||||
ewin->ewmh.sync_request_enable = 1;
|
||||
ex_window_prop_card32_get(EwinGetClientXwin(ewin),
|
||||
EX_ATOM_NET_WM_SYNC_REQUEST_COUNTER,
|
||||
ea_n._NET_WM_SYNC_REQUEST_COUNTER,
|
||||
&c, 1);
|
||||
ewin->ewmh.sync_request_counter = c;
|
||||
}
|
||||
|
@ -745,7 +743,7 @@ ICCCM_GetWmTransientFor(EWin * ewin)
|
|||
EX_Window win;
|
||||
|
||||
num = ex_window_prop_window_get(EwinGetClientXwin(ewin),
|
||||
EX_ATOM_WM_TRANSIENT_FOR, &win, 1);
|
||||
ea_i.WM_TRANSIENT_FOR, &win, 1);
|
||||
if (num > 0)
|
||||
{
|
||||
ewin->icccm.transient = 1;
|
||||
|
@ -765,7 +763,7 @@ ICCCM_GetWmClientLeader(EWin * ewin)
|
|||
EX_Window cleader;
|
||||
|
||||
num = ex_window_prop_window_get(EwinGetClientXwin(ewin),
|
||||
EX_ATOM_WM_CLIENT_LEADER, &cleader, 1);
|
||||
ea_i.WM_CLIENT_LEADER, &cleader, 1);
|
||||
if (num > 0)
|
||||
{
|
||||
ewin->icccm.client_leader = cleader;
|
||||
|
@ -805,70 +803,70 @@ ICCCM_SetIconSizes(void)
|
|||
int
|
||||
ICCCM_ProcessPropertyChange(EWin * ewin, EX_Atom atom_change)
|
||||
{
|
||||
if (atom_change == EX_ATOM_WM_NAME)
|
||||
if (atom_change == ea_i.WM_NAME)
|
||||
{
|
||||
ICCCM_GetTitle(ewin);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* ICCCM_GetHints */
|
||||
if (atom_change == EX_ATOM_WM_HINTS)
|
||||
if (atom_change == ea_i.WM_HINTS)
|
||||
{
|
||||
ICCCM_GetWmHints(ewin);
|
||||
return 1;
|
||||
}
|
||||
if (atom_change == EX_ATOM_WM_PROTOCOLS)
|
||||
if (atom_change == ea_i.WM_PROTOCOLS)
|
||||
{
|
||||
ICCCM_GetWmProtocols(ewin);
|
||||
return 1;
|
||||
}
|
||||
if (atom_change == EX_ATOM_WM_TRANSIENT_FOR)
|
||||
if (atom_change == ea_i.WM_TRANSIENT_FOR)
|
||||
{
|
||||
ICCCM_GetWmTransientFor(ewin);
|
||||
return 1;
|
||||
}
|
||||
if (atom_change == EX_ATOM_WM_CLIENT_LEADER)
|
||||
if (atom_change == ea_i.WM_CLIENT_LEADER)
|
||||
{
|
||||
ICCCM_GetWmClientLeader(ewin);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* ICCCM_GetInfo */
|
||||
if (atom_change == EX_ATOM_WM_ICON_NAME)
|
||||
if (atom_change == ea_i.WM_ICON_NAME)
|
||||
{
|
||||
ICCCM_GetWmIconName(ewin);
|
||||
return 1;
|
||||
}
|
||||
#if 1 /* FIXME - Any reason to process these? */
|
||||
if (atom_change == EX_ATOM_WM_CLASS)
|
||||
if (atom_change == ea_i.WM_CLASS)
|
||||
{
|
||||
ICCCM_GetWmClass(ewin);
|
||||
return 1;
|
||||
}
|
||||
if (atom_change == EX_ATOM_WM_COMMAND)
|
||||
if (atom_change == ea_i.WM_COMMAND)
|
||||
{
|
||||
ICCCM_GetWmCommand(ewin);
|
||||
return 1;
|
||||
}
|
||||
if (atom_change == EX_ATOM_WM_CLIENT_MACHINE)
|
||||
if (atom_change == ea_i.WM_CLIENT_MACHINE)
|
||||
{
|
||||
ICCCM_GetWmClientMachine(ewin);
|
||||
return 1;
|
||||
}
|
||||
if (atom_change == EX_ATOM_WM_WINDOW_ROLE)
|
||||
if (atom_change == ea_i.WM_WINDOW_ROLE)
|
||||
{
|
||||
ICCCM_GetWmWindowRole(ewin);
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (atom_change == EX_ATOM_WM_COLORMAP_WINDOWS)
|
||||
if (atom_change == ea_i.WM_COLORMAP_WINDOWS)
|
||||
{
|
||||
ICCCM_Cmap(ewin);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (atom_change == EX_ATOM_WM_NORMAL_HINTS)
|
||||
if (atom_change == ea_i.WM_NORMAL_HINTS)
|
||||
{
|
||||
ICCCM_GetGeoms(ewin);
|
||||
return 1;
|
||||
|
@ -891,9 +889,9 @@ EwinSyncRequestSend(EWin * ewin)
|
|||
if (count == 0)
|
||||
ewin->ewmh.sync_request_count = ++count;
|
||||
ex_client_message32_send(EwinGetClientXwin(ewin),
|
||||
EX_ATOM_WM_PROTOCOLS,
|
||||
ea_i.WM_PROTOCOLS,
|
||||
StructureNotifyMask,
|
||||
EX_ATOM_NET_WM_SYNC_REQUEST,
|
||||
ea_n._NET_WM_SYNC_REQUEST,
|
||||
Mode.events.time,
|
||||
(long)(count & 0xffffffff), (long)(count >> 32), 0);
|
||||
|
||||
|
|
251
src/xprop.c
251
src/xprop.c
|
@ -37,12 +37,6 @@
|
|||
#include "xprop.h"
|
||||
#include "xwin.h"
|
||||
|
||||
#if defined(__STDC_VERSION__) && __STDC_VERSION__ > 201112L
|
||||
#define E_STATIC_ASSERT(...) _Static_assert(__VA_ARGS__)
|
||||
#else
|
||||
#define E_STATIC_ASSERT(...)
|
||||
#endif
|
||||
|
||||
#define _ex_disp disp
|
||||
|
||||
/*
|
||||
|
@ -352,7 +346,7 @@ ex_window_prop_string_get(EX_Window win, EX_Atom atom)
|
|||
static void
|
||||
_ex_window_prop_string_utf8_set(EX_Window win, EX_Atom atom, const char *str)
|
||||
{
|
||||
XChangeProperty(_ex_disp, win, atom, E_XA_UTF8_STRING, 8,
|
||||
XChangeProperty(_ex_disp, win, atom, ea_m.UTF8_STRING, 8,
|
||||
PropModeReplace, (unsigned char *)str, strlen(str));
|
||||
}
|
||||
|
||||
|
@ -371,7 +365,7 @@ _ex_window_prop_string_utf8_get(EX_Window win, EX_Atom atom)
|
|||
str = NULL;
|
||||
prop_ret = NULL;
|
||||
XGetWindowProperty(_ex_disp, win, atom, 0, 0x7fffffff, False,
|
||||
E_XA_UTF8_STRING, &type_ret,
|
||||
ea_m.UTF8_STRING, &type_ret,
|
||||
&format_ret, &num_ret, &bytes_after, &prop_ret);
|
||||
if (prop_ret && num_ret > 0 && format_ret == 8)
|
||||
{
|
||||
|
@ -569,66 +563,42 @@ ex_window_prop_window_list_get(EX_Window win, EX_Atom atom, EX_Window ** plst)
|
|||
return ex_window_prop_xid_list_get(win, atom, XA_WINDOW, plst);
|
||||
}
|
||||
|
||||
#define S_ATOM_COUNT(s) (sizeof(s) / sizeof(EX_Atom))
|
||||
|
||||
/*
|
||||
* Misc atom stuff
|
||||
*/
|
||||
|
||||
static const char *const atoms_misc_names[] = {
|
||||
/* Misc atoms */
|
||||
"UTF8_STRING",
|
||||
"MANAGER",
|
||||
|
||||
/* Root background atoms */
|
||||
"_XROOTPMAP_ID",
|
||||
"_XROOTCOLOR_PIXEL",
|
||||
|
||||
/* E16 atoms */
|
||||
"ENLIGHTENMENT_VERSION",
|
||||
|
||||
"ENLIGHTENMENT_COMMS",
|
||||
"ENL_MSG",
|
||||
|
||||
"ENL_INTERNAL_AREA_DATA",
|
||||
"ENL_INTERNAL_DESK_DATA",
|
||||
"ENL_WIN_DATA",
|
||||
"ENL_WIN_BORDER",
|
||||
static const char *const ea_m_names[] = {
|
||||
#define DEFINE_ATOM_MISC(a) #a,
|
||||
#include "xpropdefs.h"
|
||||
#undef DEFINE_ATOM_MISC
|
||||
};
|
||||
EX_Atom atoms_misc[E_ARRAY_SIZE(atoms_misc_names)];
|
||||
|
||||
E_STATIC_ASSERT(CHECK_COUNT_MISC == E_ARRAY_SIZE(atoms_misc));
|
||||
e_atoms_misc_t ea_m;
|
||||
|
||||
void
|
||||
ex_atoms_init(void)
|
||||
{
|
||||
ex_atoms_get(atoms_misc_names, E_ARRAY_SIZE(atoms_misc), atoms_misc);
|
||||
ex_atoms_get(ea_m_names, E_ARRAY_SIZE(ea_m_names), (EX_Atom *) & ea_m);
|
||||
}
|
||||
|
||||
/*
|
||||
* ICCCM stuff
|
||||
*/
|
||||
|
||||
static const char *const atoms_icccm_names[] = {
|
||||
/* ICCCM */
|
||||
"WM_STATE",
|
||||
"WM_WINDOW_ROLE",
|
||||
"WM_CLIENT_LEADER",
|
||||
"WM_COLORMAP_WINDOWS",
|
||||
"WM_CHANGE_STATE",
|
||||
"WM_PROTOCOLS",
|
||||
"WM_DELETE_WINDOW",
|
||||
"WM_TAKE_FOCUS",
|
||||
#if 0
|
||||
"WM_SAVE_YOURSELF",
|
||||
#endif
|
||||
static const char *const ea_i_names[] = {
|
||||
#define DEFINE_ATOM_ICCCM(a) #a,
|
||||
#include "xpropdefs.h"
|
||||
#undef DEFINE_ATOM_ICCCM
|
||||
};
|
||||
EX_Atom atoms_icccm[E_ARRAY_SIZE(atoms_icccm_names)];
|
||||
|
||||
E_STATIC_ASSERT(CHECK_COUNT_ICCCM == E_ARRAY_SIZE(atoms_icccm));
|
||||
e_atoms_icccm_t ea_i;
|
||||
|
||||
void
|
||||
ex_icccm_init(void)
|
||||
{
|
||||
ex_atoms_get(atoms_icccm_names, E_ARRAY_SIZE(atoms_icccm), atoms_icccm);
|
||||
ex_atoms_get(ea_i_names, E_ARRAY_SIZE(ea_i_names), (EX_Atom *) & ea_i);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -638,7 +608,7 @@ ex_icccm_state_set(EX_Window win, unsigned int state)
|
|||
|
||||
c[0] = state;
|
||||
c[1] = 0;
|
||||
XChangeProperty(_ex_disp, win, EX_ATOM_WM_STATE, EX_ATOM_WM_STATE,
|
||||
XChangeProperty(_ex_disp, win, ea_i.WM_STATE, ea_i.WM_STATE,
|
||||
32, PropModeReplace, (unsigned char *)c, 2);
|
||||
}
|
||||
|
||||
|
@ -663,40 +633,40 @@ ex_icccm_state_set_withdrawn(EX_Window win)
|
|||
static void
|
||||
ex_icccm_client_message_send(EX_Window win, EX_Atom atom, EX_Time ts)
|
||||
{
|
||||
ex_client_message32_send(win, EX_ATOM_WM_PROTOCOLS, NoEventMask,
|
||||
ex_client_message32_send(win, ea_i.WM_PROTOCOLS, NoEventMask,
|
||||
atom, ts, 0, 0, 0);
|
||||
}
|
||||
|
||||
void
|
||||
ex_icccm_delete_window_send(EX_Window win, EX_Time ts)
|
||||
{
|
||||
ex_icccm_client_message_send(win, EX_ATOM_WM_DELETE_WINDOW, ts);
|
||||
ex_icccm_client_message_send(win, ea_i.WM_DELETE_WINDOW, ts);
|
||||
}
|
||||
|
||||
void
|
||||
ex_icccm_take_focus_send(EX_Window win, EX_Time ts)
|
||||
{
|
||||
ex_icccm_client_message_send(win, EX_ATOM_WM_TAKE_FOCUS, ts);
|
||||
ex_icccm_client_message_send(win, ea_i.WM_TAKE_FOCUS, ts);
|
||||
}
|
||||
|
||||
#if 0
|
||||
void
|
||||
ex_icccm_save_yourself_send(EX_Window win, EX_Time ts)
|
||||
{
|
||||
ex_icccm_client_message_send(win, EX_ATOM_WM_SAVE_YOURSELF, ts);
|
||||
ex_icccm_client_message_send(win, ea_i.WM_SAVE_YOURSELF, ts);
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
ex_icccm_title_set(EX_Window win, const char *title)
|
||||
{
|
||||
ex_window_prop_string_set(win, EX_ATOM_WM_NAME, title);
|
||||
ex_window_prop_string_set(win, ea_i.WM_NAME, title);
|
||||
}
|
||||
|
||||
char *
|
||||
ex_icccm_title_get(EX_Window win)
|
||||
{
|
||||
return ex_window_prop_string_get(win, EX_ATOM_WM_NAME);
|
||||
return ex_window_prop_string_get(win, ea_i.WM_NAME);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -736,117 +706,17 @@ ex_icccm_name_class_get(EX_Window win, char **name, char **clss)
|
|||
* _NET_WM hints (EWMH)
|
||||
*/
|
||||
|
||||
static const char *const atoms_netwm_names[] = {
|
||||
/* Window manager info */
|
||||
"_NET_SUPPORTED",
|
||||
"_NET_SUPPORTING_WM_CHECK",
|
||||
|
||||
/* Desktop status/requests */
|
||||
"_NET_NUMBER_OF_DESKTOPS",
|
||||
"_NET_VIRTUAL_ROOTS",
|
||||
"_NET_DESKTOP_GEOMETRY",
|
||||
"_NET_DESKTOP_NAMES",
|
||||
"_NET_DESKTOP_VIEWPORT",
|
||||
"_NET_WORKAREA",
|
||||
"_NET_CURRENT_DESKTOP",
|
||||
"_NET_SHOWING_DESKTOP",
|
||||
|
||||
"_NET_ACTIVE_WINDOW",
|
||||
"_NET_CLIENT_LIST",
|
||||
"_NET_CLIENT_LIST_STACKING",
|
||||
|
||||
/* Client window props/client messages */
|
||||
"_NET_WM_NAME",
|
||||
"_NET_WM_VISIBLE_NAME",
|
||||
"_NET_WM_ICON_NAME",
|
||||
"_NET_WM_VISIBLE_ICON_NAME",
|
||||
|
||||
"_NET_WM_DESKTOP",
|
||||
|
||||
"_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",
|
||||
|
||||
"_NET_WM_STATE",
|
||||
"_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",
|
||||
"_NET_WM_STATE_FOCUSED",
|
||||
|
||||
"_NET_WM_ALLOWED_ACTIONS",
|
||||
"_NET_WM_ACTION_MOVE",
|
||||
"_NET_WM_ACTION_RESIZE",
|
||||
"_NET_WM_ACTION_MINIMIZE",
|
||||
"_NET_WM_ACTION_SHADE",
|
||||
"_NET_WM_ACTION_STICK",
|
||||
"_NET_WM_ACTION_MAXIMIZE_HORZ",
|
||||
"_NET_WM_ACTION_MAXIMIZE_VERT",
|
||||
"_NET_WM_ACTION_FULLSCREEN",
|
||||
"_NET_WM_ACTION_CHANGE_DESKTOP",
|
||||
"_NET_WM_ACTION_CLOSE",
|
||||
"_NET_WM_ACTION_ABOVE",
|
||||
"_NET_WM_ACTION_BELOW",
|
||||
|
||||
"_NET_WM_STRUT",
|
||||
"_NET_WM_STRUT_PARTIAL",
|
||||
|
||||
"_NET_FRAME_EXTENTS",
|
||||
|
||||
"_NET_WM_ICON",
|
||||
|
||||
"_NET_WM_USER_TIME",
|
||||
"_NET_WM_USER_TIME_WINDOW",
|
||||
|
||||
#if 0 /* Not used */
|
||||
"_NET_WM_ICON_GEOMETRY",
|
||||
"_NET_WM_PID",
|
||||
"_NET_WM_HANDLED_ICONS",
|
||||
|
||||
"_NET_WM_PING",
|
||||
#endif
|
||||
"_NET_WM_SYNC_REQUEST",
|
||||
"_NET_WM_SYNC_REQUEST_COUNTER",
|
||||
|
||||
"_NET_WM_WINDOW_OPACITY",
|
||||
|
||||
/* Misc window ops */
|
||||
"_NET_CLOSE_WINDOW",
|
||||
"_NET_MOVERESIZE_WINDOW",
|
||||
"_NET_WM_MOVERESIZE",
|
||||
"_NET_RESTACK_WINDOW",
|
||||
|
||||
#if 0 /* Not yet implemented */
|
||||
"_NET_REQUEST_FRAME_EXTENTS",
|
||||
#endif
|
||||
|
||||
/* Startup notification */
|
||||
"_NET_STARTUP_ID",
|
||||
"_NET_STARTUP_INFO_BEGIN",
|
||||
"_NET_STARTUP_INFO",
|
||||
static const char *const ea_n_names[] = {
|
||||
#define DEFINE_ATOM_NETWM(a) #a,
|
||||
#include "xpropdefs.h"
|
||||
#undef DEFINE_ATOM_NETWM
|
||||
};
|
||||
EX_Atom atoms_netwm[E_ARRAY_SIZE(atoms_netwm_names)];
|
||||
|
||||
E_STATIC_ASSERT(CHECK_COUNT_NETWM == E_ARRAY_SIZE(atoms_netwm));
|
||||
e_atoms_netwm_t ea_n;
|
||||
|
||||
void
|
||||
ex_netwm_init(void)
|
||||
{
|
||||
ex_atoms_get(atoms_netwm_names, E_ARRAY_SIZE(atoms_netwm), atoms_netwm);
|
||||
ex_atoms_get(ea_n_names, E_ARRAY_SIZE(ea_n_names), (EX_Atom *) & ea_n);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -855,11 +725,11 @@ ex_netwm_init(void)
|
|||
void
|
||||
ex_netwm_wm_identify(EX_Window root, EX_Window check, const char *wm_name)
|
||||
{
|
||||
ex_window_prop_window_set(root, EX_ATOM_NET_SUPPORTING_WM_CHECK, &check, 1);
|
||||
ex_window_prop_window_set(check, EX_ATOM_NET_SUPPORTING_WM_CHECK, &check, 1);
|
||||
_ex_window_prop_string_utf8_set(check, EX_ATOM_NET_WM_NAME, wm_name);
|
||||
ex_window_prop_window_set(root, ea_n._NET_SUPPORTING_WM_CHECK, &check, 1);
|
||||
ex_window_prop_window_set(check, ea_n._NET_SUPPORTING_WM_CHECK, &check, 1);
|
||||
_ex_window_prop_string_utf8_set(check, ea_n._NET_WM_NAME, wm_name);
|
||||
/* This one isn't mandatory */
|
||||
_ex_window_prop_string_utf8_set(root, EX_ATOM_NET_WM_NAME, wm_name);
|
||||
_ex_window_prop_string_utf8_set(root, ea_n._NET_WM_NAME, wm_name);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -869,14 +739,14 @@ ex_netwm_wm_identify(EX_Window root, EX_Window check, const char *wm_name)
|
|||
void
|
||||
ex_netwm_desk_count_set(EX_Window root, unsigned int n_desks)
|
||||
{
|
||||
ex_window_prop_card32_set(root, EX_ATOM_NET_NUMBER_OF_DESKTOPS, &n_desks, 1);
|
||||
ex_window_prop_card32_set(root, ea_n._NET_NUMBER_OF_DESKTOPS, &n_desks, 1);
|
||||
}
|
||||
|
||||
void
|
||||
ex_netwm_desk_roots_set(EX_Window root, const EX_Window * vroots,
|
||||
unsigned int n_desks)
|
||||
{
|
||||
ex_window_prop_window_set(root, EX_ATOM_NET_VIRTUAL_ROOTS, vroots, n_desks);
|
||||
ex_window_prop_window_set(root, ea_n._NET_VIRTUAL_ROOTS, vroots, n_desks);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -911,8 +781,8 @@ ex_netwm_desk_names_set(EX_Window root, const char **names,
|
|||
len += l;
|
||||
}
|
||||
|
||||
XChangeProperty(_ex_disp, root, EX_ATOM_NET_DESKTOP_NAMES,
|
||||
E_XA_UTF8_STRING, 8, PropModeReplace,
|
||||
XChangeProperty(_ex_disp, root, ea_n._NET_DESKTOP_NAMES,
|
||||
ea_m.UTF8_STRING, 8, PropModeReplace,
|
||||
(unsigned char *)buf, len);
|
||||
|
||||
done:
|
||||
|
@ -926,27 +796,27 @@ ex_netwm_desk_size_set(EX_Window root, unsigned int width, unsigned int height)
|
|||
|
||||
size[0] = width;
|
||||
size[1] = height;
|
||||
ex_window_prop_card32_set(root, EX_ATOM_NET_DESKTOP_GEOMETRY, size, 2);
|
||||
ex_window_prop_card32_set(root, ea_n._NET_DESKTOP_GEOMETRY, size, 2);
|
||||
}
|
||||
|
||||
void
|
||||
ex_netwm_desk_workareas_set(EX_Window root, const unsigned int *areas,
|
||||
unsigned int n_desks)
|
||||
{
|
||||
ex_window_prop_card32_set(root, EX_ATOM_NET_WORKAREA, areas, 4 * n_desks);
|
||||
ex_window_prop_card32_set(root, ea_n._NET_WORKAREA, areas, 4 * n_desks);
|
||||
}
|
||||
|
||||
void
|
||||
ex_netwm_desk_current_set(EX_Window root, unsigned int desk)
|
||||
{
|
||||
ex_window_prop_card32_set(root, EX_ATOM_NET_CURRENT_DESKTOP, &desk, 1);
|
||||
ex_window_prop_card32_set(root, ea_n._NET_CURRENT_DESKTOP, &desk, 1);
|
||||
}
|
||||
|
||||
void
|
||||
ex_netwm_desk_viewports_set(EX_Window root, const unsigned int *origins,
|
||||
unsigned int n_desks)
|
||||
{
|
||||
ex_window_prop_card32_set(root, EX_ATOM_NET_DESKTOP_VIEWPORT,
|
||||
ex_window_prop_card32_set(root, ea_n._NET_DESKTOP_VIEWPORT,
|
||||
origins, 2 * n_desks);
|
||||
}
|
||||
|
||||
|
@ -956,7 +826,7 @@ ex_netwm_showing_desktop_set(EX_Window root, int on)
|
|||
unsigned int val;
|
||||
|
||||
val = (on) ? 1 : 0;
|
||||
ex_window_prop_card32_set(root, EX_ATOM_NET_SHOWING_DESKTOP, &val, 1);
|
||||
ex_window_prop_card32_set(root, ea_n._NET_SHOWING_DESKTOP, &val, 1);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -968,8 +838,7 @@ void
|
|||
ex_netwm_client_list_set(EX_Window root, const EX_Window * p_clients,
|
||||
unsigned int n_clients)
|
||||
{
|
||||
ex_window_prop_window_set(root, EX_ATOM_NET_CLIENT_LIST,
|
||||
p_clients, n_clients);
|
||||
ex_window_prop_window_set(root, ea_n._NET_CLIENT_LIST, p_clients, n_clients);
|
||||
}
|
||||
|
||||
/* Stacking order */
|
||||
|
@ -978,14 +847,14 @@ ex_netwm_client_list_stacking_set(EX_Window root,
|
|||
const EX_Window * p_clients,
|
||||
unsigned int n_clients)
|
||||
{
|
||||
ex_window_prop_window_set(root, EX_ATOM_NET_CLIENT_LIST_STACKING,
|
||||
ex_window_prop_window_set(root, ea_n._NET_CLIENT_LIST_STACKING,
|
||||
p_clients, n_clients);
|
||||
}
|
||||
|
||||
void
|
||||
ex_netwm_client_active_set(EX_Window root, EX_Window win)
|
||||
{
|
||||
ex_window_prop_window_set(root, EX_ATOM_NET_ACTIVE_WINDOW, &win, 1);
|
||||
ex_window_prop_window_set(root, ea_n._NET_ACTIVE_WINDOW, &win, 1);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -995,7 +864,7 @@ ex_netwm_client_active_set(EX_Window root, EX_Window win)
|
|||
void
|
||||
ex_netwm_name_set(EX_Window win, const char *name)
|
||||
{
|
||||
_ex_window_prop_string_utf8_set(win, EX_ATOM_NET_WM_NAME, name);
|
||||
_ex_window_prop_string_utf8_set(win, ea_n._NET_WM_NAME, name);
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -1003,7 +872,7 @@ ex_netwm_name_get(EX_Window win, char **name)
|
|||
{
|
||||
char *s;
|
||||
|
||||
s = _ex_window_prop_string_utf8_get(win, EX_ATOM_NET_WM_NAME);
|
||||
s = _ex_window_prop_string_utf8_get(win, ea_n._NET_WM_NAME);
|
||||
*name = s;
|
||||
|
||||
return !!s;
|
||||
|
@ -1012,7 +881,7 @@ ex_netwm_name_get(EX_Window win, char **name)
|
|||
void
|
||||
ex_netwm_visible_name_set(EX_Window win, const char *name)
|
||||
{
|
||||
_ex_window_prop_string_utf8_set(win, EX_ATOM_NET_WM_VISIBLE_NAME, name);
|
||||
_ex_window_prop_string_utf8_set(win, ea_n._NET_WM_VISIBLE_NAME, name);
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -1020,7 +889,7 @@ ex_netwm_visible_name_get(EX_Window win, char **name)
|
|||
{
|
||||
char *s;
|
||||
|
||||
s = _ex_window_prop_string_utf8_get(win, EX_ATOM_NET_WM_VISIBLE_NAME);
|
||||
s = _ex_window_prop_string_utf8_get(win, ea_n._NET_WM_VISIBLE_NAME);
|
||||
*name = s;
|
||||
|
||||
return !!s;
|
||||
|
@ -1029,7 +898,7 @@ ex_netwm_visible_name_get(EX_Window win, char **name)
|
|||
void
|
||||
ex_netwm_icon_name_set(EX_Window win, const char *name)
|
||||
{
|
||||
_ex_window_prop_string_utf8_set(win, EX_ATOM_NET_WM_ICON_NAME, name);
|
||||
_ex_window_prop_string_utf8_set(win, ea_n._NET_WM_ICON_NAME, name);
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -1037,7 +906,7 @@ ex_netwm_icon_name_get(EX_Window win, char **name)
|
|||
{
|
||||
char *s;
|
||||
|
||||
s = _ex_window_prop_string_utf8_get(win, EX_ATOM_NET_WM_ICON_NAME);
|
||||
s = _ex_window_prop_string_utf8_get(win, ea_n._NET_WM_ICON_NAME);
|
||||
*name = s;
|
||||
|
||||
return !!s;
|
||||
|
@ -1046,7 +915,7 @@ ex_netwm_icon_name_get(EX_Window win, char **name)
|
|||
void
|
||||
ex_netwm_visible_icon_name_set(EX_Window win, const char *name)
|
||||
{
|
||||
_ex_window_prop_string_utf8_set(win, EX_ATOM_NET_WM_VISIBLE_ICON_NAME, name);
|
||||
_ex_window_prop_string_utf8_set(win, ea_n._NET_WM_VISIBLE_ICON_NAME, name);
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -1054,7 +923,7 @@ ex_netwm_visible_icon_name_get(EX_Window win, char **name)
|
|||
{
|
||||
char *s;
|
||||
|
||||
s = _ex_window_prop_string_utf8_get(win, EX_ATOM_NET_WM_VISIBLE_ICON_NAME);
|
||||
s = _ex_window_prop_string_utf8_get(win, ea_n._NET_WM_VISIBLE_ICON_NAME);
|
||||
*name = s;
|
||||
|
||||
return !!s;
|
||||
|
@ -1063,31 +932,31 @@ ex_netwm_visible_icon_name_get(EX_Window win, char **name)
|
|||
void
|
||||
ex_netwm_desktop_set(EX_Window win, unsigned int desk)
|
||||
{
|
||||
ex_window_prop_card32_set(win, EX_ATOM_NET_WM_DESKTOP, &desk, 1);
|
||||
ex_window_prop_card32_set(win, ea_n._NET_WM_DESKTOP, &desk, 1);
|
||||
}
|
||||
|
||||
int
|
||||
ex_netwm_desktop_get(EX_Window win, unsigned int *desk)
|
||||
{
|
||||
return ex_window_prop_card32_get(win, EX_ATOM_NET_WM_DESKTOP, desk, 1);
|
||||
return ex_window_prop_card32_get(win, ea_n._NET_WM_DESKTOP, desk, 1);
|
||||
}
|
||||
|
||||
int
|
||||
ex_netwm_user_time_get(EX_Window win, unsigned int *ts)
|
||||
{
|
||||
return ex_window_prop_card32_get(win, EX_ATOM_NET_WM_USER_TIME, ts, 1);
|
||||
return ex_window_prop_card32_get(win, ea_n._NET_WM_USER_TIME, ts, 1);
|
||||
}
|
||||
|
||||
void
|
||||
ex_netwm_opacity_set(EX_Window win, unsigned int opacity)
|
||||
{
|
||||
ex_window_prop_card32_set(win, EX_ATOM_NET_WM_WINDOW_OPACITY, &opacity, 1);
|
||||
ex_window_prop_card32_set(win, ea_n._NET_WM_WINDOW_OPACITY, &opacity, 1);
|
||||
}
|
||||
|
||||
int
|
||||
ex_netwm_opacity_get(EX_Window win, unsigned int *opacity)
|
||||
{
|
||||
return ex_window_prop_card32_get(win, EX_ATOM_NET_WM_WINDOW_OPACITY,
|
||||
return ex_window_prop_card32_get(win, ea_n._NET_WM_WINDOW_OPACITY,
|
||||
opacity, 1);
|
||||
}
|
||||
|
||||
|
@ -1095,7 +964,7 @@ ex_netwm_opacity_get(EX_Window win, unsigned int *opacity)
|
|||
void
|
||||
ex_netwm_startup_id_set(EX_Window win, const char *id)
|
||||
{
|
||||
_ex_window_prop_string_utf8_set(win, EX_ATOM_NET_STARTUP_ID, id);
|
||||
_ex_window_prop_string_utf8_set(win, ea_n._NET_STARTUP_ID, id);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -1104,7 +973,7 @@ ex_netwm_startup_id_get(EX_Window win, char **id)
|
|||
{
|
||||
char *s;
|
||||
|
||||
s = _ex_window_prop_string_utf8_get(win, EX_ATOM_NET_STARTUP_ID);
|
||||
s = _ex_window_prop_string_utf8_get(win, ea_n._NET_STARTUP_ID);
|
||||
*id = s;
|
||||
|
||||
return !!s;
|
||||
|
|
159
src/xprop.h
159
src/xprop.h
|
@ -79,52 +79,26 @@ void ex_window_prop_string_set(EX_Window win, EX_Atom atom,
|
|||
char *ex_window_prop_string_get(EX_Window win, EX_Atom atom);
|
||||
|
||||
/* Misc atoms */
|
||||
extern EX_Atom atoms_misc[];
|
||||
|
||||
#define E_XA_UTF8_STRING atoms_misc[0]
|
||||
#define E_XA_MANAGER atoms_misc[1]
|
||||
typedef struct {
|
||||
#define DEFINE_ATOM_MISC(a) EX_Atom a;
|
||||
#include "xpropdefs.h"
|
||||
#undef DEFINE_ATOM_MISC
|
||||
} e_atoms_misc_t;
|
||||
|
||||
#define E_XROOTPMAP_ID atoms_misc[2]
|
||||
#define E_XROOTCOLOR_PIXEL atoms_misc[3]
|
||||
|
||||
#define E16_ATOM_VERSION atoms_misc[4]
|
||||
|
||||
#define E16_ATOM_COMMS_WIN atoms_misc[5]
|
||||
#define E16_ATOM_COMMS_MSG atoms_misc[6]
|
||||
|
||||
#define E16_ATOM_INTERNAL_AREA_DATA atoms_misc[7]
|
||||
#define E16_ATOM_INTERNAL_DESK_DATA atoms_misc[8]
|
||||
#define E16_ATOM_WIN_DATA atoms_misc[9]
|
||||
#define E16_ATOM_WIN_BORDER atoms_misc[10]
|
||||
|
||||
#define CHECK_COUNT_MISC 11
|
||||
extern e_atoms_misc_t ea_m;
|
||||
|
||||
void ex_atoms_init(void);
|
||||
|
||||
/* ICCCM */
|
||||
#include <X11/Xatom.h>
|
||||
extern EX_Atom atoms_icccm[];
|
||||
|
||||
/* ICCCM */
|
||||
#define EX_ATOM_WM_STATE atoms_icccm[0]
|
||||
#define EX_ATOM_WM_WINDOW_ROLE atoms_icccm[1]
|
||||
#define EX_ATOM_WM_CLIENT_LEADER atoms_icccm[2]
|
||||
#define EX_ATOM_WM_COLORMAP_WINDOWS atoms_icccm[3]
|
||||
#define EX_ATOM_WM_CHANGE_STATE atoms_icccm[4]
|
||||
#define EX_ATOM_WM_PROTOCOLS atoms_icccm[5]
|
||||
#define EX_ATOM_WM_DELETE_WINDOW atoms_icccm[6]
|
||||
#define EX_ATOM_WM_TAKE_FOCUS atoms_icccm[7]
|
||||
typedef struct {
|
||||
#define DEFINE_ATOM_ICCCM(a) EX_Atom a;
|
||||
#include "xpropdefs.h"
|
||||
#undef DEFINE_ATOM_ICCCM
|
||||
} e_atoms_icccm_t;
|
||||
|
||||
#define CHECK_COUNT_ICCCM 8
|
||||
|
||||
#define EX_ATOM_WM_CLASS XA_WM_CLASS
|
||||
#define EX_ATOM_WM_NAME XA_WM_NAME
|
||||
#define EX_ATOM_WM_COMMAND XA_WM_COMMAND
|
||||
#define EX_ATOM_WM_ICON_NAME XA_WM_ICON_NAME
|
||||
#define EX_ATOM_WM_CLIENT_MACHINE XA_WM_CLIENT_MACHINE
|
||||
#define EX_ATOM_WM_HINTS XA_WM_HINTS
|
||||
#define EX_ATOM_WM_NORMAL_HINTS XA_WM_NORMAL_HINTS
|
||||
#define EX_ATOM_WM_TRANSIENT_FOR XA_WM_TRANSIENT_FOR
|
||||
extern e_atoms_icccm_t ea_i;
|
||||
|
||||
void ex_icccm_init(void);
|
||||
|
||||
|
@ -139,111 +113,14 @@ void ex_icccm_name_class_get(EX_Window win,
|
|||
char **name, char **clss);
|
||||
|
||||
/* NETWM (EWMH) */
|
||||
extern EX_Atom atoms_netwm[];
|
||||
|
||||
/* Window manager info */
|
||||
#define EX_ATOM_NET_SUPPORTED atoms_netwm[0]
|
||||
#define EX_ATOM_NET_SUPPORTING_WM_CHECK atoms_netwm[1]
|
||||
typedef struct {
|
||||
#define DEFINE_ATOM_NETWM(a) EX_Atom a;
|
||||
#include "xpropdefs.h"
|
||||
#undef DEFINE_ATOM_NETWM
|
||||
} e_atoms_netwm_t;
|
||||
|
||||
/* Desktop status/requests */
|
||||
#define EX_ATOM_NET_NUMBER_OF_DESKTOPS atoms_netwm[2]
|
||||
#define EX_ATOM_NET_VIRTUAL_ROOTS atoms_netwm[3]
|
||||
#define EX_ATOM_NET_DESKTOP_GEOMETRY atoms_netwm[4]
|
||||
#define EX_ATOM_NET_DESKTOP_NAMES atoms_netwm[5]
|
||||
#define EX_ATOM_NET_DESKTOP_VIEWPORT atoms_netwm[6]
|
||||
#define EX_ATOM_NET_WORKAREA atoms_netwm[7]
|
||||
#define EX_ATOM_NET_CURRENT_DESKTOP atoms_netwm[8]
|
||||
#define EX_ATOM_NET_SHOWING_DESKTOP atoms_netwm[9]
|
||||
|
||||
#define EX_ATOM_NET_ACTIVE_WINDOW atoms_netwm[10]
|
||||
#define EX_ATOM_NET_CLIENT_LIST atoms_netwm[11]
|
||||
#define EX_ATOM_NET_CLIENT_LIST_STACKING atoms_netwm[12]
|
||||
|
||||
/* Client window props/client messages */
|
||||
#define EX_ATOM_NET_WM_NAME atoms_netwm[13]
|
||||
#define EX_ATOM_NET_WM_VISIBLE_NAME atoms_netwm[14]
|
||||
#define EX_ATOM_NET_WM_ICON_NAME atoms_netwm[15]
|
||||
#define EX_ATOM_NET_WM_VISIBLE_ICON_NAME atoms_netwm[16]
|
||||
|
||||
#define EX_ATOM_NET_WM_DESKTOP atoms_netwm[17]
|
||||
|
||||
#define EX_ATOM_NET_WM_WINDOW_TYPE atoms_netwm[18]
|
||||
#define EX_ATOM_NET_WM_WINDOW_TYPE_DESKTOP atoms_netwm[19]
|
||||
#define EX_ATOM_NET_WM_WINDOW_TYPE_DOCK atoms_netwm[20]
|
||||
#define EX_ATOM_NET_WM_WINDOW_TYPE_TOOLBAR atoms_netwm[21]
|
||||
#define EX_ATOM_NET_WM_WINDOW_TYPE_MENU atoms_netwm[22]
|
||||
#define EX_ATOM_NET_WM_WINDOW_TYPE_UTILITY atoms_netwm[23]
|
||||
#define EX_ATOM_NET_WM_WINDOW_TYPE_SPLASH atoms_netwm[24]
|
||||
#define EX_ATOM_NET_WM_WINDOW_TYPE_DIALOG atoms_netwm[25]
|
||||
#define EX_ATOM_NET_WM_WINDOW_TYPE_NORMAL atoms_netwm[26]
|
||||
|
||||
#define EX_ATOM_NET_WM_STATE atoms_netwm[27]
|
||||
#define EX_ATOM_NET_WM_STATE_MODAL atoms_netwm[28]
|
||||
#define EX_ATOM_NET_WM_STATE_STICKY atoms_netwm[29]
|
||||
#define EX_ATOM_NET_WM_STATE_MAXIMIZED_VERT atoms_netwm[30]
|
||||
#define EX_ATOM_NET_WM_STATE_MAXIMIZED_HORZ atoms_netwm[31]
|
||||
#define EX_ATOM_NET_WM_STATE_SHADED atoms_netwm[32]
|
||||
#define EX_ATOM_NET_WM_STATE_SKIP_TASKBAR atoms_netwm[33]
|
||||
#define EX_ATOM_NET_WM_STATE_SKIP_PAGER atoms_netwm[34]
|
||||
#define EX_ATOM_NET_WM_STATE_HIDDEN atoms_netwm[35]
|
||||
#define EX_ATOM_NET_WM_STATE_FULLSCREEN atoms_netwm[36]
|
||||
#define EX_ATOM_NET_WM_STATE_ABOVE atoms_netwm[37]
|
||||
#define EX_ATOM_NET_WM_STATE_BELOW atoms_netwm[38]
|
||||
#define EX_ATOM_NET_WM_STATE_DEMANDS_ATTENTION atoms_netwm[39]
|
||||
#define EX_ATOM_NET_WM_STATE_FOCUSED atoms_netwm[40]
|
||||
|
||||
#define EX_ATOM_NET_WM_ALLOWED_ACTIONS atoms_netwm[41]
|
||||
#define EX_ATOM_NET_WM_ACTION_MOVE atoms_netwm[42]
|
||||
#define EX_ATOM_NET_WM_ACTION_RESIZE atoms_netwm[43]
|
||||
#define EX_ATOM_NET_WM_ACTION_MINIMIZE atoms_netwm[44]
|
||||
#define EX_ATOM_NET_WM_ACTION_SHADE atoms_netwm[45]
|
||||
#define EX_ATOM_NET_WM_ACTION_STICK atoms_netwm[46]
|
||||
#define EX_ATOM_NET_WM_ACTION_MAXIMIZE_HORZ atoms_netwm[47]
|
||||
#define EX_ATOM_NET_WM_ACTION_MAXIMIZE_VERT atoms_netwm[48]
|
||||
#define EX_ATOM_NET_WM_ACTION_FULLSCREEN atoms_netwm[49]
|
||||
#define EX_ATOM_NET_WM_ACTION_CHANGE_DESKTOP atoms_netwm[50]
|
||||
#define EX_ATOM_NET_WM_ACTION_CLOSE atoms_netwm[51]
|
||||
#define EX_ATOM_NET_WM_ACTION_ABOVE atoms_netwm[52]
|
||||
#define EX_ATOM_NET_WM_ACTION_BELOW atoms_netwm[53]
|
||||
|
||||
#define EX_ATOM_NET_WM_STRUT atoms_netwm[54]
|
||||
#define EX_ATOM_NET_WM_STRUT_PARTIAL atoms_netwm[55]
|
||||
|
||||
#define EX_ATOM_NET_FRAME_EXTENTS atoms_netwm[56]
|
||||
|
||||
#define EX_ATOM_NET_WM_ICON atoms_netwm[57]
|
||||
|
||||
#define EX_ATOM_NET_WM_USER_TIME atoms_netwm[58]
|
||||
#define EX_ATOM_NET_WM_USER_TIME_WINDOW atoms_netwm[59]
|
||||
|
||||
#if 0 /* Not used */
|
||||
#define EX_ATOM_NET_WM_ICON_GEOMETRY atoms_netwm[0]
|
||||
#define EX_ATOM_NET_WM_PID atoms_netwm[0]
|
||||
#define EX_ATOM_NET_WM_HANDLED_ICONS atoms_netwm[0]
|
||||
|
||||
#define EX_ATOM_NET_WM_PING atoms_netwm[0]
|
||||
#endif
|
||||
#define EX_ATOM_NET_WM_SYNC_REQUEST atoms_netwm[60]
|
||||
#define EX_ATOM_NET_WM_SYNC_REQUEST_COUNTER atoms_netwm[61]
|
||||
|
||||
#define EX_ATOM_NET_WM_WINDOW_OPACITY atoms_netwm[62]
|
||||
|
||||
/* Misc window ops */
|
||||
#define EX_ATOM_NET_CLOSE_WINDOW atoms_netwm[63]
|
||||
#define EX_ATOM_NET_MOVERESIZE_WINDOW atoms_netwm[64]
|
||||
#define EX_ATOM_NET_WM_MOVERESIZE atoms_netwm[65]
|
||||
#define EX_ATOM_NET_RESTACK_WINDOW atoms_netwm[66]
|
||||
|
||||
#if 0 /* Not yet implemented */
|
||||
#define EX_ATOM_NET_REQUEST_FRAME_EXTENTS atoms_netwm[0]
|
||||
#endif
|
||||
|
||||
/* Startup notification */
|
||||
#define EX_ATOM_NET_STARTUP_ID atoms_netwm[67]
|
||||
#define EX_ATOM_NET_STARTUP_INFO_BEGIN atoms_netwm[68]
|
||||
#define EX_ATOM_NET_STARTUP_INFO atoms_netwm[69]
|
||||
|
||||
#define CHECK_COUNT_NETWM 70
|
||||
extern e_atoms_netwm_t ea_n;
|
||||
|
||||
void ex_netwm_init(void);
|
||||
|
||||
|
|
|
@ -0,0 +1,185 @@
|
|||
/*
|
||||
* Copyright (C) 2021 Kim Woelders
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to
|
||||
* deal in the Software without restriction, including without limitation the
|
||||
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
* sell copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies of the Software, its documentation and marketing & publicity
|
||||
* materials, and acknowledgment shall be given in the documentation, materials
|
||||
* and software packages that this Software was used.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
|
||||
#ifdef DEFINE_ATOM_MISC
|
||||
|
||||
/* Misc atoms */
|
||||
DEFINE_ATOM_MISC(UTF8_STRING)
|
||||
DEFINE_ATOM_MISC(MANAGER)
|
||||
|
||||
/* Root background atoms */
|
||||
DEFINE_ATOM_MISC(_XROOTPMAP_ID)
|
||||
DEFINE_ATOM_MISC(_XROOTCOLOR_PIXEL)
|
||||
|
||||
/* E16 atoms */
|
||||
DEFINE_ATOM_MISC(ENLIGHTENMENT_VERSION)
|
||||
|
||||
DEFINE_ATOM_MISC(ENLIGHTENMENT_COMMS)
|
||||
DEFINE_ATOM_MISC(ENL_MSG)
|
||||
|
||||
DEFINE_ATOM_MISC(ENL_INTERNAL_AREA_DATA)
|
||||
DEFINE_ATOM_MISC(ENL_INTERNAL_DESK_DATA)
|
||||
DEFINE_ATOM_MISC(ENL_WIN_DATA)
|
||||
DEFINE_ATOM_MISC(ENL_WIN_BORDER)
|
||||
#endif /* DEFINE_ATOM_MISC */
|
||||
|
||||
#ifdef DEFINE_ATOM_ICCCM
|
||||
#ifndef notdef_ATOM_ICCCM
|
||||
#define notdef_ATOM_ICCCM(a)
|
||||
#endif
|
||||
|
||||
DEFINE_ATOM_ICCCM(WM_STATE)
|
||||
DEFINE_ATOM_ICCCM(WM_WINDOW_ROLE)
|
||||
DEFINE_ATOM_ICCCM(WM_CLIENT_LEADER)
|
||||
DEFINE_ATOM_ICCCM(WM_COLORMAP_WINDOWS)
|
||||
DEFINE_ATOM_ICCCM(WM_CHANGE_STATE)
|
||||
DEFINE_ATOM_ICCCM(WM_PROTOCOLS)
|
||||
DEFINE_ATOM_ICCCM(WM_DELETE_WINDOW)
|
||||
DEFINE_ATOM_ICCCM(WM_TAKE_FOCUS)
|
||||
|
||||
notdef_ATOM_ICCCM(WM_SAVE_YOURSELF) /* Not used */
|
||||
|
||||
/* These exist as defines but we treat them like the rest anyway */
|
||||
DEFINE_ATOM_ICCCM(WM_COMMAND)
|
||||
DEFINE_ATOM_ICCCM(WM_HINTS)
|
||||
DEFINE_ATOM_ICCCM(WM_CLIENT_MACHINE)
|
||||
DEFINE_ATOM_ICCCM(WM_ICON_NAME)
|
||||
DEFINE_ATOM_ICCCM(WM_NAME)
|
||||
DEFINE_ATOM_ICCCM(WM_NORMAL_HINTS)
|
||||
DEFINE_ATOM_ICCCM(WM_CLASS)
|
||||
DEFINE_ATOM_ICCCM(WM_TRANSIENT_FOR)
|
||||
#endif /* DEFINE_ATOM_ICCCM */
|
||||
|
||||
#ifdef DEFINE_ATOM_NETWM
|
||||
#ifndef notdef_ATOM_NETWM
|
||||
#define notdef_ATOM_NETWM(a)
|
||||
#endif
|
||||
|
||||
/* Window manager info */
|
||||
DEFINE_ATOM_NETWM(_NET_SUPPORTED)
|
||||
DEFINE_ATOM_NETWM(_NET_SUPPORTING_WM_CHECK)
|
||||
|
||||
/* Desktop status/requests */
|
||||
DEFINE_ATOM_NETWM(_NET_NUMBER_OF_DESKTOPS)
|
||||
DEFINE_ATOM_NETWM(_NET_VIRTUAL_ROOTS)
|
||||
DEFINE_ATOM_NETWM(_NET_DESKTOP_GEOMETRY)
|
||||
DEFINE_ATOM_NETWM(_NET_DESKTOP_NAMES)
|
||||
DEFINE_ATOM_NETWM(_NET_DESKTOP_VIEWPORT)
|
||||
DEFINE_ATOM_NETWM(_NET_WORKAREA)
|
||||
DEFINE_ATOM_NETWM(_NET_CURRENT_DESKTOP)
|
||||
DEFINE_ATOM_NETWM(_NET_SHOWING_DESKTOP)
|
||||
|
||||
DEFINE_ATOM_NETWM(_NET_ACTIVE_WINDOW)
|
||||
DEFINE_ATOM_NETWM(_NET_CLIENT_LIST)
|
||||
DEFINE_ATOM_NETWM(_NET_CLIENT_LIST_STACKING)
|
||||
|
||||
/* Client window props/client messages */
|
||||
DEFINE_ATOM_NETWM(_NET_WM_NAME)
|
||||
DEFINE_ATOM_NETWM(_NET_WM_VISIBLE_NAME)
|
||||
DEFINE_ATOM_NETWM(_NET_WM_ICON_NAME)
|
||||
DEFINE_ATOM_NETWM(_NET_WM_VISIBLE_ICON_NAME)
|
||||
|
||||
DEFINE_ATOM_NETWM(_NET_WM_DESKTOP)
|
||||
|
||||
DEFINE_ATOM_NETWM(_NET_WM_WINDOW_TYPE)
|
||||
DEFINE_ATOM_NETWM(_NET_WM_WINDOW_TYPE_DESKTOP)
|
||||
DEFINE_ATOM_NETWM(_NET_WM_WINDOW_TYPE_DOCK)
|
||||
DEFINE_ATOM_NETWM(_NET_WM_WINDOW_TYPE_TOOLBAR)
|
||||
DEFINE_ATOM_NETWM(_NET_WM_WINDOW_TYPE_MENU)
|
||||
DEFINE_ATOM_NETWM(_NET_WM_WINDOW_TYPE_UTILITY)
|
||||
DEFINE_ATOM_NETWM(_NET_WM_WINDOW_TYPE_SPLASH)
|
||||
DEFINE_ATOM_NETWM(_NET_WM_WINDOW_TYPE_DIALOG)
|
||||
DEFINE_ATOM_NETWM(_NET_WM_WINDOW_TYPE_NORMAL)
|
||||
|
||||
DEFINE_ATOM_NETWM(_NET_WM_STATE)
|
||||
DEFINE_ATOM_NETWM(_NET_WM_STATE_MODAL)
|
||||
DEFINE_ATOM_NETWM(_NET_WM_STATE_STICKY)
|
||||
DEFINE_ATOM_NETWM(_NET_WM_STATE_MAXIMIZED_VERT)
|
||||
DEFINE_ATOM_NETWM(_NET_WM_STATE_MAXIMIZED_HORZ)
|
||||
DEFINE_ATOM_NETWM(_NET_WM_STATE_SHADED)
|
||||
DEFINE_ATOM_NETWM(_NET_WM_STATE_SKIP_TASKBAR)
|
||||
DEFINE_ATOM_NETWM(_NET_WM_STATE_SKIP_PAGER)
|
||||
DEFINE_ATOM_NETWM(_NET_WM_STATE_HIDDEN)
|
||||
DEFINE_ATOM_NETWM(_NET_WM_STATE_FULLSCREEN)
|
||||
DEFINE_ATOM_NETWM(_NET_WM_STATE_ABOVE)
|
||||
DEFINE_ATOM_NETWM(_NET_WM_STATE_BELOW)
|
||||
DEFINE_ATOM_NETWM(_NET_WM_STATE_DEMANDS_ATTENTION)
|
||||
DEFINE_ATOM_NETWM(_NET_WM_STATE_FOCUSED)
|
||||
|
||||
DEFINE_ATOM_NETWM(_NET_WM_ALLOWED_ACTIONS)
|
||||
DEFINE_ATOM_NETWM(_NET_WM_ACTION_MOVE)
|
||||
DEFINE_ATOM_NETWM(_NET_WM_ACTION_RESIZE)
|
||||
DEFINE_ATOM_NETWM(_NET_WM_ACTION_MINIMIZE)
|
||||
DEFINE_ATOM_NETWM(_NET_WM_ACTION_SHADE)
|
||||
DEFINE_ATOM_NETWM(_NET_WM_ACTION_STICK)
|
||||
DEFINE_ATOM_NETWM(_NET_WM_ACTION_MAXIMIZE_HORZ)
|
||||
DEFINE_ATOM_NETWM(_NET_WM_ACTION_MAXIMIZE_VERT)
|
||||
DEFINE_ATOM_NETWM(_NET_WM_ACTION_FULLSCREEN)
|
||||
DEFINE_ATOM_NETWM(_NET_WM_ACTION_CHANGE_DESKTOP)
|
||||
DEFINE_ATOM_NETWM(_NET_WM_ACTION_CLOSE)
|
||||
DEFINE_ATOM_NETWM(_NET_WM_ACTION_ABOVE)
|
||||
DEFINE_ATOM_NETWM(_NET_WM_ACTION_BELOW)
|
||||
|
||||
DEFINE_ATOM_NETWM(_NET_WM_STRUT)
|
||||
DEFINE_ATOM_NETWM(_NET_WM_STRUT_PARTIAL)
|
||||
|
||||
notdef_ATOM_NETWM(_NET_WM_ICON_GEOMETRY) /* Not used */
|
||||
DEFINE_ATOM_NETWM(_NET_WM_ICON)
|
||||
|
||||
notdef_ATOM_NETWM(_NET_WM_PID) /* Not used */
|
||||
|
||||
notdef_ATOM_NETWM(_NET_WM_HANDLED_ICONS) /* Not used */
|
||||
|
||||
DEFINE_ATOM_NETWM(_NET_WM_USER_TIME)
|
||||
DEFINE_ATOM_NETWM(_NET_WM_USER_TIME_WINDOW)
|
||||
|
||||
DEFINE_ATOM_NETWM(_NET_FRAME_EXTENTS)
|
||||
|
||||
notdef_ATOM_NETWM(_NET_WM_OPAQUE_REGION)
|
||||
notdef_ATOM_NETWM(_NET_WM_BYPASS_COMPOSITOR)
|
||||
|
||||
DEFINE_ATOM_NETWM(_NET_WM_WINDOW_OPACITY)
|
||||
|
||||
/* Window Manager Protocols */
|
||||
notdef_ATOM_NETWM(_NET_WM_PING) /* Not used */
|
||||
|
||||
DEFINE_ATOM_NETWM(_NET_WM_SYNC_REQUEST)
|
||||
DEFINE_ATOM_NETWM(_NET_WM_SYNC_REQUEST_COUNTER)
|
||||
|
||||
/* Misc window ops */
|
||||
DEFINE_ATOM_NETWM(_NET_CLOSE_WINDOW)
|
||||
DEFINE_ATOM_NETWM(_NET_MOVERESIZE_WINDOW)
|
||||
DEFINE_ATOM_NETWM(_NET_WM_MOVERESIZE)
|
||||
DEFINE_ATOM_NETWM(_NET_RESTACK_WINDOW)
|
||||
|
||||
notdef_ATOM_NETWM(_NET_REQUEST_FRAME_EXTENTS) /* Not implemented */
|
||||
|
||||
/* Startup notification */
|
||||
DEFINE_ATOM_NETWM(_NET_STARTUP_ID)
|
||||
DEFINE_ATOM_NETWM(_NET_STARTUP_INFO_BEGIN)
|
||||
DEFINE_ATOM_NETWM(_NET_STARTUP_INFO)
|
||||
#endif /* DEFINE_ATOM_NETWM */
|
||||
|
||||
/* *INDENT-ON* */
|
Loading…
Reference in New Issue