Skip to content

Commit 090f8c4

Browse files
committed
Removed center patch and replaced with alwayscenter
1 parent 2310a4e commit 090f8c4

File tree

4 files changed

+22
-106
lines changed

4 files changed

+22
-106
lines changed

config.def.h

+7-7
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ static const Rule rules[] = {
5454
* WM_CLASS(STRING) = instance, class
5555
* WM_NAME(STRING) = title
5656
*/
57-
/* class instance title tags mask iscentered isfloating monitor */
58-
{ "discord", NULL, NULL, 1 << 7, 0, 0, 0^monitor},
59-
{ "steam", "steam", "Steam", 1 << 6, 0, 0, 0^monitor},
60-
{ "Spotify", NULL, NULL, 1 << 8, 0, 0, 1^monitor},
61-
{ "kdeconnect.app", NULL, NULL, 1 << 7, 0, 0, 1^monitor},
62-
{ "thunderbird", NULL, NULL, 1 << 6, 0, 0, 1^monitor},
63-
{ "Com.github.xournalpp.xournalpp",NULL,NULL,1 << 8, 0, 0, 0^monitor},
57+
/* class instance title tags mask isfloating monitor */
58+
{ "discord", NULL, NULL, 1 << 7, 0, 0^monitor},
59+
{ "steam", "steam", "Steam", 1 << 6, 0, 0^monitor},
60+
{ "Spotify", NULL, NULL, 1 << 8, 0, 1^monitor},
61+
{ "kdeconnect.app", NULL, NULL, 1 << 7, 0, 1^monitor},
62+
{ "thunderbird", NULL, NULL, 1 << 6, 0, 1^monitor},
63+
{ "Com.github.xournalpp.xournalpp",NULL,NULL,1 << 8, 0, 0^monitor},
6464
};
6565

6666
/* layout(s) */

dwm.c

+3-9
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ struct Client {
9696
int basew, baseh, incw, inch, maxw, maxh, minw, minh;
9797
int bw, oldbw;
9898
unsigned int tags;
99-
int isfixed, iscentered, isfloating, isurgent, neverfocus, oldstate, isfullscreen;
99+
int isfixed, isfloating, isurgent, neverfocus, oldstate, isfullscreen;
100100
Client *next;
101101
Client *snext;
102102
Monitor *mon;
@@ -150,7 +150,6 @@ typedef struct {
150150
const char *instance;
151151
const char *title;
152152
unsigned int tags;
153-
int iscentered;
154153
int isfloating;
155154
int monitor;
156155
} Rule;
@@ -307,7 +306,6 @@ applyrules(Client *c)
307306
XClassHint ch = { NULL, NULL };
308307

309308
/* rule matching */
310-
c->iscentered = 0;
311309
c->isfloating = 0;
312310
c->tags = 0;
313311
XGetClassHint(dpy, c->win, &ch);
@@ -320,7 +318,6 @@ applyrules(Client *c)
320318
&& (!r->class || strstr(class, r->class))
321319
&& (!r->instance || strstr(instance, r->instance)))
322320
{
323-
c->iscentered = r->iscentered;
324321
c->isfloating = r->isfloating;
325322
c->tags |= r->tags;
326323
for (m = mons; m && m->num != r->monitor; m = m->next);
@@ -1102,10 +1099,8 @@ manage(Window w, XWindowAttributes *wa)
11021099
updatewindowtype(c);
11031100
updatesizehints(c);
11041101
updatewmhints(c);
1105-
if (c->iscentered) {
1106-
c->x = c->mon->mx + (c->mon->mw - WIDTH(c)) / 2;
1107-
c->y = c->mon->my + (c->mon->mh - HEIGHT(c)) / 2;
1108-
}
1102+
c->x = c->mon->mx + (c->mon->mw - WIDTH(c)) / 2;
1103+
c->y = c->mon->my + (c->mon->mh - HEIGHT(c)) / 2;
11091104
XSelectInput(dpy, w, EnterWindowMask|FocusChangeMask|PropertyChangeMask|StructureNotifyMask);
11101105
grabbuttons(c, 0);
11111106
if (!c->isfloating)
@@ -2102,7 +2097,6 @@ updatewindowtype(Client *c)
21022097
if (state == netatom[NetWMFullscreen])
21032098
setfullscreen(c, 1);
21042099
if (wtype == netatom[NetWMWindowTypeDialog]) {
2105-
c->iscentered = 1;
21062100
c->isfloating = 1;
21072101
}
21082102
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
diff -up dwm/dwm.c dwmmod/dwm.c
2+
--- dwm/dwm.c 2020-06-25 00:21:30.383692180 -0300
3+
+++ dwmmod/dwm.c 2020-06-25 00:20:35.643692330 -0300
4+
@@ -1057,6 +1057,8 @@ manage(Window w, XWindowAttributes *wa)
5+
updatewindowtype(c);
6+
updatesizehints(c);
7+
updatewmhints(c);
8+
+ c->x = c->mon->mx + (c->mon->mw - WIDTH(c)) / 2;
9+
+ c->y = c->mon->my + (c->mon->mh - HEIGHT(c)) / 2;
10+
XSelectInput(dpy, w, EnterWindowMask|FocusChangeMask|PropertyChangeMask|StructureNotifyMask);
11+
grabbuttons(c, 0);
12+
if (!c->isfloating)

patches/dwm-center-6.2.diff

-90
This file was deleted.

0 commit comments

Comments
 (0)