Skip to content

Commit 23ed325

Browse files
authored
released at 0.0.4
1 parent f9bf8a4 commit 23ed325

File tree

5 files changed

+51
-31
lines changed

5 files changed

+51
-31
lines changed

CHANGELOG

+16-5
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,27 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99
- Initial release.
1010

1111
## [0.0.2] - 2020-11-07
12-
## Added
12+
### Added
1313
- Close window command (default: Win+q).
1414

1515
### Fixed
1616
- Resize crash in root window.
1717

1818
## [0.0.3] - 2020-11-08
19-
## Added
19+
### Added
2020
- Examples in the config.h file.
21-
- New window height and width parameters.
21+
- Window height and width parameters.
2222

23-
## Removed
24-
- <string.h> library dependency.
23+
### Removed
24+
- string.h library dependency.
25+
26+
## [0.0.4] - 20202-11-10
27+
### Added
28+
- Instructions for patches and the patching process.
29+
- Minimum window height and width parameters.
30+
31+
### Removed
32+
- Unused stdarg.h library dependency.
33+
34+
### Fixed
35+
- Crash when pointer x/y cords less than window origin.

README

+18-14
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ FEATURES
1010
BUILD REQUIREMENTS
1111
==================
1212

13-
Other than libxcb, xwm also uses several default utilities which can be
14-
patched, configured or expanded to meet the users preference.
13+
libxcb, along with any default or user defined utility:
1514

1615
application launcher dmenu - https://git.suckless.org/dmenu
1716
terminal emulator st - https://git.suckless.org/st
@@ -44,6 +43,17 @@ Building and installing on KISS Linux:
4443
kiss b xwm
4544
kiss i xwm
4645

46+
PATCHES
47+
=======
48+
49+
xwm is considered a minimally viable window manager solution and,
50+
therefore, is missing several features that many users would
51+
consider "essential". For additional features, I have provided
52+
instructions below for patching, as well as a respository for
53+
sharing and hosting user created patches:
54+
https://github.com/mcpcpc/xwm-patches
55+
56+
4757
EXAMPLES
4858
========
4959

@@ -54,20 +64,14 @@ Usimg startx to run xwm:
5464
echo "exec xwm" > ~/.xinitrc
5565
startx
5666

57-
Using xsetroot to set a solid background color:
58-
xsetroot -solid red
59-
60-
Using imagemagick and a shell script to set a wallpaper:
61-
curl -L -o bud https://bit.ly/38aAmDt
62-
chmod +x bud
63-
sudo install bud /usr/bin/
64-
bud ~/wallpaper/directory/
65-
echo "bud ~/wallpaper/directory/ & exec xwm" > ~./xinitrc
67+
Using xbg to set a solid background color:
68+
xbg red
6669

67-
CREDIT
68-
======
70+
Using imagemagick to set a wallpaper:
71+
display -window root background.png
6972

70-
Special thanks to the developers of dwm, sowm, lainwm, bluem and tinywm.
73+
Patching xwm (after copying the *.patch into the source dir.):
74+
patch -p0 < mypatch.patch
7175

7276
CONTACT
7377
=======

TODO

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
1-
* Add borders to indicate window focus
2-
* Add workspaces
3-
* Add minimum window size
4-
* Use library call instead of execvp()
1+
* Add borders to indicate window focus (as a patch?)
2+
* Add workspaces (as patch)

config.h

+4-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@
2121
* window behavior
2222
*/
2323

24-
#define WINDOW_WIDTH 600
25-
#define WINDOW_HEIGHT 400
24+
#define WINDOW_WIDTH 600
25+
#define WINDOW_HEIGHT 400
26+
#define WINDOW_MIN_WIDTH 60
27+
#define WINDOW_MIN_HEIGHT 40
2628

2729
/* ALIASED COMMANDS
2830
* Each space delimited argument should be passed as an additional

xwm.c

+11-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/* See LICENSE file for license details. */
2-
#include <stdarg.h>
32
#include <unistd.h>
43
#include <xcb/xcb.h>
54
#include <xcb/xcb_keysyms.h>
@@ -69,10 +68,16 @@ static void handleMotionNotify(xcb_generic_event_t * ev) {
6968
if ((values[2] == val[1]) && (win != 0)) {
7069
xcb_get_geometry_cookie_t geom_now = xcb_get_geometry(dpy, win);
7170
xcb_get_geometry_reply_t* geom = xcb_get_geometry_reply(dpy, geom_now, NULL);
72-
values[0] = poin->root_x - geom->x;
73-
values[1] = poin->root_y - geom->y;
74-
xcb_configure_window(dpy, win, XCB_CONFIG_WINDOW_WIDTH
75-
| XCB_CONFIG_WINDOW_HEIGHT, values);
71+
if (!((poin->root_x <= geom->x) || (poin->root_y <= geom->y))) {
72+
values[0] = poin->root_x - geom->x;
73+
values[1] = poin->root_y - geom->y;
74+
uint32_t min_x = WINDOW_MIN_WIDTH;
75+
uint32_t min_y = WINDOW_MIN_HEIGHT;
76+
if ((values[0] >= min_x) && (values[1] >= min_y)) {
77+
xcb_configure_window(dpy, win, XCB_CONFIG_WINDOW_WIDTH
78+
| XCB_CONFIG_WINDOW_HEIGHT, values);
79+
}
80+
}
7681
}
7782
}
7883

@@ -216,7 +221,7 @@ static int strcmp_c(char * str1, char * str2) {
216221
int main(int argc, char * argv[]) {
217222
int ret = 0;
218223
if ((argc == 2) && (strcmp_c("-v", argv[1]) == 0)) {
219-
ret = die("xwm-0.0.3, © 2020 Michael Czigler, see LICENSE for details\n");
224+
ret = die("xwm-0.0.4, © 2020 Michael Czigler, see LICENSE for details\n");
220225
}
221226
if ((ret == 0) && (argc != 1)) {
222227
ret = die("usage: xwm [-v]\n");

0 commit comments

Comments
 (0)