diff --git a/src/E.h b/src/E.h index 5a4d990d..b7bc6fd4 100644 --- a/src/E.h +++ b/src/E.h @@ -294,6 +294,7 @@ typedef struct { char warpfocused; char raise_on_select; char warp_on_select; + char show_shape; int icon_mode; } warplist; diff --git a/src/focus.c b/src/focus.c index 988fce28..6a4300b5 100644 --- a/src/focus.c +++ b/src/focus.c @@ -733,6 +733,7 @@ typedef struct { char showiconified; char showalldesks; char warpfocused; + char show_shape; int icon_mode; } focuslist; } FocusDlgData; @@ -768,6 +769,7 @@ CB_ConfigureFocus(Dialog * d, int val, void *data __UNUSED__) Conf.warplist.showiconified = dd->focuslist.showiconified; Conf.warplist.showalldesks = dd->focuslist.showalldesks; Conf.warplist.warpfocused = dd->focuslist.warpfocused; + Conf.warplist.show_shape = dd->focuslist.show_shape; Conf.warplist.icon_mode = dd->focuslist.icon_mode; ClickGrabsUpdate(); @@ -808,6 +810,7 @@ _DlgFillFocus(Dialog * d, DItem * table, void *data __UNUSED__) dd->focuslist.showiconified = Conf.warplist.showiconified; dd->focuslist.showalldesks = Conf.warplist.showalldesks; dd->focuslist.warpfocused = Conf.warplist.warpfocused; + dd->focuslist.show_shape = Conf.warplist.show_shape; dd->focuslist.icon_mode = Conf.warplist.icon_mode; DialogItemTableSetOptions(table, 2, 0, 0, 0); @@ -935,6 +938,11 @@ _DlgFillFocus(Dialog * d, DItem * table, void *data __UNUSED__) DialogItemSetText(di, _("Focus windows while switching")); DialogItemCheckButtonSetPtr(di, &dd->focuslist.warpfocused); + di = DialogAddItem(table, DITEM_CHECKBUTTON); + DialogItemSetColSpan(di, 2); + DialogItemSetText(di, _("Outline windows while switching")); + DialogItemCheckButtonSetPtr(di, &dd->focuslist.show_shape); + di = DialogAddItem(table, DITEM_CHECKBUTTON); DialogItemSetColSpan(di, 2); DialogItemSetText(di, _("Raise windows after focus switch")); diff --git a/src/warp.c b/src/warp.c index efaef7de..7bacdb69 100644 --- a/src/warp.c +++ b/src/warp.c @@ -45,6 +45,30 @@ #include "xwin.h" #include +static void +WarpShapeDraw(EWin * ewin) +{ + static ShapeWin *shape_win = NULL; + int md = 2, bl, br, bt, bb; + + if (!ewin) + { + ShapewinDestroy(shape_win); + shape_win = NULL; + return; + } + + if (!shape_win) + shape_win = ShapewinCreate(md); + if (!shape_win) + return; + + EwinBorderGetSize(ewin, &bl, &br, &bt, &bb); + ShapewinShapeSet(shape_win, md, EoGetX(ewin), EoGetY(ewin), + ewin->client.w, ewin->client.h, bl, br, bt, bb, 0); + EoMap(shape_win, 0); +} + typedef struct { EWin *ewin; Win win; @@ -360,6 +384,9 @@ WarpFocus(int delta) if (!EwinIsOnScreen(ewin)) return; + if (Conf.warplist.show_shape) + WarpShapeDraw(ewin); + if (Conf.focus.raise_on_next) EwinRaise(ewin); if (Conf.focus.warp_on_next) @@ -400,6 +427,7 @@ WarpFocusFinish(void) ewin = warplist[warpFocusIndex].ewin; + WarpShapeDraw(NULL); WarpFocusHide(); if (!EwinFindByPtr(ewin)) @@ -492,6 +520,7 @@ static const CfgItem WarplistCfgItems[] = { 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), + CFG_ITEM_BOOL(Conf.warplist, show_shape, 0), CFG_ITEM_INT(Conf.warplist, icon_mode, EWIN_ICON_MODE_APP_IMG), }; #define N_CFG_ITEMS (sizeof(WarplistCfgItems)/sizeof(CfgItem))