Action source handling - part 1. Mostly renaming and shuffling around.

SVN revision: 18443
This commit is contained in:
Kim Woelders 2005-11-12 17:51:11 +00:00
parent 1f4a4a3f7b
commit 5b2513c0b2
16 changed files with 394 additions and 290 deletions

View File

@ -263,7 +263,6 @@
#define __A_MAX_HEIGHT wop * th
#define __A_MAX_WIDTH wop * tw
#define __A_MAX_SIZE wop * ts
#define __A_TOGGLE_FIXED wop * fix
#define __A_SET_LAYER wop * la
#define __A_SNAPSHOT remember * all
#define __A_ZOOM wop * zoom
@ -285,7 +284,7 @@
#define __A_SKIPFOCUS wop * skipfocus
#define __A_SKIPTASK wop * skiptask
#define __A_SKIPWINLIST wop * skipwinlist
#define __A_NEVERFOCUS wop * neverfocus
#define __A_NEVERFOCUS wop * no_wm_focus
#define __A_SKIPLISTS wop * skiplists
#define __A_SWAPMOVE wop * swapmove

View File

@ -37,6 +37,7 @@ Prop FixedSize Border FIXED_SIZE
Class Enlightenment_IconBox Border ICONBOX
Class Enlightenment_Dialog Border DIALOG
Class Enlightenment_Pager Border PAGER
# Default icons
Class Eterm Icon pix/mon.png
Class XTerm Icon pix/mon.png
@ -48,3 +49,6 @@ Class Xchat Icon pix/pawn.png
Class Enlightenment_Dialog Icon pix/pumpkin.png
Class Xawtv Icon pix/tv2.png
Class Enlightenment_Pager Icon pix/tv2.png
# Specific app hacks - May get fixed, may break stuff in old versions
Name Gecko Winop no_app_move:no_app_size

View File

@ -125,9 +125,9 @@ END_MENU
BEGIN_NEW_MENU("WINOPS_MISC", "EMPTY")
ADD_MENU_TEXT_ITEM("Toggle Skip Window Lists", __A_CMD, "wop * skiplists")
ADD_MENU_TEXT_ITEM("Toggle Fixed Position", __A_CMD, "wop * fixedpos")
ADD_MENU_TEXT_ITEM("Toggle Fixed Size", __A_CMD, "wop * fixedsize")
ADD_MENU_TEXT_ITEM("Toggle Never Focus", __A_CMD, "wop * neverfocus")
ADD_MENU_TEXT_ITEM("Toggle Fixed Position", __A_CMD, "wop * no_user_move")
ADD_MENU_TEXT_ITEM("Toggle Fixed Size", __A_CMD, "wop * no_user_size")
ADD_MENU_TEXT_ITEM("Toggle Never Focus", __A_CMD, "wop * no_wm_focus")
ADD_MENU_TEXT_ITEM("Toggle Click to Focus", __A_CMD, "wop * focusclick")
ADD_MENU_TEXT_ITEM("Toggle Never Use Area", __A_CMD, "wop * never_use_area")
ADD_MENU_TEXT_ITEM("Toggle Button Grabs", __A_CMD, "wop * no_button_grabs")

View File

@ -34,6 +34,9 @@
#include <math.h>
static const WinOp winops[] = {
{"border", 2, 1, 0, EWIN_OP_BORDER},
{"title", 2, 1, 1, EWIN_OP_TITLE},
{"close", 2, 1, 0, EWIN_OP_CLOSE},
{"kill", 0, 1, 0, EWIN_OP_KILL},
{"iconify", 2, 1, 1, EWIN_OP_ICONIFY},
@ -41,38 +44,47 @@ static const WinOp winops[] = {
{"shadow", 0, 1, 1, EWIN_OP_SHADOW}, /* Place before "shade" */
{"shade", 2, 1, 1, EWIN_OP_SHADE},
{"stick", 2, 1, 1, EWIN_OP_STICK},
{"fixedpos", 0, 1, 1, EWIN_OP_FIXED_POS},
{"fixedsize", 0, 1, 1, EWIN_OP_FIXED_SIZE},
{"never_use_area", 0, 1, 1, EWIN_OP_NEVER_USE_AREA},
{"focusclick", 0, 1, 1, EWIN_OP_FOCUS_CLICK},
{"neverfocus", 0, 1, 1, EWIN_OP_FOCUS_NEVER},
{"no_button_grabs", 0, 1, 1, EWIN_OP_NO_BUTTON_GRABS},
{"title", 2, 1, 1, EWIN_OP_TITLE},
{"focus", 2, 1, 0, EWIN_OP_FOCUS},
{"desk", 2, 1, 1, EWIN_OP_DESK},
{"area", 2, 1, 1, EWIN_OP_AREA},
{"move", 2, 1, 1, EWIN_OP_MOVE},
{"size", 2, 1, 1, EWIN_OP_SIZE},
{"sz", 2, 1, 1, EWIN_OP_SIZE},
{"move_relative", 0, 1, 0, EWIN_OP_MOVE_REL},
{"mr", 2, 1, 0, EWIN_OP_MOVE_REL},
{"resize_relative", 0, 1, 0, EWIN_OP_SIZE_REL},
{"sr", 2, 1, 0, EWIN_OP_SIZE_REL},
{"toggle_width", 0, 1, 0, EWIN_OP_MAX_WIDTH},
{"tw", 2, 1, 0, EWIN_OP_MAX_WIDTH},
{"toggle_height", 0, 1, 0, EWIN_OP_MAX_HEIGHT},
{"th", 0, 1, 0, EWIN_OP_MAX_HEIGHT},
{"toggle_size", 0, 1, 0, EWIN_OP_MAX_SIZE},
{"ts", 2, 1, 0, EWIN_OP_MAX_SIZE},
{"fullscreen", 2, 1, 1, EWIN_OP_FULLSCREEN},
{"zoom", 2, 1, 0, EWIN_OP_ZOOM},
{"layer", 2, 1, 1, EWIN_OP_LAYER},
{"raise", 2, 1, 0, EWIN_OP_RAISE},
{"lower", 2, 1, 0, EWIN_OP_LOWER},
{"layer", 2, 1, 1, EWIN_OP_LAYER},
{"border", 2, 1, 0, EWIN_OP_BORDER},
{"desk", 2, 1, 1, EWIN_OP_DESK},
{"area", 2, 1, 1, EWIN_OP_AREA},
{"move", 2, 1, 1, EWIN_OP_MOVE},
{"resize", 0, 1, 1, EWIN_OP_SIZE},
{"sz", 2, 1, 1, EWIN_OP_SIZE},
{"move_relative", 0, 1, 0, EWIN_OP_MOVE_REL},
{"mr", 2, 1, 0, EWIN_OP_MOVE_REL},
{"resize_relative", 0, 1, 0, EWIN_OP_SIZE_REL},
{"sr", 2, 1, 0, EWIN_OP_SIZE_REL},
{"focus", 2, 1, 0, EWIN_OP_FOCUS},
{"fullscreen", 2, 1, 1, EWIN_OP_FULLSCREEN},
{"skiplists", 4, 1, 1, EWIN_OP_SKIP_LISTS},
{"zoom", 2, 1, 0, EWIN_OP_ZOOM},
{"snap", 0, 1, 0, EWIN_OP_SNAP},
{"focusclick", 0, 1, 1, EWIN_OP_FOCUS_CLICK},
{"never_use_area", 0, 1, 1, EWIN_OP_NEVER_USE_AREA},
{"no_button_grabs", 0, 1, 1, EWIN_OP_NO_BUTTON_GRABS},
{"skiplists", 4, 1, 1, EWIN_OP_SKIP_LISTS},
{"no_app_move", 0, 1, 1, EWIN_OP_INH_APP_MOVE},
{"no_app_size", 0, 1, 1, EWIN_OP_INH_APP_SIZE},
{"no_user_close", 0, 1, 1, EWIN_OP_INH_USER_CLOSE},
{"no_user_move", 0, 1, 1, EWIN_OP_INH_USER_MOVE},
{"no_user_size", 0, 1, 1, EWIN_OP_INH_USER_SIZE},
{"no_wm_focus", 0, 1, 1, EWIN_OP_INH_WM_FOCUS},
{"noredir", 4, 1, 1, EWIN_OP_NO_REDIRECT},
{NULL, 0, 0, 0, EWIN_OP_INVALID} /* Terminator */
};
@ -1341,7 +1353,6 @@ EwinSetFullscreen(EWin * ewin, int on)
w = ewin->lw;
h = ewin->lh;
GetOnScreenPos(x, y, w, h, &x, &y);
ewin->props.fixedpos = 0; /* Yeah - well */
b = ewin->normal_border;
EwinBorderSetTo(ewin, b);

View File

@ -26,38 +26,51 @@
typedef enum
{
EWIN_OP_INVALID,
EWIN_OP_BORDER,
EWIN_OP_TITLE,
EWIN_OP_CLOSE,
EWIN_OP_KILL,
EWIN_OP_ICONIFY,
EWIN_OP_OPACITY,
EWIN_OP_SHADOW,
EWIN_OP_SHADE,
EWIN_OP_STICK,
EWIN_OP_FIXED_POS,
EWIN_OP_FIXED_SIZE,
EWIN_OP_NEVER_USE_AREA,
EWIN_OP_FOCUS_CLICK,
EWIN_OP_FOCUS_NEVER,
EWIN_OP_NO_BUTTON_GRABS,
EWIN_OP_TITLE,
EWIN_OP_MAX_WIDTH,
EWIN_OP_MAX_HEIGHT,
EWIN_OP_MAX_SIZE,
EWIN_OP_RAISE,
EWIN_OP_LOWER,
EWIN_OP_LAYER,
EWIN_OP_BORDER,
EWIN_OP_FOCUS,
EWIN_OP_DESK,
EWIN_OP_AREA,
EWIN_OP_MOVE,
EWIN_OP_SIZE,
EWIN_OP_MOVE_REL,
EWIN_OP_SIZE_REL,
EWIN_OP_FOCUS,
EWIN_OP_MAX_WIDTH,
EWIN_OP_MAX_HEIGHT,
EWIN_OP_MAX_SIZE,
EWIN_OP_FULLSCREEN,
EWIN_OP_SKIP_LISTS,
EWIN_OP_ZOOM,
EWIN_OP_LAYER,
EWIN_OP_RAISE,
EWIN_OP_LOWER,
EWIN_OP_OPACITY,
EWIN_OP_SNAP,
EWIN_OP_FOCUS_CLICK,
EWIN_OP_NEVER_USE_AREA,
EWIN_OP_NO_BUTTON_GRABS,
EWIN_OP_SKIP_LISTS,
EWIN_OP_INH_APP_MOVE,
EWIN_OP_INH_APP_SIZE,
EWIN_OP_INH_USER_CLOSE,
EWIN_OP_INH_USER_MOVE,
EWIN_OP_INH_USER_SIZE,
EWIN_OP_INH_WM_FOCUS,
EWIN_OP_SHADOW,
EWIN_OP_NO_REDIRECT,
} winop_e;

View File

@ -642,15 +642,17 @@ EwinStateUpdate(EWin * ewin)
{
ewin->state.inhibit_actions = ewin->props.no_actions;
ewin->state.inhibit_focus = !ewin->icccm.need_input ||
ewin->props.never_focus || ewin->state.iconified;
EwinInhGetWM(ewin, focus) || ewin->state.iconified;
ewin->state.no_border = ewin->props.no_border || ewin->state.docked ||
(ewin->mwm.valid && !ewin->mwm.decor_title && !ewin->mwm.decor_border);
ewin->state.inhibit_move = ewin->props.fixedpos || ewin->state.fullscreen;
ewin->state.inhibit_resize = ewin->props.fixedsize || ewin->state.shaded ||
ewin->state.inhibit_move =
EwinInhGetUser(ewin, move) || ewin->state.fullscreen;
ewin->state.inhibit_resize =
EwinInhGetUser(ewin, size) || ewin->state.shaded ||
ewin->state.fullscreen;
ewin->state.inhibit_iconify = ewin->props.never_iconify;
ewin->state.inhibit_iconify = EwinInhGetWM(ewin, iconify);
ewin->state.inhibit_shade = ewin->state.no_border || ewin->state.fullscreen;
ewin->state.inhibit_stick = 0;
ewin->state.inhibit_max_hor =
@ -660,7 +662,8 @@ EwinStateUpdate(EWin * ewin)
ewin->state.inhibit_fullscreeen =
ewin->state.inhibit_move || ewin->state.inhibit_resize;
ewin->state.inhibit_change_desk = 0;
ewin->state.inhibit_close = 0;
ewin->state.inhibit_close = EwinInhGetApp(ewin, close) ||
EwinInhGetUser(ewin, close);
}
void
@ -1173,21 +1176,27 @@ EwinEventConfigureRequest(EWin * ewin, XEvent * ev)
winrel = 0;
/* This is shady - some clients send root coords, some use the
* ICCCM ones sent by us */
if (!EwinInhGetApp(ewin, move))
{
#if 1 /* FIXME - ??? */
if (ev->xconfigurerequest.value_mask & CWX)
x = ev->xconfigurerequest.x;
if (ev->xconfigurerequest.value_mask & CWY)
y = ev->xconfigurerequest.y;
if (ev->xconfigurerequest.value_mask & CWX)
x = ev->xconfigurerequest.x;
if (ev->xconfigurerequest.value_mask & CWY)
y = ev->xconfigurerequest.y;
#else
if (ev->xconfigurerequest.value_mask & CWX)
x = ev->xconfigurerequest.x - EoGetX(EoGetDesk(ewin));
if (ev->xconfigurerequest.value_mask & CWY)
y = ev->xconfigurerequest.y - EoGetY(EoGetDesk(ewin));
if (ev->xconfigurerequest.value_mask & CWX)
x = ev->xconfigurerequest.x - EoGetX(EoGetDesk(ewin));
if (ev->xconfigurerequest.value_mask & CWY)
y = ev->xconfigurerequest.y - EoGetY(EoGetDesk(ewin));
#endif
if (ev->xconfigurerequest.value_mask & CWWidth)
w = ev->xconfigurerequest.width;
if (ev->xconfigurerequest.value_mask & CWHeight)
h = ev->xconfigurerequest.height;
}
if (!EwinInhGetApp(ewin, move))
{
if (ev->xconfigurerequest.value_mask & CWWidth)
w = ev->xconfigurerequest.width;
if (ev->xconfigurerequest.value_mask & CWHeight)
h = ev->xconfigurerequest.height;
}
if (ev->xconfigurerequest.value_mask & CWSibling)
winrel = ev->xconfigurerequest.above;
if (ev->xconfigurerequest.value_mask & CWStackMode)

View File

@ -35,6 +35,26 @@ typedef struct _ewin EWin;
struct _snapshot;
typedef struct
{
unsigned int all:32;
struct
{
unsigned close:1; /* AU */
unsigned focus:1; /* WA */
unsigned iconify:1; /* W U */
unsigned move:1; /* AU */
unsigned size:1; /* AU */
} b;
} EwinInhibit;
#define EwinInhGetApp(ewin, item) (ewin->inh_app.b.item)
#define EwinInhSetApp(ewin, item, on) ewin->inh_app.b.item = (on)
#define EwinInhGetUser(ewin, item) (ewin->inh_user.b.item)
#define EwinInhSetUser(ewin, item, on) ewin->inh_user.b.item = (on)
#define EwinInhGetWM(ewin, item) (ewin->inh_wm.b.item)
#define EwinInhSetWM(ewin, item, on) ewin->inh_wm.b.item = (on)
struct _ewin
{
EObj o;
@ -67,6 +87,7 @@ struct _ewin
unsigned placed:1;
unsigned iconified:1;
unsigned docked:1;
unsigned click_grab_isset:1;
unsigned maximized_horz:1;
unsigned maximized_vert:1;
@ -99,27 +120,25 @@ struct _ewin
} state;
struct
{
char fixedpos;
char fixedsize;
char never_use_area;
char ignorearrange;
char skip_ext_task;
char skip_ext_pager;
char skip_focuslist;
char skip_winlist;
char focusclick; /* Click to focus */
char never_focus; /* Never focus */
char no_button_grabs;
char no_actions;
unsigned never_use_area:1;
unsigned ignorearrange:1;
unsigned skip_ext_task:1;
unsigned skip_ext_pager:1;
unsigned skip_focuslist:1;
unsigned skip_winlist:1;
unsigned focusclick:1; /* Click to focus */
unsigned no_button_grabs:1;
unsigned no_actions:1;
unsigned no_resize_h:1;
unsigned no_resize_v:1;
unsigned donthide:1; /* Don't hide on show desktop */
unsigned vroot:1; /* Virtual root window */
unsigned autosave:1;
unsigned no_border:1; /* Never apply border */
unsigned never_iconify:1; /* Never iconify */
unsigned no_shadow:1; /* Never apply shadow */
} props;
EwinInhibit inh_app;
EwinInhibit inh_user;
EwinInhibit inh_wm;
struct
{
char *wm_name;

View File

@ -569,7 +569,8 @@ EWMH_GetWindowType(EWin * ewin)
ewin->focusclick = 1;
#endif
ewin->props.skip_focuslist = 1;
ewin->props.fixedpos = 1;
EwinInhSetUser(ewin, move, 1);
EwinInhSetUser(ewin, size, 1);
ewin->props.donthide = 1;
EwinSetBorderByName(ewin, "BORDERLESS");
}

View File

@ -366,7 +366,7 @@ GNOME_GetHintState(EWin * ewin, Atom atom_change)
if (flags & WIN_STATE_STICKY)
EoSetSticky(ewin, 1);
if (flags & WIN_STATE_FIXED_POSITION)
ewin->props.fixedpos = 1;
EwinInhSetUser(ewin, move, 1);
if (flags & WIN_STATE_ARRANGE_IGNORE)
ewin->props.ignorearrange = 1;
}
@ -467,7 +467,7 @@ GNOME_SetHint(const EWin * ewin)
val |= WIN_STATE_STICKY;
if (ewin->state.shaded)
val |= WIN_STATE_SHADED;
if (ewin->props.fixedpos)
if (EwinInhGetUser(ewin, move))
val |= WIN_STATE_FIXED_POSITION;
ecore_x_window_prop_card32_set(_EwinGetClientXwin(ewin), atom_set, &val, 1);
}
@ -796,9 +796,9 @@ GNOME_ProcessClientMessage(XClientMessageEvent * event)
if (event->data.l[0] & WIN_STATE_FIXED_POSITION)
{
if (event->data.l[1] & WIN_STATE_FIXED_POSITION)
ewin->props.fixedpos = 1;
EwinInhSetUser(ewin, move, 1);
else
ewin->props.fixedpos = 0;
EwinInhSetUser(ewin, move, 0);
}
if (event->data.l[0] & WIN_STATE_ARRANGE_IGNORE)
{

View File

@ -553,8 +553,8 @@ IconboxEwinInit(EWin * ewin, void *ptr)
ewin->props.skip_ext_pager = 1;
ewin->props.skip_focuslist = 1;
ewin->props.skip_winlist = 1;
ewin->props.never_focus = 1;
ewin->props.never_iconify = 1;
EwinInhSetWM(ewin, focus, 1);
EwinInhSetWM(ewin, iconify, 1);
ewin->props.autosave = 1;
EoSetSticky(ewin, 1);

312
src/ipc.c
View File

@ -438,90 +438,18 @@ IPC_WinOps(const char *params, Client * c __UNUSED__)
IpcPrintf("Error: unknown operation");
return;
case EWIN_OP_CLOSE:
EwinOpClose(ewin);
break;
case EWIN_OP_KILL:
EwinOpKill(ewin);
break;
case EWIN_OP_ICONIFY:
on = ewin->state.iconified;
if (SetEwinBoolean("window iconified", &on, param1, 0))
EwinOpIconify(ewin, !on);
break;
case EWIN_OP_OPACITY:
if (!strcmp(param1, "?"))
case EWIN_OP_BORDER:
if (!param1[0])
{
IpcPrintf("opacity: %u", ewin->ewmh.opacity >> 24);
IpcPrintf("Error: no border specified");
goto done;
}
val = 0xff;
sscanf(param1, "%i", &val);
EwinOpSetOpacity(ewin, val);
break;
#if USE_COMPOSITE
case EWIN_OP_SHADOW:
on = EoGetShadow(ewin);
if (SetEwinBoolean(wop->name, &on, param1, 0))
EoSetShadow(ewin, !on);
break;
case EWIN_OP_NO_REDIRECT:
on = EoGetNoRedirect(ewin);
on = ewin->o.noredir;
if (SetEwinBoolean(wop->name, &on, param1, 0))
EoSetNoRedirect(ewin, !on);
break;
#endif
case EWIN_OP_SHADE:
if (SetEwinBoolean(wop->name, &ewin->state.shaded, param1, 0))
EwinOpShade(ewin, !ewin->state.shaded);
break;
case EWIN_OP_STICK:
on = EoIsSticky(ewin);
if (SetEwinBoolean(wop->name, &on, param1, 0))
EwinOpStick(ewin, !on);
break;
case EWIN_OP_FIXED_POS:
SetEwinBoolean(wop->name, &ewin->props.fixedpos, param1, 1);
EwinStateUpdate(ewin);
HintsSetWindowState(ewin);
break;
case EWIN_OP_FIXED_SIZE:
SetEwinBoolean(wop->name, &ewin->props.fixedsize, param1, 1);
EwinStateUpdate(ewin);
HintsSetWindowState(ewin);
break;
case EWIN_OP_NEVER_USE_AREA:
SetEwinBoolean(wop->name, &ewin->props.never_use_area, param1, 1);
break;
case EWIN_OP_FOCUS_CLICK:
SetEwinBoolean(wop->name, &ewin->props.focusclick, param1, 1);
break;
case EWIN_OP_FOCUS_NEVER:
SetEwinBoolean(wop->name, &ewin->props.never_focus, param1, 1);
EwinStateUpdate(ewin);
break;
case EWIN_OP_NO_BUTTON_GRABS:
if (SetEwinBoolean(wop->name, &ewin->props.no_button_grabs, param1, 1))
if (!strcmp(param1, "?"))
{
if (ewin->props.no_button_grabs)
UnGrabButtonGrabs(ewin);
else
GrabButtonGrabs(ewin);
IpcPrintf("window border: %s", BorderGetName(ewin->border));
goto done;
}
EwinOpSetBorder(ewin, param1);
break;
case EWIN_OP_TITLE:
@ -542,48 +470,39 @@ IPC_WinOps(const char *params, Client * c __UNUSED__)
EwinBorderUpdateInfo(ewin);
break;
case EWIN_OP_MAX_WIDTH:
MaxWidth(ewin, param1);
case EWIN_OP_CLOSE:
EwinOpClose(ewin);
break;
case EWIN_OP_MAX_HEIGHT:
MaxHeight(ewin, param1);
case EWIN_OP_KILL:
EwinOpKill(ewin);
break;
case EWIN_OP_MAX_SIZE:
MaxSize(ewin, param1);
case EWIN_OP_ICONIFY:
on = ewin->state.iconified;
if (SetEwinBoolean("window iconified", &on, param1, 1))
EwinOpIconify(ewin, on);
break;
case EWIN_OP_RAISE:
EwinOpRaise(ewin);
case EWIN_OP_SHADE:
on = ewin->state.shaded;
if (SetEwinBoolean(wop->name, &on, param1, 1))
EwinOpShade(ewin, on);
break;
case EWIN_OP_LOWER:
EwinOpLower(ewin);
case EWIN_OP_STICK:
on = EoIsSticky(ewin);
if (SetEwinBoolean(wop->name, &on, param1, 1))
EwinOpStick(ewin, on);
break;
case EWIN_OP_LAYER:
case EWIN_OP_FOCUS:
if (!strcmp(param1, "?"))
{
IpcPrintf("window layer: %d", EoGetLayer(ewin));
IpcPrintf("focused: %s", (ewin == GetFocusEwin())? "yes" : "no");
goto done;
}
val = atoi(param1);
EwinOpSetLayer(ewin, val);
break;
case EWIN_OP_BORDER:
if (!param1[0])
{
IpcPrintf("Error: no border specified");
goto done;
}
if (!strcmp(param1, "?"))
{
IpcPrintf("window border: %s", BorderGetName(ewin->border));
goto done;
}
EwinOpSetBorder(ewin, param1);
EwinOpActivate(ewin);
break;
case EWIN_OP_DESK:
@ -705,24 +624,22 @@ IPC_WinOps(const char *params, Client * c __UNUSED__)
EwinResize(ewin, a, b);
break;
case EWIN_OP_FOCUS:
if (!strcmp(param1, "?"))
{
IpcPrintf("focused: %s", (ewin == GetFocusEwin())? "yes" : "no");
goto done;
}
EwinOpActivate(ewin);
case EWIN_OP_MAX_WIDTH:
MaxWidth(ewin, param1);
break;
case EWIN_OP_MAX_HEIGHT:
MaxHeight(ewin, param1);
break;
case EWIN_OP_MAX_SIZE:
MaxSize(ewin, param1);
break;
case EWIN_OP_FULLSCREEN:
on = ewin->state.fullscreen;
if (SetEwinBoolean(wop->name, &on, param1, 0))
EwinSetFullscreen(ewin, !on);
break;
case EWIN_OP_SKIP_LISTS:
if (SetEwinBoolean(wop->name, &ewin->props.skip_ext_task, param1, 1))
EwinOpSkipLists(ewin, ewin->props.skip_ext_task);
if (SetEwinBoolean(wop->name, &on, param1, 1))
EwinSetFullscreen(ewin, on);
break;
case EWIN_OP_ZOOM:
@ -732,9 +649,126 @@ IPC_WinOps(const char *params, Client * c __UNUSED__)
Zoom(ewin);
break;
case EWIN_OP_LAYER:
if (!strcmp(param1, "?"))
{
IpcPrintf("window layer: %d", EoGetLayer(ewin));
goto done;
}
val = atoi(param1);
EwinOpSetLayer(ewin, val);
break;
case EWIN_OP_RAISE:
EwinOpRaise(ewin);
break;
case EWIN_OP_LOWER:
EwinOpLower(ewin);
break;
case EWIN_OP_OPACITY:
if (!strcmp(param1, "?"))
{
IpcPrintf("opacity: %u", ewin->ewmh.opacity >> 24);
goto done;
}
val = 0xff;
sscanf(param1, "%i", &val);
EwinOpSetOpacity(ewin, val);
break;
case EWIN_OP_SNAP:
SnapshotEwinParse(ewin, atword(params, 3));
break;
case EWIN_OP_SKIP_LISTS:
on = ewin->props.skip_ext_task;
if (SetEwinBoolean(wop->name, &on, param1, 1))
EwinOpSkipLists(ewin, on);
break;
case EWIN_OP_NEVER_USE_AREA:
on = ewin->props.never_use_area;
SetEwinBoolean(wop->name, &on, param1, 1);
ewin->props.never_use_area = on;
break;
case EWIN_OP_FOCUS_CLICK:
on = ewin->props.focusclick;
SetEwinBoolean(wop->name, &on, param1, 1);
ewin->props.focusclick = on;
break;
case EWIN_OP_NO_BUTTON_GRABS:
on = ewin->props.no_button_grabs;
if (SetEwinBoolean(wop->name, &on, param1, 1))
{
ewin->props.no_button_grabs = on;
if (ewin->props.no_button_grabs)
UnGrabButtonGrabs(ewin);
else
GrabButtonGrabs(ewin);
}
break;
case EWIN_OP_INH_APP_MOVE:
on = EwinInhGetApp(ewin, move);
SetEwinBoolean(wop->name, &on, param1, 1);
EwinInhSetApp(ewin, move, on);
break;
case EWIN_OP_INH_APP_SIZE:
on = EwinInhGetApp(ewin, size);
SetEwinBoolean(wop->name, &on, param1, 1);
EwinInhSetApp(ewin, size, on);
break;
case EWIN_OP_INH_USER_CLOSE:
on = EwinInhGetUser(ewin, close);
SetEwinBoolean(wop->name, &on, param1, 1);
EwinInhSetUser(ewin, close, on);
EwinStateUpdate(ewin);
HintsSetWindowState(ewin);
break;
case EWIN_OP_INH_USER_MOVE:
on = EwinInhGetUser(ewin, move);
SetEwinBoolean(wop->name, &on, param1, 1);
EwinInhSetUser(ewin, move, on);
EwinStateUpdate(ewin);
HintsSetWindowState(ewin);
break;
case EWIN_OP_INH_USER_SIZE:
on = EwinInhGetUser(ewin, size);
SetEwinBoolean(wop->name, &on, param1, 1);
EwinInhSetUser(ewin, size, on);
EwinStateUpdate(ewin);
HintsSetWindowState(ewin);
break;
case EWIN_OP_INH_WM_FOCUS:
on = EwinInhGetWM(ewin, focus);
SetEwinBoolean(wop->name, &on, param1, 1);
EwinInhSetWM(ewin, focus, on);
EwinStateUpdate(ewin);
break;
#if USE_COMPOSITE
case EWIN_OP_SHADOW:
on = EoGetShadow(ewin);
if (SetEwinBoolean(wop->name, &on, param1, 1))
EoSetShadow(ewin, on);
break;
case EWIN_OP_NO_REDIRECT:
on = EoGetNoRedirect(ewin);
on = ewin->o.noredir;
if (SetEwinBoolean(wop->name, &on, param1, 1))
EoSetNoRedirect(ewin, on);
break;
#endif
}
done:
@ -1092,9 +1126,9 @@ EwinShowInfo2(const EWin * ewin)
ewin->mwm.decor_title, ewin->mwm.decor_menu,
ewin->mwm.decor_minimize, ewin->mwm.decor_maximize,
ewin->icccm.need_input, ewin->icccm.take_focus,
ewin->props.never_focus, ewin->props.focusclick,
ewin->props.never_use_area, ewin->props.fixedpos,
ewin->props.fixedsize, EoGetDeskNum(ewin),
EwinInhGetWM(ewin, focus), ewin->props.focusclick,
ewin->props.never_use_area, EwinInhGetUser(ewin, move),
EwinInhGetUser(ewin, size), EoGetDeskNum(ewin),
EoGetLayer(ewin), ewin->o.ilayer,
ewin->state.iconified, EoIsSticky(ewin), ewin->state.shaded,
ewin->state.docked, ewin->state.state, EoIsShown(ewin),
@ -1357,26 +1391,28 @@ static const IpcItem IPCArray[] = {
"You can use ? after most of these commands to receive the current\n"
"status of that flag\n"
"available win_op commands are:\n"
" win_op <windowid> border <BORDERNAME>\n"
" win_op <windowid> title <title>\n"
" win_op <windowid> <close/kill>\n"
" win_op <windowid> <fixedpos/fixedsize/never_use_area>\n"
" win_op <windowid> <focus/focusclick/neverfocus>\n"
" win_op <windowid> <fullscreen/iconify/shade/stick>\n"
" win_op <windowid> no_button_grabs\n"
" win_op <windowid> <focus/iconify/shade/stick>\n"
" win_op <windowid> desk <desktochangeto/next/prev>\n"
" win_op <windowid> area <x> <y>\n"
" win_op <windowid> <move/size> <x> <y>\n"
" (you can use ? and ?? to retreive client and frame locations)\n"
" win_op <windowid> <mr/sr> <x> <y> (incremental move/size)\n"
" win_op <windowid> toggle_<width/height/size> <conservative/available/xinerama>\n"
" win_op <windowid> <fullscreen/zoom>\n"
" win_op <windowid> layer <0-100,4=normal>\n"
" win_op <windowid> <raise/lower>\n"
" win_op <windowid> skiplists\n"
" win_op <windowid> opacity <1-255,255=opaque>\n"
" win_op <windowid> snap <what>\n"
" <what>: all, none, border, command, desktop, dialog, group, icon,\n"
" layer, location, opacity, shade, shadow, size, sticky\n"
" win_op <windowid> <focusclick/never_use_area/no_button_grabs/skiplists>\n"
" win_op <windowid> <no_app_move/size>\n"
" win_op <windowid> <no_user_close/move/size>\n"
" win_op <windowid> <no_wm_focus>\n"
" win_op <windowid> noshadow\n"
" win_op <windowid> toggle_<width/height/size> <conservative/available/xinerama>\n"
" (or none for absolute)\n"
" win_op <windowid> border <BORDERNAME>\n"
" win_op <windowid> desk <desktochangeto/next/prev>\n"
" win_op <windowid> area <x> <y>\n"
" win_op <windowid> <move/resize> <x> <y>\n"
" (you can use ? and ?? to retreive client and frame locations)\n"
" win_op <windowid> title <title>\n"
" win_op <windowid> layer <0-100,4=normal>\n"
"<windowid> may be substituted with \"current\" to use the current window\n"},
{
IPC_WinList,

View File

@ -223,7 +223,7 @@ MenuEwinInit(EWin * ewin, void *ptr)
ewin->props.no_actions = 1;
ewin->props.skip_focuslist = 1;
ewin->props.skip_winlist = 1;
ewin->props.never_focus = 1;
EwinInhSetWM(ewin, focus, 1);
ewin->client.grav = StaticGravity;
ICCCM_SetSizeConstraints(ewin, m->w, m->h, m->w, m->h, 0, 0, 1, 1,

View File

@ -223,7 +223,7 @@ static const IpcItem MiscIpcArray[] = {
MiscIpcConfig,
"misc", NULL,
"Miscellaneous functions",
" misc cfg <thing> Configure thing (focus/fx/moveresize/placement/remember)\n"}
" misc cfg <thing> Configure thing (autoraise/misc/moveresize/placement/remember/session)\n"}
};
#define N_IPC_FUNCS (sizeof(MiscIpcArray)/sizeof(IpcItem))

View File

@ -610,7 +610,7 @@ PagerEwinInit(EWin * ewin, void *ptr)
ewin->props.skip_ext_pager = 1;
ewin->props.skip_focuslist = 1;
ewin->props.skip_winlist = 1;
ewin->props.never_focus = 1;
EwinInhSetWM(ewin, focus, 1);
ewin->props.autosave = 1;
EoSetSticky(ewin, 1);

View File

@ -364,7 +364,7 @@ SnapEwinSkipLists(Snapshot * sn, const EWin * ewin)
static void
SnapEwinNeverFocus(Snapshot * sn, const EWin * ewin)
{
sn->neverfocus = ewin->props.never_focus;
sn->neverfocus = EwinInhGetWM(ewin, focus); /* FIXME */
}
static void
@ -1481,7 +1481,7 @@ SnapshotEwinApply(EWin * ewin)
}
if (use_flags & SNAP_USE_FOCUS_NEVER)
ewin->props.never_focus = sn->neverfocus;
EwinInhSetWM(ewin, focus, sn->neverfocus);
if (use_flags & SNAP_USE_SHADED)
ewin->state.shaded = sn->shaded;

View File

@ -658,7 +658,7 @@ GetBoolean(const char *value)
return 1;
}
#define WINOP_GET_BOOL(item, val) item = GetBoolean(val)
#define WINOP_SET_BOOL(item, val) item = GetBoolean(val)
static void
WindowMatchEwinOpsAction(EWin * ewin, int op, const char *args)
@ -673,73 +673,21 @@ WindowMatchEwinOpsAction(EWin * ewin, int op, const char *args)
/* We should not get here */
return;
case EWIN_OP_ICONIFY:
WINOP_GET_BOOL(ewin->icccm.start_iconified, args);
break;
case EWIN_OP_SHADE:
WINOP_GET_BOOL(ewin->state.shaded, args);
break;
case EWIN_OP_STICK:
WINOP_GET_BOOL(ewin->o.sticky, args);
break;
case EWIN_OP_FIXED_POS:
WINOP_GET_BOOL(ewin->props.fixedpos, args);
break;
case EWIN_OP_FIXED_SIZE:
WINOP_GET_BOOL(ewin->props.fixedsize, args);
break;
case EWIN_OP_NEVER_USE_AREA:
WINOP_GET_BOOL(ewin->props.never_use_area, args);
break;
case EWIN_OP_FOCUS_CLICK:
WINOP_GET_BOOL(ewin->props.focusclick, args);
break;
case EWIN_OP_FOCUS_NEVER:
WINOP_GET_BOOL(ewin->props.never_focus, args);
break;
case EWIN_OP_NO_BUTTON_GRABS:
WINOP_GET_BOOL(ewin->props.no_button_grabs, args);
break;
case EWIN_OP_FULLSCREEN:
WINOP_GET_BOOL(ewin->state.fullscreen, args);
break;
case EWIN_OP_SKIP_LISTS:
WINOP_GET_BOOL(ewin->props.skip_winlist, args);
ewin->props.skip_focuslist = ewin->props.skip_ext_task =
ewin->props.skip_winlist;
break;
case EWIN_OP_OPACITY:
ewin->ewmh.opacity = OpacityExt(atoi(args));
break;
#if USE_COMPOSITE
case EWIN_OP_SHADOW:
WINOP_GET_BOOL(ewin->o.shadow, args);
break;
case EWIN_OP_NO_REDIRECT:
WINOP_GET_BOOL(ewin->o.noredir, args);
break;
#endif
case EWIN_OP_TITLE:
_EFREE(ewin->icccm.wm_name);
ewin->icccm.wm_name = Estrdup(args);
break;
case EWIN_OP_LAYER:
EoSetLayer(ewin, atoi(args));
case EWIN_OP_ICONIFY:
WINOP_SET_BOOL(ewin->icccm.start_iconified, args);
break;
case EWIN_OP_SHADE:
WINOP_SET_BOOL(ewin->state.shaded, args);
break;
case EWIN_OP_STICK:
WINOP_SET_BOOL(ewin->o.sticky, args);
break;
case EWIN_OP_DESK:
@ -771,6 +719,70 @@ WindowMatchEwinOpsAction(EWin * ewin, int op, const char *args)
ewin->client.w = a;
ewin->client.h = b;
break;
case EWIN_OP_FULLSCREEN:
WINOP_SET_BOOL(ewin->state.fullscreen, args);
break;
case EWIN_OP_LAYER:
EoSetLayer(ewin, atoi(args));
break;
case EWIN_OP_OPACITY:
ewin->ewmh.opacity = OpacityExt(atoi(args));
break;
case EWIN_OP_SKIP_LISTS:
WINOP_SET_BOOL(ewin->props.skip_winlist, args);
ewin->props.skip_focuslist = ewin->props.skip_ext_task =
ewin->props.skip_winlist;
break;
case EWIN_OP_FOCUS_CLICK:
WINOP_SET_BOOL(ewin->props.focusclick, args);
break;
case EWIN_OP_NEVER_USE_AREA:
WINOP_SET_BOOL(ewin->props.never_use_area, args);
break;
case EWIN_OP_NO_BUTTON_GRABS:
WINOP_SET_BOOL(ewin->props.no_button_grabs, args);
break;
case EWIN_OP_INH_APP_MOVE:
WINOP_SET_BOOL(EwinInhGetApp(ewin, move), args);
break;
case EWIN_OP_INH_APP_SIZE:
WINOP_SET_BOOL(EwinInhGetApp(ewin, size), args);
break;
case EWIN_OP_INH_USER_CLOSE:
WINOP_SET_BOOL(EwinInhGetUser(ewin, close), args);
break;
case EWIN_OP_INH_USER_MOVE:
WINOP_SET_BOOL(EwinInhGetUser(ewin, move), args);
break;
case EWIN_OP_INH_USER_SIZE:
WINOP_SET_BOOL(EwinInhGetUser(ewin, size), args);
break;
case EWIN_OP_INH_WM_FOCUS:
WINOP_SET_BOOL(EwinInhGetWM(ewin, focus), args);
break;
#if USE_COMPOSITE
case EWIN_OP_SHADOW:
WINOP_SET_BOOL(ewin->o.shadow, args);
break;
case EWIN_OP_NO_REDIRECT:
WINOP_SET_BOOL(ewin->o.noredir, args);
break;
#endif
}
}