Add toggle for experimental fix

This commit is contained in:
speediegq 2022-09-09 10:07:24 +02:00
parent 59e69b9d6b
commit 5df0ad1a92
2 changed files with 41 additions and 31 deletions

View file

@ -215,7 +215,9 @@ struct Monitor {
int showbar;
int barposition;
int hidsel;
#if USETAGPREVIEWFIX
int mouseactivated;
#endif
Client *clients;
Client *sel;
#if USEIPC
@ -454,7 +456,7 @@ static void spawnbar();
static void unmanagealtbar(Window w);
static void unmanagetray(Window w);
#if USETAGPREVIEW
static void getpreview(void);
static void takepreview(void);
#endif
static void tagmon(const Arg *arg);
#if LAYOUT_TILE
@ -1024,7 +1026,9 @@ buttonpress(XEvent *e)
} while (ev->x >= x && ++i < LENGTH(tags));
if (i < LENGTH(tags) && !hidetags) {
#if USETAGPREVIEWFIX
selmon->mouseactivated = 1;
#endif
click = ClkTagBar;
arg.ui = 1 << i;
} else if (ev->x < x + blw && !leftlayout) // right layout
@ -4213,7 +4217,7 @@ sigchld(int unused)
#if USETAGPREVIEW
void
getpreview(void)
takepreview(void)
{
unsigned int occ = 0, i;
Client *c;
@ -5022,19 +5026,22 @@ view(const Arg *arg)
unsigned int tmptag;
#if USEMOUSE
#if USETAGPREVIEWFIX
selmon->mouseactivated = 1;
#endif
#endif
#if USETAGPREVIEWFIX
#if USETAGPREVIEW
/* fix: tag preview gets captured in the next tag preview if the user switched tag while a preview is showing */
if (selmon->previewshow && !selmon->mouseactivated)
return;
#endif
#endif
if(arg->ui && (arg->ui & TAGMASK) == selmon->tagset[selmon->seltags])
return;
#if USETAGPREVIEW
getpreview();
takepreview();
#endif
for (m = mons; m; m = m->next)
m->seltags ^= 1;
@ -5070,7 +5077,9 @@ view(const Arg *arg)
#if USETAGPREVIEW
XUnmapWindow(dpy, selmon->tagwin);
#endif
#if USETAGPREVIEWFIX
selmon->mouseactivated = 0;
#endif
focus(NULL);
arrange(NULL);
updatecurrentdesktop();

View file

@ -4,46 +4,47 @@
*/
/* IPC */
#define USEIPC 1 /* Whether or not to use IPC. If you set this to 1, set USEIPC to true in toggle.mk and comment the YAJLLIBS and YAJLINC lines in config.mk. Not compatible with BSDs so for those, set this to 0. */
#define USEIPC 1 /* Whether or not to use IPC. If you set this to 1, set USEIPC to true in toggle.mk and comment the YAJLLIBS and YAJLINC lines in config.mk. Not compatible with BSDs so for those, set this to 0. */
/* Alpha related patches
*
* These do not have any dependencies but can slow down older computers.
* Because of this, you can easily toggle them on/off.
*/
#define USEALPHA 1 /* Whether or not to use transparency for the bar */
#define USEFADE 1 /* Whether or not to use fading windows */
#define USEMOUSE 1 /* Whether or not to use mouse binds */
#define USEALPHA 1 /* Whether or not to use transparency for the bar */
#define USEFADE 1 /* Whether or not to use fading windows */
#define USEMOUSE 1 /* Whether or not to use mouse binds */
/* Image related patches
*
* These can slow down speedwm slightly but if you use modern computers, it's not noticeable.
* If you wish to disable them though, set them to 0.
*/
#define USEIMLIB2 1 /* Whether or not to use imlib2. Required by USEWINICON and USETAGPREVIEW. */
#define USEWINICON 1 /* Whether or not to use window icons. Requires imlib to be enabled in toggle.mk and it must be installed. */
#define USETAGPREVIEW 1 /* Whether or not to use tag previews. Requires imlib to be enabled in toggle.mk and it must be installed. */
#define USEIMLIB2 1 /* Whether or not to use imlib2. Required by USEWINICON and USETAGPREVIEW. */
#define USEWINICON 1 /* Whether or not to use window icons. Requires imlib to be enabled in toggle.mk and it must be installed. */
#define USETAGPREVIEW 1 /* Whether or not to use tag previews. Requires imlib to be enabled in toggle.mk and it must be installed. */
#define USETAGPREVIEWFIX 0 /* Experimental fix for tag previews showing up in the tag preview when a window animations are enabled. Using this is not recommended and if you use the mouse to switch tags, it will not work. */
/* Layouts
* If you don't use a layout, you can remove it to keep the speedwm binary small.
*/
#define LAYOUT_TILE 1 /* Whether or not to include the tiling layout */
#define LAYOUT_TILE54 1 /* Whether or not to include hte 5:4 tiling layout */
#define LAYOUT_MONOCLE 1 /* Whether or not to include the monocle layout */
#define LAYOUT_GRID 1 /* Whether or not to include the grid layout */
#define LAYOUT_GLGRID 1 /* Whether or not to include the gapless grid layout */
#define LAYOUT_FIBO 1 /* Whether or not to include the fibonacci layout */
#define LAYOUT_DWINDLE 1 /* Whether or not to include the dwindle layout */
#define LAYOUT_SPIRAL 1 /* Whether or not to include the spiral layout */
#define LAYOUT_TCL 1 /* Whether or not to include the three column layout */
#define LAYOUT_BSTACK 1 /* Whether or not to include the bottom stack layout */
#define LAYOUT_BSTACKH 1 /* Whether or not to include the horizontal bottom stack layout */
#define LAYOUT_HGRID 1 /* Whether or not to include the horizontal grid layout */
#define LAYOUT_DGRID 1 /* Whether or not to include the dynamic grid layout */
#define LAYOUT_TATAMI 1 /* Whether or not to include the tatami layout */
#define LAYOUT_TW 1 /* Whether or not to include the wide tiling layout */
#define LAYOUT_CM 1 /* Whether or not to include the centered master layout */
#define LAYOUT_CFM 1 /* Whether or not to include the centered floating master layout */
#define LAYOUT_DECK 1 /* Whether or not to include the deck layout */
#define LAYOUT_COL 1 /* Whether or not to include the column layout */
#define LAYOUT_STAIRS 1 /* Whether or not to include the stairs layout */
#define LAYOUT_TILE 1 /* Whether or not to include the tiling layout */
#define LAYOUT_TILE54 1 /* Whether or not to include hte 5:4 tiling layout */
#define LAYOUT_MONOCLE 1 /* Whether or not to include the monocle layout */
#define LAYOUT_GRID 1 /* Whether or not to include the grid layout */
#define LAYOUT_GLGRID 1 /* Whether or not to include the gapless grid layout */
#define LAYOUT_FIBO 1 /* Whether or not to include the fibonacci layout */
#define LAYOUT_DWINDLE 1 /* Whether or not to include the dwindle layout */
#define LAYOUT_SPIRAL 1 /* Whether or not to include the spiral layout */
#define LAYOUT_TCL 1 /* Whether or not to include the three column layout */
#define LAYOUT_BSTACK 1 /* Whether or not to include the bottom stack layout */
#define LAYOUT_BSTACKH 1 /* Whether or not to include the horizontal bottom stack layout */
#define LAYOUT_HGRID 1 /* Whether or not to include the horizontal grid layout */
#define LAYOUT_DGRID 1 /* Whether or not to include the dynamic grid layout */
#define LAYOUT_TATAMI 1 /* Whether or not to include the tatami layout */
#define LAYOUT_TW 1 /* Whether or not to include the wide tiling layout */
#define LAYOUT_CM 1 /* Whether or not to include the centered master layout */
#define LAYOUT_CFM 1 /* Whether or not to include the centered floating master layout */
#define LAYOUT_DECK 1 /* Whether or not to include the deck layout */
#define LAYOUT_COL 1 /* Whether or not to include the column layout */
#define LAYOUT_STAIRS 1 /* Whether or not to include the stairs layout */