mirror of
https://github.com/mintycube/dwm.git
synced 2024-10-22 12:05:45 +00:00
Adding ispermanent patch
This commit is contained in:
parent
3279c8747a
commit
71e61d180e
@ -15,6 +15,8 @@ Refer to [https://dwm.suckless.org/](https://dwm.suckless.org/) for details on t
|
|||||||
|
|
||||||
### Changelog:
|
### Changelog:
|
||||||
|
|
||||||
|
2019-10-22 - Added ispermanent patch
|
||||||
|
|
||||||
2019-10-16 - Introduced [flexipatch-finalizer](https://github.com/bakkeby/flexipatch-finalizer)
|
2019-10-16 - Introduced [flexipatch-finalizer](https://github.com/bakkeby/flexipatch-finalizer)
|
||||||
|
|
||||||
2019-10-11 - Added the patch to ignore Xft errors when drawing text in the status bar
|
2019-10-11 - Added the patch to ignore Xft errors when drawing text in the status bar
|
||||||
@ -160,6 +162,9 @@ Refer to [https://dwm.suckless.org/](https://dwm.suckless.org/) for details on t
|
|||||||
- sometimes dwm crashes when it cannot render some glyphs in window titles (usually emoji)
|
- sometimes dwm crashes when it cannot render some glyphs in window titles (usually emoji)
|
||||||
- this patch is essentially a hack to ignore any errors when drawing text on the status bar and may be removed if a more appropriate solution comes up
|
- this patch is essentially a hack to ignore any errors when drawing text on the status bar and may be removed if a more appropriate solution comes up
|
||||||
|
|
||||||
|
- [ispermanent](https://dwm.suckless.org/patches/ispermanent/)
|
||||||
|
- adds rule option for clients to avoid accidental termination by killclient for sticky windows
|
||||||
|
|
||||||
- [leftlayout](http://dwm.suckless.org/patches/leftlayout/)
|
- [leftlayout](http://dwm.suckless.org/patches/leftlayout/)
|
||||||
- moves the layout symbol in the status bar to the left hand side
|
- moves the layout symbol in the status bar to the left hand side
|
||||||
|
|
||||||
|
48
config.def.h
48
config.def.h
@ -186,39 +186,71 @@ static const Rule rules[] = {
|
|||||||
* WM_NAME(STRING) = title
|
* WM_NAME(STRING) = title
|
||||||
* WM_WINDOW_ROLE(STRING) = role
|
* WM_WINDOW_ROLE(STRING) = role
|
||||||
*/
|
*/
|
||||||
#if WINDOWROLERULE_PATCH && SWITCHTAG_PATCH && CENTER_PATCH
|
#if WINDOWROLERULE_PATCH && SWITCHTAG_PATCH && CENTER_PATCH && ISPERMANENT_PATCH
|
||||||
|
/* class role instance title tags mask switchtag iscentered isfloating ispermanent monitor */
|
||||||
|
{ "Gimp", NULL, NULL, NULL, 0, 1, 0, 1, 0, -1 },
|
||||||
|
{ "Firefox", NULL, NULL, NULL, 1 << 8, 1, 0, 0, 0, -1 },
|
||||||
|
#elif WINDOWROLERULE_PATCH && SWITCHTAG_PATCH && CENTER_PATCH && !ISPERMANENT_PATCH
|
||||||
/* class role instance title tags mask switchtag iscentered isfloating monitor */
|
/* class role instance title tags mask switchtag iscentered isfloating monitor */
|
||||||
{ "Gimp", NULL, NULL, NULL, 0, 1, 0, 1, -1 },
|
{ "Gimp", NULL, NULL, NULL, 0, 1, 0, 1, -1 },
|
||||||
{ "Firefox", NULL, NULL, NULL, 1 << 8, 1, 0, 0, -1 },
|
{ "Firefox", NULL, NULL, NULL, 1 << 8, 1, 0, 0, -1 },
|
||||||
#elif WINDOWROLERULE_PATCH && !SWITCHTAG_PATCH && CENTER_PATCH
|
#elif WINDOWROLERULE_PATCH && !SWITCHTAG_PATCH && CENTER_PATCH && ISPERMANENT_PATCH
|
||||||
|
/* class role instance title tags mask iscentered isfloating ispermanent monitor */
|
||||||
|
{ "Gimp", NULL, NULL, NULL, 0, 0, 1, 0, -1 },
|
||||||
|
{ "Firefox", NULL, NULL, NULL, 1 << 8, 0, 0, 0, -1 },
|
||||||
|
#elif WINDOWROLERULE_PATCH && !SWITCHTAG_PATCH && CENTER_PATCH && !ISPERMANENT_PATCH
|
||||||
/* class role instance title tags mask iscentered isfloating monitor */
|
/* class role instance title tags mask iscentered isfloating monitor */
|
||||||
{ "Gimp", NULL, NULL, NULL, 0, 0, 1, -1 },
|
{ "Gimp", NULL, NULL, NULL, 0, 0, 1, -1 },
|
||||||
{ "Firefox", NULL, NULL, NULL, 1 << 8, 0, 0, -1 },
|
{ "Firefox", NULL, NULL, NULL, 1 << 8, 0, 0, -1 },
|
||||||
#elif WINDOWROLERULE_PATCH && SWITCHTAG_PATCH && !CENTER_PATCH
|
#elif WINDOWROLERULE_PATCH && SWITCHTAG_PATCH && !CENTER_PATCH && ISPERMANENT_PATCH
|
||||||
|
/* class role instance title tags mask switchtag isfloating ispermanent monitor */
|
||||||
|
{ "Gimp", NULL, NULL, NULL, 0, 1, 1, 0, -1 },
|
||||||
|
{ "Firefox", NULL, NULL, NULL, 1 << 8, 1, 0, 0, -1 },
|
||||||
|
#elif WINDOWROLERULE_PATCH && SWITCHTAG_PATCH && !CENTER_PATCH && !ISPERMANENT_PATCH
|
||||||
/* class role instance title tags mask switchtag isfloating monitor */
|
/* class role instance title tags mask switchtag isfloating monitor */
|
||||||
{ "Gimp", NULL, NULL, NULL, 0, 1, 1, -1 },
|
{ "Gimp", NULL, NULL, NULL, 0, 1, 1, -1 },
|
||||||
{ "Firefox", NULL, NULL, NULL, 1 << 8, 1, 0, -1 },
|
{ "Firefox", NULL, NULL, NULL, 1 << 8, 1, 0, -1 },
|
||||||
#elif !WINDOWROLERULE_PATCH && SWITCHTAG_PATCH && CENTER_PATCH
|
#elif !WINDOWROLERULE_PATCH && SWITCHTAG_PATCH && CENTER_PATCH && ISPERMANENT_PATCH
|
||||||
|
/* class instance title tags mask switchtag iscentered isfloating ispermanent monitor */
|
||||||
|
{ "Gimp", NULL, NULL, 0, 1, 0, 1, 0, -1 },
|
||||||
|
{ "Firefox", NULL, NULL, 1 << 8, 1, 0, 0, 0, -1 },
|
||||||
|
#elif !WINDOWROLERULE_PATCH && SWITCHTAG_PATCH && CENTER_PATCH && !ISPERMANENT_PATCH
|
||||||
/* class instance title tags mask switchtag iscentered isfloating monitor */
|
/* class instance title tags mask switchtag iscentered isfloating monitor */
|
||||||
{ "Gimp", NULL, NULL, 0, 1, 0, 1, -1 },
|
{ "Gimp", NULL, NULL, 0, 1, 0, 1, -1 },
|
||||||
{ "Firefox", NULL, NULL, 1 << 8, 1, 0, 0, -1 },
|
{ "Firefox", NULL, NULL, 1 << 8, 1, 0, 0, -1 },
|
||||||
#elif WINDOWROLERULE_PATCH && !SWITCHTAG_PATCH && !CENTER_PATCH
|
#elif WINDOWROLERULE_PATCH && !SWITCHTAG_PATCH && !CENTER_PATCH && ISPERMANENT_PATCH
|
||||||
|
/* class role instance title tags mask isfloating ispermanent monitor */
|
||||||
|
{ "Gimp", NULL, NULL, NULL, 0, 1, 0, -1 },
|
||||||
|
{ "Firefox", NULL, NULL, NULL, 1 << 8, 0, 0, -1 },
|
||||||
|
#elif WINDOWROLERULE_PATCH && !SWITCHTAG_PATCH && !CENTER_PATCH && !ISPERMANENT_PATCH
|
||||||
/* class role instance title tags mask isfloating monitor */
|
/* class role instance title tags mask isfloating monitor */
|
||||||
{ "Gimp", NULL, NULL, NULL, 0, 1, -1 },
|
{ "Gimp", NULL, NULL, NULL, 0, 1, -1 },
|
||||||
{ "Firefox", NULL, NULL, NULL, 1 << 8, 0, -1 },
|
{ "Firefox", NULL, NULL, NULL, 1 << 8, 0, -1 },
|
||||||
#elif !WINDOWROLERULE_PATCH && SWITCHTAG_PATCH && !CENTER_PATCH
|
#elif !WINDOWROLERULE_PATCH && SWITCHTAG_PATCH && !CENTER_PATCH && ISPERMANENT_PATCH
|
||||||
|
/* class instance title tags mask switchtag isfloating ispermanent monitor */
|
||||||
|
{ "Gimp", NULL, NULL, 0, 1, 1, 0, -1 },
|
||||||
|
{ "Firefox", NULL, NULL, 1 << 8, 1, 0, 0, -1 },
|
||||||
|
#elif !WINDOWROLERULE_PATCH && SWITCHTAG_PATCH && !CENTER_PATCH && !ISPERMANENT_PATCH
|
||||||
/* class instance title tags mask switchtag isfloating monitor */
|
/* class instance title tags mask switchtag isfloating monitor */
|
||||||
{ "Gimp", NULL, NULL, 0, 1, 1, -1 },
|
{ "Gimp", NULL, NULL, 0, 1, 1, -1 },
|
||||||
{ "Firefox", NULL, NULL, 1 << 8, 1, 0, -1 },
|
{ "Firefox", NULL, NULL, 1 << 8, 1, 0, -1 },
|
||||||
#elif !WINDOWROLERULE_PATCH && !SWITCHTAG_PATCH && CENTER_PATCH
|
#elif !WINDOWROLERULE_PATCH && !SWITCHTAG_PATCH && CENTER_PATCH && ISPERMANENT_PATCH
|
||||||
|
/* class instance title tags mask iscentered isfloating ispermanent monitor */
|
||||||
|
{ "Gimp", NULL, NULL, 0, 0, 1, 0, -1 },
|
||||||
|
{ "Firefox", NULL, NULL, 1 << 8, 0, 0, 0, -1 },
|
||||||
|
#elif !WINDOWROLERULE_PATCH && !SWITCHTAG_PATCH && CENTER_PATCH && !ISPERMANENT_PATCH
|
||||||
/* class instance title tags mask iscentered isfloating monitor */
|
/* class instance title tags mask iscentered isfloating monitor */
|
||||||
{ "Gimp", NULL, NULL, 0, 0, 1, -1 },
|
{ "Gimp", NULL, NULL, 0, 0, 1, -1 },
|
||||||
{ "Firefox", NULL, NULL, 1 << 8, 0, 0, -1 },
|
{ "Firefox", NULL, NULL, 1 << 8, 0, 0, -1 },
|
||||||
|
#elif !WINDOWROLERULE_PATCH && !SWITCHTAG_PATCH && !CENTER_PATCH && ISPERMANENT_PATCH
|
||||||
|
/* class instance title tags mask isfloating ispermanent monitor */
|
||||||
|
{ "Gimp", NULL, NULL, 0, 1, 0, -1 },
|
||||||
|
{ "Firefox", NULL, NULL, 1 << 8, 0, 0, -1 },
|
||||||
#else
|
#else
|
||||||
/* class instance title tags mask isfloating monitor */
|
/* class instance title tags mask isfloating monitor */
|
||||||
{ "Gimp", NULL, NULL, 0, 1, -1 },
|
{ "Gimp", NULL, NULL, 0, 1, -1 },
|
||||||
{ "Firefox", NULL, NULL, 1 << 8, 0, -1 },
|
{ "Firefox", NULL, NULL, 1 << 8, 0, -1 },
|
||||||
#endif // granted the above will be confusing, do remember to delete rule entries for patches that you do not take
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
#if MONITOR_RULES_PATCH
|
#if MONITOR_RULES_PATCH
|
||||||
|
13
dwm.c
13
dwm.c
@ -159,6 +159,9 @@ struct Client {
|
|||||||
#if CENTER_PATCH
|
#if CENTER_PATCH
|
||||||
int iscentered;
|
int iscentered;
|
||||||
#endif // CENTER_PATCH
|
#endif // CENTER_PATCH
|
||||||
|
#if ISPERMANENT_PATCH
|
||||||
|
int ispermanent;
|
||||||
|
#endif // ISPERMANENT_PATCH
|
||||||
#if STICKY_PATCH
|
#if STICKY_PATCH
|
||||||
int issticky;
|
int issticky;
|
||||||
#endif // STICKY_PATCH
|
#endif // STICKY_PATCH
|
||||||
@ -257,6 +260,9 @@ typedef struct {
|
|||||||
int iscentered;
|
int iscentered;
|
||||||
#endif // CENTER_PATCH
|
#endif // CENTER_PATCH
|
||||||
int isfloating;
|
int isfloating;
|
||||||
|
#if ISPERMANENT_PATCH
|
||||||
|
int ispermanent;
|
||||||
|
#endif // ISPERMANENT_PATCH
|
||||||
int monitor;
|
int monitor;
|
||||||
} Rule;
|
} Rule;
|
||||||
|
|
||||||
@ -468,6 +474,9 @@ applyrules(Client *c)
|
|||||||
#if CENTER_PATCH
|
#if CENTER_PATCH
|
||||||
c->iscentered = r->iscentered;
|
c->iscentered = r->iscentered;
|
||||||
#endif // CENTER_PATCH
|
#endif // CENTER_PATCH
|
||||||
|
#if ISPERMANENT_PATCH
|
||||||
|
c->ispermanent = r->ispermanent;
|
||||||
|
#endif // ISPERMANENT_PATCH
|
||||||
c->isfloating = r->isfloating;
|
c->isfloating = r->isfloating;
|
||||||
c->tags |= r->tags;
|
c->tags |= r->tags;
|
||||||
for (m = mons; m && m->num != r->monitor; m = m->next);
|
for (m = mons; m && m->num != r->monitor; m = m->next);
|
||||||
@ -1837,7 +1846,11 @@ keypress(XEvent *e)
|
|||||||
void
|
void
|
||||||
killclient(const Arg *arg)
|
killclient(const Arg *arg)
|
||||||
{
|
{
|
||||||
|
#if ISPERMANENT_PATCH
|
||||||
|
if (!selmon->sel || selmon->sel->ispermanent)
|
||||||
|
#else
|
||||||
if (!selmon->sel)
|
if (!selmon->sel)
|
||||||
|
#endif // ISPERMANENT_PATCH
|
||||||
return;
|
return;
|
||||||
#if SYSTRAY_PATCH
|
#if SYSTRAY_PATCH
|
||||||
if (!sendevent(selmon->sel->win, wmatom[WMDelete], NoEventMask, wmatom[WMDelete], CurrentTime, 0, 0, 0)) {
|
if (!sendevent(selmon->sel->win, wmatom[WMDelete], NoEventMask, wmatom[WMDelete], CurrentTime, 0, 0, 0)) {
|
||||||
|
@ -199,6 +199,11 @@
|
|||||||
*/
|
*/
|
||||||
#define HOLDBAR_PATCH 0
|
#define HOLDBAR_PATCH 0
|
||||||
|
|
||||||
|
/* Adds rule option for clients to avoid accidental termination by killclient for sticky windows.
|
||||||
|
* https://dwm.suckless.org/patches/ispermanent/
|
||||||
|
*/
|
||||||
|
#define ISPERMANENT_PATCH 0
|
||||||
|
|
||||||
/* Sometimes dwm crashes when it cannot render some glyphs in window titles (usually emoji).
|
/* Sometimes dwm crashes when it cannot render some glyphs in window titles (usually emoji).
|
||||||
* This patch is essentially a hack to ignore any errors when drawing text on the status bar.
|
* This patch is essentially a hack to ignore any errors when drawing text on the status bar.
|
||||||
* https://groups.google.com/forum/m/#!topic/wmii/7bncCahYIww
|
* https://groups.google.com/forum/m/#!topic/wmii/7bncCahYIww
|
||||||
|
Loading…
x
Reference in New Issue
Block a user