mirror of
https://github.com/mintycube/dwm.git
synced 2024-10-22 14:05:45 +02: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:
|
||||
|
||||
2019-10-22 - Added ispermanent patch
|
||||
|
||||
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
|
||||
@ -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)
|
||||
- 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/)
|
||||
- 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_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 */
|
||||
{ "Gimp", NULL, NULL, NULL, 0, 1, 0, 1, -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 */
|
||||
{ "Gimp", NULL, NULL, NULL, 0, 0, 1, -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 */
|
||||
{ "Gimp", NULL, NULL, NULL, 0, 1, 1, -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 */
|
||||
{ "Gimp", NULL, NULL, 0, 1, 0, 1, -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 */
|
||||
{ "Gimp", NULL, NULL, NULL, 0, 1, -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 */
|
||||
{ "Gimp", NULL, NULL, 0, 1, 1, -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 */
|
||||
{ "Gimp", NULL, NULL, 0, 0, 1, -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
|
||||
/* class instance title tags mask isfloating monitor */
|
||||
{ "Gimp", NULL, NULL, 0, 1, -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
|
||||
|
13
dwm.c
13
dwm.c
@ -159,6 +159,9 @@ struct Client {
|
||||
#if CENTER_PATCH
|
||||
int iscentered;
|
||||
#endif // CENTER_PATCH
|
||||
#if ISPERMANENT_PATCH
|
||||
int ispermanent;
|
||||
#endif // ISPERMANENT_PATCH
|
||||
#if STICKY_PATCH
|
||||
int issticky;
|
||||
#endif // STICKY_PATCH
|
||||
@ -257,6 +260,9 @@ typedef struct {
|
||||
int iscentered;
|
||||
#endif // CENTER_PATCH
|
||||
int isfloating;
|
||||
#if ISPERMANENT_PATCH
|
||||
int ispermanent;
|
||||
#endif // ISPERMANENT_PATCH
|
||||
int monitor;
|
||||
} Rule;
|
||||
|
||||
@ -468,6 +474,9 @@ applyrules(Client *c)
|
||||
#if CENTER_PATCH
|
||||
c->iscentered = r->iscentered;
|
||||
#endif // CENTER_PATCH
|
||||
#if ISPERMANENT_PATCH
|
||||
c->ispermanent = r->ispermanent;
|
||||
#endif // ISPERMANENT_PATCH
|
||||
c->isfloating = r->isfloating;
|
||||
c->tags |= r->tags;
|
||||
for (m = mons; m && m->num != r->monitor; m = m->next);
|
||||
@ -1837,7 +1846,11 @@ keypress(XEvent *e)
|
||||
void
|
||||
killclient(const Arg *arg)
|
||||
{
|
||||
#if ISPERMANENT_PATCH
|
||||
if (!selmon->sel || selmon->sel->ispermanent)
|
||||
#else
|
||||
if (!selmon->sel)
|
||||
#endif // ISPERMANENT_PATCH
|
||||
return;
|
||||
#if SYSTRAY_PATCH
|
||||
if (!sendevent(selmon->sel->win, wmatom[WMDelete], NoEventMask, wmatom[WMDelete], CurrentTime, 0, 0, 0)) {
|
||||
|
@ -199,6 +199,11 @@
|
||||
*/
|
||||
#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).
|
||||
* 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
|
||||
|
Loading…
Reference in New Issue
Block a user