parent
5b2513c0b2
commit
e3f3a9c6bd
|
@ -724,7 +724,7 @@ EwinDeIconify(EWin * ewin)
|
|||
EwinDeIconify1(ewin, dx, dy);
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
EwinUnStick(EWin * ewin)
|
||||
{
|
||||
|
||||
|
@ -739,7 +739,7 @@ EwinUnStick(EWin * ewin)
|
|||
SnapshotEwinUpdate(ewin, SNAP_USE_STICKY);
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
EwinStick(EWin * ewin)
|
||||
{
|
||||
int x, y, dx, dy;
|
||||
|
@ -1415,20 +1415,20 @@ EwinMoveToArea(EWin * ewin, int ax, int ay)
|
|||
}
|
||||
|
||||
void
|
||||
EwinOpActivate(EWin * ewin)
|
||||
EwinOpActivate(EWin * ewin, int source)
|
||||
{
|
||||
if (!ewin->state.animated && !ewin->state.iconified)
|
||||
DeskGotoByEwin(ewin);
|
||||
EwinOpRaise(ewin);
|
||||
EwinOpRaise(ewin, source);
|
||||
if (ewin->state.iconified)
|
||||
EwinOpIconify(ewin, 0);
|
||||
EwinOpIconify(ewin, source, 0);
|
||||
if (ewin->state.shaded)
|
||||
EwinOpShade(ewin, 0);
|
||||
EwinOpShade(ewin, source, 0);
|
||||
FocusToEWin(ewin, FOCUS_SET);
|
||||
}
|
||||
|
||||
void
|
||||
EwinOpClose(EWin * ewin)
|
||||
EwinOpClose(EWin * ewin, int source __UNUSED__)
|
||||
{
|
||||
EWin **gwins;
|
||||
int num, i;
|
||||
|
@ -1448,14 +1448,14 @@ EwinOpClose(EWin * ewin)
|
|||
}
|
||||
|
||||
void
|
||||
EwinOpKill(EWin * ewin)
|
||||
EwinOpKill(EWin * ewin, int source __UNUSED__)
|
||||
{
|
||||
SoundPlay("SOUND_WINDOW_CLOSE");
|
||||
EDestroyWindow(_EwinGetClientWin(ewin));
|
||||
}
|
||||
|
||||
void
|
||||
EwinOpRaise(EWin * ewin)
|
||||
EwinOpRaise(EWin * ewin, int source __UNUSED__)
|
||||
{
|
||||
EWin **gwins = NULL;
|
||||
int i, num;
|
||||
|
@ -1469,7 +1469,7 @@ EwinOpRaise(EWin * ewin)
|
|||
}
|
||||
|
||||
void
|
||||
EwinOpLower(EWin * ewin)
|
||||
EwinOpLower(EWin * ewin, int source __UNUSED__)
|
||||
{
|
||||
EWin **gwins = NULL;
|
||||
int i, num;
|
||||
|
@ -1545,7 +1545,7 @@ EwinOpRaiseLower(EWin * ewin)
|
|||
#endif
|
||||
|
||||
void
|
||||
EwinOpStick(EWin * ewin, int on)
|
||||
EwinOpStick(EWin * ewin, int source __UNUSED__, int on)
|
||||
{
|
||||
EWin **gwins = NULL;
|
||||
Group *curr_group = NULL;
|
||||
|
@ -1574,7 +1574,7 @@ EwinOpStick(EWin * ewin, int on)
|
|||
}
|
||||
|
||||
void
|
||||
EwinOpSkipLists(EWin * ewin, int skip)
|
||||
EwinOpSkipLists(EWin * ewin, int source __UNUSED__, int skip)
|
||||
{
|
||||
ewin->props.skip_ext_task = skip;
|
||||
ewin->props.skip_winlist = skip;
|
||||
|
@ -1626,7 +1626,7 @@ EwinOpNeverFocus(EWin * ewin, int on)
|
|||
#endif
|
||||
|
||||
void
|
||||
EwinOpIconify(EWin * ewin, int on)
|
||||
EwinOpIconify(EWin * ewin, int source __UNUSED__, int on)
|
||||
{
|
||||
Group *curr_group = NULL;
|
||||
EWin **gwins = NULL;
|
||||
|
@ -1654,7 +1654,7 @@ EwinOpIconify(EWin * ewin, int on)
|
|||
}
|
||||
|
||||
void
|
||||
EwinOpShade(EWin * ewin, int on)
|
||||
EwinOpShade(EWin * ewin, int source __UNUSED__, int on)
|
||||
{
|
||||
EWin **gwins = NULL;
|
||||
Group *curr_group = NULL;
|
||||
|
@ -1683,7 +1683,7 @@ EwinOpShade(EWin * ewin, int on)
|
|||
}
|
||||
|
||||
void
|
||||
EwinOpSetLayer(EWin * ewin, int layer)
|
||||
EwinOpSetLayer(EWin * ewin, int source __UNUSED__, int layer)
|
||||
{
|
||||
if (EoGetLayer(ewin) > layer)
|
||||
{
|
||||
|
@ -1700,7 +1700,7 @@ EwinOpSetLayer(EWin * ewin, int layer)
|
|||
}
|
||||
|
||||
void
|
||||
EwinOpSetBorder(EWin * ewin, const char *name)
|
||||
EwinOpSetBorder(EWin * ewin, int source __UNUSED__, const char *name)
|
||||
{
|
||||
EWin **gwins = NULL;
|
||||
int i, num;
|
||||
|
@ -1763,7 +1763,7 @@ OpacityExt(int op)
|
|||
}
|
||||
|
||||
void
|
||||
EwinOpSetOpacity(EWin * ewin, int opacity)
|
||||
EwinOpSetOpacity(EWin * ewin, int source __UNUSED__, int opacity)
|
||||
{
|
||||
unsigned int op;
|
||||
|
||||
|
@ -1775,7 +1775,7 @@ EwinOpSetOpacity(EWin * ewin, int opacity)
|
|||
}
|
||||
|
||||
void
|
||||
EwinOpMoveToDesk(EWin * ewin, Desk * dsk, int inc)
|
||||
EwinOpMoveToDesk(EWin * ewin, int source __UNUSED__, Desk * dsk, int inc)
|
||||
{
|
||||
dsk = DeskGetRelative(dsk, inc);
|
||||
|
||||
|
|
35
src/ewins.h
35
src/ewins.h
|
@ -35,6 +35,12 @@ typedef struct _ewin EWin;
|
|||
|
||||
struct _snapshot;
|
||||
|
||||
/* Window operation sources */
|
||||
#define OPSRC_UNKNOWN 0
|
||||
#define OPSRC_APP 1
|
||||
#define OPSRC_USER 2
|
||||
#define OPSRC_WM 3
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned int all:32;
|
||||
|
@ -322,8 +328,6 @@ void EwinFloatAt(EWin * ewin, int x, int y);
|
|||
void EwinUnfloatAt(EWin * ewin, struct _desk *d, int x, int y);
|
||||
void EwinIconify(EWin * ewin);
|
||||
void EwinDeIconify(EWin * ewin);
|
||||
void EwinStick(EWin * ewin);
|
||||
void EwinUnStick(EWin * ewin);
|
||||
void EwinInstantShade(EWin * ewin, int force);
|
||||
void EwinInstantUnShade(EWin * ewin);
|
||||
void EwinShade(EWin * ewin);
|
||||
|
@ -331,19 +335,20 @@ void EwinUnShade(EWin * ewin);
|
|||
void EwinSetFullscreen(EWin * ewin, int on);
|
||||
void EwinMoveToArea(EWin * ewin, int ax, int ay);
|
||||
|
||||
void EwinOpClose(EWin * ewin);
|
||||
void EwinOpActivate(EWin * ewin);
|
||||
void EwinOpKill(EWin * ewin);
|
||||
void EwinOpRaise(EWin * ewin);
|
||||
void EwinOpLower(EWin * ewin);
|
||||
void EwinOpStick(EWin * ewin, int on);
|
||||
void EwinOpSkipLists(EWin * ewin, int skip);
|
||||
void EwinOpIconify(EWin * ewin, int on);
|
||||
void EwinOpShade(EWin * ewin, int on);
|
||||
void EwinOpSetLayer(EWin * ewin, int layer);
|
||||
void EwinOpSetBorder(EWin * ewin, const char *name);
|
||||
void EwinOpSetOpacity(EWin * ewin, int opacity);
|
||||
void EwinOpMoveToDesk(EWin * ewin, struct _desk *dsk, int inc);
|
||||
void EwinOpClose(EWin * ewin, int source);
|
||||
void EwinOpActivate(EWin * ewin, int source);
|
||||
void EwinOpKill(EWin * ewin, int source);
|
||||
void EwinOpRaise(EWin * ewin, int source);
|
||||
void EwinOpLower(EWin * ewin, int source);
|
||||
void EwinOpStick(EWin * ewin, int source, int on);
|
||||
void EwinOpSkipLists(EWin * ewin, int source, int skip);
|
||||
void EwinOpIconify(EWin * ewin, int source, int on);
|
||||
void EwinOpShade(EWin * ewin, int source, int on);
|
||||
void EwinOpSetLayer(EWin * ewin, int source, int layer);
|
||||
void EwinOpSetBorder(EWin * ewin, int source, const char *name);
|
||||
void EwinOpSetOpacity(EWin * ewin, int source, int opacity);
|
||||
void EwinOpMoveToDesk(EWin * ewin, int source, struct _desk *dsk,
|
||||
int inc);
|
||||
|
||||
/* finders.c */
|
||||
EWin *EwinFindByPtr(const EWin * ewin);
|
||||
|
|
26
src/ewmh.c
26
src/ewmh.c
|
@ -857,23 +857,23 @@ EWMH_ProcessClientMessage(XClientMessageEvent * ev)
|
|||
|
||||
if (ev->message_type == ECORE_X_ATOM_NET_ACTIVE_WINDOW)
|
||||
{
|
||||
EwinOpActivate(ewin);
|
||||
EwinOpActivate(ewin, OPSRC_UNKNOWN);
|
||||
}
|
||||
else if (ev->message_type == ECORE_X_ATOM_NET_CLOSE_WINDOW)
|
||||
{
|
||||
EwinOpClose(ewin);
|
||||
EwinOpClose(ewin, OPSRC_UNKNOWN);
|
||||
}
|
||||
else if (ev->message_type == ECORE_X_ATOM_NET_WM_DESKTOP)
|
||||
{
|
||||
if ((unsigned)ev->data.l[0] == 0xFFFFFFFF)
|
||||
{
|
||||
if (!EoIsSticky(ewin))
|
||||
EwinStick(ewin);
|
||||
EwinOpStick(ewin, OPSRC_UNKNOWN, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (EoIsSticky(ewin))
|
||||
EwinUnStick(ewin);
|
||||
EwinOpStick(ewin, OPSRC_UNKNOWN, 0);
|
||||
else
|
||||
EwinMoveToDesktop(ewin, DeskGet(ev->data.l[0]));
|
||||
}
|
||||
|
@ -899,18 +899,12 @@ EWMH_ProcessClientMessage(XClientMessageEvent * ev)
|
|||
else if (atom == ECORE_X_ATOM_NET_WM_STATE_STICKY)
|
||||
{
|
||||
action = do_set(EoIsSticky(ewin), action);
|
||||
if (action)
|
||||
EwinStick(ewin);
|
||||
else
|
||||
EwinUnStick(ewin);
|
||||
EwinOpStick(ewin, OPSRC_UNKNOWN, action);
|
||||
}
|
||||
else if (atom == ECORE_X_ATOM_NET_WM_STATE_SHADED)
|
||||
{
|
||||
action = do_set(ewin->state.shaded, action);
|
||||
if (action)
|
||||
EwinShade(ewin);
|
||||
else
|
||||
EwinUnShade(ewin);
|
||||
EwinOpShade(ewin, OPSRC_UNKNOWN, action);
|
||||
}
|
||||
else if (atom == ECORE_X_ATOM_NET_WM_STATE_SKIP_TASKBAR)
|
||||
{
|
||||
|
@ -970,17 +964,17 @@ EWMH_ProcessClientMessage(XClientMessageEvent * ev)
|
|||
{
|
||||
action = do_set(EoGetLayer(ewin) >= 6, action);
|
||||
if (action)
|
||||
EwinOpSetLayer(ewin, 6);
|
||||
EwinOpSetLayer(ewin, OPSRC_UNKNOWN, 6);
|
||||
else
|
||||
EwinOpSetLayer(ewin, 4);
|
||||
EwinOpSetLayer(ewin, OPSRC_UNKNOWN, 4);
|
||||
}
|
||||
else if (atom == ECORE_X_ATOM_NET_WM_STATE_BELOW)
|
||||
{
|
||||
action = do_set(EoGetLayer(ewin) <= 2, action);
|
||||
if (action)
|
||||
EwinOpSetLayer(ewin, 2);
|
||||
EwinOpSetLayer(ewin, OPSRC_UNKNOWN, 2);
|
||||
else
|
||||
EwinOpSetLayer(ewin, 4);
|
||||
EwinOpSetLayer(ewin, OPSRC_UNKNOWN, 4);
|
||||
}
|
||||
else if (atom == ECORE_X_ATOM_NET_WM_STATE_DEMANDS_ATTENTION)
|
||||
{
|
||||
|
|
18
src/gnome.c
18
src/gnome.c
|
@ -810,23 +810,13 @@ GNOME_ProcessClientMessage(XClientMessageEvent * event)
|
|||
if ((event->data.l[0] & WIN_STATE_STICKY)
|
||||
&& (!ewin->props.ignorearrange))
|
||||
{
|
||||
if (event->data.l[1] & WIN_STATE_STICKY)
|
||||
{
|
||||
if (!EoIsSticky(ewin))
|
||||
EwinStick(ewin);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (EoIsSticky(ewin))
|
||||
EwinUnStick(ewin);
|
||||
}
|
||||
EwinOpStick(ewin, OPSRC_USER,
|
||||
(event->data.l[1] & WIN_STATE_STICKY) != 0);
|
||||
}
|
||||
if (event->data.l[0] & WIN_STATE_SHADED)
|
||||
{
|
||||
if (event->data.l[1] & WIN_STATE_SHADED)
|
||||
EwinShade(ewin);
|
||||
else
|
||||
EwinUnShade(ewin);
|
||||
EwinOpShade(ewin, OPSRC_USER,
|
||||
(event->data.l[1] & WIN_STATE_SHADED) != 0);
|
||||
}
|
||||
HintsSetWindowState(ewin);
|
||||
return;
|
||||
|
|
|
@ -594,7 +594,6 @@ IconboxShow(Iconbox * ib)
|
|||
else
|
||||
{
|
||||
/* The first one */
|
||||
EwinStick(ewin);
|
||||
EwinMoveToDesktop(ewin, EoGetDesk(ewin));
|
||||
EwinResize(ewin, 128, 32);
|
||||
EwinMove(ewin, VRoot.w - EoGetW(ewin), VRoot.h - EoGetH(ewin));
|
||||
|
@ -2064,7 +2063,7 @@ IboxEventIconWin(XEvent * ev, void *prm)
|
|||
if (tt)
|
||||
TooltipHide(tt);
|
||||
|
||||
EwinOpIconify(ewin, 0);
|
||||
EwinOpIconify(ewin, OPSRC_USER, 0);
|
||||
break;
|
||||
|
||||
case MotionNotify:
|
||||
|
|
30
src/ipc.c
30
src/ipc.c
|
@ -449,7 +449,7 @@ IPC_WinOps(const char *params, Client * c __UNUSED__)
|
|||
IpcPrintf("window border: %s", BorderGetName(ewin->border));
|
||||
goto done;
|
||||
}
|
||||
EwinOpSetBorder(ewin, param1);
|
||||
EwinOpSetBorder(ewin, OPSRC_USER, param1);
|
||||
break;
|
||||
|
||||
case EWIN_OP_TITLE:
|
||||
|
@ -471,29 +471,29 @@ IPC_WinOps(const char *params, Client * c __UNUSED__)
|
|||
break;
|
||||
|
||||
case EWIN_OP_CLOSE:
|
||||
EwinOpClose(ewin);
|
||||
EwinOpClose(ewin, OPSRC_USER);
|
||||
break;
|
||||
|
||||
case EWIN_OP_KILL:
|
||||
EwinOpKill(ewin);
|
||||
EwinOpKill(ewin, OPSRC_USER);
|
||||
break;
|
||||
|
||||
case EWIN_OP_ICONIFY:
|
||||
on = ewin->state.iconified;
|
||||
if (SetEwinBoolean("window iconified", &on, param1, 1))
|
||||
EwinOpIconify(ewin, on);
|
||||
EwinOpIconify(ewin, OPSRC_USER, on);
|
||||
break;
|
||||
|
||||
case EWIN_OP_SHADE:
|
||||
on = ewin->state.shaded;
|
||||
if (SetEwinBoolean(wop->name, &on, param1, 1))
|
||||
EwinOpShade(ewin, on);
|
||||
EwinOpShade(ewin, OPSRC_USER, on);
|
||||
break;
|
||||
|
||||
case EWIN_OP_STICK:
|
||||
on = EoIsSticky(ewin);
|
||||
if (SetEwinBoolean(wop->name, &on, param1, 1))
|
||||
EwinOpStick(ewin, on);
|
||||
EwinOpStick(ewin, OPSRC_USER, on);
|
||||
break;
|
||||
|
||||
case EWIN_OP_FOCUS:
|
||||
|
@ -502,7 +502,7 @@ IPC_WinOps(const char *params, Client * c __UNUSED__)
|
|||
IpcPrintf("focused: %s", (ewin == GetFocusEwin())? "yes" : "no");
|
||||
goto done;
|
||||
}
|
||||
EwinOpActivate(ewin);
|
||||
EwinOpActivate(ewin, OPSRC_USER);
|
||||
break;
|
||||
|
||||
case EWIN_OP_DESK:
|
||||
|
@ -513,11 +513,11 @@ IPC_WinOps(const char *params, Client * c __UNUSED__)
|
|||
}
|
||||
if (!strncmp(param1, "next", 1))
|
||||
{
|
||||
EwinOpMoveToDesk(ewin, EoGetDesk(ewin), 1);
|
||||
EwinOpMoveToDesk(ewin, OPSRC_USER, EoGetDesk(ewin), 1);
|
||||
}
|
||||
else if (!strncmp(param1, "prev", 1))
|
||||
{
|
||||
EwinOpMoveToDesk(ewin, EoGetDesk(ewin), -1);
|
||||
EwinOpMoveToDesk(ewin, OPSRC_USER, EoGetDesk(ewin), -1);
|
||||
}
|
||||
else if (!strcmp(param1, "?"))
|
||||
{
|
||||
|
@ -525,7 +525,7 @@ IPC_WinOps(const char *params, Client * c __UNUSED__)
|
|||
}
|
||||
else
|
||||
{
|
||||
EwinOpMoveToDesk(ewin, NULL, atoi(param1));
|
||||
EwinOpMoveToDesk(ewin, OPSRC_USER, NULL, atoi(param1));
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -656,15 +656,15 @@ IPC_WinOps(const char *params, Client * c __UNUSED__)
|
|||
goto done;
|
||||
}
|
||||
val = atoi(param1);
|
||||
EwinOpSetLayer(ewin, val);
|
||||
EwinOpSetLayer(ewin, OPSRC_USER, val);
|
||||
break;
|
||||
|
||||
case EWIN_OP_RAISE:
|
||||
EwinOpRaise(ewin);
|
||||
EwinOpRaise(ewin, OPSRC_USER);
|
||||
break;
|
||||
|
||||
case EWIN_OP_LOWER:
|
||||
EwinOpLower(ewin);
|
||||
EwinOpLower(ewin, OPSRC_USER);
|
||||
break;
|
||||
|
||||
case EWIN_OP_OPACITY:
|
||||
|
@ -675,7 +675,7 @@ IPC_WinOps(const char *params, Client * c __UNUSED__)
|
|||
}
|
||||
val = 0xff;
|
||||
sscanf(param1, "%i", &val);
|
||||
EwinOpSetOpacity(ewin, val);
|
||||
EwinOpSetOpacity(ewin, OPSRC_USER, val);
|
||||
break;
|
||||
|
||||
case EWIN_OP_SNAP:
|
||||
|
@ -685,7 +685,7 @@ IPC_WinOps(const char *params, Client * c __UNUSED__)
|
|||
case EWIN_OP_SKIP_LISTS:
|
||||
on = ewin->props.skip_ext_task;
|
||||
if (SetEwinBoolean(wop->name, &on, param1, 1))
|
||||
EwinOpSkipLists(ewin, on);
|
||||
EwinOpSkipLists(ewin, OPSRC_USER, on);
|
||||
break;
|
||||
|
||||
case EWIN_OP_NEVER_USE_AREA:
|
||||
|
|
Loading…
Reference in New Issue