Add option to show windows on all desks in focus list.
SVN revision: 28583
This commit is contained in:
parent
ace904b96e
commit
a19cdebd92
1
src/E.h
1
src/E.h
|
@ -410,6 +410,7 @@ typedef struct
|
|||
char showsticky;
|
||||
char showshaded;
|
||||
char showiconified;
|
||||
char showalldesks;
|
||||
char warpfocused;
|
||||
char raise_on_select;
|
||||
char warp_on_select;
|
||||
|
|
|
@ -1487,14 +1487,15 @@ EwinMoveToArea(EWin * ewin, int ax, int ay)
|
|||
}
|
||||
|
||||
void
|
||||
EwinOpActivate(EWin * ewin, int source)
|
||||
EwinOpActivate(EWin * ewin, int source, int raise)
|
||||
{
|
||||
if (source == OPSRC_APP && EwinInhGetApp(ewin, focus))
|
||||
return;
|
||||
|
||||
if (!ewin->state.animated && !ewin->state.iconified)
|
||||
DeskGotoByEwin(ewin);
|
||||
EwinOpRaise(ewin, source);
|
||||
if (raise)
|
||||
EwinOpRaise(ewin, source);
|
||||
if (ewin->state.iconified)
|
||||
EwinOpIconify(ewin, source, 0);
|
||||
if (ewin->state.shaded)
|
||||
|
|
|
@ -417,7 +417,7 @@ void EwinOpFloatAt(EWin * ewin, int source, int x, int y);
|
|||
void EwinOpUnfloatAt(EWin * ewin, int source, Desk * d,
|
||||
int x, int y);
|
||||
void EwinOpClose(EWin * ewin, int source);
|
||||
void EwinOpActivate(EWin * ewin, int source);
|
||||
void EwinOpActivate(EWin * ewin, int source, int raise);
|
||||
void EwinOpKill(EWin * ewin, int source);
|
||||
void EwinOpRaise(EWin * ewin, int source);
|
||||
void EwinOpLower(EWin * ewin, int source);
|
||||
|
|
|
@ -904,7 +904,7 @@ EWMH_ProcessClientMessage(XClientMessageEvent * ev)
|
|||
source = OPSRC(ev->data.l[0]);
|
||||
ts = ev->data.l[1];
|
||||
/* cwin = ev->data.l[2]; */
|
||||
EwinOpActivate(ewin, source);
|
||||
EwinOpActivate(ewin, source, 1);
|
||||
}
|
||||
else if (ev->message_type == ECORE_X_ATOM_NET_CLOSE_WINDOW)
|
||||
{
|
||||
|
|
|
@ -649,6 +649,7 @@ static char tmp_raise_after_focus;
|
|||
static char tmp_showsticky;
|
||||
static char tmp_showshaded;
|
||||
static char tmp_showiconified;
|
||||
static char tmp_showalldesks;
|
||||
static char tmp_warpfocused;
|
||||
static int tmp_warp_icon_mode;
|
||||
|
||||
|
@ -672,6 +673,7 @@ CB_ConfigureFocus(Dialog * d __UNUSED__, int val, void *data __UNUSED__)
|
|||
Conf.warplist.showsticky = tmp_showsticky;
|
||||
Conf.warplist.showshaded = tmp_showshaded;
|
||||
Conf.warplist.showiconified = tmp_showiconified;
|
||||
Conf.warplist.showalldesks = tmp_showalldesks;
|
||||
Conf.warplist.warpfocused = tmp_warpfocused;
|
||||
Conf.warplist.icon_mode = tmp_warp_icon_mode;
|
||||
|
||||
|
@ -700,6 +702,7 @@ _DlgFillFocus(Dialog * d __UNUSED__, DItem * table, void *data __UNUSED__)
|
|||
tmp_showsticky = Conf.warplist.showsticky;
|
||||
tmp_showshaded = Conf.warplist.showshaded;
|
||||
tmp_showiconified = Conf.warplist.showiconified;
|
||||
tmp_showalldesks = Conf.warplist.showalldesks;
|
||||
tmp_warpfocused = Conf.warplist.warpfocused;
|
||||
tmp_warp_icon_mode = Conf.warplist.icon_mode;
|
||||
|
||||
|
@ -794,6 +797,11 @@ _DlgFillFocus(Dialog * d __UNUSED__, DItem * table, void *data __UNUSED__)
|
|||
DialogItemSetText(di, _("Include iconified windows in focus list"));
|
||||
DialogItemCheckButtonSetPtr(di, &tmp_showiconified);
|
||||
|
||||
di = DialogAddItem(table, DITEM_CHECKBUTTON);
|
||||
DialogItemSetColSpan(di, 2);
|
||||
DialogItemSetText(di, _("Include windows on other desks in focus list"));
|
||||
DialogItemCheckButtonSetPtr(di, &tmp_showalldesks);
|
||||
|
||||
di = DialogAddItem(table, DITEM_CHECKBUTTON);
|
||||
DialogItemSetColSpan(di, 2);
|
||||
DialogItemSetText(di, _("Focus windows while switching"));
|
||||
|
|
|
@ -481,7 +481,7 @@ IpcWinop(const WinOp * wop, EWin * ewin, const char *prm)
|
|||
IpcPrintf("focused: %s", (ewin == GetFocusEwin())? "yes" : "no");
|
||||
goto done;
|
||||
}
|
||||
EwinOpActivate(ewin, OPSRC_USER);
|
||||
EwinOpActivate(ewin, OPSRC_USER, 1);
|
||||
break;
|
||||
|
||||
case EWIN_OP_DESK:
|
||||
|
|
46
src/warp.c
46
src/warp.c
|
@ -32,6 +32,7 @@
|
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*/
|
||||
#include "E.h"
|
||||
#include "desktops.h"
|
||||
#include "emodule.h"
|
||||
#include "ewins.h"
|
||||
#include "focus.h"
|
||||
|
@ -112,8 +113,9 @@ WarpFocusWinShow(WarpFocusWin * fw)
|
|||
{
|
||||
WarplistItem *wi;
|
||||
EImageBorder *pad;
|
||||
EWin *ewin;
|
||||
int i, x, y, w, h, ww, hh;
|
||||
char s[1024];
|
||||
char s[1024], ss[32];
|
||||
const char *fmt;
|
||||
|
||||
w = 0;
|
||||
|
@ -125,13 +127,23 @@ WarpFocusWinShow(WarpFocusWin * fw)
|
|||
wi = warplist + i;
|
||||
wi->win = ECreateWindow(EoGetWin(fw), 0, 0, 1, 1, 0);
|
||||
EMapWindow(wi->win);
|
||||
if (wi->ewin->state.iconified)
|
||||
fmt = "[%s]";
|
||||
else if (wi->ewin->state.shaded)
|
||||
fmt = "=%s=";
|
||||
|
||||
ewin = wi->ewin;
|
||||
if (ewin->state.iconified)
|
||||
fmt = "%s[%s]";
|
||||
else if (ewin->state.shaded)
|
||||
fmt = "%s=%s=";
|
||||
else
|
||||
fmt = "%s";
|
||||
Esnprintf(s, sizeof(s), fmt, EwinGetTitle(wi->ewin));
|
||||
fmt = "%s%s";
|
||||
ss[0] = '\0';
|
||||
if (Conf.warplist.showalldesks)
|
||||
{
|
||||
if (EoIsSticky(ewin) || ewin->state.iconified)
|
||||
strcpy(ss, "[-] ");
|
||||
else
|
||||
Esnprintf(ss, sizeof(ss), "[%d] ", EoGetDeskNum(ewin));
|
||||
}
|
||||
Esnprintf(s, sizeof(s), fmt, ss, EwinGetTitle(ewin));
|
||||
wi->txt = strdup(s);
|
||||
TextSize(fw->tc, 0, 0, 0, wi->txt, &ww, &hh, 17);
|
||||
if (ww > w)
|
||||
|
@ -295,7 +307,8 @@ WarpFocus(int delta)
|
|||
{
|
||||
ewin = lst[i];
|
||||
if ( /* Either visible or iconified */
|
||||
((EwinIsOnScreen(ewin)) || (ewin->state.iconified)) &&
|
||||
((EwinIsOnScreen(ewin)) || (ewin->state.iconified) ||
|
||||
(Conf.warplist.showalldesks)) &&
|
||||
/* Exclude windows that explicitely say so */
|
||||
(!ewin->props.skip_focuslist) &&
|
||||
(!ewin->props.skip_ext_task) &&
|
||||
|
@ -335,6 +348,9 @@ WarpFocus(int delta)
|
|||
|
||||
WarpFocusShow();
|
||||
|
||||
if (!EwinIsOnScreen(ewin))
|
||||
return;
|
||||
|
||||
if (Conf.focus.raise_on_next)
|
||||
EwinRaise(ewin);
|
||||
if (Conf.focus.warp_on_next)
|
||||
|
@ -366,7 +382,8 @@ WarpFocusClick(int ix)
|
|||
if (!EwinFindByPtr(ewin))
|
||||
return;
|
||||
|
||||
EwinRaise(ewin);
|
||||
if (Conf.focus.raise_on_next)
|
||||
EwinRaise(ewin);
|
||||
|
||||
FocusToEWin(ewin, FOCUS_SET);
|
||||
}
|
||||
|
@ -383,19 +400,13 @@ WarpFocusFinish(void)
|
|||
if (!EwinFindByPtr(ewin))
|
||||
return;
|
||||
|
||||
if (ewin->state.iconified)
|
||||
EwinDeIconify(ewin);
|
||||
if (ewin->state.shaded)
|
||||
EwinUnShade(ewin);
|
||||
if (Conf.warplist.raise_on_select)
|
||||
EwinRaise(ewin);
|
||||
EwinOpActivate(ewin, OPSRC_USER, Conf.warplist.raise_on_select);
|
||||
if (Conf.warplist.warp_on_select)
|
||||
if (ewin != Mode.mouse_over_ewin)
|
||||
{
|
||||
EXWarpPointer(EoGetXwin(ewin), EoGetW(ewin) / 2, EoGetH(ewin) / 2);
|
||||
Mode.mouse_over_ewin = ewin;
|
||||
}
|
||||
FocusToEWin(ewin, FOCUS_SET);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -486,7 +497,8 @@ static const CfgItem WarplistCfgItems[] = {
|
|||
CFG_ITEM_BOOL(Conf.warplist, enable, 1),
|
||||
CFG_ITEM_BOOL(Conf.warplist, showsticky, 1),
|
||||
CFG_ITEM_BOOL(Conf.warplist, showshaded, 1),
|
||||
CFG_ITEM_BOOL(Conf.warplist, showiconified, 0),
|
||||
CFG_ITEM_BOOL(Conf.warplist, showiconified, 1),
|
||||
CFG_ITEM_BOOL(Conf.warplist, showalldesks, 0),
|
||||
CFG_ITEM_BOOL(Conf.warplist, warpfocused, 1),
|
||||
CFG_ITEM_BOOL(Conf.warplist, raise_on_select, 1),
|
||||
CFG_ITEM_BOOL(Conf.warplist, warp_on_select, 0),
|
||||
|
|
Loading…
Reference in New Issue