meta: Rewrite sowm and swap to XCB.

This was my first real C project and it shows. Learning C is quite
fun and I still have a long way to go. This next rewrite should be
less of a hot-mess than the original Xlib version.

Notable mistakes:

- while (1 && ...)
- for win (spastic pre-processor stuff)
- no proper tracking of client sizes/positions.
- lazy window focus model.
- almost code-golfed code-base.
- circular-doubly-linked-list for clients.

The following changes mark the initial commit for the rewrite.
The window manager works but does not yet do enough for it to be
usable. Clients, keybindings, a configuration file, etc, etc do
not yet exist. Baby steps.
This commit is contained in:
Dylan Araps committed 2020-07-11 11:31:30 +03:00
1 parent d327a0978a
commit 1a4c655b9d
7 files changed
+180 -477

No files matched your search

+14 -12
View File
@@ -1,22 +1,24 @@
CFLAGS += -std=c99 -Wall -Wextra -pedantic -Wold-style-declaration
CFLAGS += -Wmissing-prototypes -Wno-unused-parameter
PREFIX ?= /usr
BINDIR ?= $(PREFIX)/bin
CC ?= gcc
.POSIX:
PREFIX = /usr/local
ALL_WARN = -Wall -Wextra -pedantic -Wmissing-prototypes -Wstrict-prototypes
ALL_CFLAGS = $(CFLAGS) $(CPPFLAGS) -std=c99 $(ALL_WARN)
ALL_LDFLAGS = $(LDFLAGS) -lxcb
CC = cc
all: sowm
config.h:
cp config.def.h config.h
sowm: sowm.c sowm.h config.h Makefile
$(CC) -O3 $(CFLAGS) -o $@ $< -lX11 $(LDFLAGS)
sowm: sowm.c Makefile
$(CC) -O3 $(ALL_CFLAGS) -o $@ $< $(ALL_LDFLAGS)
install: all
install -Dm755 sowm $(DESTDIR)$(BINDIR)/sowm
mkdir -p $(DESTDIR)/bin
cp sowm $(DESTDIR)/bin/sowm
uninstall:
rm -f $(DESTDIR)$(BINDIR)/sowm
rm -f $(DESTDIR)/bin/sowm
clean:
rm -f sowm *.o