Updated dwm-flexipatch to commit 8191c07 & ddb2e83
This is for fiixing focusonclick for hover related patches. - 8191c07: focusonclick: not skipping motionnotify events as to avoid interferring with tagpreview and other on hover patches - ddb2e83: tagpreview: adding compatibility with powerline tags and taglabels
This commit is contained in:
parent
b68fc4c64f
commit
fd31f4da70
|
@ -562,7 +562,7 @@ static const BarRule barrules[] = {
|
||||||
{ -1, 1, BAR_ALIGN_RIGHT, width_stbutton5, draw_stbutton5, click_stbutton5, NULL, "statusbutton5" },
|
{ -1, 1, BAR_ALIGN_RIGHT, width_stbutton5, draw_stbutton5, click_stbutton5, NULL, "statusbutton5" },
|
||||||
#endif // BAR_STATUSBUTTON_PATCH
|
#endif // BAR_STATUSBUTTON_PATCH
|
||||||
#if BAR_POWERLINE_TAGS_PATCH
|
#if BAR_POWERLINE_TAGS_PATCH
|
||||||
{ 0, 0, BAR_ALIGN_LEFT, width_pwrl_tags, draw_pwrl_tags, click_pwrl_tags, NULL, "powerline_tags" },
|
{ 0, 0, BAR_ALIGN_LEFT, width_pwrl_tags, draw_pwrl_tags, click_pwrl_tags, hover_pwrl_tags, "powerline_tags" },
|
||||||
#endif // BAR_POWERLINE_TAGS_PATCH
|
#endif // BAR_POWERLINE_TAGS_PATCH
|
||||||
#if BAR_TAGS_PATCH
|
#if BAR_TAGS_PATCH
|
||||||
{ -1, 0, BAR_ALIGN_LEFT, width_tags, draw_tags, click_tags, hover_tags, "tags" },
|
{ -1, 0, BAR_ALIGN_LEFT, width_tags, draw_tags, click_tags, hover_tags, "tags" },
|
||||||
|
|
|
@ -683,9 +683,7 @@ static void killclient(const Arg *arg);
|
||||||
static void manage(Window w, XWindowAttributes *wa);
|
static void manage(Window w, XWindowAttributes *wa);
|
||||||
static void mappingnotify(XEvent *e);
|
static void mappingnotify(XEvent *e);
|
||||||
static void maprequest(XEvent *e);
|
static void maprequest(XEvent *e);
|
||||||
#if !FOCUSONCLICK_PATCH
|
|
||||||
static void motionnotify(XEvent *e);
|
static void motionnotify(XEvent *e);
|
||||||
#endif // FOCUSONCLICK_PATCH
|
|
||||||
static void movemouse(const Arg *arg);
|
static void movemouse(const Arg *arg);
|
||||||
static Client *nexttiled(Client *c);
|
static Client *nexttiled(Client *c);
|
||||||
#if !ZOOMSWAP_PATCH || TAGINTOSTACK_ALLMASTER_PATCH || TAGINTOSTACK_ONEMASTER_PATCH
|
#if !ZOOMSWAP_PATCH || TAGINTOSTACK_ALLMASTER_PATCH || TAGINTOSTACK_ONEMASTER_PATCH
|
||||||
|
@ -821,9 +819,7 @@ static void (*handler[LASTEvent]) (XEvent *) = {
|
||||||
#endif // COMBO_PATCH / BAR_HOLDBAR_PATCH
|
#endif // COMBO_PATCH / BAR_HOLDBAR_PATCH
|
||||||
[MappingNotify] = mappingnotify,
|
[MappingNotify] = mappingnotify,
|
||||||
[MapRequest] = maprequest,
|
[MapRequest] = maprequest,
|
||||||
#if !FOCUSONCLICK_PATCH
|
|
||||||
[MotionNotify] = motionnotify,
|
[MotionNotify] = motionnotify,
|
||||||
#endif // FOCUSONCLICK_PATCH
|
|
||||||
[PropertyNotify] = propertynotify,
|
[PropertyNotify] = propertynotify,
|
||||||
#if BAR_SYSTRAY_PATCH
|
#if BAR_SYSTRAY_PATCH
|
||||||
[ResizeRequest] = resizerequest,
|
[ResizeRequest] = resizerequest,
|
||||||
|
@ -2706,12 +2702,13 @@ maprequest(XEvent *e)
|
||||||
manage(ev->window, &wa);
|
manage(ev->window, &wa);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !FOCUSONCLICK_PATCH
|
|
||||||
void
|
void
|
||||||
motionnotify(XEvent *e)
|
motionnotify(XEvent *e)
|
||||||
{
|
{
|
||||||
|
#if !FOCUSONCLICK_PATCH
|
||||||
static Monitor *mon = NULL;
|
static Monitor *mon = NULL;
|
||||||
Monitor *m;
|
Monitor *m;
|
||||||
|
#endif // FOCUSONCLICK_PATCH
|
||||||
Bar *bar;
|
Bar *bar;
|
||||||
#if LOSEFULLSCREEN_PATCH
|
#if LOSEFULLSCREEN_PATCH
|
||||||
Client *sel;
|
Client *sel;
|
||||||
|
@ -2728,6 +2725,7 @@ motionnotify(XEvent *e)
|
||||||
hidetagpreview(selmon);
|
hidetagpreview(selmon);
|
||||||
#endif // BAR_TAGPREVIEW_PATCH
|
#endif // BAR_TAGPREVIEW_PATCH
|
||||||
|
|
||||||
|
#if !FOCUSONCLICK_PATCH
|
||||||
if (ev->window != root)
|
if (ev->window != root)
|
||||||
return;
|
return;
|
||||||
if ((m = recttomon(ev->x_root, ev->y_root, 1, 1)) != mon && mon) {
|
if ((m = recttomon(ev->x_root, ev->y_root, 1, 1)) != mon && mon) {
|
||||||
|
@ -2742,8 +2740,8 @@ motionnotify(XEvent *e)
|
||||||
focus(NULL);
|
focus(NULL);
|
||||||
}
|
}
|
||||||
mon = m;
|
mon = m;
|
||||||
}
|
|
||||||
#endif // FOCUSONCLICK_PATCH
|
#endif // FOCUSONCLICK_PATCH
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
movemouse(const Arg *arg)
|
movemouse(const Arg *arg)
|
||||||
|
@ -5251,4 +5249,3 @@ main(int argc, char *argv[])
|
||||||
#endif // RESTARTSIG_PATCH
|
#endif // RESTARTSIG_PATCH
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -105,3 +105,57 @@ click_pwrl_tags(Bar *bar, Arg *arg, BarArg *a)
|
||||||
return ClkTagBar;
|
return ClkTagBar;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
hover_pwrl_tags(Bar *bar, BarArg *a, XMotionEvent *ev)
|
||||||
|
{
|
||||||
|
#if BAR_TAGPREVIEW_PATCH
|
||||||
|
int i = 0, x = lrpad / 2;
|
||||||
|
int px, py;
|
||||||
|
int plw = drw->fonts->h / 2 + 1;
|
||||||
|
Monitor *m = bar->mon;
|
||||||
|
#if VANITYGAPS_PATCH
|
||||||
|
int ov = gappov;
|
||||||
|
int oh = gappoh;
|
||||||
|
#else
|
||||||
|
int ov = 0;
|
||||||
|
int oh = 0;
|
||||||
|
#endif // VANITYGAPS_PATCH
|
||||||
|
|
||||||
|
#if BAR_HIDEVACANTTAGS_PATCH
|
||||||
|
Client *c;
|
||||||
|
unsigned int occ = 0;
|
||||||
|
for (c = bar->mon->clients; c; c = c->next)
|
||||||
|
occ |= c->tags == 255 ? 0 : c->tags;
|
||||||
|
#endif // BAR_HIDEVACANTTAGS_PATCH
|
||||||
|
|
||||||
|
do {
|
||||||
|
#if BAR_HIDEVACANTTAGS_PATCH
|
||||||
|
if (!(occ & 1 << i || bar->mon->tagset[bar->mon->seltags] & 1 << i))
|
||||||
|
continue;
|
||||||
|
#endif // BAR_HIDEVACANTTAGS_PATCH
|
||||||
|
x += TEXTW(tagicon(bar->mon, i)) + plw;
|
||||||
|
} while (a->x >= x && ++i < NUMTAGS);
|
||||||
|
|
||||||
|
if (i < NUMTAGS) {
|
||||||
|
if ((i + 1) != selmon->previewshow && !(selmon->tagset[selmon->seltags] & 1 << i)) {
|
||||||
|
if (bar->by > m->my + m->mh / 2) // bottom bar
|
||||||
|
py = bar->by - m->mh / scalepreview - oh;
|
||||||
|
else // top bar
|
||||||
|
py = bar->by + bar->bh + oh;
|
||||||
|
px = bar->bx + ev->x - m->mw / scalepreview / 2;
|
||||||
|
if (px + m->mw / scalepreview > m->mx + m->mw)
|
||||||
|
px = m->wx + m->ww - m->mw / scalepreview - ov;
|
||||||
|
else if (px < bar->bx)
|
||||||
|
px = m->wx + ov;
|
||||||
|
selmon->previewshow = i + 1;
|
||||||
|
showtagpreview(i, px, py);
|
||||||
|
} else if (selmon->tagset[selmon->seltags] & 1 << i) {
|
||||||
|
hidetagpreview(selmon);
|
||||||
|
}
|
||||||
|
} else if (selmon->previewshow != 0) {
|
||||||
|
hidetagpreview(selmon);
|
||||||
|
}
|
||||||
|
#endif // BAR_TAGPREVIEW_PATCH
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
static int width_pwrl_tags(Bar *bar, BarArg *a);
|
static int width_pwrl_tags(Bar *bar, BarArg *a);
|
||||||
static int draw_pwrl_tags(Bar *bar, BarArg *a);
|
static int draw_pwrl_tags(Bar *bar, BarArg *a);
|
||||||
static int click_pwrl_tags(Bar *bar, Arg *arg, BarArg *a);
|
static int click_pwrl_tags(Bar *bar, Arg *arg, BarArg *a);
|
||||||
|
static int hover_pwrl_tags(Bar *bar, BarArg *a, XMotionEvent *ev);
|
||||||
|
|
|
@ -105,18 +105,9 @@ hover_taglabels(Bar *bar, BarArg *a, XMotionEvent *ev)
|
||||||
int oh = 0;
|
int oh = 0;
|
||||||
#endif // VANITYGAPS_PATCH
|
#endif // VANITYGAPS_PATCH
|
||||||
|
|
||||||
#if BAR_HIDEVACANTTAGS_PATCH
|
|
||||||
Client *c;
|
|
||||||
unsigned int occ = 0;
|
|
||||||
for (c = bar->mon->clients; c; c = c->next)
|
|
||||||
occ |= c->tags == 255 ? 0 : c->tags;
|
|
||||||
#endif // BAR_HIDEVACANTTAGS_PATCH
|
|
||||||
|
|
||||||
do {
|
do {
|
||||||
#if BAR_HIDEVACANTTAGS_PATCH
|
if (!m->taglabel[i][0])
|
||||||
if (!(occ & 1 << i || bar->mon->tagset[bar->mon->seltags] & 1 << i))
|
|
||||||
continue;
|
continue;
|
||||||
#endif // BAR_HIDEVACANTTAGS_PATCH
|
|
||||||
x += TEXTW(m->taglabel[i]);
|
x += TEXTW(m->taglabel[i]);
|
||||||
} while (a->x >= x && ++i < NUMTAGS);
|
} while (a->x >= x && ++i < NUMTAGS);
|
||||||
|
|
||||||
|
|
|
@ -650,7 +650,7 @@
|
||||||
* client window that remains under the mouse cursor rather than the most recently focused window.
|
* client window that remains under the mouse cursor rather than the most recently focused window.
|
||||||
* https://github.com/bakkeby/patches/wiki/focusfollowmouse
|
* https://github.com/bakkeby/patches/wiki/focusfollowmouse
|
||||||
*/
|
*/
|
||||||
#define FOCUSFOLLOWMOUSE_PATCH 1
|
#define FOCUSFOLLOWMOUSE_PATCH 0
|
||||||
|
|
||||||
/* A simple patch that just puts focus back to the master client.
|
/* A simple patch that just puts focus back to the master client.
|
||||||
* https://dwm.suckless.org/patches/focusmaster/
|
* https://dwm.suckless.org/patches/focusmaster/
|
||||||
|
@ -660,7 +660,7 @@
|
||||||
/* Switch focus only by mouse click and not sloppy (focus follows mouse pointer).
|
/* Switch focus only by mouse click and not sloppy (focus follows mouse pointer).
|
||||||
* https://dwm.suckless.org/patches/focusonclick/
|
* https://dwm.suckless.org/patches/focusonclick/
|
||||||
*/
|
*/
|
||||||
#define FOCUSONCLICK_PATCH 0
|
#define FOCUSONCLICK_PATCH 1
|
||||||
|
|
||||||
/* Selects the next window having the urgent flag regardless of the tag it is on.
|
/* Selects the next window having the urgent flag regardless of the tag it is on.
|
||||||
* The urgent flag can be artificially set with the following xdotool command on any window:
|
* The urgent flag can be artificially set with the following xdotool command on any window:
|
||||||
|
|
Loading…
Reference in a new issue