Compare commits

...

140 Commits
5.7.2 ... 6.1

Author SHA1 Message Date
5ed9c48196 code-style consistency 2015-11-08 23:11:48 +01:00
3c91283ede unboolification 2015-11-08 22:48:43 +01:00
e941181f46 sort include + whitespace fix 2015-11-08 20:38:00 +01:00
43e82adf0d separate program-specific c99 bool and X11
True, False are X11-specific (int), make sure to use c99 stdbool for
program-specific things.
2015-11-08 20:35:25 +01:00
42cf1c7d8f Makefile: package all files with make dist 2015-11-08 16:52:53 +01:00
dce4fb3737 setfullscreen: don't process the property twice
Some clients try to set _NET_WM_STATE_FULLSCREEN even when the window is
already in fullscreen.
For example, c->oldstate was set two times in a raw and window would
then always be floating.
We must check that it's not the case before processing it.
(original patch modified with suggestion from Markus Teich
<markus.teich@stusta.mhn.de>)
2015-11-07 14:31:21 +01:00
646b351cc7 sync updated drw code from dmenu
important:
- drw_rect: didn't use w and h, change the dwm code accordingly.
- drw_text: text is NULL is not allowed, use drw_rect().
2015-10-20 23:38:31 +02:00
e3b7e1d620 dwm: use ecalloc, prevent theoretical overflow 2015-10-20 23:38:31 +02:00
04db03a4e6 cleanup, dont use c++ style comments
- signal: print error string.
- die: start message with lower-case (consistency).
- bump version to 2015.
2015-10-20 23:38:20 +02:00
4a4817b3aa dwm: cleanup: free schemes and cursors as array 2015-10-20 23:27:31 +02:00
7e1182ce55 config.h: use common default font, pass Xft font name to dmenu
dmenu uses Xft now (soon to be released).
2015-10-20 23:10:54 +02:00
40529e1469 config.mk: add $FREETYPELIBS and $FREETYPEINC, simpler to override (ports and *BSDs) 2015-10-20 23:01:49 +02:00
14343e69cc Add Xft and follback-fonts support to graphics lib 2015-03-13 21:44:22 +01:00
35db6d8afc removed .hgtags, thanks Dimitris for spotting 2014-11-23 15:25:35 +01:00
3d1090ba89 applied Hiltjo's resize/move limitation
"Limit the amount of updates when resizing or moving a window in floating
mode to 60 times per second. This makes resizing and moving alot smoother
and by limiting it it also uses alot less resources on my machine.
2014-08-11 07:24:29 +02:00
18248ebf4b same as before with dwm.c as well 2014-05-29 18:05:17 +02:00
b468873b2b updated copyright notice in LICENSE file 2014-05-29 18:02:12 +02:00
cdec9782a1 applied Lukas' focus suggestion at startup, thanks 2013-08-27 20:39:21 +02:00
6af273771c applied improved version of Martti Kühne's dmenu/multi monitor approach from dwm, no dmenuspawn required 2013-08-02 22:40:20 +02:00
4fb31e0896 do not take our font declaration as default for st 2013-07-20 09:08:46 +02:00
b800a1d136 applied Jochen's drw_text patch, thanks 2013-06-23 21:53:09 +02:00
33a74489f0 applied Julian's enum approach,
however renamed theme into scheme resp. Theme into ClrScheme
2013-06-19 19:35:33 +02:00
5364697914 finished libsl/drw integration 2013-06-16 15:20:29 +02:00
7edc596311 include font argument for st by default 2013-05-02 17:31:22 +02:00
68b400e95d added st to SEE ALSO section 2013-05-01 15:45:32 +02:00
656882d76f use st as default terminal from now on 2013-05-01 15:41:44 +02:00
1479e76f01 shut up about deprecated Xlib functions 2013-05-01 15:39:06 +02:00
f2544a3318 renamed draw into drw 2013-04-17 21:21:47 +02:00
aafeaf7317 continued with draw.c and draw.h implementation, now the integration begins 2012-12-09 19:11:11 +01:00
f21d46ea7d continued with draw.c abstraction, also started util.{h,c} implementation, that will be used by draw.c as well 2012-12-08 10:13:01 +01:00
c0ba635c50 removed DDC, all is Draw-dependent 2012-11-18 17:52:42 +01:00
0a673ad7a3 continued, distinction of Draw and DDC is bad, needs to be merged 2012-11-18 17:26:12 +01:00
3aabc08ede reverting the xkb dependency, I don't care if this function is deprecated, it seems it breaks other stuff instead. 2012-11-18 16:39:56 +01:00
d456617f0e basic draw.c structure 2012-11-18 12:04:29 +01:00
61fe833a06 reverting to plain X11 fonts in order to implement draw.c default 2012-11-18 10:56:54 +01:00
917e281634 removed obsolete bugs from BUGS file 2012-11-17 20:04:04 +01:00
31451c3ad3 compile fix 2012-11-17 19:12:10 +01:00
344f35f9f5 applied Neil Klopfstein's patch, slightly modified 2012-11-17 19:10:39 +01:00
87adcd263b starting with initial draw.h 2012-11-17 19:01:22 +01:00
fd3c19bd55 incorporating Xft instead of cairo, cairo provides far too many options 2012-11-02 12:17:50 +01:00
1bdb393f81 keep 6.1 intact 2012-07-08 09:45:53 +02:00
940feed314 reverted to old updategeom() after several complains, we need to optimize the old way 2012-07-08 09:43:11 +02:00
606b44179d applied James Turner's XkbKeycodeToKeysym patch, thanks 2012-06-23 20:12:49 +02:00
20f6917910 drastically changed updategeom() handling, see comment in updategeom() for details 2012-06-23 10:12:46 +02:00
820cbb3545 reversed Andreas Amann's fullscreen fix with the approach proposed by Gary Langshaw:
- idea is not supporting movemouse/resizemouse/togglefloating for fullscreen windows
- as fullscreen windows are broken anyways, they should only be adjusted by their own means
2012-06-23 09:06:00 +02:00
90f3238301 added kludge to fix some input focus misbehavior in gedit and anjuta, thanks Martti Kühne 2012-04-15 11:41:18 +02:00
3bfc43c3d0 applied Andreas Amanns' netwm_client_list patch, but with some indentation fixes 2012-03-25 17:49:35 +02:00
c1128417a9 applied Andreas Amann's netwm_active_window patch, thx 2012-03-25 17:46:03 +02:00
1b62f8fa58 applied Andreas Amann fullscreen fix, some minor modifications 2012-03-17 18:14:17 +01:00
54c3044dec unfocus on slow sloppy monitor focus 2012-02-10 00:36:08 +00:00
51336aa4a3 applied Eckehard Berns fix fix, sorry that this took so long 2012-02-08 19:54:05 +01:00
c4b6ac812e added 20h's clarification 2012-01-22 20:23:49 +01:00
873bcb97a9 applied Eckehard Berns barwin leak fix and his suggestion to deal with restack() -- the latter aspect needs further investigation. 2012-01-12 07:36:05 +01:00
907db0a851 config.mk cleanup 2012-01-04 13:30:12 +01:00
4e7c469862 Added tag 6.0 for changeset ec4baab78314 2011-12-19 16:09:07 +01:00
26445a0dc9 bump version to 6.0 2011-12-19 15:38:30 +01:00
b5068e32e9 add sloppy monitor focus 2011-11-15 20:16:58 +01:00
f099d2d5b5 new default colour scheme 2011-11-06 20:36:23 +01:00
80a9da555e calculate window/monitor intersection 2011-11-06 20:31:29 +01:00
d21026f0a1 honour fullscreen hint on map 2011-11-06 20:30:06 +01:00
e5a1e77351 testing Brians multiscreen issue fix 2011-11-04 20:02:35 +01:00
8262d9e663 make ewmh dialog windows float 2011-11-02 12:01:28 +00:00
90af1ced3c allow 0 nmaster 2011-10-31 20:09:27 +01:00
5ccd42f807 fix big-border corner case 2011-10-30 12:14:34 +01:00
1586b7a02d added keyrelease remark to TODO 2011-10-29 10:57:27 +02:00
2420071f4c improve tile spacing 2011-10-28 23:45:12 +01:00
04c26574b8 add nmaster binds to manpage 2011-10-26 12:16:25 +01:00
b1a28ae1da apply nmaster patch 2011-10-25 20:40:46 +01:00
f68a01cd76 apply resize hints in floating layout 2011-10-25 20:08:08 +01:00
2b625eb73e hide clients to the left, not the right 2011-10-25 20:01:18 +01:00
0f1f30daca applied Connors cleanup patch of Eckehards proposed fix of applyrules(), thanks everyone involved 2011-08-15 18:44:12 +02:00
dec4850d05 applied Connors and Valentins patch to improve the unmapnotify handling of broken clients 2011-08-08 16:55:06 +00:00
0de4197cc5 applied Peter Hartlichs nice interim Xinerama and map fix patches, for debugging purposes I also added his transient test driver 2011-07-29 20:01:22 +02:00
a372248b80 applied anonymous code cleanup patch 2011-07-27 19:59:10 +02:00
69e7d7dfd3 added a marker for the flash fullscreen issue 2011-07-24 10:41:43 +01:00
c99fe7dd7d changed sleep 20 into sleep 1 in example script as suggested by Snader_LB 2011-07-20 18:56:10 +00:00
d6670a800d applied Connors aesthitic buf fix in tile(), thanks 2011-07-20 18:45:40 +00:00
6288c44697 applied Peters magic float mode bugfix 2011-07-20 18:36:15 +00:00
d5c5c52b30 applied lolilolicon's floating center patch, further investigation wrt his second issue reported needed 2011-07-20 18:33:19 +00:00
d0b4575bf4 thanks to recursions on IRC for his remark 2011-07-20 18:30:51 +00:00
03518ce49e Added tag 5.9 for changeset dd74622a4785 2011-07-10 21:25:23 +01:00
cd8bb06af5 enabled release flags 2011-07-10 21:24:17 +01:00
3150a8a1be applied Peters wintoclient/wintomon optimisation in enternotify() 2011-07-10 21:22:22 +01:00
b3c5f5435a removed unneeded offset recalculation, thanks Jukka, let's see if this breaks some other client 2011-07-10 21:18:50 +01:00
a692bdcf2b undo the focus optimisation patch for 5.9 2011-07-10 21:12:05 +01:00
d83454f6b7 applied Peters two patches, please test hg tip, if nothing breaks this is 5.9 2011-07-09 07:57:10 +01:00
27b0142203 applied Garys patch in a slightly modified way 2011-07-02 11:02:22 +02:00
867ba36030 applied Nicolas Capit's patch as interim solution until the multiscreen support is reworked in 6.0 2011-07-01 17:56:53 +01:00
e83f36db10 fixed scroll lock (thanks bogdan) 2011-06-27 20:12:42 +01:00
212f417e44 fix numlock (thanks mikhail) 2011-06-27 19:35:11 +01:00
3a392b8558 making enternotify less focus hungry 2011-06-25 09:07:28 +01:00
92fe06b501 applied Andreas Amann's patch from Oct 2010, thanks 2011-06-24 21:02:32 +01:00
6cf29bff33 applied Rudys barwidth patch, thanks Rudy 2011-06-17 20:22:54 +01:00
60c06a7cb4 don't check for monocle layout in zoom() exit condition 2011-06-14 22:28:16 +01:00
1147546122 Thanks for the pedantic review :) 2011-06-14 05:51:21 +01:00
d384cee751 fixing some minor issues, next week is dwm-5.9 release time 2011-06-11 08:33:20 +01:00
5c710cf89c rm draw.c from 5.9 branch 2011-06-04 23:02:00 +01:00
8a111c181e fix typo 2011-06-04 10:18:54 +01:00
2255bf46a0 cleaner drawing 2011-06-04 10:17:25 +01:00
04797343db update draw.c 2011-05-21 20:26:26 +01:00
e7d41cc188 added draw.h, draw.c 2011-05-20 19:10:26 +01:00
22d8818850 applied Evil_Bobs cleanup patch 2011-05-12 14:16:33 +00:00
6784429c3c applied another minor change to the README 2011-04-27 15:55:18 +00:00
37fea84de8 applied Thomas' README patch 2011-04-27 12:38:59 +00:00
c14d293e51 applied Jack's mplayer fullscreen patch 2011-04-26 08:13:39 +00:00
79b1657a19 missed declaration 2011-04-15 08:13:06 +00:00
d24837f1ad minor fix of the NetActiveWindow multi-monitor flaw, slight rearrangement 2011-04-15 08:12:20 +00:00
3c2d303c0e applied Peter/Andreas NetActiveWindow patch in a slightly modified version 2011-04-14 13:46:25 +00:00
1e20a0f78a applied Brendan MacDonell's WM_TAKE_FOCUS patch, thanks Brendan! 2011-04-12 20:19:32 +00:00
96f9855248 applied another patch of Hiltjo, thanks 2011-03-25 14:06:46 +00:00
3c48858ffa applied Hiltjos' BUGS patch from 23 Mar, sorry took a while :) 2011-03-25 13:57:54 +00:00
dd46d5b588 applied Hiltjo's multimon mouse-based resize fix 2011-03-23 08:58:57 +00:00
0bc4e41ebd applied anonymous patch, I don't think the reversed array access has semantic side-effects 2011-01-07 16:05:22 +00:00
703c4dd253 added a todo 2010-12-02 10:16:47 +00:00
b68528d85d applied Hiltjo's cleanup patch 2010-11-19 11:53:59 +00:00
a644baf674 applied Hiltjo's tiny cleanup fix 2010-09-27 07:53:44 +00:00
c1f8688bfa applied Hiltjo's tiny cleanup patch, thanks! 2010-09-25 13:39:08 +00:00
bea4dd2490 does this make a difference? 2010-09-11 19:00:18 +00:00
83d10be1c1 added TODO and bumped version to 5.9 2010-08-24 13:13:20 +01:00
1529058f27 applied Hiltjo Posthuma's line saver patch 2010-08-23 17:25:53 +01:00
36311d88af applied Hiltjo Posthuma's double-XineramaQueryScreens() patch, thanks Hiltjo! 2010-07-25 09:58:25 +01:00
f1a2a3c850 Added tag 5.8.2 for changeset a043f0800805 2010-06-04 11:41:16 +01:00
ee734fae6b increased version 2010-05-30 10:03:09 +01:00
62d3caa999 implemented better fullscreen handling, please test 2010-05-30 10:02:56 +01:00
4c9b397ff9 Added tag 5.8.1 for changeset 1ed1e75c9c2e 2010-05-29 12:48:18 +01:00
5c6545adf5 removing Sylvain's patch because it breaks more than it fixes unfortunately, re-issuing a bugfix release 5.8.1 2010-05-29 12:48:11 +01:00
a704b1ee34 Added tag 5.8 for changeset 60ea8fed13ab 2010-05-28 11:43:44 +01:00
f83d61dfe8 removed DEBUG code and added 2010 to the copyright list 2010-05-27 08:20:42 +01:00
c6180949a7 applied Sylvain Laurent's EWMH fullscreen state patch, simplified his patch a bit 2010-05-27 08:19:08 +01:00
1973ab0643 added the related bug reported by voltaic 2010-04-11 18:42:32 +01:00
427053f8d1 pretty printing bugs a bit 2010-04-01 22:34:46 +01:00
a88e0373ef selmon optimisation is needed 2010-04-01 19:39:24 +01:00
aa9f2be24e more debug output, experimental focus optimisation 2010-04-01 00:14:15 +01:00
c53b29e60b quick typo fix 2010-03-31 23:27:30 +01:00
d6bdd03d91 it's debug season for upcoming dwm 5.8, so only use this if you really want to run experimental code or debug code 2010-03-31 23:24:22 +01:00
1144e98394 another bug report 2009-11-25 13:56:17 +00:00
7671d03a90 removed misleading comment, thanks Romain Bertrand 2009-11-24 09:31:17 +00:00
bc554d45d8 added nsz's last bug corner case 2009-11-23 08:13:18 +00:00
ac4caea921 added BUGS, next version is 5.8 2009-10-31 11:45:56 +00:00
161f2d921b Added tag 5.7.2 for changeset 15761ac5e2f1 2009-09-27 20:20:14 +01:00
15 changed files with 1597 additions and 914 deletions

67
.hgtags
View File

@ -1,67 +0,0 @@
d31b5ad96b0ba7b5b0a30928fcf000428339a577 0.1
0a6472e2203994bc5738d40a340d26f7ec9d6062 0.2
7e66082e5092fb0bccd18a3695a0bec52c80fdb2 0.3
eb3165734f00fe7f7da8aeebaed00e60a57caac9 0.4
22213b9a2114167ee8ba019a012e27da0422a61a 0.5
c11f86db4550cac5d0a648a3fe4d6d3b9a4fcf7e 0.6
3fb41412e2492f66476d92ce8f007a8b48fb1d2a 0.7
cd15de32e173f8ce97bfe1c9b6607937b59056b4 0.8
fae61afa861755636c4a1070694209ace8efbb6c 0.9
bbc98e77ae89a7c9232a5be0835f60ea00d8036e 1.0
44a55e6e46bf6c231780b09d919977d6f01083de 1.1
e3179ce2b90451d2807cd53b589d768412b8666b 1.2
f5f5cbf016a94b48a8fe9c47f0736e96d166d5d4 1.3
3cff9403766bf83a9fc2a0aef230115d68de2a8e 1.4
728c9089b079721b43c3347124639a29baa22a97 1.5
ad3fa2d185426c51fd5deceae809770363f8d33c 1.6
4dbdb61c8b8ce21dee5c7050a6b103855964ed20 1.7
d5ad819f2a66a40fa75dd2e44429f3bfc884d07b 1.7.1
c71952fa3c7ca848ec38a6923b5c6d0e18fff431 1.8
a5567a0d30112822db2627a04a2e7aa3b6c38148 1.9
12deea36603da407e3f32640048846a3bd74a9ec 2.0
a2c465098a3b972bbed00feda9804b6aae1e9531 2.1
7e92f58754ae6edb3225f26d754bd89c1ff458cf 2.2
719b37b37b0df829d7cf017ac70e353088fe5849 2.3
32b246925086910d63147483160281a91a47479f 2.4
dcbbfabc8ecc5f33a6cc950584de87da1a368045 2.5
c7f84f23ec5aef29988dcdc4ec22a7352ee8f58e 2.5.1
5308dd22b6ee8e3218c81d9e7e4125f235bb5778 2.6
21951c0dfbae5af68ed77821a4d87253ee91803f 2.7
107719a9ce3bd0c79f9f1f626596eb338a276561 2.8
3a5910fac3ccb522a98aeeba7af7008530b25092 2.9
76b58d21ea98257c05565a3b9c850b9b26a32968 3.0
e1c8bef05e6e48df4f26471ea0712aa43ab9d949 3.1
4ce65f61f01b055fa6c2901c6d2527ef741aa4bf 3.2
f2cabc83a18f9b5b548159329ddd4dee904fa31f 3.2.1
d3876aa792923f9a95f7ad0c7f0134533404df35 3.2.2
0f91934037b04221ff5d1ba3a6c39c1ff26e3661 3.3
9ede7b2d2450537e750d5505789fbe63960e97e6 3.4
63ad05e7f9e1f4f1881fb02f529cb6c6ae81e693 3.5
75b1b25fe0d7e29400baf30568153f668324928b 3.6
20ec6976cee1fcfee0c2f354ae382ee3f9f68efa 3.6.1
baee494346e520f8dee2cee9491b8350064770d2 3.7
2ea201354cf016407ea93e1e390d1422940d29b0 3.8
55478328b2422c700c5404a774c85e77322f41a3 3.9
018c3846842291cb6c009dc087e7fe2f0ef53bea 4.0
00f4180df72b49aadb2933804fde4bfb33e5666d 4.1
c13cb8c6b7a56af74cc88346e71d2490470b546f 4.2
e0ec0d5d8b1ef3ee04a83c7c0fee5853aa2ac6a6 4.3
408014d2126153d2b0fce26a13ba707db222b7b9 4.4
7c117df5d202530e85066d8b1ab02cef605c79ad 4.4.1
2acc60d6dfe28c101a8cd44a8aa710a38ae3607c 4.5
bcd7e18e196a00cc2e97ff3a4a58f3cdaba13856 4.6
d6d3085307d8d98b8b012b669e858fd787befeb1 4.7
607015ddb091d49cbd3457af41713691aa69f4d6 4.8
22c669b2dd3673785c3476b9976da21e8783f745 4.9
06eb9644e2dad7667d97495eb7d7bc62aa0429e8 5.0
ce355cea9bb89e162f61913737a46908cdfa7e45 5.1
e4bcaca8e6ef13d2c3b81f1218ad15e5da4d68bd 5.2
4004d61160355d869a7d2672561caad440751ba0 5.3
335301ed102fec9b1a15d06bfa0184d53b38fa54 5.3.1
8b7836a471f8f9ee61bec980df00971888d76343 5.4
85a78d8afa0fe8b106a8223b5327e5bddb5dd5e3 5.4.1
deaa276abac17ca08fbeb936916e4c8292d293a4 5.5
5550702215773aad462f22a774dced9b87437c51 5.6
e47a47bd3ed42fd3cf023572147b75ebc2adef82 5.6.1
257403d4cd962cac03344a871ea56cc742bae38e 5.7
48c3f87c335d6606e55fbae97267fa6b39ca56e0 5.7.1

44
BUGS Normal file
View File

@ -0,0 +1,44 @@
---
18:17 < Biolunar> when i change my resolution in dwm (to a smaller one) and then back to the native, the top bar is not repainted. that's since 5.7.2, in 5.6 it worked fine
18:19 < Biolunar> is it just happening to me or a (known) bug?
18:24 < Biolunar> and in addition, mplayers fullscreen is limited to the small resolution after i changed it back to the native
reproducible with xrandr -s but not with --output and --mode, strange
---
yet another corner case:
open a terminal, focus another monitor, but without moving the mouse
pointer there
if there is no client on the other monitor to get the focus, then the
terminal will be unfocused but it will accept input
---
Donald Allen reported this:
starting emacs from dmenu in archlinux results in missing configure of emacs, but mod1-space or mod1-shift-space fix this problem. this problem is new and did not happen in 1.6 xorg servers
---
voltaic reports this:
When I use two monitors, one larger in resolution than the other, the
bar is drawn using the smaller x-dimension on both screens. I think
what's happening is that there are two bars drawn, but the short bar
is always on top of the long bar such that I can't see the information
under the short bar. If I switch to the small screen, hide the short
bar, and then switch to the large screen, the long bar is drawn
correctly.
A similar problem occurs when I have started dwm on a small resolution
monitor (laptop screen) and then I switch to a large external display.
When I do this, the bar itself is drawn for the original smaller
resolution, but the information to be printed on the bar is
right-aligned for a longer bar. So what I see is a bar that has the
right hand side of it cut-off. See attached screenshot.
I am using standard options for xrandr such as --output VGA1 --auto, etc.
---

10
LICENSE
View File

@ -1,16 +1,18 @@
MIT/X Consortium License
© 2006-2009 Anselm R Garbe <garbeam at gmail dot com>
© 2006-2007 Sander van Dijk <a dot h dot vandijk at gmail dot com>
© 2006-2014 Anselm R Garbe <anselm@garbe.us>
© 2010-2014 Hiltjo Posthuma <hiltjo@codemadness.org>
© 2007-2011 Peter Hartlich <sgkkr at hartlich dot com>
© 2010-2011 Connor Lane Smith <cls@lubutu.com>
© 2006-2009 Jukka Salmi <jukka at salmi dot ch>
© 2007-2009 Premysl Hruby <dfenze at gmail dot com>
© 2007-2009 Szabolcs Nagy <nszabolcs at gmail dot com>
© 2007-2009 Christof Musik <christof at sendfax dot de>
© 2009 Mate Nagy <mnagy at port70 dot net>
© 2007-2008 Enno Gottox Boland <gottox at s01 dot de>
© 2007-2008 Peter Hartlich <sgkkr at hartlich dot com>
© 2008 Martin Hurton <martin dot hurton at gmail dot com>
© 2008 Neale Pickett <neale dot woozle dot org>
© 2009 Mate Nagy <mnagy@port70.net>
© 2006-2007 Sander van Dijk <a dot h dot vandijk at gmail dot com>
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),

View File

@ -3,7 +3,7 @@
include config.mk
SRC = dwm.c
SRC = drw.c dwm.c util.c
OBJ = ${SRC:.c=.o}
all: options dwm
@ -35,8 +35,8 @@ clean:
dist: clean
@echo creating dist tarball
@mkdir -p dwm-${VERSION}
@cp -R LICENSE Makefile README config.def.h config.mk \
dwm.1 ${SRC} dwm-${VERSION}
@cp -R LICENSE TODO BUGS Makefile README config.def.h config.mk \
dwm.1 drw.h util.h ${SRC} dwm.png transient.c dwm-${VERSION}
@tar -cf dwm-${VERSION}.tar dwm-${VERSION}
@gzip dwm-${VERSION}.tar
@rm -rf dwm-${VERSION}

5
README
View File

@ -38,10 +38,9 @@ the DISPLAY environment variable is set correctly, e.g.:
In order to display status info in the bar, you can do something
like this in your .xinitrc:
while true
while xsetroot -name "`date` `uptime | sed 's/.*,//'`"
do
xsetroot -name "`date` `uptime | sed 's/.*,//'`"
sleep 1
sleep 1
done &
exec dwm

4
TODO Normal file
View File

@ -0,0 +1,4 @@
- add a flag to Key to execute the command on release (needed for commands
affecting the keyboard grab, see scrot -s for example)
- add updategeom() hook for external tools like dzen
- consider onscreenkeyboard hooks for tablet deployment

View File

@ -1,30 +1,38 @@
/* See LICENSE file for copyright and license details. */
/* appearance */
static const char font[] = "-*-*-medium-*-*-*-14-*-*-*-*-*-*-*";
static const char normbordercolor[] = "#cccccc";
static const char normbgcolor[] = "#cccccc";
static const char normfgcolor[] = "#000000";
static const char selbordercolor[] = "#0066ff";
static const char selbgcolor[] = "#0066ff";
static const char selfgcolor[] = "#ffffff";
static const char *fonts[] = {
"monospace:size=10"
};
static const char dmenufont[] = "monospace:size=10";
static const char normbordercolor[] = "#444444";
static const char normbgcolor[] = "#222222";
static const char normfgcolor[] = "#bbbbbb";
static const char selbordercolor[] = "#005577";
static const char selbgcolor[] = "#005577";
static const char selfgcolor[] = "#eeeeee";
static const unsigned int borderpx = 1; /* border pixel of windows */
static const unsigned int snap = 32; /* snap pixel */
static const Bool showbar = True; /* False means no bar */
static const Bool topbar = True; /* False means bottom bar */
static const int showbar = 1; /* 0 means no bar */
static const int topbar = 1; /* 0 means bottom bar */
/* tagging */
static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
static const Rule rules[] = {
/* xprop(1):
* WM_CLASS(STRING) = instance, class
* WM_NAME(STRING) = title
*/
/* class instance title tags mask isfloating monitor */
{ "Gimp", NULL, NULL, 0, True, -1 },
{ "Firefox", NULL, NULL, 1 << 8, False, -1 },
{ "Gimp", NULL, NULL, 0, 1, -1 },
{ "Firefox", NULL, NULL, 1 << 8, 0, -1 },
};
/* layout(s) */
static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */
static const Bool resizehints = True; /* True means respect size hints in tiled resizals */
static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */
static const int nmaster = 1; /* number of clients in master area */
static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */
static const Layout layouts[] = {
/* symbol arrange function */
@ -45,8 +53,9 @@ static const Layout layouts[] = {
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
/* commands */
static const char *dmenucmd[] = { "dmenu_run", "-fn", font, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbgcolor, "-sf", selfgcolor, NULL };
static const char *termcmd[] = { "uxterm", NULL };
static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbgcolor, "-sf", selfgcolor, NULL };
static const char *termcmd[] = { "st", NULL };
static Key keys[] = {
/* modifier key function argument */
@ -55,6 +64,8 @@ static Key keys[] = {
{ MODKEY, XK_b, togglebar, {0} },
{ MODKEY, XK_j, focusstack, {.i = +1 } },
{ MODKEY, XK_k, focusstack, {.i = -1 } },
{ MODKEY, XK_i, incnmaster, {.i = +1 } },
{ MODKEY, XK_d, incnmaster, {.i = -1 } },
{ MODKEY, XK_h, setmfact, {.f = -0.05} },
{ MODKEY, XK_l, setmfact, {.f = +0.05} },
{ MODKEY, XK_Return, zoom, {0} },

View File

@ -1,5 +1,5 @@
# dwm version
VERSION = 5.7.2
VERSION = 6.1
# Customize below to fit your system
@ -10,20 +10,25 @@ MANPREFIX = ${PREFIX}/share/man
X11INC = /usr/X11R6/include
X11LIB = /usr/X11R6/lib
# Xinerama, un-comment if you want it
XINERAMALIBS = -L${X11LIB} -lXinerama
# Xinerama, comment if you don't want it
XINERAMALIBS = -lXinerama
XINERAMAFLAGS = -DXINERAMA
# freetype
FREETYPELIBS = -lfontconfig -lXft
FREETYPEINC = /usr/include/freetype2
# OpenBSD (uncomment)
#FREETYPEINC = ${X11INC}/freetype2
# includes and libs
INCS = -I. -I/usr/include -I${X11INC}
LIBS = -L/usr/lib -lc -L${X11LIB} -lX11 ${XINERAMALIBS}
INCS = -I${X11INC} -I${FREETYPEINC}
LIBS = -L${X11LIB} -lX11 ${XINERAMALIBS} ${FREETYPELIBS}
# flags
CPPFLAGS = -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS}
#CFLAGS = -g -std=c99 -pedantic -Wall -O0 ${INCS} ${CPPFLAGS}
CFLAGS = -std=c99 -pedantic -Wall -Os ${INCS} ${CPPFLAGS}
#LDFLAGS = -g ${LIBS}
LDFLAGS = -s ${LIBS}
CPPFLAGS = -D_BSD_SOURCE -D_POSIX_C_SOURCE=2 -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS}
#CFLAGS = -g -std=c99 -pedantic -Wall -O0 ${INCS} ${CPPFLAGS}
CFLAGS = -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os ${INCS} ${CPPFLAGS}
LDFLAGS = -s ${LIBS}
# Solaris
#CFLAGS = -fast ${INCS} -DVERSION=\"${VERSION}\"

398
drw.c Normal file
View File

@ -0,0 +1,398 @@
/* See LICENSE file for copyright and license details. */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <X11/Xlib.h>
#include <X11/Xft/Xft.h>
#include "drw.h"
#include "util.h"
#define UTF_INVALID 0xFFFD
#define UTF_SIZ 4
static const unsigned char utfbyte[UTF_SIZ + 1] = {0x80, 0, 0xC0, 0xE0, 0xF0};
static const unsigned char utfmask[UTF_SIZ + 1] = {0xC0, 0x80, 0xE0, 0xF0, 0xF8};
static const long utfmin[UTF_SIZ + 1] = { 0, 0, 0x80, 0x800, 0x10000};
static const long utfmax[UTF_SIZ + 1] = {0x10FFFF, 0x7F, 0x7FF, 0xFFFF, 0x10FFFF};
static long
utf8decodebyte(const char c, size_t *i)
{
for (*i = 0; *i < (UTF_SIZ + 1); ++(*i))
if (((unsigned char)c & utfmask[*i]) == utfbyte[*i])
return (unsigned char)c & ~utfmask[*i];
return 0;
}
static size_t
utf8validate(long *u, size_t i)
{
if (!BETWEEN(*u, utfmin[i], utfmax[i]) || BETWEEN(*u, 0xD800, 0xDFFF))
*u = UTF_INVALID;
for (i = 1; *u > utfmax[i]; ++i)
;
return i;
}
static size_t
utf8decode(const char *c, long *u, size_t clen)
{
size_t i, j, len, type;
long udecoded;
*u = UTF_INVALID;
if (!clen)
return 0;
udecoded = utf8decodebyte(c[0], &len);
if (!BETWEEN(len, 1, UTF_SIZ))
return 1;
for (i = 1, j = 1; i < clen && j < len; ++i, ++j) {
udecoded = (udecoded << 6) | utf8decodebyte(c[i], &type);
if (type)
return j;
}
if (j < len)
return 0;
*u = udecoded;
utf8validate(u, len);
return len;
}
Drw *
drw_create(Display *dpy, int screen, Window root, unsigned int w, unsigned int h)
{
Drw *drw;
drw = ecalloc(1, sizeof(Drw));
drw->dpy = dpy;
drw->screen = screen;
drw->root = root;
drw->w = w;
drw->h = h;
drw->drawable = XCreatePixmap(dpy, root, w, h, DefaultDepth(dpy, screen));
drw->gc = XCreateGC(dpy, root, 0, NULL);
drw->fontcount = 0;
XSetLineAttributes(dpy, drw->gc, 1, LineSolid, CapButt, JoinMiter);
return drw;
}
void
drw_resize(Drw *drw, unsigned int w, unsigned int h)
{
drw->w = w;
drw->h = h;
if (drw->drawable)
XFreePixmap(drw->dpy, drw->drawable);
drw->drawable = XCreatePixmap(drw->dpy, drw->root, w, h, DefaultDepth(drw->dpy, drw->screen));
}
void
drw_free(Drw *drw)
{
size_t i;
for (i = 0; i < drw->fontcount; i++)
drw_font_free(drw->fonts[i]);
XFreePixmap(drw->dpy, drw->drawable);
XFreeGC(drw->dpy, drw->gc);
free(drw);
}
/* This function is an implementation detail. Library users should use
* drw_font_create instead.
*/
static Fnt *
drw_font_xcreate(Drw *drw, const char *fontname, FcPattern *fontpattern)
{
Fnt *font;
XftFont *xfont = NULL;
FcPattern *pattern = NULL;
if (fontname) {
/* Using the pattern found at font->xfont->pattern does not yield same
* the same substitution results as using the pattern returned by
* FcNameParse; using the latter results in the desired fallback
* behaviour whereas the former just results in
* missing-character-rectangles being drawn, at least with some fonts.
*/
if (!(xfont = XftFontOpenName(drw->dpy, drw->screen, fontname))) {
fprintf(stderr, "error, cannot load font: '%s'\n", fontname);
return NULL;
}
if (!(pattern = FcNameParse((FcChar8 *) fontname))) {
fprintf(stderr, "error, cannot load font: '%s'\n", fontname);
XftFontClose(drw->dpy, xfont);
return NULL;
}
} else if (fontpattern) {
if (!(xfont = XftFontOpenPattern(drw->dpy, fontpattern))) {
fprintf(stderr, "error, cannot load font pattern.\n");
return NULL;
}
} else {
die("no font specified.\n");
}
font = ecalloc(1, sizeof(Fnt));
font->xfont = xfont;
font->pattern = pattern;
font->ascent = xfont->ascent;
font->descent = xfont->descent;
font->h = font->ascent + font->descent;
font->dpy = drw->dpy;
return font;
}
Fnt*
drw_font_create(Drw *drw, const char *fontname)
{
return drw_font_xcreate(drw, fontname, NULL);
}
void
drw_load_fonts(Drw* drw, const char *fonts[], size_t fontcount)
{
size_t i;
Fnt *font;
for (i = 0; i < fontcount; i++) {
if (drw->fontcount >= DRW_FONT_CACHE_SIZE) {
die("font cache exhausted.\n");
} else if ((font = drw_font_xcreate(drw, fonts[i], NULL))) {
drw->fonts[drw->fontcount++] = font;
}
}
}
void
drw_font_free(Fnt *font)
{
if (!font)
return;
if (font->pattern)
FcPatternDestroy(font->pattern);
XftFontClose(font->dpy, font->xfont);
free(font);
}
Clr *
drw_clr_create(Drw *drw, const char *clrname)
{
Clr *clr;
clr = ecalloc(1, sizeof(Clr));
if (!XftColorAllocName(drw->dpy, DefaultVisual(drw->dpy, drw->screen),
DefaultColormap(drw->dpy, drw->screen),
clrname, &clr->rgb))
die("error, cannot allocate color '%s'\n", clrname);
clr->pix = clr->rgb.pixel;
return clr;
}
void
drw_clr_free(Clr *clr)
{
free(clr);
}
void
drw_setscheme(Drw *drw, ClrScheme *scheme)
{
drw->scheme = scheme;
}
void
drw_rect(Drw *drw, int x, int y, unsigned int w, unsigned int h, int filled, int empty, int invert)
{
if (!drw->scheme)
return;
XSetForeground(drw->dpy, drw->gc, invert ? drw->scheme->bg->pix : drw->scheme->fg->pix);
if (filled)
XFillRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w + 1, h + 1);
else if (empty)
XDrawRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w, h);
}
int
drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, const char *text, int invert)
{
char buf[1024];
int tx, ty, th;
Extnts tex;
XftDraw *d = NULL;
Fnt *curfont, *nextfont;
size_t i, len;
int utf8strlen, utf8charlen, render;
long utf8codepoint = 0;
const char *utf8str;
FcCharSet *fccharset;
FcPattern *fcpattern;
FcPattern *match;
XftResult result;
int charexists = 0;
if (!drw->scheme || !drw->fontcount)
return 0;
if (!(render = x || y || w || h)) {
w = ~w;
} else {
XSetForeground(drw->dpy, drw->gc, invert ?
drw->scheme->fg->pix : drw->scheme->bg->pix);
XFillRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w, h);
d = XftDrawCreate(drw->dpy, drw->drawable,
DefaultVisual(drw->dpy, drw->screen),
DefaultColormap(drw->dpy, drw->screen));
}
curfont = drw->fonts[0];
while (1) {
utf8strlen = 0;
utf8str = text;
nextfont = NULL;
while (*text) {
utf8charlen = utf8decode(text, &utf8codepoint, UTF_SIZ);
for (i = 0; i < drw->fontcount; i++) {
charexists = charexists || XftCharExists(drw->dpy, drw->fonts[i]->xfont, utf8codepoint);
if (charexists) {
if (drw->fonts[i] == curfont) {
utf8strlen += utf8charlen;
text += utf8charlen;
} else {
nextfont = drw->fonts[i];
}
break;
}
}
if (!charexists || (nextfont && nextfont != curfont))
break;
else
charexists = 0;
}
if (utf8strlen) {
drw_font_getexts(curfont, utf8str, utf8strlen, &tex);
/* shorten text if necessary */
for (len = MIN(utf8strlen, (sizeof buf) - 1); len && (tex.w > w - drw->fonts[0]->h || w < drw->fonts[0]->h); len--)
drw_font_getexts(curfont, utf8str, len, &tex);
if (len) {
memcpy(buf, utf8str, len);
buf[len] = '\0';
if (len < utf8strlen)
for (i = len; i && i > len - 3; buf[--i] = '.');
if (render) {
th = curfont->ascent + curfont->descent;
ty = y + (h / 2) - (th / 2) + curfont->ascent;
tx = x + (h / 2);
XftDrawStringUtf8(d, invert ? &drw->scheme->bg->rgb : &drw->scheme->fg->rgb, curfont->xfont, tx, ty, (XftChar8 *)buf, len);
}
x += tex.w;
w -= tex.w;
}
}
if (!*text) {
break;
} else if (nextfont) {
charexists = 0;
curfont = nextfont;
} else {
/* Regardless of whether or not a fallback font is found, the
* character must be drawn.
*/
charexists = 1;
if (drw->fontcount >= DRW_FONT_CACHE_SIZE)
continue;
fccharset = FcCharSetCreate();
FcCharSetAddChar(fccharset, utf8codepoint);
if (!drw->fonts[0]->pattern) {
/* Refer to the comment in drw_font_xcreate for more
* information. */
die("the first font in the cache must be loaded from a font string.\n");
}
fcpattern = FcPatternDuplicate(drw->fonts[0]->pattern);
FcPatternAddCharSet(fcpattern, FC_CHARSET, fccharset);
FcPatternAddBool(fcpattern, FC_SCALABLE, FcTrue);
FcConfigSubstitute(NULL, fcpattern, FcMatchPattern);
FcDefaultSubstitute(fcpattern);
match = XftFontMatch(drw->dpy, drw->screen, fcpattern, &result);
FcCharSetDestroy(fccharset);
FcPatternDestroy(fcpattern);
if (match) {
curfont = drw_font_xcreate(drw, NULL, match);
if (curfont && XftCharExists(drw->dpy, curfont->xfont, utf8codepoint)) {
drw->fonts[drw->fontcount++] = curfont;
} else {
drw_font_free(curfont);
curfont = drw->fonts[0];
}
}
}
}
if (d)
XftDrawDestroy(d);
return x;
}
void
drw_map(Drw *drw, Window win, int x, int y, unsigned int w, unsigned int h)
{
XCopyArea(drw->dpy, drw->drawable, win, drw->gc, x, y, w, h, x, y);
XSync(drw->dpy, False);
}
void
drw_font_getexts(Fnt *font, const char *text, unsigned int len, Extnts *tex)
{
XGlyphInfo ext;
XftTextExtentsUtf8(font->dpy, font->xfont, (XftChar8 *)text, len, &ext);
tex->h = font->h;
tex->w = ext.xOff;
}
unsigned int
drw_font_getexts_width(Fnt *font, const char *text, unsigned int len)
{
Extnts tex;
drw_font_getexts(font, text, len, &tex);
return tex.w;
}
Cur *
drw_cur_create(Drw *drw, int shape)
{
Cur *cur;
cur = ecalloc(1, sizeof(Cur));
cur->cursor = XCreateFontCursor(drw->dpy, shape);
return cur;
}
void
drw_cur_free(Drw *drw, Cur *cursor)
{
if (!cursor)
return;
XFreeCursor(drw->dpy, cursor->cursor);
free(cursor);
}

74
drw.h Normal file
View File

@ -0,0 +1,74 @@
/* See LICENSE file for copyright and license details. */
#define DRW_FONT_CACHE_SIZE 32
typedef struct {
unsigned long pix;
XftColor rgb;
} Clr;
typedef struct {
Cursor cursor;
} Cur;
typedef struct {
Display *dpy;
int ascent;
int descent;
unsigned int h;
XftFont *xfont;
FcPattern *pattern;
} Fnt;
typedef struct {
Clr *fg;
Clr *bg;
Clr *border;
} ClrScheme;
typedef struct {
unsigned int w, h;
Display *dpy;
int screen;
Window root;
Drawable drawable;
GC gc;
ClrScheme *scheme;
size_t fontcount;
Fnt *fonts[DRW_FONT_CACHE_SIZE];
} Drw;
typedef struct {
unsigned int w;
unsigned int h;
} Extnts;
/* Drawable abstraction */
Drw *drw_create(Display *, int, Window, unsigned int, unsigned int);
void drw_resize(Drw *, unsigned int, unsigned int);
void drw_free(Drw *);
/* Fnt abstraction */
Fnt *drw_font_create(Drw *, const char *);
void drw_load_fonts(Drw *, const char *[], size_t);
void drw_font_free(Fnt *);
void drw_font_getexts(Fnt *, const char *, unsigned int, Extnts *);
unsigned int drw_font_getexts_width(Fnt *, const char *, unsigned int);
/* Colour abstraction */
Clr *drw_clr_create(Drw *, const char *);
void drw_clr_free(Clr *);
/* Cursor abstraction */
Cur *drw_cur_create(Drw *, int);
void drw_cur_free(Drw *, Cur *);
/* Drawing context manipulation */
void drw_setfont(Drw *, Fnt *);
void drw_setscheme(Drw *, ClrScheme *);
/* Drawing functions */
void drw_rect(Drw *, int, int, unsigned int, unsigned int, int, int, int);
int drw_text(Drw *, int, int, unsigned int, unsigned int, const char *, int);
/* Map functions */
void drw_map(Drw *, Window, int, int, unsigned int, unsigned int);

15
dwm.1
View File

@ -57,7 +57,7 @@ click on a tag label adds/removes that tag to/from the focused window.
.TP
.B Mod1\-Shift\-Return
Start
.BR uxterm (1).
.BR st(1).
.TP
.B Mod1\-,
Focus previous screen, if any.
@ -92,12 +92,18 @@ Focus next window.
.B Mod1\-k
Focus previous window.
.TP
.B Mod1\-h
Decrease master area size.
.B Mod1\-i
Increase clients in master area.
.TP
.B Mod1\-d
Decrease clients in master area.
.TP
.B Mod1\-l
Increase master area size.
.TP
.B Mod1\-h
Decrease master area size.
.TP
.B Mod1\-Return
Zooms/cycles focused window to/from master area (tiled layouts only).
.TP
@ -144,7 +150,8 @@ Resize focused window while dragging. Tiled windows will be toggled to the float
dwm is customized by creating a custom config.h and (re)compiling the source
code. This keeps it fast, secure and simple.
.SH SEE ALSO
.BR dmenu (1)
.BR dmenu (1),
.BR st (1)
.SH BUGS
Java applications which use the XToolkit/XAWT backend may draw grey windows
only. The XToolkit/XAWT backend breaks ICCCM-compliance in recent JDK 1.5 and early

1739
dwm.c

File diff suppressed because it is too large Load Diff

42
transient.c Normal file
View File

@ -0,0 +1,42 @@
/* cc transient.c -o transient -lX11 */
#include <stdlib.h>
#include <unistd.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
int main(void) {
Display *d;
Window r, f, t = None;
XSizeHints h;
XEvent e;
d = XOpenDisplay(NULL);
if (!d)
exit(1);
r = DefaultRootWindow(d);
f = XCreateSimpleWindow(d, r, 100, 100, 400, 400, 0, 0, 0);
h.min_width = h.max_width = h.min_height = h.max_height = 400;
h.flags = PMinSize | PMaxSize;
XSetWMNormalHints(d, f, &h);
XStoreName(d, f, "floating");
XMapWindow(d, f);
XSelectInput(d, f, ExposureMask);
while (1) {
XNextEvent(d, &e);
if (t == None) {
sleep(5);
t = XCreateSimpleWindow(d, r, 50, 50, 100, 100, 0, 0, 0);
XSetTransientForHint(d, t, f);
XStoreName(d, t, "transient");
XMapWindow(d, t);
XSelectInput(d, t, ExposureMask);
}
}
XCloseDisplay(d);
exit(0);
}

33
util.c Normal file
View File

@ -0,0 +1,33 @@
/* See LICENSE file for copyright and license details. */
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "util.h"
void *
ecalloc(size_t nmemb, size_t size)
{
void *p;
if (!(p = calloc(nmemb, size)))
perror(NULL);
return p;
}
void
die(const char *fmt, ...) {
va_list ap;
va_start(ap, fmt);
vfprintf(stderr, fmt, ap);
va_end(ap);
if (fmt[0] && fmt[strlen(fmt)-1] == ':') {
fputc(' ', stderr);
perror(NULL);
}
exit(1);
}

8
util.h Normal file
View File

@ -0,0 +1,8 @@
/* See LICENSE file for copyright and license details. */
#define MAX(A, B) ((A) > (B) ? (A) : (B))
#define MIN(A, B) ((A) < (B) ? (A) : (B))
#define BETWEEN(X, A, B) ((A) <= (X) && (X) <= (B))
void die(const char *errstr, ...);
void *ecalloc(size_t, size_t);