Merge branch 'master' into bacardi55
Conflicts: src/wmfs.c
This commit is contained in:
commit
20c99826ce
2
.gitignore
vendored
2
.gitignore
vendored
@ -3,4 +3,4 @@
|
|||||||
wmfs
|
wmfs
|
||||||
#*
|
#*
|
||||||
\#*
|
\#*
|
||||||
build
|
Makefile
|
||||||
|
|||||||
58
BSDmakefile
58
BSDmakefile
@ -1,58 +0,0 @@
|
|||||||
.include "config.mk"
|
|
||||||
.include "common.mk"
|
|
||||||
|
|
||||||
PROG= wmfs
|
|
||||||
MAN1= wmfs.1
|
|
||||||
|
|
||||||
.for lib in xrandr xinerama
|
|
||||||
.if !empty(LIBS:M${lib})
|
|
||||||
CFLAGS+= -DHAVE_${lib:U}
|
|
||||||
.endif
|
|
||||||
.endfor
|
|
||||||
|
|
||||||
.if !empty(LIBS:Mimlib2)
|
|
||||||
CFLAGS+= -DHAVE_IMLIB
|
|
||||||
.endif
|
|
||||||
|
|
||||||
.if !defined(CFLAGS_LIBS)
|
|
||||||
CFLAGS_LIBS!= pkg-config --cflags-only-I ${LIBS}
|
|
||||||
.endif
|
|
||||||
|
|
||||||
.if !defined(LDFLAGS_LIBS)
|
|
||||||
LDFLAGS_LIBS!= pkg-config --libs ${LIBS}
|
|
||||||
.endif
|
|
||||||
|
|
||||||
CFLAGS+= ${CFLAGS_LIBS}
|
|
||||||
LDADD+= ${LDFLAGS_LIBS} -lpthread
|
|
||||||
|
|
||||||
install: all
|
|
||||||
@echo installing executable file to ${DESTDIR}${PREFIX}/bin
|
|
||||||
@mkdir -p ${DESTDIR}${PREFIX}/bin
|
|
||||||
@install ${.OBJDIR}/wmfs ${DESTDIR}${PREFIX}/bin
|
|
||||||
@echo installing manual page to ${DESTDIR}${MANPREFIX}/man1
|
|
||||||
@mkdir -p ${DESTDIR}${MANPREFIX}/man1
|
|
||||||
@install -m 644 ${.OBJDIR}/wmfs.1.gz ${DESTDIR}${MANPREFIX}/man1/
|
|
||||||
@echo installing xsession file to ${DESTDIR}${PREFIX}/share/xsessions
|
|
||||||
@mkdir -p ${DESTDIR}${PREFIX}/share/xsessions
|
|
||||||
@install -m 644 ${.CURDIR}/wmfs.desktop ${DESTDIR}${PREFIX}/share/xsessions/
|
|
||||||
@echo installing default config file to ${DESTDIR}${XDG_CONFIG_DIR}
|
|
||||||
@mkdir -p ${DESTDIR}${XDG_CONFIG_DIR}
|
|
||||||
@install -m 444 ${.CURDIR}/wmfsrc ${DESTDIR}${XDG_CONFIG_DIR}
|
|
||||||
|
|
||||||
uninstall:
|
|
||||||
@echo removing executable file from ${DESTDIR}${PREFIX}/bin
|
|
||||||
@rm -f ${DESTDIR}${PREFIX}/bin/wmfs
|
|
||||||
@echo removing manual page from ${DESTDIR}${MANPREFIX}/man1
|
|
||||||
@rm -f ${DESTDIR}${MANPREFIX}/man1/wmfs.1.gz
|
|
||||||
@echo removing xsession file from ${DESTDIR}${PREFIX}/share/xsessions/
|
|
||||||
@rm -f ${DESTDIR}${PREFIX}/share/xsessions/wmfs.desktop
|
|
||||||
@echo removing config file from ${DESTDIR}${XDG_CONFIG_DIR}
|
|
||||||
@rm -f ${DESTDIR}${XDG_CONFIG_DIR}/wmfsrc
|
|
||||||
|
|
||||||
|
|
||||||
.include <bsd.prog.mk>
|
|
||||||
|
|
||||||
.c.o: config.mk
|
|
||||||
@if [ ! -d `dirname ${.TARGET}` ]; then mkdir -p `dirname ${.TARGET}`; fi
|
|
||||||
@echo CC ${.IMPSRC}
|
|
||||||
@${CC} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET}
|
|
||||||
81
Makefile
81
Makefile
@ -1,81 +0,0 @@
|
|||||||
include config.mk
|
|
||||||
include common.mk
|
|
||||||
|
|
||||||
OBJ = ${patsubst %.c,${O}/%.o,${SRCS}}
|
|
||||||
|
|
||||||
ifneq ($(findstring xrandr, ${LIBS}),)
|
|
||||||
CFLAGS+= -DHAVE_XRANDR
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifneq ($(findstring xinerama, ${LIBS}),)
|
|
||||||
CFLAGS+= -DHAVE_XINERAMA
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifneq ($(findstring imlib2, ${LIBS}),)
|
|
||||||
CFLAGS+= -DHAVE_IMLIB
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifndef CFLAGS_LIBS
|
|
||||||
CFLAGS_LIBS= $(shell pkg-config --cflags-only-I ${LIBS})
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifndef LDFLAGS_LIBS
|
|
||||||
LDFLAGS_LIBS= $(shell pkg-config --libs ${LIBS})
|
|
||||||
endif
|
|
||||||
|
|
||||||
CFLAGS+= ${CFLAGS_LIBS}
|
|
||||||
LDFLAGS+= ${LDFLAGS_LIBS} -lpthread
|
|
||||||
|
|
||||||
all: options ${O}/wmfs ${O}/wmfs.1.gz
|
|
||||||
|
|
||||||
${O}/wmfs.1.gz: wmfs.1
|
|
||||||
gzip -cn -9 $< > $@
|
|
||||||
|
|
||||||
${O}/%.o: %.c config.mk
|
|
||||||
@if [ ! -d `dirname ${O}/$<` ]; then mkdir -p `dirname ${O}/$<`; fi
|
|
||||||
@echo CC $<
|
|
||||||
@${CC} -c ${CFLAGS} $< -o $@
|
|
||||||
|
|
||||||
options:
|
|
||||||
@echo wmfs compile with ${LIBS}
|
|
||||||
@echo - CFLAGS ${CFLAGS}
|
|
||||||
@echo - LDFLAGS ${LDFLAGS}
|
|
||||||
@echo - OUTPUT ${O}
|
|
||||||
|
|
||||||
@if [ ! -d ${O} ]; then mkdir -p ${O}; fi
|
|
||||||
|
|
||||||
${O}/wmfs: ${OBJ} config.mk src/structs.h src/wmfs.h src/parse/parse.h
|
|
||||||
@echo CC -o $@
|
|
||||||
@${CC} -o $@ ${OBJ} ${LDFLAGS}
|
|
||||||
|
|
||||||
clean:
|
|
||||||
@rm -f ${OBJ} ${O}/wmfs ${O}/wmfs.1.gz
|
|
||||||
|
|
||||||
install: all
|
|
||||||
@echo installing executable file to ${DESTDIR}${PREFIX}/bin
|
|
||||||
@mkdir -p ${DESTDIR}${PREFIX}/bin
|
|
||||||
@install ${O}/wmfs ${DESTDIR}${PREFIX}/bin
|
|
||||||
@echo installing manual page to ${DESTDIR}${MANPREFIX}/man1
|
|
||||||
@mkdir -p ${DESTDIR}${MANPREFIX}/man1
|
|
||||||
@install -m 644 ${O}/wmfs.1.gz ${DESTDIR}${MANPREFIX}/man1/
|
|
||||||
@echo installing xsession file to ${DESTDIR}${PREFIX}/share/xsessions
|
|
||||||
@mkdir -p ${DESTDIR}${PREFIX}/share/xsessions
|
|
||||||
@install -m 644 wmfs.desktop ${DESTDIR}${PREFIX}/share/xsessions/
|
|
||||||
@echo installing default config file to ${DESTDIR}${XDG_CONFIG_DIR}
|
|
||||||
@mkdir -p ${DESTDIR}${XDG_CONFIG_DIR}
|
|
||||||
@install -m 444 wmfsrc ${DESTDIR}${XDG_CONFIG_DIR}
|
|
||||||
|
|
||||||
uninstall:
|
|
||||||
@echo removing executable file from ${DESTDIR}${PREFIX}/bin
|
|
||||||
@rm -f ${DESTDIR}${PREFIX}/bin/wmfs
|
|
||||||
@echo removing manual page from ${DESTDIR}${MANPREFIX}/man1
|
|
||||||
@rm -f ${DESTDIR}${MANPREFIX}/man1/wmfs.1.gz
|
|
||||||
@echo removing xsession file from ${DESTDIR}${PREFIX}/share/xsessions
|
|
||||||
@rm -f ${DESTDIR}${PREFIX}/share/xsessions/wmfs.desktop
|
|
||||||
@echo removing config file from ${DESTDIR}${XDG_CONFIG_DIR}
|
|
||||||
@rm -f ${DESTDIR}${XDG_CONFIG_DIR}/wmfsrc
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.PHONY: all clean install uninstall
|
|
||||||
|
|
||||||
80
Makefile.in
Normal file
80
Makefile.in
Normal file
@ -0,0 +1,80 @@
|
|||||||
|
PROG=wmfs
|
||||||
|
MAN=wmfs.1
|
||||||
|
|
||||||
|
# wmfs version
|
||||||
|
VERSION= 201011
|
||||||
|
|
||||||
|
SRCS= \
|
||||||
|
src/barwin.c \
|
||||||
|
src/client.c \
|
||||||
|
src/config.c \
|
||||||
|
src/draw.c \
|
||||||
|
src/event.c \
|
||||||
|
src/ewmh.c \
|
||||||
|
src/frame.c \
|
||||||
|
src/getinfo.c \
|
||||||
|
src/infobar.c \
|
||||||
|
src/init.c \
|
||||||
|
src/launcher.c \
|
||||||
|
src/layout.c \
|
||||||
|
src/menu.c \
|
||||||
|
src/mouse.c \
|
||||||
|
src/parse/api.c \
|
||||||
|
src/parse/parse.c \
|
||||||
|
src/screen.c \
|
||||||
|
src/status.c \
|
||||||
|
src/systray.c \
|
||||||
|
src/tag.c \
|
||||||
|
src/util.c \
|
||||||
|
src/viwmfs.c \
|
||||||
|
src/wmfs.c
|
||||||
|
|
||||||
|
# flags
|
||||||
|
CFLAGS+= -DXDG_CONFIG_DIR=\"${XDG_CONFIG_DIR}\"
|
||||||
|
CFLAGS+= -DWMFS_VERSION=\"${VERSION}\"
|
||||||
|
CFLAGS+= -W -Wall -Wextra -ansi
|
||||||
|
|
||||||
|
OBJS= ${SRCS:.c=.o}
|
||||||
|
|
||||||
|
all: ${PROG} ${MAN}.gz
|
||||||
|
|
||||||
|
${PROG}: ${OBJS} src/structs.h src/wmfs.h src/parse/parse.h
|
||||||
|
${CC} -o $@ ${OBJS} ${LDFLAGS}
|
||||||
|
|
||||||
|
${MAN}.gz: ${MAN}
|
||||||
|
gzip -cn -9 ${MAN} > $@
|
||||||
|
|
||||||
|
.c.o:
|
||||||
|
${CC} -c ${CFLAGS} $< -o $@
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f ${OBJS} wmfs ${MAN}.gz
|
||||||
|
|
||||||
|
install: all
|
||||||
|
@echo installing executable file to ${DESTDIR}${PREFIX}/bin
|
||||||
|
mkdir -p ${DESTDIR}${PREFIX}/bin
|
||||||
|
install ${PROG} ${DESTDIR}${PREFIX}/bin
|
||||||
|
@echo installing manual page to ${DESTDIR}${MANPREFIX}/man1
|
||||||
|
mkdir -p ${DESTDIR}${MANPREFIX}/man1
|
||||||
|
install -m 644 ${MAN}.gz ${DESTDIR}${MANPREFIX}/man1/
|
||||||
|
@echo installing xsession file to ${DESTDIR}${PREFIX}/share/xsessions
|
||||||
|
mkdir -p ${DESTDIR}${PREFIX}/share/xsessions
|
||||||
|
install -m 644 wmfs.desktop ${DESTDIR}${PREFIX}/share/xsessions/
|
||||||
|
@echo installing default config file to ${DESTDIR}${XDG_CONFIG_DIR}
|
||||||
|
mkdir -p ${DESTDIR}${XDG_CONFIG_DIR}
|
||||||
|
install -m 444 wmfsrc ${DESTDIR}${XDG_CONFIG_DIR}
|
||||||
|
|
||||||
|
uninstall:
|
||||||
|
@echo removing executable file from ${DESTDIR}${PREFIX}/bin
|
||||||
|
rm -f ${DESTDIR}${PREFIX}/bin/wmfs
|
||||||
|
@echo removing manual page from ${DESTDIR}${MANPREFIX}/man1
|
||||||
|
rm -f ${DESTDIR}${MANPREFIX}/man1/wmfs.1.gz
|
||||||
|
@echo removing xsession file from ${DESTDIR}${PREFIX}/share/xsessions
|
||||||
|
rm -f ${DESTDIR}${PREFIX}/share/xsessions/wmfs.desktop
|
||||||
|
@echo removing config file from ${DESTDIR}${XDG_CONFIG_DIR}
|
||||||
|
rm -f ${DESTDIR}${XDG_CONFIG_DIR}/wmfsrc
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.PHONY: all clean install uninstall
|
||||||
|
|
||||||
29
README
29
README
@ -4,33 +4,34 @@ WMFS Window Manager.
|
|||||||
|
|
||||||
A highly configurable and manageable tiling Window Manager created from scratch
|
A highly configurable and manageable tiling Window Manager created from scratch
|
||||||
|
|
||||||
AUTHORS :
|
AUTHORS : (in order of commits and > 5 commits)
|
||||||
Martin Duquesnoy <xorg62@gmail.com>
|
- Martin Duquesnoy <xorg62@gmail.com>
|
||||||
|
- Philippe Pepiot <phil@philpep.org>
|
||||||
|
- Marc Lagrange <markocpc@gmail.com>
|
||||||
|
- OldMan <tele-post@mail.ru>
|
||||||
|
- Raphael Khaiat <raphael@khaiat.org>
|
||||||
|
- Tomáš Chvátal <scarabeus@gentoo.org>
|
||||||
|
- David Delassus <linkdd@ydb.me>
|
||||||
|
|
||||||
|
|
||||||
LICENSE : BSD
|
LICENSE : BSD
|
||||||
|
|
||||||
REQUIREMENT :
|
REQUIREMENT :
|
||||||
- freetype2
|
- freetype2
|
||||||
|
- libxft
|
||||||
|
- libx11
|
||||||
- libxinerama (optional)
|
- libxinerama (optional)
|
||||||
- libxrandr (optional)
|
- libxrandr (optional)
|
||||||
- imlib2 (optional)
|
- imlib2 (optional)
|
||||||
- libxft
|
|
||||||
- libx11
|
|
||||||
- CMake >= 2.6
|
|
||||||
|
|
||||||
OS :
|
OS :
|
||||||
- GNU/Linux : Supported.
|
- GNU/Linux : Supported.
|
||||||
- FreeBSD : Supported.
|
- FreeBSD/OpenBSD/NetBSD : Supported.
|
||||||
|
|
||||||
INSTALL :
|
INSTALL :
|
||||||
- mkdir build
|
./configure [--without-imlib2|--without-xrandr|--without-xinerama] (./configure -h)
|
||||||
- cd build
|
make
|
||||||
- cmake ..
|
sudo make install
|
||||||
- make
|
|
||||||
- sudo make install
|
|
||||||
- sudo make uninstall # if you would to remove it.
|
|
||||||
|
|
||||||
If you have doxygen installed you can generate doxygen documentation via custom target 'make doc' in the build dir.
|
|
||||||
|
|
||||||
DISTROS :
|
DISTROS :
|
||||||
- wmfs port for FreeBSD at x11-wm/wmfs
|
- wmfs port for FreeBSD at x11-wm/wmfs
|
||||||
|
|||||||
33
common.mk
33
common.mk
@ -1,33 +0,0 @@
|
|||||||
SRCS= \
|
|
||||||
src/barwin.c \
|
|
||||||
src/client.c \
|
|
||||||
src/config.c \
|
|
||||||
src/draw.c \
|
|
||||||
src/event.c \
|
|
||||||
src/ewmh.c \
|
|
||||||
src/frame.c \
|
|
||||||
src/getinfo.c \
|
|
||||||
src/infobar.c \
|
|
||||||
src/init.c \
|
|
||||||
src/launcher.c \
|
|
||||||
src/layout.c \
|
|
||||||
src/menu.c \
|
|
||||||
src/mouse.c \
|
|
||||||
src/parse/api.c \
|
|
||||||
src/parse/parse.c \
|
|
||||||
src/screen.c \
|
|
||||||
src/status.c \
|
|
||||||
src/systray.c \
|
|
||||||
src/tag.c \
|
|
||||||
src/util.c \
|
|
||||||
src/viwmfs.c \
|
|
||||||
src/wmfs.c
|
|
||||||
|
|
||||||
# flags
|
|
||||||
CFLAGS+= ${C_FLAGS}
|
|
||||||
CFLAGS+= -DXDG_CONFIG_DIR=\"${XDG_CONFIG_DIR}\"
|
|
||||||
CFLAGS+= -DWMFS_VERSION=\"${VERSION}\"
|
|
||||||
LDFLAGS+= ${LD_FLAGS}
|
|
||||||
|
|
||||||
# build directory
|
|
||||||
O?= build
|
|
||||||
27
config.mk
27
config.mk
@ -1,27 +0,0 @@
|
|||||||
# wmfs version
|
|
||||||
VERSION= 201011
|
|
||||||
|
|
||||||
# Customize below to fit your system
|
|
||||||
# x11 xft and freetype2 are REQUIRED, others are optionals
|
|
||||||
LIBS= x11 xft freetype2 xrandr xinerama imlib2
|
|
||||||
|
|
||||||
|
|
||||||
# If theses variables are defined, make will not call pkg-config
|
|
||||||
#
|
|
||||||
# Linux example
|
|
||||||
# CFLAGS_LIBS= -I/usr/include/freetype2
|
|
||||||
# LDFLAGS_LIBS= -lX11 -lXft -lfreetype -lXrandr -lXinerama -lImlib2
|
|
||||||
#
|
|
||||||
# FreeBSD example
|
|
||||||
# CFLAGS_LIBS= -I/usr/local/include -I/usr/local/include/freetype2
|
|
||||||
# LDFLAGS_LIBS= -L/usr/local/lib -lXft -lXrender -lfontconfig -lX11 -lfreetype -lXrandr -lXinerama -lImlib2
|
|
||||||
|
|
||||||
# paths
|
|
||||||
PREFIX= /usr/local
|
|
||||||
MANPREFIX= ${PREFIX}/man
|
|
||||||
XDG_CONFIG_DIR= /usr/local/etc/xdg/wmfs
|
|
||||||
|
|
||||||
|
|
||||||
# CFLAGS LDFLAGS can be customised here
|
|
||||||
C_FLAGS= -Wall
|
|
||||||
LD_FLAGS=
|
|
||||||
105
configure
vendored
Executable file
105
configure
vendored
Executable file
@ -0,0 +1,105 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
LIBS="x11 xft freetype2"
|
||||||
|
USE_XINERAMA="xinerama"
|
||||||
|
USE_XRANDR="xrandr"
|
||||||
|
USE_IMLIB2="imlib2"
|
||||||
|
OS=`uname -s`
|
||||||
|
PREFIX=/usr/local
|
||||||
|
MANPREFIX="$PREFIX/man"
|
||||||
|
XDG_CONFIG_DIR="$PREFIX/etc/xdg/wmfs"
|
||||||
|
|
||||||
|
while true; do
|
||||||
|
case "$1" in
|
||||||
|
--without-xinerama)
|
||||||
|
USE_XINERAMA=""; shift;;
|
||||||
|
--without-xrandr)
|
||||||
|
USE_XRANDR=""; shift;;
|
||||||
|
--without-imlib2)
|
||||||
|
USE_IMLIB2=""; shift;;
|
||||||
|
--prefix)
|
||||||
|
[ -z "$2" ] && echo "Missing argument" && exit 1
|
||||||
|
PREFIX=$2; shift 2;;
|
||||||
|
--xdg-config-dir)
|
||||||
|
[ -z "$2" ] && echo "Missing argument" && exit 1
|
||||||
|
XDG_CONFIG_DIR=$2; shift 2;;
|
||||||
|
--man-prefix)
|
||||||
|
[ -z "$2" ] && echo "Missing argument" && exit 1
|
||||||
|
MANPREFIX=$2; shift 2;;
|
||||||
|
--help|-h)
|
||||||
|
echo "Usage: ./configure [options]
|
||||||
|
--without-imlib2 : compile without imlib2 support
|
||||||
|
--without-xrandr : compile without xrandr support
|
||||||
|
--without-xinerama : compile without xinerama support
|
||||||
|
--prefix DIRECTORY : install binary with specified prefix (default $PREFIX)
|
||||||
|
--xdg-config-dir DIRECTORY : install configuration to specified directory (default $XDG_CONFIG_DIR)
|
||||||
|
--man-prefix DIRECTORY : install man page to specified prefix (default $MANPREFIX)"
|
||||||
|
exit 0;;
|
||||||
|
*) break;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
LIBS="$LIBS $USE_XINERAMA $USE_XRANDR $USE_IMLIB2"
|
||||||
|
|
||||||
|
which pkg-config >/dev/null 2>&1
|
||||||
|
|
||||||
|
if [ $? -eq 0 ];
|
||||||
|
then
|
||||||
|
CFLAGS=`pkg-config --cflags-only-I $LIBS`
|
||||||
|
LDFLAGS=`pkg-config --libs $LIBS`
|
||||||
|
else
|
||||||
|
# Try to use some known paths
|
||||||
|
case $OS in
|
||||||
|
FreeBSD)
|
||||||
|
CFLAGS="-I/usr/local/include -I/usr/local/include/freetype2"
|
||||||
|
LDFLAGS="-L/usr/local/lib";;
|
||||||
|
OpenBSD)
|
||||||
|
CFLAGS="-I/usr/X11R6/include -I/usr/X11R6/include/freetype2 -I/usr/local/include"
|
||||||
|
LDFLAGS="-L/usr/X11R6/lib -L/usr/local/lib";;
|
||||||
|
NetBSD)
|
||||||
|
CFLAGS="-I/usr/X11R7/include -I/usr/X11R7/include/freetype2 -I/usr/local/include"
|
||||||
|
LDFLAGS="-L/usr/X11R7/lib -L/usr/local/lib";;
|
||||||
|
Linux)
|
||||||
|
CFLAGS="-I/usr/include/freetype2"
|
||||||
|
LDFLAGS=""
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "No default CFLAGS and LDFLAGS found for your OS, feel free to contribute or install pkg-config :)"
|
||||||
|
exit 1;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
LDFLAGS="$LDFLAGS -lX11 -lXft -lfreetype"
|
||||||
|
|
||||||
|
[ -n "$USE_XINERAMA" ] && LDFLAGS="$LDFLAGS -lXinerama"
|
||||||
|
[ -n "$USE_XRANDR" ] && LDFLAGS="$LDFLAGS -lXrandr"
|
||||||
|
[ -n "$USE_IMLIB2" ] && LDFLAGS="$LDFLAGS -lImlib2"
|
||||||
|
fi
|
||||||
|
|
||||||
|
[ -n "$USE_XINERAMA" ] && CFLAGS="$CFLAGS -DHAVE_XINERAMA"
|
||||||
|
[ -n "$USE_XRANDR" ] && CFLAGS="$CFLAGS -DHAVE_XRANDR"
|
||||||
|
[ -n "$USE_IMLIB2" ] && CFLAGS="$CFLAGS -DHAVE_IMLIB"
|
||||||
|
|
||||||
|
LDFLAGS="$LDFLAGS -lpthread"
|
||||||
|
|
||||||
|
cat > Makefile << EOF
|
||||||
|
PREFIX=$PREFIX
|
||||||
|
XDG_CONFIG_DIR=$XDG_CONFIG_DIR
|
||||||
|
MANPREFIX=$MANPREFIX
|
||||||
|
|
||||||
|
CFLAGS+=$CFLAGS
|
||||||
|
LDFLAGS+=$LDFLAGS
|
||||||
|
|
||||||
|
EOF
|
||||||
|
|
||||||
|
cat Makefile.in >> Makefile
|
||||||
|
|
||||||
|
echo "Compilation resume:
|
||||||
|
OS=$OS
|
||||||
|
CFLAGS=$CFLAGS
|
||||||
|
LDFLAGS=$LDFLAGS
|
||||||
|
PREFIX=$PREFIX
|
||||||
|
MANPREFIX=$MANPREFIX
|
||||||
|
XDG_CONFIG_DIR=$XDG_CONFIG_DIR
|
||||||
|
|
||||||
|
You can run 'make' now :-)
|
||||||
|
"
|
||||||
@ -293,7 +293,7 @@ barwin_refresh_color(BarWindow *bw)
|
|||||||
|
|
||||||
if(bw->stipple)
|
if(bw->stipple)
|
||||||
{
|
{
|
||||||
XSetForeground(dpy, gc_stipple, ((bw->stipple_color != -1) ? bw->stipple_color : getcolor(bw->fg)));
|
XSetForeground(dpy, gc_stipple, ((bw->stipple_color != (uint)-1) ? (long)bw->stipple_color : getcolor(bw->fg)));
|
||||||
XFillRectangle(dpy, bw->dr, gc_stipple, 3, 2, bw->geo.width - 6, bw->geo.height - 4);
|
XFillRectangle(dpy, bw->dr, gc_stipple, 3, 2, bw->geo.width - 6, bw->geo.height - 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
37
src/client.c
37
src/client.c
@ -181,6 +181,7 @@ void
|
|||||||
uicb_client_prev(uicb_t cmd)
|
uicb_client_prev(uicb_t cmd)
|
||||||
{
|
{
|
||||||
Client *c;
|
Client *c;
|
||||||
|
(void)cmd;
|
||||||
|
|
||||||
if((c = client_get_prev()))
|
if((c = client_get_prev()))
|
||||||
{
|
{
|
||||||
@ -198,6 +199,7 @@ void
|
|||||||
uicb_client_next(uicb_t cmd)
|
uicb_client_next(uicb_t cmd)
|
||||||
{
|
{
|
||||||
Client *c;
|
Client *c;
|
||||||
|
(void)cmd;
|
||||||
|
|
||||||
if((c = client_get_next()))
|
if((c = client_get_next()))
|
||||||
{
|
{
|
||||||
@ -215,6 +217,7 @@ void
|
|||||||
uicb_client_swap_next(uicb_t cmd)
|
uicb_client_swap_next(uicb_t cmd)
|
||||||
{
|
{
|
||||||
Client *c;
|
Client *c;
|
||||||
|
(void)cmd;
|
||||||
|
|
||||||
if((c = client_get_next()))
|
if((c = client_get_next()))
|
||||||
{
|
{
|
||||||
@ -232,6 +235,7 @@ void
|
|||||||
uicb_client_swap_prev(uicb_t cmd)
|
uicb_client_swap_prev(uicb_t cmd)
|
||||||
{
|
{
|
||||||
Client *c;
|
Client *c;
|
||||||
|
(void)cmd;
|
||||||
|
|
||||||
if((c = client_get_prev()))
|
if((c = client_get_prev()))
|
||||||
{
|
{
|
||||||
@ -249,6 +253,7 @@ void
|
|||||||
uicb_client_focus_right(uicb_t cmd)
|
uicb_client_focus_right(uicb_t cmd)
|
||||||
{
|
{
|
||||||
Client *c;
|
Client *c;
|
||||||
|
(void)cmd;
|
||||||
|
|
||||||
if((c = client_get_next_with_direction(Right)))
|
if((c = client_get_next_with_direction(Right)))
|
||||||
{
|
{
|
||||||
@ -267,6 +272,7 @@ void
|
|||||||
uicb_client_focus_left(uicb_t cmd)
|
uicb_client_focus_left(uicb_t cmd)
|
||||||
{
|
{
|
||||||
Client *c;
|
Client *c;
|
||||||
|
(void)cmd;
|
||||||
|
|
||||||
if((c = client_get_next_with_direction(Left)))
|
if((c = client_get_next_with_direction(Left)))
|
||||||
{
|
{
|
||||||
@ -284,6 +290,7 @@ void
|
|||||||
uicb_client_focus_top(uicb_t cmd)
|
uicb_client_focus_top(uicb_t cmd)
|
||||||
{
|
{
|
||||||
Client *c;
|
Client *c;
|
||||||
|
(void)cmd;
|
||||||
|
|
||||||
if((c = client_get_next_with_direction(Top)))
|
if((c = client_get_next_with_direction(Top)))
|
||||||
{
|
{
|
||||||
@ -301,6 +308,7 @@ void
|
|||||||
uicb_client_focus_bottom(uicb_t cmd)
|
uicb_client_focus_bottom(uicb_t cmd)
|
||||||
{
|
{
|
||||||
Client *c;
|
Client *c;
|
||||||
|
(void)cmd;
|
||||||
|
|
||||||
if((c = client_get_next_with_direction(Bottom)))
|
if((c = client_get_next_with_direction(Bottom)))
|
||||||
{
|
{
|
||||||
@ -317,7 +325,9 @@ uicb_client_focus_bottom(uicb_t cmd)
|
|||||||
void
|
void
|
||||||
client_above(Client *c)
|
client_above(Client *c)
|
||||||
{
|
{
|
||||||
XRectangle geo = { 0 };
|
XRectangle geo;
|
||||||
|
|
||||||
|
memset(&geo, 0, sizeof(geo));
|
||||||
|
|
||||||
if(c->flags & AboveFlag)
|
if(c->flags & AboveFlag)
|
||||||
return;
|
return;
|
||||||
@ -373,7 +383,7 @@ client_focus(Client *c)
|
|||||||
|
|
||||||
/* Set focusontag option */
|
/* Set focusontag option */
|
||||||
for(cc = clients; cc; cc = cc->next)
|
for(cc = clients; cc; cc = cc->next)
|
||||||
if(cc->focusontag == c->tag)
|
if(cc->focusontag == (int)c->tag)
|
||||||
cc->focusontag = -1;
|
cc->focusontag = -1;
|
||||||
|
|
||||||
c->focusontag = seltag[selscreen];
|
c->focusontag = seltag[selscreen];
|
||||||
@ -559,7 +569,7 @@ client_hide(Client *c)
|
|||||||
Bool
|
Bool
|
||||||
ishide(Client *c, int screen)
|
ishide(Client *c, int screen)
|
||||||
{
|
{
|
||||||
if(((c->tag == seltag[screen] || c->tag == MAXTAG + 1) && c->screen == screen)
|
if(((c->tag == (uint)seltag[screen] || c->tag == MAXTAG + 1) && c->screen == screen)
|
||||||
|| tags[screen][seltag[screen]].tagad & TagFlag(c->tag))
|
|| tags[screen][seltag[screen]].tagad & TagFlag(c->tag))
|
||||||
return False;
|
return False;
|
||||||
|
|
||||||
@ -614,6 +624,7 @@ client_kill(Client *c)
|
|||||||
void
|
void
|
||||||
uicb_client_kill(uicb_t cmd)
|
uicb_client_kill(uicb_t cmd)
|
||||||
{
|
{
|
||||||
|
(void)cmd;
|
||||||
CHECK(sel);
|
CHECK(sel);
|
||||||
|
|
||||||
client_kill(sel);
|
client_kill(sel);
|
||||||
@ -990,13 +1001,15 @@ client_swap(Client *c1, Client *c2)
|
|||||||
void
|
void
|
||||||
client_set_rules(Client *c)
|
client_set_rules(Client *c)
|
||||||
{
|
{
|
||||||
XClassHint xch = { 0 };
|
XClassHint xch;
|
||||||
int i, j, k, f;
|
int i, j, k, f;
|
||||||
Atom rf;
|
Atom rf;
|
||||||
ulong n, il;
|
ulong n, il;
|
||||||
uchar *data = NULL;
|
uchar *data = NULL;
|
||||||
char wwrole[256] = { 0 };
|
char wwrole[256] = { 0 };
|
||||||
|
|
||||||
|
memset(&xch, 0, sizeof(xch));
|
||||||
|
|
||||||
if(conf.ignore_next_client_rules)
|
if(conf.ignore_next_client_rules)
|
||||||
{
|
{
|
||||||
conf.ignore_next_client_rules = False;
|
conf.ignore_next_client_rules = False;
|
||||||
@ -1040,7 +1053,7 @@ client_set_rules(Client *c)
|
|||||||
c->screen = i;
|
c->screen = i;
|
||||||
c->tag = j;
|
c->tag = j;
|
||||||
|
|
||||||
if(c->tag != seltag[selscreen])
|
if(c->tag != (uint)seltag[selscreen])
|
||||||
{
|
{
|
||||||
tags[c->screen][c->tag].request_update = True;
|
tags[c->screen][c->tag].request_update = True;
|
||||||
client_focus(NULL);
|
client_focus(NULL);
|
||||||
@ -1074,7 +1087,7 @@ client_set_rules(Client *c)
|
|||||||
c->flags |= MaxFlag;
|
c->flags |= MaxFlag;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(c->tag != seltag[selscreen])
|
if(c->tag != (uint)seltag[selscreen])
|
||||||
{
|
{
|
||||||
tags[c->screen][c->tag].request_update = True;
|
tags[c->screen][c->tag].request_update = True;
|
||||||
client_focus(NULL);
|
client_focus(NULL);
|
||||||
@ -1131,6 +1144,7 @@ client_raise(Client *c)
|
|||||||
void
|
void
|
||||||
uicb_client_raise(uicb_t cmd)
|
uicb_client_raise(uicb_t cmd)
|
||||||
{
|
{
|
||||||
|
(void)cmd;
|
||||||
CHECK(sel);
|
CHECK(sel);
|
||||||
|
|
||||||
client_raise(sel);
|
client_raise(sel);
|
||||||
@ -1167,7 +1181,7 @@ client_focus_next(Client *c)
|
|||||||
&& c_next->screen != c->screen;
|
&& c_next->screen != c->screen;
|
||||||
c_next = c_next->next);
|
c_next = c_next->next);
|
||||||
|
|
||||||
if(c_next && c_next->tag == seltag[selscreen]
|
if(c_next && c_next->tag == (uint)seltag[selscreen]
|
||||||
&& c_next->screen == selscreen)
|
&& c_next->screen == selscreen)
|
||||||
client_focus(c_next);
|
client_focus(c_next);
|
||||||
|
|
||||||
@ -1204,7 +1218,7 @@ client_unmanage(Client *c)
|
|||||||
|
|
||||||
/* Arrange */
|
/* Arrange */
|
||||||
for(i = 0; i < screen_count() && !b; ++i)
|
for(i = 0; i < screen_count() && !b; ++i)
|
||||||
if(c->tag == seltag[i] || tags[i][seltag[i]].tagad & TagFlag(c->tag))
|
if(c->tag == (uint)seltag[i] || tags[i][seltag[i]].tagad & TagFlag(c->tag))
|
||||||
b = True;
|
b = True;
|
||||||
|
|
||||||
if(b)
|
if(b)
|
||||||
@ -1299,6 +1313,7 @@ client_set_screen(Client *c, int s)
|
|||||||
void
|
void
|
||||||
uicb_client_screen_next(uicb_t cmd)
|
uicb_client_screen_next(uicb_t cmd)
|
||||||
{
|
{
|
||||||
|
(void)cmd;
|
||||||
CHECK(sel);
|
CHECK(sel);
|
||||||
|
|
||||||
client_set_screen(sel, (sel->screen + 1 > screen_count() - 1) ? 0 : sel->screen + 1);
|
client_set_screen(sel, (sel->screen + 1 > screen_count() - 1) ? 0 : sel->screen + 1);
|
||||||
@ -1312,6 +1327,7 @@ uicb_client_screen_next(uicb_t cmd)
|
|||||||
void
|
void
|
||||||
uicb_client_screen_prev(uicb_t cmd)
|
uicb_client_screen_prev(uicb_t cmd)
|
||||||
{
|
{
|
||||||
|
(void)cmd;
|
||||||
CHECK(sel);
|
CHECK(sel);
|
||||||
|
|
||||||
client_set_screen(sel, (sel->screen - 1 < 0) ? screen_count() - 1 : sel->screen - 1);
|
client_set_screen(sel, (sel->screen - 1 < 0) ? screen_count() - 1 : sel->screen - 1);
|
||||||
@ -1384,6 +1400,7 @@ uicb_client_resize(uicb_t cmd)
|
|||||||
void
|
void
|
||||||
uicb_ignore_next_client_rules(uicb_t cmd)
|
uicb_ignore_next_client_rules(uicb_t cmd)
|
||||||
{
|
{
|
||||||
|
(void)cmd;
|
||||||
conf.ignore_next_client_rules = !conf.ignore_next_client_rules;
|
conf.ignore_next_client_rules = !conf.ignore_next_client_rules;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@ -1465,7 +1482,7 @@ uicb_client_select(uicb_t cmd)
|
|||||||
if(clist_index[i].client->screen != selscreen)
|
if(clist_index[i].client->screen != selscreen)
|
||||||
screen_set_sel(clist_index[i].client->screen);
|
screen_set_sel(clist_index[i].client->screen);
|
||||||
|
|
||||||
if(clist_index[i].client->tag != seltag[clist_index[i].client->screen])
|
if(clist_index[i].client->tag != (uint)seltag[clist_index[i].client->screen])
|
||||||
tag_set(clist_index[i].client->tag);
|
tag_set(clist_index[i].client->tag);
|
||||||
|
|
||||||
client_focus(clist_index[i].client);
|
client_focus(clist_index[i].client);
|
||||||
@ -1487,6 +1504,7 @@ uicb_client_select(uicb_t cmd)
|
|||||||
Bool
|
Bool
|
||||||
uicb_checkclist(uicb_t cmd)
|
uicb_checkclist(uicb_t cmd)
|
||||||
{
|
{
|
||||||
|
(void)cmd;
|
||||||
return True;
|
return True;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1496,6 +1514,7 @@ uicb_checkclist(uicb_t cmd)
|
|||||||
void
|
void
|
||||||
uicb_client_ignore_tag(uicb_t cmd)
|
uicb_client_ignore_tag(uicb_t cmd)
|
||||||
{
|
{
|
||||||
|
(void)cmd;
|
||||||
CHECK(sel);
|
CHECK(sel);
|
||||||
|
|
||||||
screen_get_sel();
|
screen_get_sel();
|
||||||
|
|||||||
@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
#include "wmfs.h"
|
#include "wmfs.h"
|
||||||
|
|
||||||
func_name_list_t tmp_func_list[] =
|
const func_name_list_t func_list[] =
|
||||||
{
|
{
|
||||||
{"spawn", uicb_spawn },
|
{"spawn", uicb_spawn },
|
||||||
{"client_kill", uicb_client_kill },
|
{"client_kill", uicb_client_kill },
|
||||||
@ -726,7 +726,8 @@ conf_launcher_section(void)
|
|||||||
void
|
void
|
||||||
conf_keybind_section(void)
|
conf_keybind_section(void)
|
||||||
{
|
{
|
||||||
int i, j;
|
int i;
|
||||||
|
size_t j;
|
||||||
struct conf_sec *sec, **ks;
|
struct conf_sec *sec, **ks;
|
||||||
struct opt_type *opt;
|
struct opt_type *opt;
|
||||||
|
|
||||||
@ -778,10 +779,6 @@ init_conf(void)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set func_list */
|
|
||||||
func_list = emalloc(LEN(tmp_func_list), sizeof(func_name_list_t));
|
|
||||||
memcpy(func_list, tmp_func_list, LEN(tmp_func_list) * sizeof(func_name_list_t));
|
|
||||||
|
|
||||||
conf_misc_section();
|
conf_misc_section();
|
||||||
conf_bar_section();
|
conf_bar_section();
|
||||||
conf_root_section();
|
conf_root_section();
|
||||||
|
|||||||
@ -51,6 +51,7 @@ draw_image_ofset_text(Drawable d, int x, int y, char* fg, int pad, char *str, in
|
|||||||
{
|
{
|
||||||
XftColor xftcolor;
|
XftColor xftcolor;
|
||||||
XftDraw *xftd;
|
XftDraw *xftd;
|
||||||
|
(void)pad;
|
||||||
|
|
||||||
if(!str)
|
if(!str)
|
||||||
return;
|
return;
|
||||||
@ -130,7 +131,7 @@ draw_rectangle(Drawable dr, int x, int y, uint w, uint h, uint color)
|
|||||||
void
|
void
|
||||||
draw_graph(Drawable dr, int x, int y, uint w, uint h, uint color, char *data)
|
draw_graph(Drawable dr, int x, int y, uint w, uint h, uint color, char *data)
|
||||||
{
|
{
|
||||||
int i;
|
uint i;
|
||||||
|
|
||||||
XSetForeground(dpy, gc, color);
|
XSetForeground(dpy, gc, color);
|
||||||
|
|
||||||
|
|||||||
@ -236,7 +236,7 @@ clientmessageevent(XClientMessageEvent *ev)
|
|||||||
|
|
||||||
/* Manage _NET_WM_DESKTOP */
|
/* Manage _NET_WM_DESKTOP */
|
||||||
if(mess_t == net_wm_desktop)
|
if(mess_t == net_wm_desktop)
|
||||||
if((c = client_gb_win(ev->window)) && ev->data.l[0] != 0xFFFFFFFF)
|
if((c = client_gb_win(ev->window)) && ev->data.l[0] != (long)0xFFFFFFFF)
|
||||||
tag_transfert(c, ev->data.l[0]);
|
tag_transfert(c, ev->data.l[0]);
|
||||||
|
|
||||||
/* Manage _WMFS_STATUSTEXT_x */
|
/* Manage _WMFS_STATUSTEXT_x */
|
||||||
@ -275,7 +275,6 @@ clientmessageevent(XClientMessageEvent *ev)
|
|||||||
ewmh_get_client_list();
|
ewmh_get_client_list();
|
||||||
ewmh_get_desktop_names();
|
ewmh_get_desktop_names();
|
||||||
ewmh_set_desktop_geometry();
|
ewmh_set_desktop_geometry();
|
||||||
ewmh_set_workarea();
|
|
||||||
screen_count();
|
screen_count();
|
||||||
screen_get_sel();
|
screen_get_sel();
|
||||||
}
|
}
|
||||||
@ -446,7 +445,7 @@ focusin(XFocusChangeEvent *ev)
|
|||||||
void
|
void
|
||||||
grabkeys(void)
|
grabkeys(void)
|
||||||
{
|
{
|
||||||
uint i;
|
int i;
|
||||||
KeyCode code;
|
KeyCode code;
|
||||||
|
|
||||||
XUngrabKey(dpy, AnyKey, AnyModifier, ROOT);
|
XUngrabKey(dpy, AnyKey, AnyModifier, ROOT);
|
||||||
@ -468,7 +467,7 @@ grabkeys(void)
|
|||||||
void
|
void
|
||||||
keypress(XKeyPressedEvent *ev)
|
keypress(XKeyPressedEvent *ev)
|
||||||
{
|
{
|
||||||
uint i;
|
int i;
|
||||||
KeySym keysym;
|
KeySym keysym;
|
||||||
|
|
||||||
keysym = XKeycodeToKeysym(dpy, (KeyCode)ev->keycode, 0);
|
keysym = XKeycodeToKeysym(dpy, (KeyCode)ev->keycode, 0);
|
||||||
@ -607,6 +606,7 @@ propertynotify(XPropertyEvent *ev)
|
|||||||
void
|
void
|
||||||
reparentnotify(XReparentEvent *ev)
|
reparentnotify(XReparentEvent *ev)
|
||||||
{
|
{
|
||||||
|
(void)ev;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
43
src/ewmh.c
43
src/ewmh.c
@ -60,7 +60,6 @@ ewmh_init_hints(void)
|
|||||||
net_atom[net_current_desktop] = ATOM("_NET_CURRENT_DESKTOP");
|
net_atom[net_current_desktop] = ATOM("_NET_CURRENT_DESKTOP");
|
||||||
net_atom[net_desktop_names] = ATOM("_NET_DESKTOP_NAMES");
|
net_atom[net_desktop_names] = ATOM("_NET_DESKTOP_NAMES");
|
||||||
net_atom[net_desktop_geometry] = ATOM("_NET_DESKTOP_GEOMETRY");
|
net_atom[net_desktop_geometry] = ATOM("_NET_DESKTOP_GEOMETRY");
|
||||||
net_atom[net_workarea] = ATOM("_NET_WORKAREA");
|
|
||||||
net_atom[net_active_window] = ATOM("_NET_ACTIVE_WINDOW");
|
net_atom[net_active_window] = ATOM("_NET_ACTIVE_WINDOW");
|
||||||
net_atom[net_close_window] = ATOM("_NET_CLOSE_WINDOW");
|
net_atom[net_close_window] = ATOM("_NET_CLOSE_WINDOW");
|
||||||
net_atom[net_wm_name] = ATOM("_NET_WM_NAME");
|
net_atom[net_wm_name] = ATOM("_NET_WM_NAME");
|
||||||
@ -319,45 +318,13 @@ ewmh_set_desktop_geometry(void)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Manage _NET_WORKAREA
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
ewmh_set_workarea(void)
|
|
||||||
{
|
|
||||||
long *data;
|
|
||||||
int i, s, j, tag_c = 0, pos = 0;
|
|
||||||
|
|
||||||
s = screen_count();
|
|
||||||
|
|
||||||
for(i = 0; i < s; ++i)
|
|
||||||
tag_c += conf.ntag[i];
|
|
||||||
|
|
||||||
data = emalloc(tag_c * 4, sizeof(long));
|
|
||||||
|
|
||||||
for(i = 0; i < s; ++i)
|
|
||||||
for(j = 0; j < conf.ntag[i]; ++j)
|
|
||||||
{
|
|
||||||
data[pos++] = spgeo[i].x;
|
|
||||||
data[pos++] = spgeo[i].y;
|
|
||||||
data[pos++] = spgeo[i].width;
|
|
||||||
data[pos++] = spgeo[i].height;
|
|
||||||
}
|
|
||||||
|
|
||||||
XChangeProperty(dpy, ROOT, net_atom[net_workarea], XA_CARDINAL, 32,
|
|
||||||
PropModeReplace, (uchar*)data, 4 * tag_c);
|
|
||||||
|
|
||||||
free(data);
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Manage _NET_WM_STATE_* ewmh
|
/** Manage _NET_WM_STATE_* ewmh
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
ewmh_manage_net_wm_state(long data_l[], Client *c)
|
ewmh_manage_net_wm_state(long data_l[], Client *c)
|
||||||
{
|
{
|
||||||
/* Manage _NET_WM_STATE_FULLSCREEN */
|
/* Manage _NET_WM_STATE_FULLSCREEN */
|
||||||
if(data_l[1] == net_atom[net_wm_state_fullscreen])
|
if(data_l[1] == (long)net_atom[net_wm_state_fullscreen])
|
||||||
{
|
{
|
||||||
if(data_l[0] == _NET_WM_STATE_ADD && !(c->flags & FSSFlag))
|
if(data_l[0] == _NET_WM_STATE_ADD && !(c->flags & FSSFlag))
|
||||||
{
|
{
|
||||||
@ -392,14 +359,14 @@ ewmh_manage_net_wm_state(long data_l[], Client *c)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* Manage _NET_WM_STATE_STICKY */
|
/* Manage _NET_WM_STATE_STICKY */
|
||||||
else if(data_l[1] == net_atom[net_wm_state_sticky])
|
else if(data_l[1] == (long)net_atom[net_wm_state_sticky])
|
||||||
{
|
{
|
||||||
/* == client_ignore_tag */
|
/* == client_ignore_tag */
|
||||||
c->tag = MAXTAG + 1;
|
c->tag = MAXTAG + 1;
|
||||||
arrange(c->screen, True);
|
arrange(c->screen, True);
|
||||||
}
|
}
|
||||||
/* Manage _NET_WM_STATE_DEMANDS_ATTENTION */
|
/* Manage _NET_WM_STATE_DEMANDS_ATTENTION */
|
||||||
else if(data_l[1] == net_atom[net_wm_state_demands_attention])
|
else if(data_l[1] == (long)net_atom[net_wm_state_demands_attention])
|
||||||
{
|
{
|
||||||
if(data_l[0] == _NET_WM_STATE_ADD)
|
if(data_l[0] == _NET_WM_STATE_ADD)
|
||||||
client_focus(c);
|
client_focus(c);
|
||||||
@ -419,8 +386,8 @@ void
|
|||||||
ewmh_manage_window_type(Client *c)
|
ewmh_manage_window_type(Client *c)
|
||||||
{
|
{
|
||||||
Atom *atom, rf;
|
Atom *atom, rf;
|
||||||
int i, f;
|
int f;
|
||||||
ulong n, il;
|
ulong n, il, i;
|
||||||
uchar *data = NULL;
|
uchar *data = NULL;
|
||||||
long ldata[5] = { 0 };
|
long ldata[5] = { 0 };
|
||||||
|
|
||||||
|
|||||||
@ -95,7 +95,7 @@ infobar_init(void)
|
|||||||
/* Create layout switch barwindow */
|
/* Create layout switch barwindow */
|
||||||
infobar[sc].layout_button = barwin_create(infobar[sc].bar->win,
|
infobar[sc].layout_button = barwin_create(infobar[sc].bar->win,
|
||||||
((conf.layout_placement) ? 0 : (j + PAD / 2)), 0,
|
((conf.layout_placement) ? 0 : (j + PAD / 2)), 0,
|
||||||
((conf.layout_button_width > 0) ? conf.layout_button_width : (textw(tags[sc][seltag[sc]].layout.symbol) + PAD)),
|
((conf.layout_button_width > 0) ? (uint)conf.layout_button_width : (textw(tags[sc][seltag[sc]].layout.symbol) + PAD)),
|
||||||
infobar[sc].geo.height,
|
infobar[sc].geo.height,
|
||||||
conf.colors.layout_bg, conf.colors.layout_fg,
|
conf.colors.layout_bg, conf.colors.layout_fg,
|
||||||
False, False, conf.border.layout);
|
False, False, conf.border.layout);
|
||||||
@ -159,7 +159,7 @@ infobar_draw_layout(int sc)
|
|||||||
if(!conf.layout_placement)
|
if(!conf.layout_placement)
|
||||||
barwin_move(infobar[sc].layout_button, infobar[sc].tags_board->geo.width + PAD / 2, 0);
|
barwin_move(infobar[sc].layout_button, infobar[sc].tags_board->geo.width + PAD / 2, 0);
|
||||||
|
|
||||||
barwin_resize(infobar[sc].layout_button, ((conf.layout_button_width > 0) ? conf.layout_button_width : (textw(tags[sc][seltag[sc]].layout.symbol) + PAD)), infobar[sc].geo.height);
|
barwin_resize(infobar[sc].layout_button, ((conf.layout_button_width > 0) ? (uint)conf.layout_button_width : (textw(tags[sc][seltag[sc]].layout.symbol) + PAD)), infobar[sc].geo.height);
|
||||||
barwin_refresh_color(infobar[sc].layout_button);
|
barwin_refresh_color(infobar[sc].layout_button);
|
||||||
|
|
||||||
if(tags[sc][seltag[sc]].layout.symbol)
|
if(tags[sc][seltag[sc]].layout.symbol)
|
||||||
@ -193,7 +193,7 @@ infobar_draw_selbar(int sc)
|
|||||||
str = emalloc(conf.selbar.maxlength + 4, sizeof(char));
|
str = emalloc(conf.selbar.maxlength + 4, sizeof(char));
|
||||||
strncpy(str, sel->title, conf.selbar.maxlength);
|
strncpy(str, sel->title, conf.selbar.maxlength);
|
||||||
|
|
||||||
if(strlen(sel->title) > conf.selbar.maxlength)
|
if(strlen(sel->title) > (size_t)conf.selbar.maxlength)
|
||||||
strcat(str, "...");
|
strcat(str, "...");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -225,7 +225,7 @@ infobar_draw_taglist(int sc)
|
|||||||
Bool is_occupied[MAXTAG + 1];
|
Bool is_occupied[MAXTAG + 1];
|
||||||
|
|
||||||
if(conf.layout_placement)
|
if(conf.layout_placement)
|
||||||
barwin_move(infobar[sc].tags_board, ((conf.layout_button_width > 0) ? conf.layout_button_width : (textw(tags[sc][seltag[sc]].layout.symbol) + PAD)) + PAD / 2, 0);
|
barwin_move(infobar[sc].tags_board, ((conf.layout_button_width > 0) ? (uint)conf.layout_button_width : (textw(tags[sc][seltag[sc]].layout.symbol) + PAD)) + PAD / 2, 0);
|
||||||
|
|
||||||
for(i = 0; i < MAXTAG; i++)
|
for(i = 0; i < MAXTAG; i++)
|
||||||
is_occupied[i] = False;
|
is_occupied[i] = False;
|
||||||
@ -381,7 +381,6 @@ infobar_set_position(int pos)
|
|||||||
|
|
||||||
barwin_move(infobar[selscreen].bar, sgeo[selscreen].x - BORDH, infobar[selscreen].geo.y);
|
barwin_move(infobar[selscreen].bar, sgeo[selscreen].x - BORDH, infobar[selscreen].geo.y);
|
||||||
infobar_draw(selscreen);
|
infobar_draw(selscreen);
|
||||||
ewmh_set_workarea();
|
|
||||||
arrange(selscreen, True);
|
arrange(selscreen, True);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@ -393,6 +392,7 @@ infobar_set_position(int pos)
|
|||||||
void
|
void
|
||||||
uicb_infobar_togglepos(uicb_t cmd)
|
uicb_infobar_togglepos(uicb_t cmd)
|
||||||
{
|
{
|
||||||
|
(void)cmd;
|
||||||
screen_get_sel();
|
screen_get_sel();
|
||||||
|
|
||||||
infobar_set_position((tags[selscreen][seltag[selscreen]].barpos
|
infobar_set_position((tags[selscreen][seltag[selscreen]].barpos
|
||||||
@ -410,6 +410,7 @@ void
|
|||||||
uicb_toggle_tagautohide(uicb_t cmd)
|
uicb_toggle_tagautohide(uicb_t cmd)
|
||||||
{
|
{
|
||||||
int i, x;
|
int i, x;
|
||||||
|
(void)cmd;
|
||||||
|
|
||||||
screen_get_sel();
|
screen_get_sel();
|
||||||
conf.tagautohide = !conf.tagautohide;
|
conf.tagautohide = !conf.tagautohide;
|
||||||
|
|||||||
@ -108,14 +108,14 @@ launcher_execute(Launcher *launcher)
|
|||||||
case XK_Up:
|
case XK_Up:
|
||||||
if(launcher->nhisto)
|
if(launcher->nhisto)
|
||||||
{
|
{
|
||||||
if(histpos >= launcher->nhisto)
|
if(histpos >= (int)launcher->nhisto)
|
||||||
histpos = 0;
|
histpos = 0;
|
||||||
strncpy(buf, launcher->histo[launcher->nhisto - ++histpos], sizeof(buf));
|
strncpy(buf, launcher->histo[launcher->nhisto - ++histpos], sizeof(buf));
|
||||||
pos = strlen(buf);
|
pos = strlen(buf);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case XK_Down:
|
case XK_Down:
|
||||||
if(launcher->nhisto && histpos > 0 && histpos < launcher->nhisto)
|
if(launcher->nhisto && histpos > 0 && histpos < (int)launcher->nhisto)
|
||||||
{
|
{
|
||||||
strncpy(buf, launcher->histo[launcher->nhisto - --histpos], sizeof(buf));
|
strncpy(buf, launcher->histo[launcher->nhisto - --histpos], sizeof(buf));
|
||||||
pos = strlen(buf);
|
pos = strlen(buf);
|
||||||
|
|||||||
33
src/layout.c
33
src/layout.c
@ -65,6 +65,7 @@ void
|
|||||||
freelayout(int screen)
|
freelayout(int screen)
|
||||||
{
|
{
|
||||||
Client *c;
|
Client *c;
|
||||||
|
(void)screen;
|
||||||
|
|
||||||
for(c = clients; c; c = c->next)
|
for(c = clients; c; c = c->next)
|
||||||
if(!ishide(c, selscreen)
|
if(!ishide(c, selscreen)
|
||||||
@ -92,7 +93,7 @@ layoutswitch(Bool b)
|
|||||||
screen_get_sel();
|
screen_get_sel();
|
||||||
|
|
||||||
if(tags[selscreen][seltag[selscreen]].layout.func == freelayout)
|
if(tags[selscreen][seltag[selscreen]].layout.func == freelayout)
|
||||||
for(c = clients; c && (c->tag != seltag[selscreen] && c->screen != selscreen); c = c->next)
|
for(c = clients; c && (c->tag != (uint)seltag[selscreen] && c->screen != selscreen); c = c->next)
|
||||||
{
|
{
|
||||||
c->ogeo = c->geo;
|
c->ogeo = c->geo;
|
||||||
c->free_geo = c->geo;
|
c->free_geo = c->geo;
|
||||||
@ -124,6 +125,7 @@ layoutswitch(Bool b)
|
|||||||
void
|
void
|
||||||
uicb_layout_next(uicb_t cmd)
|
uicb_layout_next(uicb_t cmd)
|
||||||
{
|
{
|
||||||
|
(void)cmd;
|
||||||
layoutswitch(True);
|
layoutswitch(True);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@ -135,6 +137,7 @@ uicb_layout_next(uicb_t cmd)
|
|||||||
void
|
void
|
||||||
uicb_layout_prev(uicb_t cmd)
|
uicb_layout_prev(uicb_t cmd)
|
||||||
{
|
{
|
||||||
|
(void)cmd;
|
||||||
layoutswitch(False);
|
layoutswitch(False);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@ -321,15 +324,15 @@ multi_tile(int screen, Position type)
|
|||||||
if(type == Top || type == Bottom)
|
if(type == Top || type == Bottom)
|
||||||
{
|
{
|
||||||
if(type == Top)
|
if(type == Top)
|
||||||
mastergeo.y = (n <= nmaster) ? sg.y : sg.y + (sg.height - mwfact) - BORDH;
|
mastergeo.y = (n <= nmaster) ? (uint)sg.y : sg.y + (sg.height - mwfact) - BORDH;
|
||||||
mastergeo.width = (sg.width / nmaster) - (BORDH * 4);
|
mastergeo.width = (sg.width / nmaster) - (BORDH * 4);
|
||||||
mastergeo.height = (n <= nmaster) ? sg.height - BORDH : mwfact;
|
mastergeo.height = (n <= nmaster) ? (uint)(sg.height - BORDH) : mwfact;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(type == Left)
|
if(type == Left)
|
||||||
mastergeo.x = (n <= nmaster) ? sg.x : (sg.x + sg.width) - mwfact - (BORDH * 2);
|
mastergeo.x = (n <= nmaster) ? (uint)sg.x : (sg.x + sg.width) - mwfact - (BORDH * 2);
|
||||||
mastergeo.width = (n <= nmaster) ? sg.width - (BORDH * 2) : mwfact;
|
mastergeo.width = (n <= nmaster) ? (uint)(sg.width - (BORDH * 2)) : mwfact;
|
||||||
mastergeo.height = (sg.height / nmaster) - BORDH;
|
mastergeo.height = (sg.height / nmaster) - BORDH;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -434,12 +437,15 @@ mirror(int screen, Bool horizontal)
|
|||||||
XRectangle sg = sgeo[screen];
|
XRectangle sg = sgeo[screen];
|
||||||
XRectangle mastergeo = {sg.x, sg.y, sg.width, sg.height};
|
XRectangle mastergeo = {sg.x, sg.y, sg.width, sg.height};
|
||||||
XRectangle cgeo = {sg.x, sg.y , sg.width, sg.height};
|
XRectangle cgeo = {sg.x, sg.y , sg.width, sg.height};
|
||||||
XRectangle nextg[2] = { {0} };
|
XRectangle nextg[2];
|
||||||
uint i, n, tilesize = 0, mwfact;
|
uint i, n, tilesize = 0, mwfact;
|
||||||
uint nmaster = tags[screen][seltag[screen]].nmaster;
|
uint nmaster = tags[screen][seltag[screen]].nmaster;
|
||||||
int pa, imp;
|
int pa, imp;
|
||||||
Bool isp = 0;
|
Bool isp = 0;
|
||||||
|
|
||||||
|
memset(&nextg[0], 0, sizeof(nextg[0]));
|
||||||
|
memset(&nextg[1], 0, sizeof(nextg[2]));
|
||||||
|
|
||||||
for(n = 0, c = tiled_client(screen, clients); c; c = tiled_client(screen, c->next), ++n);
|
for(n = 0, c = tiled_client(screen, clients); c; c = tiled_client(screen, c->next), ++n);
|
||||||
CHECK(n);
|
CHECK(n);
|
||||||
|
|
||||||
@ -687,6 +693,7 @@ grid_vertical(int screen)
|
|||||||
void
|
void
|
||||||
uicb_tile_switch(uicb_t cmd)
|
uicb_tile_switch(uicb_t cmd)
|
||||||
{
|
{
|
||||||
|
(void)cmd;
|
||||||
layout_set_client_master (sel);
|
layout_set_client_master (sel);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -697,6 +704,8 @@ uicb_tile_switch(uicb_t cmd)
|
|||||||
void
|
void
|
||||||
uicb_togglefree(uicb_t cmd)
|
uicb_togglefree(uicb_t cmd)
|
||||||
{
|
{
|
||||||
|
(void)cmd;
|
||||||
|
|
||||||
if(!sel || sel->screen != screen_get_sel() || (sel->flags & FSSFlag))
|
if(!sel || sel->screen != screen_get_sel() || (sel->flags & FSSFlag))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -728,6 +737,8 @@ uicb_togglefree(uicb_t cmd)
|
|||||||
void
|
void
|
||||||
uicb_togglemax(uicb_t cmd)
|
uicb_togglemax(uicb_t cmd)
|
||||||
{
|
{
|
||||||
|
(void)cmd;
|
||||||
|
|
||||||
if(!sel || ishide(sel, selscreen)
|
if(!sel || ishide(sel, selscreen)
|
||||||
|| (sel->flags & HintFlag)|| (sel->flags & FSSFlag))
|
|| (sel->flags & HintFlag)|| (sel->flags & FSSFlag))
|
||||||
return;
|
return;
|
||||||
@ -759,6 +770,7 @@ void
|
|||||||
uicb_toggle_resizehint(uicb_t cmd)
|
uicb_toggle_resizehint(uicb_t cmd)
|
||||||
{
|
{
|
||||||
screen_get_sel();
|
screen_get_sel();
|
||||||
|
(void)cmd;
|
||||||
|
|
||||||
tags[selscreen][seltag[selscreen]].resizehint = !tags[selscreen][seltag[selscreen]].resizehint;
|
tags[selscreen][seltag[selscreen]].resizehint = !tags[selscreen][seltag[selscreen]].resizehint;
|
||||||
|
|
||||||
@ -774,6 +786,7 @@ void
|
|||||||
uicb_toggle_abovefc(uicb_t cmd)
|
uicb_toggle_abovefc(uicb_t cmd)
|
||||||
{
|
{
|
||||||
Client *c;
|
Client *c;
|
||||||
|
(void)cmd;
|
||||||
|
|
||||||
screen_get_sel();
|
screen_get_sel();
|
||||||
|
|
||||||
@ -782,7 +795,7 @@ uicb_toggle_abovefc(uicb_t cmd)
|
|||||||
for(c = clients; c; c = c->next)
|
for(c = clients; c; c = c->next)
|
||||||
if(c->flags & AboveFlag
|
if(c->flags & AboveFlag
|
||||||
&& c->screen == selscreen
|
&& c->screen == selscreen
|
||||||
&& c->tag == seltag[selscreen])
|
&& c->tag == (uint)seltag[selscreen])
|
||||||
{
|
{
|
||||||
c->flags &= ~AboveFlag;
|
c->flags &= ~AboveFlag;
|
||||||
break;
|
break;
|
||||||
@ -802,7 +815,7 @@ uicb_toggle_abovefc(uicb_t cmd)
|
|||||||
void
|
void
|
||||||
uicb_set_layout(uicb_t cmd)
|
uicb_set_layout(uicb_t cmd)
|
||||||
{
|
{
|
||||||
int i, j, n;
|
size_t i, j, n;
|
||||||
|
|
||||||
screen_get_sel();
|
screen_get_sel();
|
||||||
|
|
||||||
@ -850,6 +863,8 @@ layout_set_client_master(Client *c)
|
|||||||
Bool
|
Bool
|
||||||
uicb_checkmax(uicb_t cmd)
|
uicb_checkmax(uicb_t cmd)
|
||||||
{
|
{
|
||||||
|
(void)cmd;
|
||||||
|
|
||||||
if(!sel)
|
if(!sel)
|
||||||
return False;
|
return False;
|
||||||
|
|
||||||
@ -865,6 +880,8 @@ uicb_checkmax(uicb_t cmd)
|
|||||||
Bool
|
Bool
|
||||||
uicb_checkfree(uicb_t cmd)
|
uicb_checkfree(uicb_t cmd)
|
||||||
{
|
{
|
||||||
|
(void)cmd;
|
||||||
|
|
||||||
if(!sel)
|
if(!sel)
|
||||||
return False;
|
return False;
|
||||||
|
|
||||||
|
|||||||
@ -354,6 +354,8 @@ menu_clear(Menu *menu)
|
|||||||
Bool
|
Bool
|
||||||
menu_get_checkstring_needed(MenuItem *mi, int nitem)
|
menu_get_checkstring_needed(MenuItem *mi, int nitem)
|
||||||
{
|
{
|
||||||
|
(void)mi;
|
||||||
|
(void)nitem;
|
||||||
return True;
|
return True;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -319,7 +319,7 @@ mouse_resize(Client *c)
|
|||||||
void
|
void
|
||||||
mouse_grabbuttons(Client *c, Bool focused)
|
mouse_grabbuttons(Client *c, Bool focused)
|
||||||
{
|
{
|
||||||
int i;
|
size_t i;
|
||||||
uint but[] = {Button1, Button2, Button3, Button4, Button5};
|
uint but[] = {Button1, Button2, Button3, Button4, Button5};
|
||||||
|
|
||||||
XUngrabButton(dpy, AnyButton, AnyModifier, c->win);
|
XUngrabButton(dpy, AnyButton, AnyModifier, c->win);
|
||||||
@ -348,6 +348,7 @@ mouse_grabbuttons(Client *c, Bool focused)
|
|||||||
void
|
void
|
||||||
uicb_mouse_move(uicb_t cmd)
|
uicb_mouse_move(uicb_t cmd)
|
||||||
{
|
{
|
||||||
|
(void)cmd;
|
||||||
CHECK(sel);
|
CHECK(sel);
|
||||||
|
|
||||||
mouse_move(sel);
|
mouse_move(sel);
|
||||||
@ -361,6 +362,7 @@ uicb_mouse_move(uicb_t cmd)
|
|||||||
void
|
void
|
||||||
uicb_mouse_resize(uicb_t cmd)
|
uicb_mouse_resize(uicb_t cmd)
|
||||||
{
|
{
|
||||||
|
(void)cmd;
|
||||||
CHECK(sel);
|
CHECK(sel);
|
||||||
|
|
||||||
mouse_resize(sel);
|
mouse_resize(sel);
|
||||||
|
|||||||
@ -215,7 +215,6 @@ screen_init_geo(void)
|
|||||||
#endif /* HAVE_XRANDR */
|
#endif /* HAVE_XRANDR */
|
||||||
|
|
||||||
ewmh_set_desktop_geometry();
|
ewmh_set_desktop_geometry();
|
||||||
ewmh_set_workarea();
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -237,6 +236,7 @@ uicb_screen_select(uicb_t cmd)
|
|||||||
void
|
void
|
||||||
uicb_screen_next(uicb_t cmd)
|
uicb_screen_next(uicb_t cmd)
|
||||||
{
|
{
|
||||||
|
(void)cmd;
|
||||||
screen_get_sel();
|
screen_get_sel();
|
||||||
|
|
||||||
selscreen = (selscreen + 1 > screen_count() - 1) ? 0 : selscreen + 1;
|
selscreen = (selscreen + 1 > screen_count() - 1) ? 0 : selscreen + 1;
|
||||||
@ -252,6 +252,7 @@ uicb_screen_next(uicb_t cmd)
|
|||||||
void
|
void
|
||||||
uicb_screen_prev(uicb_t cmd)
|
uicb_screen_prev(uicb_t cmd)
|
||||||
{
|
{
|
||||||
|
(void)cmd;
|
||||||
screen_get_sel();
|
screen_get_sel();
|
||||||
|
|
||||||
selscreen = (selscreen - 1 < 0) ? screen_count() - 1 : selscreen - 1;
|
selscreen = (selscreen - 1 < 0) ? screen_count() - 1 : selscreen - 1;
|
||||||
@ -267,6 +268,7 @@ uicb_screen_prev(uicb_t cmd)
|
|||||||
void
|
void
|
||||||
uicb_screen_prev_sel(uicb_t cmd)
|
uicb_screen_prev_sel(uicb_t cmd)
|
||||||
{
|
{
|
||||||
|
(void)cmd;
|
||||||
screen_get_sel();
|
screen_get_sel();
|
||||||
|
|
||||||
screen_set_sel(prevselscreen);
|
screen_set_sel(prevselscreen);
|
||||||
|
|||||||
12
src/status.c
12
src/status.c
@ -44,7 +44,7 @@ statustext_rectangle(StatusRec *r, char *str)
|
|||||||
char as;
|
char as;
|
||||||
int n, i, j, k;
|
int n, i, j, k;
|
||||||
|
|
||||||
for(i = j = n = 0; i < strlen(str); ++i, ++j)
|
for(i = j = n = 0; i < (int)strlen(str); ++i, ++j)
|
||||||
if(sscanf(&str[i], "\\b[%d;%d;%d;%d;#%x]%c", &r[n].x, &r[n].y, &r[n].w, &r[n].h, &r[n].color, &as) == 6
|
if(sscanf(&str[i], "\\b[%d;%d;%d;%d;#%x]%c", &r[n].x, &r[n].y, &r[n].w, &r[n].h, &r[n].color, &as) == 6
|
||||||
&& as == '\\')
|
&& as == '\\')
|
||||||
for(++n, ++i, --j; str[i] != as || str[i - 1] != ']'; ++i);
|
for(++n, ++i, --j; str[i] != as || str[i - 1] != ']'; ++i);
|
||||||
@ -68,7 +68,7 @@ statustext_graph(StatusGraph *g, char *str)
|
|||||||
char as, c, *p;
|
char as, c, *p;
|
||||||
int n, i, j, k, m, w;
|
int n, i, j, k, m, w;
|
||||||
|
|
||||||
for(i = j = n = 0; i < strlen(str); ++i, ++j)
|
for(i = j = n = 0; i < (int)strlen(str); ++i, ++j)
|
||||||
if(sscanf(&str[i], "\\g[%d;%d;%d;%d;#%x;%512[^]]]%c",
|
if(sscanf(&str[i], "\\g[%d;%d;%d;%d;#%x;%512[^]]]%c",
|
||||||
&g[n].x, &g[n].y, &g[n].w, &g[n].h, &g[n].color, g[n].data, &as) == 7
|
&g[n].x, &g[n].y, &g[n].w, &g[n].h, &g[n].color, g[n].data, &as) == 7
|
||||||
&& as == '\\')
|
&& as == '\\')
|
||||||
@ -84,7 +84,7 @@ statustext_graph(StatusGraph *g, char *str)
|
|||||||
/* height limits */
|
/* height limits */
|
||||||
if(c < 0)
|
if(c < 0)
|
||||||
c = 0;
|
c = 0;
|
||||||
if(c > g[n].h)
|
if(c > (char)g[n].h)
|
||||||
c = g[n].h;
|
c = g[n].h;
|
||||||
g[n].data[m] = c;
|
g[n].data[m] = c;
|
||||||
p = strtok(NULL, ";");
|
p = strtok(NULL, ";");
|
||||||
@ -118,7 +118,7 @@ statustext_text(StatusText *s, char *str)
|
|||||||
char as;
|
char as;
|
||||||
int n, i, j, k;
|
int n, i, j, k;
|
||||||
|
|
||||||
for(i = j = n = 0; i < strlen(str); ++i, ++j)
|
for(i = j = n = 0; i < (int)strlen(str); ++i, ++j)
|
||||||
if(sscanf(&str[i], "\\s[%d;%d;%7[^;];%512[^]]]%c", &s[n].x, &s[n].y, s[n].color, s[n].text, &as) == 5
|
if(sscanf(&str[i], "\\s[%d;%d;%7[^;];%512[^]]]%c", &s[n].x, &s[n].y, s[n].color, s[n].text, &as) == 5
|
||||||
&& as == '\\')
|
&& as == '\\')
|
||||||
for(++n, ++i, --j; str[i] != as || str[i - 1] != ']'; ++i);
|
for(++n, ++i, --j; str[i] != as || str[i - 1] != ']'; ++i);
|
||||||
@ -146,7 +146,7 @@ statustext_normal(int sc, char *str)
|
|||||||
if(sc == conf.systray.screen)
|
if(sc == conf.systray.screen)
|
||||||
sw = systray_get_width();
|
sw = systray_get_width();
|
||||||
|
|
||||||
for(i = j = n = 0; i < strlen(str); ++i, ++j)
|
for(i = j = n = 0; i < (int)strlen(str); ++i, ++j)
|
||||||
if(str[i] == '\\' && str[i + 1] == '#' && str[i + 8] == '\\')
|
if(str[i] == '\\' && str[i + 1] == '#' && str[i + 8] == '\\')
|
||||||
{
|
{
|
||||||
++n;
|
++n;
|
||||||
@ -164,7 +164,7 @@ statustext_normal(int sc, char *str)
|
|||||||
{
|
{
|
||||||
strcpy(buf, strwc);
|
strcpy(buf, strwc);
|
||||||
|
|
||||||
for(i = k = 0; i < strlen(str); ++i, ++k)
|
for(i = k = 0; i < (int)strlen(str); ++i, ++k)
|
||||||
if(str[i] == '\\' && str[i + 1] == '#' && str[i + 8] == '\\')
|
if(str[i] == '\\' && str[i + 1] == '#' && str[i + 8] == '\\')
|
||||||
{
|
{
|
||||||
/* Store current color in col[] */
|
/* Store current color in col[] */
|
||||||
|
|||||||
@ -108,7 +108,6 @@ enum
|
|||||||
net_current_desktop,
|
net_current_desktop,
|
||||||
net_desktop_names,
|
net_desktop_names,
|
||||||
net_desktop_geometry,
|
net_desktop_geometry,
|
||||||
net_workarea,
|
|
||||||
net_active_window,
|
net_active_window,
|
||||||
net_close_window,
|
net_close_window,
|
||||||
net_wm_icon_name,
|
net_wm_icon_name,
|
||||||
|
|||||||
27
src/tag.c
27
src/tag.c
@ -114,7 +114,7 @@ tag_set(int tag)
|
|||||||
/* No focusontag option found on any client, try to find the first of the tag */
|
/* No focusontag option found on any client, try to find the first of the tag */
|
||||||
if(!c)
|
if(!c)
|
||||||
for(c = clients; c; c = c->next)
|
for(c = clients; c; c = c->next)
|
||||||
if(c->tag == seltag[selscreen] && c->screen == selscreen)
|
if(c->tag == (uint)seltag[selscreen] && c->screen == selscreen)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
client_focus((c) ? c : NULL);
|
client_focus((c) ? c : NULL);
|
||||||
@ -175,6 +175,7 @@ uicb_tag(uicb_t cmd)
|
|||||||
void
|
void
|
||||||
uicb_tag_next(uicb_t cmd)
|
uicb_tag_next(uicb_t cmd)
|
||||||
{
|
{
|
||||||
|
(void)cmd;
|
||||||
screen_get_sel();
|
screen_get_sel();
|
||||||
|
|
||||||
tag_set(seltag[selscreen] + 1);
|
tag_set(seltag[selscreen] + 1);
|
||||||
@ -188,6 +189,7 @@ uicb_tag_next(uicb_t cmd)
|
|||||||
void
|
void
|
||||||
uicb_tag_prev(uicb_t cmd)
|
uicb_tag_prev(uicb_t cmd)
|
||||||
{
|
{
|
||||||
|
(void)cmd;
|
||||||
screen_get_sel();
|
screen_get_sel();
|
||||||
|
|
||||||
tag_set(seltag[selscreen] - 1);
|
tag_set(seltag[selscreen] - 1);
|
||||||
@ -204,6 +206,7 @@ uicb_tag_next_visible(uicb_t cmd)
|
|||||||
int i, tag;
|
int i, tag;
|
||||||
Client *c;
|
Client *c;
|
||||||
Bool is_occupied[MAXTAG];
|
Bool is_occupied[MAXTAG];
|
||||||
|
(void)cmd;
|
||||||
|
|
||||||
screen_get_sel();
|
screen_get_sel();
|
||||||
|
|
||||||
@ -247,6 +250,7 @@ uicb_tag_prev_visible(uicb_t cmd)
|
|||||||
int i, tag;
|
int i, tag;
|
||||||
Client *c;
|
Client *c;
|
||||||
Bool is_occupied[MAXTAG];
|
Bool is_occupied[MAXTAG];
|
||||||
|
(void)cmd;
|
||||||
|
|
||||||
screen_get_sel();
|
screen_get_sel();
|
||||||
|
|
||||||
@ -314,6 +318,7 @@ uicb_tagtransfert(uicb_t cmd)
|
|||||||
void
|
void
|
||||||
uicb_tag_prev_sel(uicb_t cmd)
|
uicb_tag_prev_sel(uicb_t cmd)
|
||||||
{
|
{
|
||||||
|
(void)cmd;
|
||||||
screen_get_sel();
|
screen_get_sel();
|
||||||
|
|
||||||
tag_set(prevseltag[selscreen]);
|
tag_set(prevseltag[selscreen]);
|
||||||
@ -329,6 +334,7 @@ uicb_tagtransfert_next(uicb_t cmd)
|
|||||||
{
|
{
|
||||||
CHECK(sel);
|
CHECK(sel);
|
||||||
int tag = seltag[selscreen] + 1;
|
int tag = seltag[selscreen] + 1;
|
||||||
|
(void)cmd;
|
||||||
|
|
||||||
if(tag > conf.ntag[selscreen])
|
if(tag > conf.ntag[selscreen])
|
||||||
{
|
{
|
||||||
@ -349,6 +355,7 @@ uicb_tagtransfert_prev(uicb_t cmd)
|
|||||||
{
|
{
|
||||||
CHECK(sel);
|
CHECK(sel);
|
||||||
int tag = seltag[selscreen] - 1;
|
int tag = seltag[selscreen] - 1;
|
||||||
|
(void)cmd;
|
||||||
|
|
||||||
if(tag <= 0)
|
if(tag <= 0)
|
||||||
{
|
{
|
||||||
@ -370,6 +377,8 @@ uicb_tag_urgent(uicb_t cmd)
|
|||||||
Client *c;
|
Client *c;
|
||||||
Bool b = False;
|
Bool b = False;
|
||||||
|
|
||||||
|
(void)cmd;
|
||||||
|
|
||||||
/* Check if there is a urgent client */
|
/* Check if there is a urgent client */
|
||||||
for(c = clients; c; c = c->next)
|
for(c = clients; c; c = c->next)
|
||||||
if(c->flags & UrgentFlag)
|
if(c->flags & UrgentFlag)
|
||||||
@ -441,9 +450,9 @@ tag_swap(int s, int t1, int t2)
|
|||||||
|
|
||||||
for(c = clients; c; c = c->next)
|
for(c = clients; c; c = c->next)
|
||||||
{
|
{
|
||||||
if(c->screen == s && c->tag == t1)
|
if(c->screen == s && c->tag == (uint)t1)
|
||||||
c->tag = t2;
|
c->tag = t2;
|
||||||
else if(c->screen == s && c->tag == t2)
|
else if(c->screen == s && c->tag == (uint)t2)
|
||||||
c->tag = t1;
|
c->tag = t1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -472,6 +481,7 @@ uicb_tag_swap(uicb_t cmd)
|
|||||||
void
|
void
|
||||||
uicb_tag_swap_next(uicb_t cmd)
|
uicb_tag_swap_next(uicb_t cmd)
|
||||||
{
|
{
|
||||||
|
(void)cmd;
|
||||||
screen_get_sel();
|
screen_get_sel();
|
||||||
|
|
||||||
tag_swap(selscreen, seltag[selscreen], seltag[selscreen] + 1);
|
tag_swap(selscreen, seltag[selscreen], seltag[selscreen] + 1);
|
||||||
@ -485,6 +495,7 @@ uicb_tag_swap_next(uicb_t cmd)
|
|||||||
void
|
void
|
||||||
uicb_tag_swap_previous(uicb_t cmd)
|
uicb_tag_swap_previous(uicb_t cmd)
|
||||||
{
|
{
|
||||||
|
(void)cmd;
|
||||||
screen_get_sel();
|
screen_get_sel();
|
||||||
|
|
||||||
tag_swap(selscreen, seltag[selscreen], seltag[selscreen] - 1);
|
tag_swap(selscreen, seltag[selscreen], seltag[selscreen] - 1);
|
||||||
@ -559,15 +570,17 @@ uicb_tag_new(uicb_t cmd)
|
|||||||
void
|
void
|
||||||
tag_delete(int s, int tag)
|
tag_delete(int s, int tag)
|
||||||
{
|
{
|
||||||
Tag t = { 0 };
|
Tag t;
|
||||||
Client *c;
|
Client *c;
|
||||||
int i;
|
size_t i;
|
||||||
|
|
||||||
|
memset(&t, 0, sizeof(t));
|
||||||
|
|
||||||
if(tag < 0 || tag > conf.ntag[s] || conf.ntag[s] == 1)
|
if(tag < 0 || tag > conf.ntag[s] || conf.ntag[s] == 1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for(c = clients; c; c = c->next)
|
for(c = clients; c; c = c->next)
|
||||||
if(c->screen == s && c->tag == tag)
|
if(c->screen == s && c->tag == (uint)tag)
|
||||||
{
|
{
|
||||||
warnx("Client(s) present in this tag, can't delete it");
|
warnx("Client(s) present in this tag, can't delete it");
|
||||||
|
|
||||||
@ -579,7 +592,7 @@ tag_delete(int s, int tag)
|
|||||||
tags[s][tag] = t;
|
tags[s][tag] = t;
|
||||||
infobar[s].tags[tag] = NULL;
|
infobar[s].tags[tag] = NULL;
|
||||||
|
|
||||||
for(i = tag; i < conf.ntag[s] + 1; ++i)
|
for(i = tag; i < (size_t)conf.ntag[s] + 1; ++i)
|
||||||
{
|
{
|
||||||
/* Set clients tag because of shift */
|
/* Set clients tag because of shift */
|
||||||
for(c = clients; c; c = c->next)
|
for(c = clients; c; c = c->next)
|
||||||
|
|||||||
@ -209,7 +209,8 @@ spawn(const char *format, ...)
|
|||||||
char cmd[512];
|
char cmd[512];
|
||||||
va_list ap;
|
va_list ap;
|
||||||
pid_t pid, ret;
|
pid_t pid, ret;
|
||||||
int p[2], len;
|
int p[2];
|
||||||
|
size_t len;
|
||||||
|
|
||||||
va_start(ap, format);
|
va_start(ap, format);
|
||||||
len = vsnprintf(cmd, sizeof(cmd), format, ap);
|
len = vsnprintf(cmd, sizeof(cmd), format, ap);
|
||||||
@ -307,7 +308,7 @@ parse_image_block(ImageAttr *im, char *str)
|
|||||||
char as;
|
char as;
|
||||||
int n, i, j, k;
|
int n, i, j, k;
|
||||||
|
|
||||||
for(i = j = n = 0; i < strlen(str); ++i, ++j)
|
for(i = j = n = 0; i < (int)strlen(str); ++i, ++j)
|
||||||
if(sscanf(&str[i], "\\i[%d;%d;%d;%d;%512[^]]]%c", &im[n].x, &im[n].y, &im[n].w, &im[n].h, im[n].name, &as) == 6
|
if(sscanf(&str[i], "\\i[%d;%d;%d;%d;%512[^]]]%c", &im[n].x, &im[n].y, &im[n].w, &im[n].h, im[n].name, &as) == 6
|
||||||
&& as == '\\')
|
&& as == '\\')
|
||||||
for(++n, ++i, --j; str[i] != as || str[i - 1] != ']'; ++i);
|
for(++n, ++i, --j; str[i] != as || str[i - 1] != ']'; ++i);
|
||||||
|
|||||||
@ -65,7 +65,7 @@ vicmd_to_uicb vicmd[] =
|
|||||||
void
|
void
|
||||||
viwmfs_help(void)
|
viwmfs_help(void)
|
||||||
{
|
{
|
||||||
int i;
|
size_t i;
|
||||||
char s[20];
|
char s[20];
|
||||||
|
|
||||||
printf("ViWMFS commands list:\n");
|
printf("ViWMFS commands list:\n");
|
||||||
@ -85,7 +85,7 @@ viwmfs_help(void)
|
|||||||
void
|
void
|
||||||
viwmfs(int argc, char **argv)
|
viwmfs(int argc, char **argv)
|
||||||
{
|
{
|
||||||
int i;
|
size_t i;
|
||||||
char *cmd, str[256] = { 0 };
|
char *cmd, str[256] = { 0 };
|
||||||
Bool e;
|
Bool e;
|
||||||
|
|
||||||
@ -94,7 +94,7 @@ viwmfs(int argc, char **argv)
|
|||||||
|
|
||||||
if(argc > 3)
|
if(argc > 3)
|
||||||
{
|
{
|
||||||
for(i = 2; i < argc; ++i)
|
for(i = 2; i < (size_t)argc; ++i)
|
||||||
{
|
{
|
||||||
strcat(str, argv[i]);
|
strcat(str, argv[i]);
|
||||||
|
|
||||||
|
|||||||
22
src/wmfs.c
22
src/wmfs.c
@ -68,6 +68,8 @@ errorhandler(Display *d, XErrorEvent *event)
|
|||||||
int
|
int
|
||||||
errorhandlerdummy(Display *d, XErrorEvent *event)
|
errorhandlerdummy(Display *d, XErrorEvent *event)
|
||||||
{
|
{
|
||||||
|
(void)d;
|
||||||
|
(void)event;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -77,7 +79,7 @@ void
|
|||||||
quit(void)
|
quit(void)
|
||||||
{
|
{
|
||||||
Client *c;
|
Client *c;
|
||||||
int i;
|
size_t i, len;
|
||||||
|
|
||||||
/* Set the silent error handler */
|
/* Set the silent error handler */
|
||||||
XSetErrorHandler(errorhandlerdummy);
|
XSetErrorHandler(errorhandlerdummy);
|
||||||
@ -104,7 +106,6 @@ quit(void)
|
|||||||
IFREE(spgeo);
|
IFREE(spgeo);
|
||||||
IFREE(infobar);
|
IFREE(infobar);
|
||||||
IFREE(keys);
|
IFREE(keys);
|
||||||
IFREE(func_list);
|
|
||||||
IFREE(net_atom);
|
IFREE(net_atom);
|
||||||
|
|
||||||
/* Clean conf alloced thing */
|
/* Clean conf alloced thing */
|
||||||
@ -112,7 +113,8 @@ quit(void)
|
|||||||
|
|
||||||
if(conf.menu)
|
if(conf.menu)
|
||||||
{
|
{
|
||||||
for(i = 0; i < LEN(conf.menu); ++i)
|
len = LEN(conf.menu);
|
||||||
|
for(i = 0; i < len; ++i)
|
||||||
IFREE(conf.menu[i].item);
|
IFREE(conf.menu[i].item);
|
||||||
IFREE(conf.menu);
|
IFREE(conf.menu);
|
||||||
}
|
}
|
||||||
@ -193,6 +195,7 @@ mainloop(void)
|
|||||||
void
|
void
|
||||||
uicb_quit(uicb_t cmd)
|
uicb_quit(uicb_t cmd)
|
||||||
{
|
{
|
||||||
|
(void)cmd;
|
||||||
exiting = True;
|
exiting = True;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@ -204,11 +207,11 @@ uicb_quit(uicb_t cmd)
|
|||||||
void
|
void
|
||||||
scan(void)
|
scan(void)
|
||||||
{
|
{
|
||||||
uint i, n;
|
uint n;
|
||||||
XWindowAttributes wa;
|
XWindowAttributes wa;
|
||||||
Window usl, usl2, *w = NULL;
|
Window usl, usl2, *w = NULL;
|
||||||
Atom rt;
|
Atom rt;
|
||||||
int s, rf, tag = -1, screen = -1, free = -1;
|
int s, rf, tag = -1, screen = -1, free = -1, i;
|
||||||
ulong ir, il;
|
ulong ir, il;
|
||||||
uchar *ret;
|
uchar *ret;
|
||||||
Client *c;
|
Client *c;
|
||||||
@ -259,7 +262,7 @@ scan(void)
|
|||||||
/* Set update layout request */
|
/* Set update layout request */
|
||||||
for(c = clients; c; c = c->next)
|
for(c = clients; c; c = c->next)
|
||||||
{
|
{
|
||||||
if(c->tag > conf.ntag[c->screen])
|
if(c->tag > (uint)conf.ntag[c->screen])
|
||||||
c->tag = conf.ntag[c->screen];
|
c->tag = conf.ntag[c->screen];
|
||||||
tags[c->screen][c->tag].request_update = True;
|
tags[c->screen][c->tag].request_update = True;
|
||||||
}
|
}
|
||||||
@ -278,11 +281,17 @@ scan(void)
|
|||||||
void
|
void
|
||||||
uicb_reload(uicb_t cmd)
|
uicb_reload(uicb_t cmd)
|
||||||
{
|
{
|
||||||
|
(void)cmd;
|
||||||
quit();
|
quit();
|
||||||
|
|
||||||
for(; argv_global[0] && argv_global[0] == ' '; ++argv_global);
|
for(; argv_global[0] && argv_global[0] == ' '; ++argv_global);
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
execvp(argv_global, all_argv);
|
execvp(argv_global, all_argv);
|
||||||
|
=======
|
||||||
|
/* add -C to always load the same config file */
|
||||||
|
execlp(argv_global, argv_global, "-C", conf.confpath, NULL);
|
||||||
|
>>>>>>> master
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -398,6 +407,7 @@ update_status(void)
|
|||||||
void
|
void
|
||||||
signal_handle(int sig)
|
signal_handle(int sig)
|
||||||
{
|
{
|
||||||
|
(void)sig;
|
||||||
exiting = True;
|
exiting = True;
|
||||||
quit();
|
quit();
|
||||||
exit(EXIT_SUCCESS);
|
exit(EXIT_SUCCESS);
|
||||||
|
|||||||
@ -33,7 +33,9 @@
|
|||||||
#ifndef WMFS_H
|
#ifndef WMFS_H
|
||||||
#define WMFS_H
|
#define WMFS_H
|
||||||
|
|
||||||
|
/* glibc stuff */
|
||||||
#define _BSD_SOURCE /* vsnprintf */
|
#define _BSD_SOURCE /* vsnprintf */
|
||||||
|
#define _POSIX_SOURCE /* kill() */
|
||||||
|
|
||||||
/* Lib headers */
|
/* Lib headers */
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@ -220,7 +222,6 @@ void ewmh_update_current_tag_prop(void);
|
|||||||
void ewmh_get_client_list(void);
|
void ewmh_get_client_list(void);
|
||||||
void ewmh_get_desktop_names(void);
|
void ewmh_get_desktop_names(void);
|
||||||
void ewmh_set_desktop_geometry(void);
|
void ewmh_set_desktop_geometry(void);
|
||||||
void ewmh_set_workarea(void);
|
|
||||||
void ewmh_manage_net_wm_state(long data_l[], Client *c);
|
void ewmh_manage_net_wm_state(long data_l[], Client *c);
|
||||||
void ewmh_manage_window_type(Client *c);
|
void ewmh_manage_window_type(Client *c);
|
||||||
|
|
||||||
@ -471,7 +472,7 @@ Client *clients;
|
|||||||
Client *sel;
|
Client *sel;
|
||||||
|
|
||||||
/* Other */
|
/* Other */
|
||||||
func_name_list_t *func_list;
|
extern const func_name_list_t func_list[];
|
||||||
extern const func_name_list_t layout_list[];
|
extern const func_name_list_t layout_list[];
|
||||||
uint numlockmask;
|
uint numlockmask;
|
||||||
Systray *trayicons;
|
Systray *trayicons;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user