about summary refs log tree commit diff stats
path: root/util.h
diff options
context:
space:
mode:
authorChris Down <chris@chrisdown.name>2021-12-18 16:58:23 +0000
committerHiltjo Posthuma <hiltjo@codemadness.org>2021-12-19 16:16:30 +0100
commit8657affa2a61e85ca8df76b62e43cb02897d1d80 (patch)
tree278fac042ed0989747aea5a80b8f1f5e92db4efa /util.h
parenta786211d6cb794fba0ea406d86002c7618998afc (diff)
downloaddwm-8657affa2a61e85ca8df76b62e43cb02897d1d80.tar.gz
drawbar: Don't expend effort drawing bar if it is occluded
I noticed that a non-trivial amount of dwm's work on my machine was from
drw_text, which seemed weird, because I have the bar disabled and we
only use drw_text as part of bar drawing.

Looking more closely, I realised that while we use m->showbar when
updating the monitor bar margins, but don't skip actually drawing the
bar if it is hidden. This patch skips drawing it entirely if that is the
case.

On my machine, this takes 10% of dwm's on-CPU time, primarily from
restack() and focus().

When the bar is toggled on again, the X server will generate an Expose
event, and we'll redraw the bar as normal as part of expose().
Diffstat (limited to 'util.h')
0 files changed, 0 insertions, 0 deletions
1457adc1df6a5ee'>57699011 ^
df8bb4c3 ^
88be3dbc ^
1ead3562 ^
f1e953d0 ^
bc643692 ^


f1e953d0 ^
1ead3562 ^
bc643692 ^

f1e953d0 ^
d7494165 ^

bc643692 ^

d7494165 ^
bc643692 ^


f1e953d0 ^
ec926027 ^




363be37f ^
b24eb476 ^
ca01193d ^
363be37f ^
50eab110 ^



1fa53058 ^


ec926027 ^
31401373 ^
ec926027 ^



ca01193d ^
363be37f ^
69e14325 ^
5eb49929 ^
e2240eb4 ^

363be37f ^
77cdc6d0 ^

dd2e01e4 ^
77cdc6d0 ^

31401373 ^
d72f3799 ^
0b0cfb6f ^
7284d503 ^
67573caf ^




7284d503 ^

b24eb476 ^

31401373 ^
67573caf ^
ec926027 ^
7c8493b3 ^

31401373 ^
795f5244 ^
ec926027 ^
dcfca05e ^

31401373 ^
1fa53058 ^



795f5244 ^
dcfca05e ^
f89378d5 ^
2142ccfc ^

f3760b0f ^
1b76245c ^
2142ccfc ^

f1a6f323 ^
9cf71627 ^
5810092d ^
513bfed8 ^




2142ccfc ^
77cdc6d0 ^

dd2e01e4 ^
77cdc6d0 ^

012d2ee1 ^
af085cf6 ^




3eeea0a2 ^

9cf71627 ^
5f98a10c ^

1ead3562 ^
2cb36cd0 ^

5f98a10c ^
2cb36cd0 ^

5f98a10c ^
1ead3562 ^
2cb36cd0 ^

5f98a10c ^
2cb36cd0 ^
7284d503 ^
64cf0a59 ^
69e14325 ^


df8bb4c3 ^
f6d47435 ^
95b2a140 ^
5eb49929 ^
31401373 ^
795f5244 ^
5eb49929 ^

f1e953d0 ^
ec926027 ^

ac0e9db5 ^
2e8c5d39 ^
77cdc6d0 ^
dd2e01e4 ^
77cdc6d0 ^


31401373 ^
b75e94b3 ^
9fdda88b ^
5f98a10c ^
8eff7919 ^
f6d47435 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168