matchbox-window-manager-1.2/0000755000211500234210000000000011307442071014736 5ustar bifh1bifhsmatchbox-window-manager-1.2/config.guess0000644000211500234210000012546611307442071017271 0ustar bifh1bifhs#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. timestamp='2005-04-22' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner . # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you # don't specify an explicit build system type. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit 0 ;; --version | -v ) echo "$version" ; exit 0 ;; --help | --h* | -h ) echo "$usage"; exit 0 ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep __ELF__ >/dev/null then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit 0 ;; amd64:OpenBSD:*:*) echo x86_64-unknown-openbsd${UNAME_RELEASE} exit 0 ;; amiga:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; cats:OpenBSD:*:*) echo arm-unknown-openbsd${UNAME_RELEASE} exit 0 ;; hp300:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; luna88k:OpenBSD:*:*) echo m88k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mac68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; macppc:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme88k:OpenBSD:*:*) echo m88k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvmeppc:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sgi:OpenBSD:*:*) echo mips64-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sun3:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; *:OpenBSD:*:*) echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} exit 0 ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit 0 ;; macppc:MirBSD:*:*) echo powerppc-unknown-mirbsd${UNAME_RELEASE} exit 0 ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit 0 ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit 0 ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit 0 ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit 0 ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit 0;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit 0 ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit 0 ;; *:OS/390:*:*) echo i370-ibm-openedition exit 0 ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit 0 ;; *:OS400:*:*) echo powerpc-ibm-os400 exit 0 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit 0;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit 0;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit 0 ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit 0 ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit 0 ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7 && exit 0 ;; esac ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; i86pc:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit 0 ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit 0 ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit 0 ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit 0 ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit 0 ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit 0 ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit 0 ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit 0 ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit 0 ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit 0 ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit 0 ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit 0 ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit 0 ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c \ && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ && exit 0 echo mips-mips-riscos${UNAME_RELEASE} exit 0 ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit 0 ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit 0 ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit 0 ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit 0 ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit 0 ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit 0 ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit 0 ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit 0 ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit 0 ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit 0 ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit 0 ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit 0 ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit 0 ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit 0 ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit 0 ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 echo rs6000-ibm-aix3.2.5 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit 0 ;; *:AIX:*:[45]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit 0 ;; *:AIX:*:*) echo rs6000-ibm-aix exit 0 ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit 0 ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit 0 ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit 0 ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit 0 ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit 0 ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit 0 ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then # avoid double evaluation of $set_cc_for_build test -n "$CC_FOR_BUILD" || eval $set_cc_for_build if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit 0 ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit 0 ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 echo unknown-hitachi-hiuxwe2 exit 0 ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit 0 ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit 0 ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit 0 ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit 0 ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit 0 ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit 0 ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit 0 ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit 0 ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit 0 ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit 0 ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit 0 ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit 0 ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit 0 ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit 0 ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:FreeBSD:*:*) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit 0 ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit 0 ;; i*:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit 0 ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit 0 ;; x86:Interix*:[34]*) echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' exit 0 ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit 0 ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit 0 ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit 0 ;; amd64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit 0 ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit 0 ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit 0 ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit 0 ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit 0 ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit 0 ;; crisv32:Linux:*:*) echo crisv32-axis-linux-gnu exit 0 ;; frv:Linux:*:*) echo frv-unknown-linux-gnu exit 0 ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; mips:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips #undef mipsel #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mipsel #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 ;; mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips64 #undef mips64el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mips64el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips64 #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit 0 ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit 0 ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit 0 ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit 0 ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit 0 ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit 0 ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit 0 ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. # Set LC_ALL=C to ensure ld outputs messages in English. ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g s/.*supported targets: *// s/ .*// p'` case "$ld_supported_targets" in elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit 0 ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit 0 ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-gnuoldld" exit 0 ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 LIBC=gnu # else LIBC=gnulibc1 # endif # else LIBC=gnulibc1 # endif #else #ifdef __INTEL_COMPILER LIBC=gnu #else LIBC=gnuaout #endif #endif #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit 0 ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit 0 ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit 0 ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit 0 ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit 0 ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit 0 ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit 0 ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit 0 ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit 0 ;; i*86:*:5:[78]*) case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit 0 ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit 0 ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i386. echo i386-pc-msdosdjgpp exit 0 ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit 0 ;; paragon:*:*:*) echo i860-intel-osf1 exit 0 ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit 0 ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit 0 ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit 0 ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit 0 ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4.3${OS_REL} && exit 0 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4 && exit 0 ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit 0 ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit 0 ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit 0 ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit 0 ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit 0 ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit 0 ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit 0 ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit 0 ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit 0 ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit 0 ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit 0 ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit 0 ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit 0 ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit 0 ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit 0 ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit 0 ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit 0 ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit 0 ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit 0 ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in *86) UNAME_PROCESSOR=i686 ;; unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit 0 ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit 0 ;; *:QNX:*:4*) echo i386-pc-qnx exit 0 ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit 0 ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit 0 ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit 0 ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit 0 ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit 0 ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit 0 ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit 0 ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit 0 ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit 0 ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit 0 ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit 0 ;; *:ITS:*:*) echo pdp10-unknown-its exit 0 ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit 0 ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit 0 ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms && exit 0 ;; I*) echo ia64-dec-vms && exit 0 ;; V*) echo vax-dec-vms && exit 0 ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit 0 ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0 # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit 0 ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; c34*) echo c34-convex-bsd exit 0 ;; c38*) echo c38-convex-bsd exit 0 ;; c4*) echo c4-convex-bsd exit 0 ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: matchbox-window-manager-1.2/config.sub0000644000211500234210000007547011307442071016733 0ustar bifh1bifhs#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. timestamp='2005-04-22' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit 0 ;; --version | -v ) echo "$version" ; exit 0 ;; --help | --h* | -h ) echo "$usage"; exit 0 ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit 0;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \ kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray) os= basic_machine=$1 ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | m32r | m32rle | m68000 | m68k | m88k | maxq | mcore \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64vr | mips64vrel \ | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | msp430 \ | ns16k | ns32k \ | openrisc | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b \ | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64vr-* | mips64vrel-* \ | mips64orion-* | mips64orionel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | msp430-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa-* \ | ymp-* \ | z8k-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; c90) basic_machine=c90-cray os=-unicos ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16c) basic_machine=cr16c-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; or32 | or32-*) basic_machine=or32-unknown os=-coff ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tic55x | c55x*) basic_machine=tic55x-unknown os=-coff ;; tic6x | c6x*) basic_machine=tic6x-unknown os=-coff ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sh64) basic_machine=sh64-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: matchbox-window-manager-1.2/matchbox-window-manager/0000775000211500234210000000000011307441355021466 5ustar bifh1bifhsmatchbox-window-manager-1.2/matchbox-window-manager/depcomp0000775000211500234210000003541011307441355023046 0ustar bifh1bifhs#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2004-04-25.13 # Copyright (C) 1999, 2000, 2003, 2004 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by `PROGRAMS ARGS'. object Object file output by `PROGRAMS ARGS'. depfile Dependency file to output. tmpdepfile Temporary file to use when outputing dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit 0 ;; -v | --v*) echo "depcomp $scriptversion" exit 0 ;; esac if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # `libtool' can also be set to `yes' or `no'. if test -z "$depfile"; then base=`echo "$object" | sed -e 's,^.*/,,' -e 's,\.\([^.]*\)$,.P\1,'` dir=`echo "$object" | sed 's,/.*$,/,'` if test "$dir" = "$object"; then dir= fi # FIXME: should be _deps on DOS. depfile="$dir.deps/$base" fi tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the `deleted header file' problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' ' ' < "$tmpdepfile" | ## Some versions of gcc put a space before the `:'. On the theory ## that the space means something, we add a space to the output as ## well. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like `#:fec' to the end of the # dependency line. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr ' ' ' ' >> $depfile echo >> $depfile # The second pass generates a dummy entry for each header file. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> $depfile else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts `$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` tmpdepfile="$stripped.u" if test "$libtool" = yes; then "$@" -Wc,-M else "$@" -M fi stat=$? if test -f "$tmpdepfile"; then : else stripped=`echo "$stripped" | sed 's,^.*/,,'` tmpdepfile="$stripped.u" fi if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi if test -f "$tmpdepfile"; then outname="$stripped.o" # Each line is of the form `foo.o: dependent.h'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler understands `-MD -MF file'. However on # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want: # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using \ : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in `foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then # Dependencies are output in .lo.d with libtool 1.4. # They are output in .o.d with libtool 1.5. tmpdepfile1="$dir.libs/$base.lo.d" tmpdepfile2="$dir.libs/$base.o.d" tmpdepfile3="$dir.libs/$base.d" "$@" -Wc,-MD else tmpdepfile1="$dir$base.o.d" tmpdepfile2="$dir$base.d" tmpdepfile3="$dir$base.d" "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi if test -f "$tmpdepfile1"; then tmpdepfile="$tmpdepfile1" elif test -f "$tmpdepfile2"; then tmpdepfile="$tmpdepfile2" else tmpdepfile="$tmpdepfile3" fi if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for `:' # in the target name. This is to cope with DOS-style filenames: # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. "$@" $dashmflag | sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' ' ' < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # X makedepend shift cleared=no for arg in "$@"; do case $cleared in no) set ""; shift cleared=yes ;; esac case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix="`echo $object | sed 's/^.*\././'`" touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' ' ' | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o, # because we must use -o when running libtool. "$@" || exit $? IFS=" " for arg do case "$arg" in "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: matchbox-window-manager-1.2/matchbox-window-manager/configure.ac0000664000211500234210000003450711307441354023764 0ustar bifh1bifhsAC_PREREQ(2.53) AC_INIT([matchbox-window-manager], 1.2, [mallum@handhelds.org]) AC_CONFIG_SRCDIR([src/wm.c]) AM_INIT_AUTOMAKE() AM_MAINTAINER_MODE AM_CONFIG_HEADER([config.h]) # Checks for programs. AC_PROG_CC # Checks for header files. AC_HEADER_SYS_WAIT AC_CHECK_HEADERS([stdlib.h string.h unistd.h]) SUPPORTS_PNG=0 SUPPORTS_JPEG=0 SUPPORTS_XFT=0 SUPPORTS_PANGO=0 SUPPORTS_XSETTINGS=0 dnl ----- Args ------------------------------------------------------------- AC_ARG_ENABLE(standalone-xft, [ --enable-standalone-xft enable standalone build ( with Xft font), [default=no]], enable_standalone_xft=$enableval, enable_standalone_xft=no) AC_ARG_ENABLE(standalone, [ --enable-standalone enable standalone build.], enable_standalone=$enableval, enable_standalone=no) AC_ARG_ENABLE(composite, [ --enable-composite enable composite support (EXPERIMENTAL).], enable_composite=$enableval, enable_composite=no) AC_ARG_ENABLE(frameanimation, [ --enable-frameanimation enable frame animation support (EXPERIMENTAL).], enable_frameanimation=$enableval, enable_frameanimation=no) AC_ARG_ENABLE(startup_notification, [ --enable-startup-notification enable startup notification support], enable_startup_notification=$enableval, enable_startup_notification=no ) AC_ARG_ENABLE(expat, [ --enable-expat enable expat XML parser support], enable_expat=$enableval, enable_expat=no ) AC_ARG_WITH(expat-includes, [ --with-expat-includes=DIR Use Expat includes in DIR], expat_includes=$withval, expat_includes=yes) AC_ARG_WITH(expat-lib, [ --with-expat-lib=DIR Use Expat library in DIR], expat_lib=$withval, expat_lib=yes) # DISABLE PERMANTLY FOR NOW #AC_ARG_ENABLE(xsync, # [ --enable-xsync enable XSYNC X extension support (EXPERIMENTAL )], # enable_xsync=$enableval, enable_xsync=no ) enable_xsync=no AC_ARG_ENABLE(gconf, [ --enable-gconf enable gconf support], enable_gconf=$enableval, enable_gconf=no ) AC_ARG_ENABLE(session, [ --enable-session enable session manager support], enable_session=$enableval, enable_session=no ) AC_ARG_ENABLE(keyboard, [ --disable-keyboard disable keyboard support [default=no]], enable_keyboard=$enableval, enable_keyboard=yes) AC_ARG_ENABLE(ping-protocol, [ --disable-ping-protocol disable ping protocol support [default=no]], enable_ping_protocol=$enableval, enable_ping_protocol=yes) AC_ARG_ENABLE(xrm, [ --disable-xrm disable Xrm support [default=no]], enable_xrm=$enableval, enable_xrm=yes) AC_ARG_ENABLE(alt_input_wins, [ --enable-alt-input-wins enable alternate managing input windows ], enable_alt_input_wins=$enableval, enable_alt_input_wins=no) AC_ARG_ENABLE(debug, [ --enable-debug enable debug ( verbose ) build], enable_debug=$enableval, enable_debug=no ) AC_ARG_ENABLE(gcov, [ --enable-gcov enable gcov coverage ( testing only ) build], enable_gcov=$enableval, enable_gcov=no ) AC_ARG_ENABLE(gprof, [ --enable-gprof enable gprof profiler ( testing only ) build], enable_gprof=$enableval, enable_gprof=no ) dnl ---- Check we can find libmb if test x$enable_standalone != xyes && test x$enable_standalone_xft != xyes; then PKG_CHECK_MODULES(LIBMB, libmb >= 1.5, [have_libmb="yes"], [have_libmb="no"]) if test x$have_libmb = xno; then echo " ******************************************************************* *** *** Cannot find libmatchbox ( >= 1.5 ) library, please check it is *** correctly installed. *** *** If you want to build without libmatchbox, you can build a 'standalone' *** matchbox. To do so rerun configure with; *** *** --enable-standalone, or --enable-standalone-xft *** *** NOTE: a 'standalone' build does _not_ support themeing. It will be ugly. *** *** ( See manual at http://projects.o-hand.com/matchbox for more info ) *** ******************************************************************* " AC_MSG_ERROR([Unable to find libMatchbox and standalone build not requested.]) fi else # we need to get PKG_CONFIG set anyway AC_PATH_PROG(PKG_CONFIG, pkg-config, no) fi XFT_LIBS= XFT_CFLAGS= if test x$enable_standalone_xft = xyes; then AC_MSG_CHECKING([for xft]) if test x$PKG_CONFIG != xno && $PKG_CONFIG --exists xft; then XFT_CFLAGS="`pkg-config --cflags xft`" XFT_LIBS="`pkg-config --libs xft`" AC_DEFINE(USE_XFT, [1], [Use Xft]) SUPPORTS_XFT=1 AC_MSG_RESULT(yes) else AC_PATH_PROG(XFT_CONFIG, xft-config, no) if test x$XFT_CONFIG = xno; then AC_MSG_RESULT(no) AC_MSG_WARN([*** Cannot find Xft librarys, disabling support]) enable_standalone=yes enable_standalone_xft=no else XFT_CFLAGS="`xft-config --cflags`" XFT_LIBS="`xft-config --libs`" AC_DEFINE(USE_XFT, [1], [Use Xft]) SUPPORTS_XFT=1 AC_MSG_RESULT(yes) fi fi fi if test x$enable_standalone = xyes || test x$enable_standalone_xft = xyes; then AC_PATH_XTRA if test x"$no_x" = x"yes"; then AC_MSG_ERROR([*** Required X11 Headers and libraries not found.***]) fi LIBMB_CFLAGS="$XLIBS_CLAGS $XFT_CFLAGS" LIBMB_LIBS="$X_LIBS $XFT_LIBS -lX11 -lXext" AC_DEFINE(STANDALONE, [1], [Use Standalone]) if test x$enable_standalone_xft = xyes; then AC_DEFINE(USE_XFT, [1], [Use Xft fonts]) fi fi AM_CONDITIONAL(WANT_STANDALONE, test x$enable_standalone = xyes || test x$enable_standalone_xft = xyes) dnl ------ XSYNC support ------------------------------------------------ if test x$enable_xsync = xyes; then have_xsync="yes" AC_CHECK_LIB(Xext, XSyncQueryExtension, have_xsync="yes" , have_sync="no" ,$LIBMB_LIBS ) if test "x$have_xsync" = "xyes"; then AC_CHECK_HEADER(X11/extensions/sync.h,,have_xsync=no, [#include ]) fi if test "x$have_xsync" = "xno"; then AC_MSG_WARN([Unable to meet XSync dependencies. Not enabling]) enable_xsync="no" else AC_MSG_RESULT([Enabling XSync Support.]) AC_DEFINE(USE_XSYNC, 1, Have the SYNC extension library) fi fi dnl ------ keyboard support ------------------------------------------------ if test x$enable_keyboard = xno; then LIBMB_CFLAGS="$LIBMB_CFLAGS -DNO_KBD" AC_MSG_RESULT([Disabling Keyboard Support.]) fi dnl ------ ping proto support ---------------------------------------------- if test x$enable_ping_protocol = xno; then LIBMB_CFLAGS="$LIBMB_CFLAGS -DNO_PING" AC_MSG_RESULT([Disabling Ping Protocol Support.]) fi dnl ------ Input Wins---------------------------------------------------- if test x$enable_alt_input_wins = xyes; then AC_DEFINE(USE_ALT_INPUT_WIN, [1], [use alternative input Windows]) fi dnl ------ Xrm support ------------------------------------------------ if test x$enable_xrm = xno; then AC_DEFINE(NO_XRM, [1], [Dont use Xrm]) AC_MSG_RESULT([Disabling Xrm Support.]) fi dnl ------ Debug Build ----------------------------------------------------- if test x$enable_debug = xyes; then LIBMB_CFLAGS="$LIBMB_CFLAGS -DDEBUG" fi dnl ------ Composite ------------------------------------------------------- if test x$enable_composite != xno; then PKG_CHECK_MODULES(COMPO, xcomposite xfixes xdamage xrender, , AC_MSG_ERROR([*** Required Composite Librays not installed ***])) AC_DEFINE(USE_COMPOSITE, [1], [use bleeding enge composite code]) fi dnl ------ Frame animation ------------------------------------------------- if test x$enable_frameanimation != xno; then AC_DEFINE(USE_FRAME_ANIMATION, [1], [use frame animation code]) fi dnl ------ XFixes Curosr removal check ------------------------------------ PKG_CHECK_MODULES(XFIXES, xfixes >= 4.0, have_xfixes=yes, have_xfixes=no) if test x$have_xfixes = xyes; then AC_DEFINE(HAVE_XFIXES, [1], [Use XFixes ext to really hide cursor]) fi PKG_CHECK_MODULES(XCURSOR, xcursor, have_xcursor=yes, have_xcursor=no) if test x$have_xcursor = xyes; then AC_DEFINE(HAVE_XCURSOR, [1], [Use XCursor to sync pointer themes]) fi dnl ------ Expat ------------------------------------------------------------ if test x$enable_expat != xno; then case "$expat_includes" in yes|no) EXPAT_CFLAGS="" ;; *) EXPAT_CFLAGS="-I$expat_includes" ;; esac case "$expat_lib" in yes) case "$expat" in yes) EXPAT_LIBS="-lexpat" ;; *) EXPAT_LIBS="-L$expat/lib -lexpat" ;; esac ;; no) ;; *) EXPAT_LIBS="-L$expat_lib -lexpat" ;; esac expatsaved_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $EXPAT_CFLAGS" expatsaved_LIBS="$LIBS" LIBS="$LIBS $EXPAT_LIBS" AC_CHECK_HEADER(expat.h) case "$ac_cv_header_expat_h" in no) AC_CHECK_HEADER(xmlparse.h) case "$ac_cv_header_xmlparse_h" in no) have_expat_header=no; ;; yes) HAVE_XMLPARSE_H=1 AC_SUBST(HAVE_XMLPARSE_H) AC_DEFINE_UNQUOTED(HAVE_XMLPARSE_H,$HAVE_XMLPARSE_H, [Use xmlparse.h instead of expat.h]) have_expat_header=yes ;; esac ;; yes) have_expat_header=yes ;; esac case "$have_expat_header" in no) expat=no ;; yes) AC_CHECK_FUNCS(XML_ParserCreate) case "$ac_cv_func_XML_ParserCreate" in no) expat=no ;; yes) HAVE_EXPAT=1 AC_SUBST(HAVE_EXPAT) AC_DEFINE_UNQUOTED(HAVE_EXPAT,$HAVE_EXPAT, [Found a useable expat library]) ;; esac ;; esac CPPFLAGS="$saved_CPPFLAGS" LIBS="$saved_LIBS" if test x$expat = xno; then AC_MSG_ERROR([cannot find expat library]) fi AC_DEFINE(USE_EXPAT, [1], [Use Expat XML Parser]) fi dnl ------ Startup Notification --------------------------------------------- if test x$enable_startup_notification != xno; then PKG_CHECK_MODULES(SN, libstartup-notification-1.0, , AC_MSG_ERROR([*** Required Startup Notification Librays not installed ***])) AC_DEFINE(USE_LIBSN, [1], [Has StartupNotification Support]) fi dnl ----- Gconf ------------------------------------------------------------- if test x$enable_gconf != xno; then PKG_CHECK_MODULES(GCONF, gconf-2.0, , AC_MSG_ERROR([*** Required Gconf librarys not installed ***])) AC_PATH_PROG(GCONFTOOL, gconftool-2, no) if test x"$GCONFTOOL" = xno; then AC_MSG_ERROR([gconftool-2 executable not found in your path - should be installed with GConf]) fi AC_DEFINE(USE_GCONF, [1], [Has GConf Support]) fi AM_GCONF_SOURCE_2 AM_CONDITIONAL(ENABLE_SCHEMAS, test x$enable_gconf != xno) dnl ----- Session Manager --------------------------------------------------- if test x$enable_session != xno; then AC_CHECK_LIB(SM, SmcSaveYourselfDone, [AC_CHECK_HEADERS(X11/SM/SMlib.h, LIBMB_LIBS="-lSM -lICE $LIBMB_LIBS" found_sm=nn)], , $LIBMB_LIBS) if test "$found_sm" = "no"; then AC_MSG_ERROR([--enable-session requested and -lSM not found]) exit 1 fi AC_DEFINE(USE_SM, [1], [Has support for session manager connection]) fi dnl ----- Xsettings --------------------------------------------------------- dnl FIXME FIXME: Avoid craziness with pkg-config and check for xsetting proper if test x$enable_standalone != xyes && test x$enable_standalone_xft != xyes; then AC_MSG_CHECKING([for libmb xsettings support]) if $PKG_CONFIG --libs libmb | grep -i xsettings ; then mb_have_xsettings="yes" AC_DEFINE(USE_XSETTINGS, [1], [Use XSettings]) AC_MSG_RESULT([yes]) else mb_have_xsettings="no" AC_MSG_RESULT([no]) fi fi dnl ------ GCC flags -------------------------------------------------------- if test "x$GCC" = "xyes"; then if test x$enable_gprof = xyes; then GCC_WARNINGS="$GCC_WARNINGS -pg" AC_MSG_RESULT([Enabling gprof Support.]) fi if test x$enable_gcov = xyes; then GCC_WARNINGS="$GCC_WARNINGS -fprofile-arcs -ftest-coverage" AC_MSG_RESULT([Enabling gcov Support.]) fi GCC_WARNINGS="-g -Wall -fno-strict-aliasing $GCC_WARNINGS" LIBMB_CFLAGS="$GCC_WARNINGS $LIBMB_CFLAGS" else if test x$enable_gprof = xyes; then AC_MSG_WARN([*** Need gcc compiler for gprof support]) fi if test x$enable_gcov = xyes; then AC_MSG_WARN([*** Need gcc compiler for gcov support]) fi fi dnl ------ Substitute in found libs, clags to Makefiles etc ----------------- AC_SUBST(LIBMB_CFLAGS) AC_SUBST(LIBMB_LIBS) AC_SUBST(COMPO_CFLAGS) AC_SUBST(COMPO_LIBS) AC_SUBST(EXPAT_LIBS) AC_SUBST(EXPAT_CFLAGS) AC_SUBST(SN_LIBS) AC_SUBST(SN_CFLAGS) AC_SUBST(GCONF_LIBS) AC_SUBST(GCONF_CFLAGS) AC_SUBST(GCONF_SCHEMA_SUBDIRS) AC_SUBST(XFIXES_CFLAGS) AC_SUBST(XFIXES_LIBS) dnl ------ Standard Stuff - # probably needs updating but now we know its safe for x-compiles AC_C_CONST AC_TYPE_PID_T # Checks for library functions. AC_FUNC_FORK AC_FUNC_VPRINTF AC_CHECK_FUNCS([strchr strdup strsep]) # FIXME: install mbsession ? AC_OUTPUT([ Makefile src/Makefile data/Makefile data/themes/Makefile data/themes/Default/Makefile data/schemas/Makefile ]) # #util/Makefile #themes/Makefile dnl ========================================================================== echo " Matchbox-wm $VERSION ====================== prefix: ${prefix} source code location: ${srcdir} compiler: ${CC} ${X_LIBS} Building with Debug: ${enable_debug} Building with gcov: ${enable_gcov} Building with gprof: ${enable_gprof} Building Standalone: ${enable_standalone} Building Standalone with Xft: ${enable_standalone_xft} Building with Keyboard: ${enable_keyboard} Building with XRM support ${enable_xrm} Building with wm ping protocol: ${enable_ping_protocol} Building with Alt input Windows: ${enable_alt_input_wins} Building with Expat: ${enable_expat} Building with XSync: ${enable_xsync} Building with XSettings: ${mb_have_xsettings} Building with Startup-Notification: ${enable_startup_notification} Building with GConf: ${enable_gconf} Building with Session support: ${enable_session} Building with Composite manager: ${enable_composite} Building with Frame animations: ${enable_frameanimation} " matchbox-window-manager-1.2/matchbox-window-manager/missing0000775000211500234210000002466611307441355023103 0ustar bifh1bifhs#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2003-09-02.23 # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003 # Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case "$1" in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case "$1" in -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch] Send bug reports to ." ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; aclocal*) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case "$f" in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison|yacc) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.h fi ;; esac fi if [ ! -f y.tab.h ]; then echo >y.tab.h fi if [ ! -f y.tab.c ]; then echo 'main() { return 0; }' >y.tab.c fi ;; lex|flex) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if [ ! -f lex.yy.c ]; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` fi if [ -f "$file" ]; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit 1 fi ;; makeinfo) if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then # We have makeinfo, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` fi touch $file ;; tar) shift if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 fi # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error # messages. if (gnutar --version > /dev/null 2>&1); then gnutar "$@" && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar "$@" && exit 0 fi firstarg="$1" if shift; then case "$firstarg" in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac case "$firstarg" in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 ;; esac fi echo 1>&2 "\ WARNING: I can't seem to be able to run \`tar' with the given arguments. You may want to install GNU tar or Free paxutils, or check the command line arguments." exit 1 ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: matchbox-window-manager-1.2/matchbox-window-manager/README0000664000211500234210000000206611307441354022351 0ustar bifh1bifhsThis is the Matchbox Window Manager source, via http://projects.o-hand.com/matchbox Quick build Notes == o Unless you want to build a really small ( and ugly ) 'standalone' matchbox-window-manager make sure you have libmatchbox already installed. o For most uses no arguments to configure should be needed. o To build a really small light matchbox wm; ./configure --enable-standalone --disable-keyboard --disable-ping-protocol \ --disable-xrm o To build a compostite matchbox wm ( for shadows effects etc ) configure with --enable-composite o To build a verbose debuggable matchbox wm configure with --enable-debug o To build a 'fat' fully featured matchbox wm ( useful for running with GNOME or KDE ); ./configure --enable-startup-notification --enable-session --enable-gconf \ --enable-expat ( Also you amy want to build libmatchbox with Pango and XSettings support. ) o Make sure your target system has at least one font installed ! o See http://projects.o-hand.com/matchbox for full documentation. matchbox-window-manager-1.2/matchbox-window-manager/AUTHORS0000664000211500234210000000004111307441354022530 0ustar bifh1bifhsMatthew Allum matchbox-window-manager-1.2/matchbox-window-manager/ChangeLog0000664000211500234210000024237111307441354023250 0ustar bifh1bifhs2009-05-27 Thomas Thurman * src/mbtheme.c: Titlebar graphics are tiled, not scaled. Fixes: NB#119151. 2009-05-18 Kimmo Hämäläinen * matchbox-window-manager/src/wm.c (wm_make_new_client): Remove urgency flag from notifications. * matchbox-window-manager/src/dialog_client.c (dialog_init_geometry): Do not allow decorationless dialogs to position themselves freely. Use 'tthurman hack' for titleless dialogs as well. Fixes: NB#106529 (dialog_client_button_press): Do not hide dialog or allow dragging when tapped on the title bar. Fixes: NB#103387 2009-05-15 Thomas Thurman * src/wm.c: all notifications have no titlebar. Closes NB#103733. 2009-05-05 Thomas Thurman * src/dialog_client.c: Remove restrictions on urgent dialogs so that they get placed and decorated. 2009-04-22 Kimmo Hämäläinen * src/wm.c (wm_set_cursor_visibility): Comment out XFixes code since it is not needed and does not hide the cursor permanently (it gets visible after the WM exits). 2007-08-16 Matthew Allum * src/wm.c: (wm_make_new_client): Always send config notifiy to new clients (Tapani Palli) 2007-08-13 Matthew Allum * src/client_common.c: (client_button_do_ops): Set time from event rather that CurrentTime when sending MB_GRAB_TRANSFER (Tapani Palli) 2007-06-22 Matthew Allum * src/wm.c: (wm_make_new_client): Make sure EWMH lists are updated when app starts in iconized state. 2007-06-21 Matthew Allum * src/structs.h: * src/base_client.c: * src/wm.c: (wm_handle_configure_request), (wm_make_new_client): Change handling of affected dialogs when an (alt) input window. (Via Tapani) Handle application windows starting in iconized state (Sugar) 2007-05-25 Matthew Allum * src/client_common.c: (client_button_do_ops): Send button number with 'grab tranfer' (#334) (Via Tapani) 2007-04-26 Matthew Allum * src/ewmh.c: (ewmh_init), (ewmh_update_lists): * src/structs.h: Add new _MB_NUM_SYSTEM_MODAL_WINDOWS_PRESENT prop. 2007-04-23 Matthew Allum * src/wm.c: (wm_make_new_client): Make sure dialog ABOVE state is inherited. (via Tapani) 2007-04-13 =============== 1.2 Release. ===================== 2007-04-13 Matthew Allum * configure.ac: Bump up for 1.2 release 2007-03-19 Matthew Allum * src/ewmh.c: (ewmh_init): * src/structs.h: * src/wm.c: (wm_make_new_client): Add basic support for; _NET_WM_WINDOW_TYPE_POPUP_MENU & _NET_WM_WINDOW_TYPE_DROPDOWN_MENU 2007-02-17 Matthew Allum * src/dialog_client.c: (dialog_client_move_resize): Dont attempt to move non existstant frame of non decorated dialog window. 2007-02-06 Matthew Allum * src/ewmh.c: (ewmh_init_props): Set _NET_CURRENT_DESKTOP to 0 2007-02-06 Matthew Allum * src/ewmh.c: (ewmh_update_rects), (set_supported): Dont list _NET_CURRENT_DESKTOP supported twice. Fix _NET_DESKTOP_GEOMETRY to be correctly WxH rather than full geom. 2007-01-25 Matthew Allum * src/wm.c: (wm_handle_configure_request): Allow decorationless dialogs to *re*position themselves offscreen. 2007-01-17 Matthew Allum * src/ewmh.c: * src/structs.h: * src/wm.c: Add support for _NET_WM_WINDOW_TYPE_NOTIFICATION (maps to mb only TYPE_MESSAGE, can be deprecated) 2007-01-16 Matthew Allum * src/wm.c: Fix Maemo input win vertical resize handling. 2007-01-11 Matthew Allum * src/dialog_client.c: Fixes to focus chaining in presence of modal dialogs. * src/stack.c: (stack_dump): * src/wm.c: (wm_activate_client): Improve debug stack dumping info. 2006-12-22 Matthew Allum * src/ewmh.c: * src/structs.h: Add very basic support for an _MB_WM_STATE prop. 2006-12-15 Matthew Allum * src/wm.c: Fix small XSet #define typo (thanks to Tapani) 2006-12-14 Matthew Allum * src/wm.c: (wm_update_layout): Handle resizing of dialogs better when a input window unmaps. (Note, for non alt-input-wins, i.e. maemo) 2006-12-14 Matthew Allum * src/base_client.c: (base_client_destroy): Release passive button grab on client destruction 2006-11-23 Matthew Allum * data/themes/blondie/theme.xml: * src/mbtheme.c: (mbtheme_init): Allow theme to set cursor theme and size. 2006-11-17 Matthew Allum * configure.ac: * src/Makefile.am: * src/wm.c: (wm_xsettings_notify_cb): Sync with cursor theme and size GTK xsettings propertys 2006-11-03 Matthew Allum * src/dialog_client.c: (dialog_init_geometry): On position a splash window centered if positioned initially at 0,0 Fixes position issues with mb panel applet message wins. 2006-10-11 Matthew Allum * src/dialog_client.c: (dialog_get_available_area): Backout 2006-09-07 change (uneeded) * src/wm.c: (wm_handle_configure_request), (wm_activate_client): Dont let alt input wins resize horizontal. Misc cleanups ( a c++ comment ) 2006-09-22 Matthew Allum * src/dialog_client.c: * src/ewmh.c: * src/structs.h: Set modal indicator desktop hint for all modal dialogs, not just system ones. Be sure to set panel in titlebar state hints (#40723) 2006-09-18 Matthew Allum * src/wm.c: (wm_handle_button_event): Dont attempt to move focus from a modal dialog to parent (maemo #40455) 2006-09-18 Matthew Allum * src/dialog_client.c: (dialog_get_available_area), (dialog_client_button_press): Fix alt input win positioning. Add better check for modal window presence to disable decoration buttons ( in super modal mode ). 2006-09-07 Matthew Allum * src/ewmh.c: (ewmh_init), (ewmh_update_lists): * src/structs.h: Advertise presence of modal blocker wins on root window ( in maemo super modal mode ) 2006-09-07 Matthew Allum * src/dialog_client.c: (dialog_get_available_area): Fix for returning correct available area for dialogs when alt input win present. 2006-09-05 Matthew Allum * src/dialog_client.c: Redo dialog dragging code to use XShape for outlines rather that XOR'ing. 2006-08-31 Matthew Allum * configure.ac: Really check for 4.0 xfixes.. 2006-08-29 Matthew Allum * configure.ac: Check for xfixes >= 4.0 rather than 2.0. 2006-08-28 Matthew Allum * src/dialog_client.c: (dialog_init_geometry): Still allow decorationless dialogs to position themselves freely - fixes error in previous commit. ( Thanks to Marco ) 2006-08-28 Matthew Allum * src/base_client.c: (base_client_new): Remove spurious repositioning if client positioned with negative positions ( should get fixed later ). * src/structs.h: * src/dialog_client.c: (dialog_init_geometry): * src/wm.c: (wm_make_new_client): Only center 0,0 non decorated clients if they have splash screen hint set. 2006-08-24 Matthew Allum * configure.ac: * src/Makefile.am: * src/wm.c: Support XFixesHide/ShowCursor if XFixes lib and recent enough extension available. Really hides cursor now. 2006-08-24 Matthew Allum * src/wm.c: (wm_update_layout): Dont let panels changing size ( or unmapping ) effect fullscreen app windows. 2006-08-24 Matthew Allum * src/wm.c: (wm_remove_client): Only check for lack of main win, not desktop also for mb app active prop update ( see last commit ) 2006-08-24 Matthew Allum * src/ewmh.c: (ewmh_update_lists): * src/wm.c: (wm_remove_client): Set root win list and active props accordingly when no active clients. 2006-08-11 Matthew Allum * src/dialog_client.c: (dialog_client_show): * src/stack.c: (stack_dump): * src/wm.c: (wm_activate_client): Grouped dialog stacking fixes (see maemo #36977) 2006-08-09 Matthew Allum * src/wm.c: (wm_activate_client): Fix focus for app mapping with multi level trans for root present. 2006-08-04 =============== 1.1 Release. ===================== 2006-08-04 Matthew Allum * NEWS: * configure.ac: Bump up version to 1.1 2006-08-03 Matthew Allum * src/client_common.c: (client_get_transient_list): * src/ewmh.c: (ewmh_init): * src/main_client.c: (main_client_configure), (main_client_title_height), (main_client_get_coverage), (main_client_reparent), (main_client_move_resize), (main_client_toggle_fullscreen), (main_client_redraw), (main_client_button_press), (main_client_toggle_title_bar): * src/structs.h: * src/wm.c: (wm_handle_property_change), (wm_make_new_client), (wm_activate_client): Add support for decoration less application windows. 2006-07-28 Matthew Allum * src/wm.c: (wm_load_config): Fix typo in non XRDB cmd line parser. 2006-07-19 Matthew Allum * src/keys.c: (keys_load_config): * src/structs.h: * src/wm.c: (wm_usage), (wm_load_config): Add support for '-kbdconfig' cmd line option to specify an alternate key shortcut config file. 2006-07-05 Matthew Allum * src/base_client.c: (base_client_destroy): Fix compiler warning when not building with alt input wins. * src/structs.h: * src/keys.c: (keys_keysym_needs_shift), (keys_add_entry): * src/wm.c: (wm_handle_keypress): Fixes for better handling shifted key shortcuts. 2006-07-05 Matthew Allum * src/wm.c: (wm_activate_client): Set the active app root prop *after* setting new list props as to avoid sync issues in apps using this info. 2006-06-13 Matthew Allum * src/ewmh.c: (ewmh_handle_root_message): Dont start pinging an app if requests to be activated but is already activated, ( maemo #32483 ) 2006-06-06 Matthew Allum * src/base_client.c: (base_client_destroy): Be more careful removing alt ( maemo ) input methods when transient to removed dialog / application. 2006-06-01 Matthew Allum * src/ewmh.c: (ewmh_hung_app_check): Call XSync() so ping is sent immediatly to be double safe. * src/wm.c: (wm_event_loop): correctly honur PING_INTERVAL, not PING_INTERVAL+1 2006-05-26 Matthew Allum * src/toolbar_client.c: (toolbar_client_show), (toolbar_client_hide), (toolbar_client_button_press): Fix for iconizing toolbar windows and there position. Fixes MB bug #95 2006-05-23 Matthew Allum * src/toolbar_client_alt.c: (toolbar_client_destroy): Add repaint to removal also. 2006-05-22 Matthew Allum * src/toolbar_client_alt.c: (toolbar_client_configure): Force a dialog repaint on IM dialog resize for safety. 2006-05-17 Matthew Allum * src/toolbar_client_alt.c: (toolbar_client_destroy): Fix typo snafu with previous commit. 2006-05-17 Matthew Allum * src/toolbar_client_alt.c: (toolbar_client_destroy): Just change affected dialog height back to original size. Dont try and do anything clever with positioning. 2006-05-11 Matthew Allum * src/ewmh.c: (ewmh_handle_root_message): * src/main_client.c: (main_client_toggle_fullscreen): * src/wm.c: (wm_activate_client): Make aggresive pinging a little less aggressive; - No pinging on fullscreen toggles. - Only ping on NET_ACTIVE message. 2006-05-08 Matthew Allum * src/toolbar_client_alt.c: (toolbar_client_new), (toolbar_client_configure), (toolbar_client_destroy): Only remember size of affected dialogs for reseting, not position. 2006-05-08 Matthew Allum * src/client_common.c: (client_get_highest_transient): Honour client_flags in initial loop. should fix maemo #25281 2006-04-19 Matthew Allum * src/main_client.c: (main_client_toggle_fullscreen): Send state message before configure when toggleing fullscreen. 2006-04-19 Matthew Allum * src/dialog_client.c: (dialog_init_geometry): Fix dialog gravity in presence of panels 2006-04-13 Matthew Allum * src/mbtheme.c: (theme_frame_paint): Dont attempt to paint 0 width decorations. 2006-04-12 Matthew Allum * src/toolbar_client_alt.c: (toolbar_client_new), (toolbar_client_configure), (toolbar_client_destroy): Support repositioning dialogs an alt toolbar ( IM ) window is transient for. * src/wm.c: (wm_handle_configure_request): Correct some debug info. 2006-04-12 Matthew Allum * src/client_common.c: (client_set_focus): Focus tracking fix moving between dialogs and trans for root dialog. fixs maemo #26095 2006-04-10 Matthew Allum * src/base_client.c: (base_client_new): * src/dialog_client.c: (dialog_client_reparent), (dialog_init_geometry): * src/structs.h: * src/wm.c: (wm_event_loop), (wm_handle_configure_request): Add basic support for window gravity on dialogs. 2006-03-24 Matthew Allum * src/wm.c: (wm_handle_property_change): Make sure window names changes can end up NULL. 2006-03-15 Matthew Allum * src/dialog_client.c: (dialog_client_button_press): Stop buttons on lower dialogs working when modal blocker window in place ( When in super modal mode ). 2006-03-10 Matthew Allum * src/client_common.c: (client_set_focus): * src/dialog_client.c: (dialog_client_set_focus_next): Focus fixes for case of multiple trans for root dialogs. 2006-03-07 =============== 1.0 Release. ===================== 2006-03-07 Matthew Allum * configure.ac: Be brave and finally bump up version to 1.0 2006-03-01 Matthew Allum * src/dialog_client.c: (dialog_client_show): Attempted fix for grouped dialog stacking. 2006-02-19 Matthew Allum * src/client_common.c: (client_deliver_delete): * src/ewmh.c: (ewmh_handle_root_message), (ewmh_get_user_time), (ewmh_set_current_app_window), (ewmh_ping_client_start), (ewmh_ping_client_stop), (ewmh_hung_app_check): * src/ewmh.h: * src/main_client.c: (main_client_toggle_fullscreen): * src/structs.h: * src/wm.c: (wm_load_config), (wm_event_loop), (wm_activate_client): Implement alternate optional more aggesive pinging policy needed for maemo. 2006-02-05 Matthew Allum * src/dialog_client.c: (dialog_client_get_offsets), (dialog_client_title_height), (dialog_client_redraw): * src/mbtheme-standalone.c: (theme_has_message_decor): * src/mbtheme-standalone.h: * src/mbtheme.c: (theme_has_message_decor), (theme_frame_paint): * src/mbtheme.h: * src/structs.h: Add support for optional alternate custom themeing for border only ( no title bar ) dialogs. 2006-02-03 Matthew Allum * configure.ac: Add a FIXME comment * src/mbtheme.c: (theme_frame_paint): avoid freeing non existant font color on theme switch. 2006-01-24 Matthew Allum * src/mbtheme.c: (mbtheme_new), (mbtheme_init): Add support for cache attribute in tags. MB_THEME_ALWAYS_CACHE env var overides. 2006-01-19 Matthew Allum * src/mbtheme.c: (theme_frame_button_paint), (theme_frame_paint), (mbtheme_new): * src/mbtheme.h: setting MB_NO_THEME_CACHE env var turns off internal pixbuf cacheing ( very experimental ) 2006-01-17 Matthew Allum * src/base_client.c: (base_client_new): * src/ewmh.c: (ewmh_init), (ewmh_set_active): * src/ewmh.h: * src/main_client.c: (main_client_show): * src/structs.h: Add basic ( set to 0 ) support for _NET_USER_TIME * src/mbtheme.c: (theme_frame_paint), (_theme_frame_menu_paint_text_entry): Fix wierd mb_col leak. 2006-01-05 Matthew Allum * src/ewmh.c: (ewmh_init), (ewmh_update_lists): * src/structs.h: Add support for _MB_APP_WINDOW_LIST_STACKING root win prop 2005-12-27 Matthew Allum * src/client_common.c: (client_set_focus), (client_get_transient_list): * src/dialog_client.c: (dialog_client_show): Add basic support for window grouping. 2005-12-12 Matthew Allum * src/dialog_client.c: (dialog_client_show): * src/main_client.c: (main_client_show): * src/structs.h: * src/wm.c: (wm_activate_client): Fix 'flash' when non top apps map dialogs. Fix issues with minimised dialogs not remapping. 2005-11-15 Matthew Allum * src/client_common.c: (client_get_transient_list): * src/client_common.h: * src/dialog_client.c: (dialog_client_show): Stacking fixes for multiple groups of transient for transient dialogs. 2005-11-01 Matthew Allum * src/stack.c: (stack_get_window_list), (stack_sync_to_display): XRestackWindows didn't include count of blocker wins in total window count. 2005-10-27 Matthew Allum * src/dialog_client.c: (dialog_client_show): Fix preivous blocker win borkage 2005-10-17 Matthew Allum * src/dialog_client.c: (dialog_client_reparent): Dont map the blocker wins on reparenting, wait for show() 2005-10-14 Matthew Allum * src/dialog_client.c: (dialog_client_show), (dialog_client_reparent), (dialog_client_iconize), (dialog_client_destroy): Add extra debug info for blocker wins 2005-10-10 mallum * src/wm.c: (wm_make_new_client): Fix potential XGetWMHints leak 2005-10-04 mallum * src/dockbar_client.c: (dockbar_client_configure): Small fix for east panels to get correctly positioned after theme switch. 2005-10-03 mallum * src/base_client.c: (base_client_new): * src/ewmh.c: (ewmh_get_utf8_prop), (ewmh_get_icon_prop_data): * src/matchbox-remote.c: (mbcommand): * src/mbtheme.c: (theme_frame_icon_paint), (mbtheme_init): * src/misc.c: (mwm_get_decoration_flags): * src/wm.c: (wm_handle_property_change): Fix GCC 4 warnings. 2005-09-29 mallum,,, * src/dialog_client.c: (dialog_client_show), (dialog_client_reparent), (dialog_client_iconize), (dialog_client_destroy): * src/stack.c: (stack_get_window_list): * src/structs.h: Fix issues with modal blocker wins breaking stack count. 2005-09-29 mallum,,, * src/base_client.c: (base_client_destroy): * src/wm.c: (wm_remove_client): Move previous fix to safer place in code. 2005-09-29 mallum,,, * src/wm.c: (wm_remove_client): Make sure ewmh lists get updated when closing a window. ( regression from 2005-06-14 change ) 2005-09-20 mallum,,, * src/client_common.c: (client_get_wm_protocols): * src/wm.c: (wm_handle_property_change): Fix re-enabling of help/accept/custom buttons 2005-09-20 mallum * src/base_client.c: (base_client_new): * src/client_common.c: (client_deliver_wm_protocol): * src/client_common.h: * src/wm.c: (wm_handle_property_change): Add support for help/accept/custom buttons being toggled on the fly 2005-09-07 mallum * src/main_client.c: (main_client_manage_toolbars_for_fullscreen): Add a little more debug. * src/wm.c: (wm_activate_client): Fix for making sure alt input windows get resized correctly when transient for a transient for root window and switching from/to a fullscreen to a non fullscreen app win. 2005-09-07 mallum * src/base_client.c: (base_client_new): Dont try and manage new clients if no memory available. * src/wm.c: (wm_remove_client): unmap before reparent to root in effort to avoid potential flash. 2005-08-31 mallum,,, * src/dialog_client.c: (dialog_client_reparent): * src/main_client.c: (main_client_button_press): * src/structs.h: * src/wm.c: (wm_usage), (wm_load_config): Add new -use_super_modal switch to enable previously default maemo 'aggresive' modal handling - blocking wins etc 2005-08-08 mallum,,, * src/toolbar_client_alt.c: (toolbar_client_hide): Reparent hidden toolbar wins to current position rather than 0,0 2005-07-28 mallum,,, * src/wm.c: (wm_remove_client): reparent 'removed' win to current pos on root rather than 0,0 2005-07-28 mallum,,, * src/ewmh.c: (ewmh_state_set): Really clear NET_WM_STATE if no states set. 2005-06-21 mallum,,, * src/main_client.c: (main_client_button_press): Send PING even when close button is 'blocked' by modal dialog * src/wm.c: (wm_handle_property_change): print debug warning if client sets tranciency to itself 2005-06-20 mallum,,, * src/wm.c: (wm_handle_configure_request), (wm_make_new_client): Add some more X error traps very early on in new client creation. 2005-06-19 mallum,,, * src/mbtheme.c: (theme_frame_menu_get_dimentions) Include iconized clients in select menu sizing. 2005-06-17 mallum,,, * src/wm.c: (wm_handle_property_change): Avoid potential recursive for self tranciency changes. 2005-06-17 mallum,,, * src/ewmh.c: (ewmh_update_lists), (ewmh_hung_app_check): * src/wm.c: (wm_usage), (wm_load_config): Fix compiler warning. If set, use env 'MB_HUNG_APP_HANDLER' pointing at executable to handle hung applications rather than default killer. 2005-06-15 mallum,,, * src/dialog_client.c: (dialog_client_show): * src/main_client.c: (main_client_show): Make sure de iconizing a client de-iconizes transients too. 2005-06-14 mallum,,, * src/base_client.c: (base_client_destroy): * src/desktop_client.c: (desktop_client_unmap): * src/dockbar_client.c: (dockbar_client_show): * src/ewmh.c: (ewmh_handle_root_message): * src/ewmh.h: * src/mbtheme.c: (mbtheme_switch): * src/wm.c: (wm_init_existing), (wm_update_layout), (wm_activate_client), (wm_toggle_desktop): Less aggresive root window property updating. 2005-06-12 mallum,,, * src/ewmh.c: (ewmh_set_current_app_window), (ewmh_hung_app_check): * src/ewmh.h: * src/wm.c: (wm_event_loop): Clean up ping code a little. Adding new define for frequency of hung app check. * src/mbtheme.c: (mbtheme_switch): Simplify switching code a little. 2005-06-08 mallum,,, * src/dialog_client.c: (dialog_client_show): Remove old attempted transient infinite loop fix ( 2005-06-02 ) 2005-06-06 mallum,,, * src/main_client.c: (main_client_iconize): * src/wm.c: (wm_handle_property_change), (wm_remove_client): Handle windows hiding but not always unmapping there windows. Fixes 'ghost' windows when quicking hiding/showing a GTK win. 2005-06-03 mallum,,, * src/wm.c: (wm_handle_property_change): Dont let windows change transiency to themselves. 2005-06-02 mallum,,, * configure.ac: * src/dialog_client.c: (dialog_client_show): avoid potential infinite loop from transiant race? 2005-05-26 mallum,,, * configure.ac: Bump up version to 0.9.5 2005-05-25 mallum,,, * src/dialog_client.c: (dialog_client_reparent): Possible fix for odd dissapearing firefox prefs window bug. 2005-05-24 mallum,,, * src/dialog_client.c: (dialog_init_geometry), (dialog_client_configure): * src/wm.c: (wm_make_new_client): Fix broken login so menu's really can position at 0,0 this time. 2005-05-24 mallum,,, * src/dialog_client.c: (dialog_client_check_for_state_hints), (dialog_init_geometry): * src/structs.h: * src/wm.c: (wm_make_new_client): Dont center 'menu' dialogs if initial position is 0,0 2005-05-20 mallum,,, * src/ewmh.c: (ewmh_state_set): * src/wm.c: (wm_make_new_client): Avoid trashing unsupported state hints. 2005-05-17 mallum,,, * src/wm.c: (wm_usage): Rejig usage info a little. 2005-05-12 mallum,,, * src/matchbox-remote.c: (usage), (main): * src/structs.h: * src/wm.c: (wm_handle_client_message): Add 2 new simple switches to matchbox-remote, one too toggle compositor and one to force reload of key shortcuts. 2005-05-11 mallum,,, * src/toolbar_client.c: (toolbar_client_reparent): * src/wm.c: (wm_remove_client), (wm_update_layout): Clear up some more ( final? ) X Errors. Speed up app window resizes caused by horizonal panels/toolbars by avoiding uneeded repaints. 2005-05-11 mallum,,, * data/themes/Default/theme.xml: * data/themes/MBOpus/theme.xml: * data/themes/blondie/theme.xml: Tweak+add basic rough toolbar decorations to keep old apps happy that still use decorated toolbars. 2005-05-11 mallum,,, * configure.ac: minor cleanups, remove xsync enable * src/session.c: (sm_save_yourself_cb): Fix things enough to avoid gnome-session hanging. Support still very basic and incomplete. 2005-05-11 mallum,,, * src/session.c: (sm_save_yourself_cb), (sm_die_cb), (sm_shutdown_cancelled_cb), (sm_connect): * src/session.h: * src/structs.h: * src/wm.c: (wm_new), (wm_usage), (wm_load_config), (wm_find_client), (get_xevent_timed): Fix up session support some more. 2005-05-05 mallum,,, * src/client_common.c: (client_set_focus): * src/ewmh.c: (ewmh_init), (ewmh_set_active): * src/ewmh.h: * src/structs.h: * src/wm.c: (wm_activate_client): Fix _NET_ACTIVE_WIN to not be set to just app wins. Add _MB_CURRENT_APP_WINDOW to do old behaviour. * src/dialog_client.c: (dialog_client_set_focus_next): Fix focusing when non focused dialog is closed 2005-04-28 mallum,,, * src/session.c: (sm_save_yourself_cb): Add some very basic registration info with session manager 2005-04-28 mallum,,, * configure.ac: * src/Makefile.am: * src/session.c: * src/session.h: * src/structs.h: * src/wm.c: (wm_new), (wm_find_client), (wm_event_loop): * src/wm.h: Add basic initial support for connecting to session managers. It currently just connects, should avoid hang when started by gnome-session. 2005-04-26 mallum,,, * src/ewmh.c: (ewmh_handle_root_message): Fix for activate client message being sent to an non topped app dialog window and no effect happerning. Makes GNOME task selector work nicer with MB. 2005-04-26 mallum,,, * src/mbtheme.c: (theme_frame_icon_paint): Fix potential segv if app sets ewmh icon smaller than 16x16 2005-04-26 mallum,,, * src/toolbar_client.c: (toolbar_client_move_resize), (toolbar_client_reparent): Fix a couple of toolbar related X Error warnings 2005-04-16 mallum,,, * configure.ac: Throw an error if AC_PATH_XTRA comes up empty 2005-04-11 Relased 0.9.4 2005-04-11 mallum,,, * configure.ac: Bump up version to 0.9.4 2005-04-07 mallum,,, * src/dialog_client.c: (dialog_client_set_focus_next): Possible fix for odd focus crasher 2005-04-07 mallum,,, * src/dialog_client.c: (dialog_get_available_area): * src/main_client.c: (main_client_manage_toolbars_for_fullscreen): * src/toolbar_client_alt.c: (toolbar_client_configure): Make sure alt input trans for dialog but on top of fullscreen app get resized correctly on fullscreen toggle. Make sure dialogs get positioned correctly for fullscreen with alt input. 2005-03-30 mallum,,, * src/base_client.c: (base_client_new), (base_client_process_name): * src/ewmh.c: (ewmh_update_lists): * src/mbtheme.c: (mbtheme_init): * src/misc.c: (fork_exec): * src/wm.c: (wm_sn_exec): Fixes via Andreas Gunnarsson for bugs 117-121. Includes mainly potential overflow fixes + warnings on openBSD. * src/toolbar_client_alt.c: (toolbar_client_new), (toolbar_client_move_resize): Extra debug statements 2005-03-16 mallum,,, * src/base_client.h: * src/matchbox-remote.c: * src/structs.h: * src/xml.c: Add _GNU_SOURCE to work round x11.pc setting -DX_OPENSOURCE 2005-03-11 mallum,,, * src/base_client.c: (base_client_new): * src/composite-engine.c: (_render_a_client), (comp_engine_destroy_root_buffer), (comp_engine_render): * src/dialog_client.c: (dialog_client_reparent): * src/wm.c: (wm_handle_map_notify): Fix composite lowlighting with blocker win. Also make modal for root dialogs lowlight entire display. 2005-03-01 mallum * src/toolbar_client_alt.c: (toolbar_client_show): Attempt for lessening potential dekstop flash on mapping input win * src/wm.c: (wm_activate_client): Fix stacking order for transient for desktop dialogs 2005-02-28 mallum,,, * src/dialog_client.c: (dialog_client_button_press): Fix for static mode dialogs losing focus when hidden via title bar click. 2005-02-23 mallum,,, * src/keys.c: (keys_add_entry), (keys_load_config): * src/structs.h: Backed held key code out. Seems very difficult todo sanely due to the way X does keyrepeats. Maybe battle again another day. 2005-02-23 mallum,,, * src/main_client.c: (main_client_configure): Refix fullscreen toggling for non alt input windows 2005-02-23 mallum,,, * src/structs.h: * src/keys.c: (keys_add_entry), (keys_load_config): Initial work on supporting 'held' keys - config can now be parsed. * src/main_client.c: (main_client_configure): Fix for toolbars affecting app size when toggling fullscreen. 2005-02-22 mallum,,, * src/dialog_client.c: (dialog_client_reparent), (dialog_client_redraw), (dialog_client_drag): More composite lowlighting related tweaks 2005-02-22 mallum,,, * src/composite-engine.c: (_render_a_client): Force composite lowlighting *off* for now. Needs fixing. 2005-02-22 mallum,,, * src/dialog_client.c: (dialog_get_available_area): Fix dialog positioning for fullscreen windows * src/toolbar_client.c: (toolbar_client_new): Fix toolbar wins getting in correctly handled between mb wm restarts. 2005-02-21 mallum,,, * src/base_client.c: (base_client_destroy): * src/ewmh.c: (ewmh_update_rects): * src/misc.c: More XError trapping; Add debug statements so we no when traps are in place. Do an XSync before untrapping on destroy call, to flush an errors through. 2005-02-18 mallum,,, * src/stack.c: (stack_sync_to_display): * src/toolbar_client_alt.c: (toolbar_client_destroy): Trap some more X Errors 2005-02-18 mallum,,, * src/dialog_client.c: (dialog_get_available_area), (dialog_constrain_geometry): * src/toolbar_client_alt.c: (toolbar_client_new), (toolbar_win_offset), (toolbar_client_configure): Fix alternative toolbar repositioning dialog. Also add some more debug statements. 2005-02-18 mallum,,, * src/dialog_client.c: (dialog_client_redraw), (dialog_client_button_press): Support 'custom' buttons on dialogs. 2005-02-17 mallum,,, * src/main_client.c: (main_client_button_press): Disable app close button in presence of modal app * src/wm.c: (wm_handle_keypress): Fix topping of single instance apps 2005-02-16 mallum,,, * src/dialog_client.c: (dialog_client_reparent): Add colormap to frames so argb wins work again * src/main_client.c: (main_client_button_press): Ignore minimise buttons in presence of modal dialog 2005-02-08 0.9.3 Released 2005-02-08 mallum,,, * configure.ac: Bump up version to 0.9.3 2005-02-08 mallum * src/client_common.c: (client_get_state): * src/toolbar_client_alt.c: (toolbar_client_hide): 2005-02-08 mallum * src/mbtheme.c: Fix press only buttons 2005-01-31 mallum,,, * src/wm.c: (wm_load_config): Added missing memset to wm config struct. 2005-01-31 mallum,,, * src/dialog_client.c: (dialog_client_iconize): Fix for focus_next type causing segv 2005-01-28 mallum,,, * src/main_client.c: (main_client_iconize): Fix broken minimizing on main clients 2005-01-24 0.9.2 Release 2005-01-24 mallum,,, * configure.ac: * data/themes/MBOpus/Makefile.am: Packaging snafu. 2005-01-24 0.9.1 2005-01-23 mallum,,, * src/mbtheme-standalone.c: (_draw_button), (_theme_paint_pixmap_border), (theme_frame_paint), (mbtheme_new): * src/mbtheme-standalone.h: Tweak the standalone 'theme' a little. 2005-01-21 mallum,,, * data/themes/Default/theme.xml: offset shadow a little more. * src/wm.c: (wm_handle_client_message): debug statement added for toggling compositor. 2005-01-21 mallum,,, * src/dialog_client.c: (dialog_client_button_press): Only hide dialog in static mode if title bar clicked, not side/bottom decorations. 2005-01-19 mallum,,, * src/dialog_client.c: (dialog_client_iconize): * src/main_client.c: * src/toolbar_client_alt.c: (toolbar_client_hide): Make sure iconizing, iconizes any transients too. 2005-01-18 mallum,,, * src/ewmh.c: (ewmh_init): * src/structs.h: * src/wm.c: (wm_make_new_client): Make _MB_WM_WINDOW_TYPE_MESSAGE work again. This is a workaround as it seems GTK2 cannot set the XUrgency flag. 2005-01-17 mallum,,, * src/ewmh.c: (ewmh_handle_root_message): * src/wm.c: (wm_handle_configure_request): Allow window stacking changes for dialogs vai _NET_STATE_ABOVE changing and a window raising itself. 2005-01-14 mallum,,, * data/kbdconfig: Change mbcontrol -> matchbox-remote * src/mbtheme.c: (mbtheme_init): * src/misc.c: (handle_xerror): * src/wm.c: (wm_usage), (wm_load_config): Update err strings from matchbox -> matchbox-wm 2005-01-14 mallum,,, * data/themes/MBOpus/Makefile.am: * data/themes/MBOpus/theme.desktop: * data/themes/MBOpus/theme.xml: Update MBOpus theme. Also add png bg for panel. * src/base_client.c: (base_client_new): Add some extra debug info for XUrgencyFlag checking 2005-01-13 mallum,,, * src/mbtheme.c: (theme_frame_button_paint), (parse_frame_layer_tag), (mbtheme_free): * src/mbtheme.h: Free up toolbar panel params on theme switch. Reformat a little. * src/toolbar_client_alt.c: (toolbar_client_reparent): Remove stray old removed client* ref causing breakage. 2005-01-12 mallum,,, * configure.ac: * data/themes/Default/Makefile.am: * data/themes/Default/acceptbutton.xpm: * data/themes/Default/closebutton.xpm: * data/themes/Default/menubutton.xpm: * data/themes/Default/theme.desktop: * data/themes/Default/theme.xml: * data/themes/MBOpus/Makefile.am: * data/themes/MBOpus/theme.desktop: * data/themes/MBOpus/theme.xml: * data/themes/Makefile.am: Add new themes * src/structs.h: Set Default theme to 'Default' 2005-01-12 mallum,,, * src/dialog_client.c: (dialog_client_move_resize), (dialog_client_reparent), (dialog_client_set_focus_next), (dialog_client_iconize), (dialog_client_destroy): * src/stack.c: (stack_get_window_list): * src/structs.h: Add initial support for 'forcing' modility on transient for root modal dialogs. * src/main_client.c: (main_client_button_press): * src/mbtheme.c: (theme_frame_button_paint): Fix bug in buttons having the backgrounds wrong. 2005-01-10 mallum,,, * src/dialog_client.c: (dialog_client_reparent), (dialog_client_destroy): Dont set colormap on dialogs. For some odd reason causes firefox dialogs to break. Needs more looking into. Clean up compile warning. 2005-01-10 mallum,,, * data/kbdconfig: Add saner defaults to keyboard shortcut config. Also add some more info to the file. 2005-01-10 mallum,,, * src/mbtheme.c: (theme_frame_button_paint): Fix typo break composite builds. 2005-01-10 mallum,,, * src/dialog_client.c: (dialog_client_destroy): * src/structs.h: * src/wm.c: (wm_event_loop), (wm_make_new_client): * src/wm.h: Removal of _MESSAGE and message queue code. ICCCM urgency hint should now be used instead. 2005-01-10 mallum,,, * src/base_client.c: (base_client_new): * src/ewmh.c: (ewmh_init): * src/mbtheme.c: (theme_frame_paint): * src/structs.h: * src/wm.c: (wm_handle_property_change): Remove support of MB only SUBNAME property. 2005-01-10 mallum,,, * src/client_common.c: (client_button_init), (client_button_new): * src/client_common.h: * src/mbtheme.c: (theme_frame_button_paint): Redo button themeing and painting code. Making smaller and slightly easier to understand. 2005-01-07 mallum,,, * src/mbtheme.c: (mbtheme_switch): Fix Segv for changing theme with no managed clients. 2005-01-06 mallum,,, * src/mbtheme.c: (theme_frame_icon_paint), (theme_frame_button_paint), (_theme_paint_gradient), (_theme_paint_core), (theme_frame_paint), (theme_frame_menu_get_dimentions), (_theme_frame_menu_paint_text_entry), (theme_frame_menu_highlight_entry), (theme_frame_menu_paint), (theme_frame_button_get_x_pos), (theme_frame_defined_width_get), (theme_frame_defined_height_get), (theme_img_cache_clear_all), (get_attr), (lookup_button_action), (mbtheme_button_press_activates), (mbtheme_button_new): Minor initial Cleanup of themeing code. Also add fast path for gradients that arn't gradients 2005-01-06 mallum,,, * configure.ac: Only build an standalone build if specifically requested, otherwise if libmb is not found through a useful error. 2005-01-05 Ross Burton * src/wm.c: Change the direction the default cursor points in, do avoid driving Ross insane. 2005-01-04 0.9 Released. 2005-01-04 mallum,,, * configure.ac: Bump up version to 0.9 2004-12-23 mallum,,, * src/client_common.c: (client_set_focus), (client_decor_frames_move_resize), (client_decor_frames_init): * src/dialog_client.c: (dialog_client_reparent): Clean up some X Errors - woohoo. 2004-12-23 mallum,,, * src/main_client.c: (main_client_show): Make sure closed app goes back to desktop correctly even after app has opened. * src/toolbar_client.c: (toolbar_client_show), (toolbar_client_redraw): Try and fix composite not updating properly when dialog resized via toolbar. * src/wm.c: (wm_handle_configure_request): repaint resized dialogs 2004-12-23 mallum,,, * src/main_client.c: (main_client_manage_toolbars_for_fullscreen): Max sure toolbar for fullscreen window is resized correctly on toggle. * src/matchbox-remote.c: (mbcommand), (send_input_manager_request), (usage), (main): Add new option for toggling input manager method 2004-12-23 mallum,,, * src/main_client.c: (main_client_reparent): Fix frames getting set up right for fullscreen windows 2004-12-20 mallum * data/Makefile.am: * src/Makefile.am: * src/keys.c: (keys_load_config): Move kdbconfig to /etc/matchbox so more visible. 2004-12-20 mallum * src/mbtheme.c: (theme_frame_icon_paint), (_theme_paint_gradient): Fixups for new 16bpp pixbuf stuff 2004-12-15 mallum,,, * configure.ac: Add some more info to --enable-* options * src/mbtheme-standalone.c: (theme_frame_button_paint), (theme_has_message_decor): * src/mbtheme-standalone.h: * src/mbtheme.c: (theme_frame_button_paint): * src/mbtheme.h: * src/structs.h: * src/wm.c: (wm_handle_configure_notify), (wm_update_layout): Kill pixmap cache if main win is resized ( by layout change ) * src/toolbar_client.c: (toolbar_client_reparent), (toolbar_client_show), (toolbar_client_hide), (toolbar_client_redraw): Fix toolbars painting there buttons. 2004-12-14 mallum * src/mbtheme.c: (theme_frame_paint), (theme_frame_defined_width_get), (theme_frame_defined_height_get), (theme_img_cache_clear), (theme_img_cache_clear_all), (parse_shadow_tag), (mbtheme_new): * src/mbtheme.h: * src/structs.h: Implement a new pixmap cache that caches pixmaps for east/west/south app window decorations. * src/wm.c: (wm_handle_configure_notify): Clear *all* caches or a display size change/rotation 2004-12-10 mallum * src/base_client.c: (base_client_destroy): Call XDestroySubWindows() for frame decor wins, thus avoiding some X Errors. * src/dialog_client.c: (dialog_client_redraw): Minor cleanup 2004-12-10 mallum * src/dialog_client.c: (dialog_constrain_geometry), (dialog_init_geometry): Position decorationless centered if and only if 0,0 initial position. * src/wm.c: (wm_handle_button_event): Dont try and forward button events onto window decor if already handled for app child window. 2004-12-09 mallum * src/base_client.c: (base_client_destroy): Trap X errors. * src/client_common.c: (client_want_focus), (client_decor_frames_move_resize), (client_decor_frames_init): Remove uneeded calls. Trap errors in want focus. * src/stack.c: (stack_get_above), (stack_get_below): Add some commenting. * src/main_client.c: (main_client_redraw), (main_client_hide), (main_client_unmap): * src/wm.c: (wm_handle_unmap_event), (wm_handle_property_change), (wm_activate_client), (wm_get_offsets_size), (wm_toggle_desktop): Focus/desktop handling fixes. Trap some more X errors. 2004-12-09 mallum * src/base_client.c: (base_client_destroy): * src/client_common.c: (client_decor_frames_init): * src/dialog_client.c: (dialog_client_redraw): * src/mbtheme-standalone.c: (theme_frame_button_paint), (_theme_paint_pixmap_border), (theme_frame_paint), (_theme_frame_menu_paint_text_entry), (theme_frame_menu_paint): * src/mbtheme-standalone.h: * src/structs.h: Fix up standalone builds for new lower memory decoration code. 2004-12-09 mallum * configure.ac: * src/wm.c: (wm_usage), (wm_load_config): Minor tweaks to XRM option layout. * src/base_client.c: (base_client_new), (base_client_move_resize), (base_client_destroy): * src/client_common.c: (client_decor_frames_init): * src/client_common.h: * src/dialog_client.c: (dialog_client_redraw): * src/main_client.c: (main_client_reparent), (main_client_redraw), (main_client_button_press), (main_client_toggle_title_bar): * src/mbtheme.c: (theme_frame_button_paint), (_theme_paint_core), (theme_frame_paint), (theme_frame_menu_get_dimentions), (_theme_frame_menu_paint_text_entry), (theme_frame_menu_highlight_entry), (theme_frame_menu_paint): * src/mbtheme.h: * src/select_client.c: (select_client_new), (select_client_redraw): * src/structs.h: * src/toolbar_client.c: (toolbar_client_move_resize), (toolbar_client_reparent), (toolbar_client_show), (toolbar_client_redraw): For new lower server memory frame decorations: - Fix decoration button rendering. - Fix toolbars, task menu to use new mechansim. - Remove uneeded pixbuf caching. - Remove older 'backing' code and references. 2004-12-08 mallum * src/base_client.c: (base_client_new): * src/client_common.c: (client_get_highest_transient): * src/client_common.h: * src/dialog_client.c: (dialog_client_move_resize), (dialog_client_reparent), (dialog_client_redraw), (dialog_client_drag): * src/main_client.c: (main_client_reparent), (main_client_move_resize), (main_client_redraw): * src/mbtheme.c: (theme_frame_button_paint), (theme_frame_paint), (mbtheme_switch): * src/structs.h: * src/wm.c: (wm_find_client), (wm_handle_button_event): Add Initial support for new lower server memory frame decorations. Composite and standalone will likely be BROKEN atm. Also avoid refocusing dialog if it already has focus. 2004-12-07 Ross Burton * configure.ac: Add an option to disable use of Xrm. * src/wm.c: When Xrm is disabled, use a simple command line parser. 2004-12-01 mallum * src/composite-engine.c: (comp_engine_client_get_trans_prop): Change old atoms[INTEGER] to XA_INTEGER 2004-11-30 mallum * configure.ac: Bump Version. * src/base_client.c: (base_client_new), (base_client_destroy): * src/base_client.h: * src/client_common.c: * src/client_common.h: * src/composite-engine.c: (comp_engine_client_configure), (_render_a_client), (comp_engine_render): * src/composite-engine.h: * src/desktop_client.c: * src/desktop_client.h: * src/dialog_client.c: (dialog_client_new), (dialog_client_check_for_state_hints), (dialog_client_button_press), (dialog_client_set_focus_next), (dialog_client_iconize), (dialog_client_destroy): * src/dialog_client.h: * src/dockbar_client.c: * src/dockbar_client.h: * src/ewmh.c: (ewmh_init), (sync_value_increment), (ewmh_sync_init), (ewmh_sync_handle_event), (ewmh_sync_client_move_resize), (ewmh_sync_client_init_counter): * src/ewmh.h: * src/keys.c: * src/keys.h: * src/list.c: * src/list.h: * src/main.c: * src/main_client.c: (main_client_configure), (main_client_move_resize), (main_client_toggle_fullscreen), (main_client_button_press): * src/main_client.h: * src/matchbox-remote.c: * src/mbtheme-standalone.c: * src/mbtheme-standalone.h: * src/mbtheme.c: * src/mbtheme.h: * src/misc.c: * src/misc.h: * src/select_client.c: * src/select_client.h: * src/stack.c: * src/stack.h: * src/structs.h: * src/toolbar_client.c: * src/toolbar_client.h: * src/toolbar_client_alt.c: (toolbar_client_hide): * src/wm.c: (wm_event_loop), (wm_handle_configure_notify): * src/wm.h: * src/xml.c: * src/xml.h: Update copyright on all files. Add initial _NET_WM_SYNC support ( not working ). Tweak alternative toolbar behaviour. 2004-11-19 mallum,,, * src/wm.c: (wm_activate_client): * src/desktop_client.c: (desktop_client_new): Fixes for decorated desktop mode * src/main.c: (main): Add call to XSyncronize() is MB_SYNC env var set. 2004-11-19 0.9rc2 released. 2004-11-19 mallum,,, * configure.ac: Bump versison to 0.9rc2 2004-11-18 mallum,,, * src/ewmh.c: (ewmh_init): Add Transient atoms * src/structs.h: * src/wm.c: (wm_load_config), (wm_handle_configure_request), (wm_handle_unmap_event), (wm_handle_property_change), (wm_remove_client): Fix ordering of actions when handling window unmapping, avoids odd problems with GTK transients and GDK X Errors Make handle_configure_request more ICCCM compliant. Handle clients changing transient property. Remove AWT workaround. * src/toolbar_client_alt.c: (toolbar_client_show), (toolbar_client_hide): Remove compiler warning. 2004-11-18 mallum,,, * src/main_client.c: (main_client_manage_toolbars_for_fullscreen), (main_client_unmap): * src/toolbar_client_alt.c: (toolbar_client_configure), (toolbar_client_show), (toolbar_client_redraw): * src/wm.c: (wm_update_layout), (wm_activate_client): More alternative toolbar/input window work. Now works with fullscreen correctly + repositions dialogs ok. 2004-11-18 mallum,,, * src/base_client.c: (base_client_new), (base_client_process_name), (base_client_destroy): * src/desktop_client.c: (desktop_client_unmap): Reduce some bogus X Errors. * src/ewmh.c: (ewmh_update_lists): * src/list.c: (list_add), (list_find_by_id), (list_find_by_name), (list_remove): * src/list.h: * src/mbtheme-standalone.c: (theme_frame_menu_paint): * src/mbtheme.c: (theme_frame_menu_paint): * src/structs.h: * src/wm.c: (wm_handle_unmap_event): Add a new sperate 'age' based client list for non stack ordered propertys. May not keep this code, not sure if needed. 2004-11-17 mallum,,, * configure.ac: * src/Makefile.am: * src/base_client.c: (base_client_destroy): * src/main_client.c: (main_client_manage_toolbars_for_fullscreen): * src/structs.h: * src/toolbar_client.c: * src/toolbar_client_alt.c: (toolbar_client_new), (toolbar_win_offset), (toolbar_client_configure), (toolbar_client_move_resize), (toolbar_client_reparent), (toolbar_client_show), (toolbar_client_hide), (toolbar_client_destroy), (toolbar_client_redraw): Add initial alternative input/toolbar window code. * src/stack.c: (stack_get_type_list), (stack_move_type_above_client): Fix possible infinite loop. * src/wm.c: (wm_new), (wm_usage): Minor cleanup - remove old PANGO defines. 2004-11-17 mallum * src/main_client.c: (main_client_hide), (main_client_iconize), (main_client_show), (main_client_unmap): Avoid focus related crash - w->focused_client left pointing to non existant client. Make uniconizing slightly more efficient. * src/toolbar_client.c: (toolbar_client_reparent): Set background as grey pixel 2004-11-16 mallum * src/xml.c: Really free up parsed params for non expat parser. Should fix bug #100 2004-11-16 mallum,,, * src/main_client.c: (main_client_show): Make uniconized main clients set correct state * src/wm.c: (wm_handle_button_event): Dont try and set main app focus if task menu is active ( crasher ) 2004-11-15 0.9rc1 released. 2004-11-15 mallum,,, * src/wm.c: (wm_handle_configure_request), (wm_make_new_client): * src/dialog_client.c: (dialog_client_get_offsets), (dialog_client_title_height), (dialog_client_redraw): Tweak configure request event handling a little. * src/mbtheme-standalone.c: (theme_has_message_decor): * src/mbtheme-standalone.h: * src/mbtheme.c: (theme_has_message_decor): * src/mbtheme.h: Make message window decor fall back to normal dialog decor if none defined in theme. 2004-11-12 mallum,,, * src/client_common.c: (client_get_transient_list): Fixes for stacking dialogs transient for transient .. for root. * src/desktop_client.c: (desktop_client_show): * src/dockbar_client.c: (dockbar_client_show): * src/stack.c: (stack_prepend_bottom), (stack_move_client_above_type), (stack_move_above_client), (stack_move_type_above_client), (stack_cycle_forward), (stack_cycle_backward), (stack_add_below_client), (stack_move_type_below_client), (stack_move_below_client), (stack_move_below_type), (stack_update_transients), (stack_move_above_extended): * src/stack.h: * src/toolbar_client.c: (toolbar_client_show): * src/wm.c: (wm_activate_client): Refactor stack 'api' making code much smaller 2004-11-12 mallum,,, * src/dialog_client.c: (dialog_client_destroy): * src/structs.h: * src/wm.c: (wm_event_loop), (wm_make_new_client), (wm_msg_win_queue_add), (wm_msg_win_queue_pop), (wm_msg_win_queue_process): * src/wm.h: Re-add message window queueing code and old message hint. Fix segv on dialog closing with no 'focus' history. 2004-11-11 mallum,,, * src/main_client.c: (main_client_unmap): Fix possible segv in w->stack_top_app ending up pointing to rubbish. * src/wm.c: (wm_activate_client): Fix dialogs *always* covering panels. 2004-11-11 mallum,,, * src/dialog_client.h: Add missing prototype. * src/dialog_client.c: (dialog_client_show): * src/stack.c: (stack_move_transients_to_top): * src/wm.c: (wm_activate_client): Add support for _NET_WM_STATE_ABOVE to dialog stacking Make urgent wins non transient for root stack lower. 2004-11-11 mallum,,, * src/dialog_client.c: (dialog_client_check_for_state_hints), (dialog_client_button_press): * src/wm.c: (wm_handle_button_event): Make -use_dialog_mode static windows breaifly hide when titlebar is clicked on. So 'see through' kind of. 2004-11-10 mallum,,, * src/dialog_client.c: (dialog_constrain_geometry): Rename dialog_check_geometry * src/client_common.c: (client_set_focus): * src/wm.c: (wm_handle_configure_request), (wm_handle_expose_event), (wm_update_layout): Add more commenting. 2004-11-10 mallum * COMPLIANCE: Update a little. * src/base_client.c: (base_client_new), (base_client_process_name), (base_client_hide), (base_client_show), (base_client_destroy): * src/client_common.c: (client_deliver_config), (client_deliver_delete), (client_set_focus), (client_get_transient_list), (client_button_do_ops): * src/dialog_client.c: (dialog_client_check_for_state_hints), (dialog_client_hide), (dialog_client_show), (dialog_client_redraw), (dialog_client_drag), (dialog_client_destroy): * src/dockbar_client.c: (dockbar_client_show), (dockbar_client_destroy): * src/ewmh.c: (ewmh_handle_root_message), (ewmh_state_check): * src/keys.c: (keys_init): * src/main_client.c: (main_client_configure), (main_client_move_resize), (main_client_toggle_fullscreen), (main_client_iconize), (main_client_show), (main_client_unmap), (main_client_destroy): * src/select_client.c: (select_client_new), (select_client_event_loop): * src/stack.c: (stack_move_transients_to_top), (stack_dump), (main): * src/wm.c: (wm_handle_configure_request), (wm_handle_unmap_event), (wm_make_new_client), (wm_activate_client): Eeek, another massive commit. Mainly just cleanups - removal of #if 0's, more commenting, remove dialog defines. 2004-11-10 mallum,,, * configure.ac: Remove message win enable. Add input win enable. Bump up version * src/base_client.c: (base_client_new): * src/structs.h: * src/wm.c: (wm_new), (wm_usage), (wm_load_config), (wm_find_client), (wm_handle_map_notify), (wm_event_loop), (wm_handle_button_event), (wm_handle_keypress), (wm_handle_configure_notify), (wm_handle_configure_request), (wm_handle_expose_event), (wm_handle_client_message), (wm_handle_property_change), (wm_win_force_dialog), (wm_make_new_client), (wm_remove_client), (wm_update_layout), (wm_activate_client), (wm_get_offsets_size), (wm_toggle_desktop), (wm_set_cursor_visibility), (wm_sn_exec), (wm_sn_cycle_update_xid), (wm_lowlight): Clean wm.c up. Move some functionality into base_client_new() 2004-11-09 mallum,,, * src/composite-engine.c: (comp_engine_render): * src/dialog_client.c: (dialog_client_check_for_state_hints), (dialog_client_drag): Composite engine tweaks for new api * src/misc.c: (handle_xerror): Add missing newline * src/wm.c: (wm_make_new_client): Remove possible segv in dodgy dbg statement 2004-11-09 mallum * src/misc.c: (handle_xerror): Fix silly mistake in xerror handler causing random segfaults 2004-11-08 mallum * src/composite-engine.c: (client_win_extents), (_render_a_client), (comp_engine_render): * src/dialog_client.c: (dialog_client_check_for_state_hints), (dialog_client_move_resize), (dialog_client_show): * src/stack.c: (stack_move_transients_to_top): * src/structs.h: * src/wm.c: (wm_handle_map_notify), (wm_activate_client): Compositor now at least compiles again. Doesn't work 100% as yet ( crashes ). Basic support for reading _NET_WM_STATE_ABOVE hint added. 2004-11-07 mallum,,, * src/structs.h: * src/ewmh.c: (ewmh_init): Add state_above hint. * src/misc.c: (fork_exec), (sig_handler), (handle_xerror), (ignore_xerror), (mwm_get_decoration_flags): * src/wm.c: (wm_new), (wm_load_config): Minor clean up of misc.c. Remove err() call. * src/xml.c: (list_add_node), (xml_node_new): * src/xml.h: Minor cleanup of xml.c . Remove xml_dump() 2004-11-02 mallum,,, * src/wm.c: (wm_make_new_client): Make new clients get decorations drawn before mapping. 2004-11-02 mallum,,, * src/base_client.c: (base_client_new), (base_client_show): * src/client_common.c: (client_get_transient_list), (client_get_highest_transient): * src/client_common.h: * src/dialog_client.c: (dialog_client_new), (dialog_client_get_offsets), (dialog_client_title_height), (dialog_client_show), (dialog_get_available_area), (dialog_check_geometry), (dialog_init_geometry), (dialog_client_redraw), (dialog_client_button_press), (dialog_client_drag), (dialog_client_destroy): * src/mbtheme-standalone.c: (theme_frame_menu_paint), (theme_frame_menu_get_dimentions): * src/stack.c: (stack_move_transients_to_top): * src/stack.h: * src/toolbar_client.c: (toolbar_client_configure), (toolbar_client_reparent), (toolbar_client_show), (toolbar_client_hide), (toolbar_client_destroy), (toolbar_client_button_press), (toolbar_client_redraw): * src/wm.c: (wm_new), (wm_usage), (wm_event_loop), (wm_handle_keypress), (wm_handle_client_message), (wm_make_new_client), (wm_activate_client), (wm_sn_monitor_event_func), (wm_lowlight): Fix standalone + startup notification builds. Initial implimentation of 'msg' wins via urgent flag with correct stacking. Make matchbox-remote theme switching work again 2004-11-01 mallum,,, * src/client_common.c: (client_set_focus): * src/dialog_client.c: (dialog_client_destroy): * src/wm.c: (wm_handle_button_event), (wm_activate_client): More focus model fixes. * src/mbtheme-standalone.c: (theme_frame_menu_paint), (theme_frame_menu_get_dimentions): Update standalone build a little for newer internals 2004-11-01 mallum,,, * src/base_client.c: (base_client_new), (base_client_process_name), (base_client_move_resize), (base_client_hide), (base_client_show), (base_client_destroy): * src/client_common.c: (client_want_focus), (client_set_focus), (client_get_transient_list): * src/client_common.h: * src/composite-engine.c: (comp_engine_deinit), (comp_engine_reinit), (comp_engine_client_init), (comp_engine_client_show), (comp_engine_client_destroy), (comp_engine_client_configure): * src/desktop_client.c: (desktop_client_new), (desktop_client_show): * src/dialog_client.c: (dialog_client_new), (dialog_client_show), (dialog_client_destroy): * src/ewmh.c: (ewmh_hung_app_check): * src/main_client.c: (main_client_check_for_single), (main_client_hide), (main_client_show): * src/main_client.h: * src/mbtheme.c: (mbtheme_switch): * src/structs.h: * src/toolbar_client.c: (toolbar_client_show): * src/wm.c: (wm_new), (wm_find_client), (wm_handle_button_event), (wm_make_new_client), (wm_update_layout), (wm_activate_client), (wm_get_offsets_size): More misc cleanups Dialog stacking fixes Implement new intelligent focus model. 2004-10-29 mallum * src/desktop_client.c: (desktop_client_show): * src/main_client.c: (main_client_redraw), (main_client_button_press): * src/wm.c: (wm_handle_button_event), (wm_activate_client): More transient stacking dialog fixes. Initial support for minimize button on app windows ( untested ). Embedded panel in titlebar fixes. Other stacking fixes. 2004-10-28 * src/base_client.c: (base_client_new), (base_client_process_name), (base_client_hide_transients), (base_client_show), (base_client_destroy): * src/client_common.c: (client_set_state), (client_get_state), (client_deliver_config), (client_deliver_wm_protocol), (client_deliver_message), (client_obliterate), (client_deliver_delete), (client_want_focus), (client_get_transient_list), (client_get_highest_transient), (client_init_backing), (client_init_backing_mask), (client_button_new), (client_button_remove), (client_buttons_delete_all), (client_get_button_from_event), (client_get_button_list_item_from_event), (client_button_do_ops): * src/client_common.h: * src/desktop_client.c: (desktop_client_new), (desktop_client_show), (desktop_client_unmap), (desktop_client_destroy): * src/dialog_client.c: (dialog_client_new), (dialog_client_show), (dialog_get_available_area), (dialog_client_button_press), (dialog_client_drag): * src/dockbar_client.c: (dockbar_client_new), (dockbar_client_configure), (dockbar_client_move_resize), (dockbar_client_show), (dockbar_client_hide), (dockbar_client_destroy): * src/ewmh.c: (ewmh_handle_root_message), (ewmh_update_lists), (ewmh_update_rects), (ewmh_state_check), (ewmh_set_allowed_actions), (ewmh_set_active), (ewmh_hung_app_check), (ewmh_get_utf8_prop), (ewmh_get_icon_prop_data): * src/list.h: * src/main_client.c: (main_client_new), (main_client_check_for_single), (main_client_manage_toolbars_for_fullscreen), (main_client_configure), (main_client_title_height), (main_client_reparent), (main_client_move_resize), (main_client_toggle_fullscreen), (main_client_redraw), (main_client_button_press), (main_client_toggle_title_bar), (main_client_iconize), (main_client_show), (main_client_unmap), (main_client_destroy): * src/mbtheme.c: (theme_frame_button_paint), (theme_frame_menu_get_dimentions), (theme_frame_menu_paint), (mbtheme_new), (mbtheme_switch): * src/select_client.c: (select_client_new), (select_client_event_loop): * src/stack.c: (stack_add_below_client), (stack_add_above_client), (stack_remove), (stack_update_transients), (stack_move_above_extended), (stack_move_below_client), (stack_move_above_client), (stack_move_type_above_client), (stack_move_type_below_client), (stack_move_transients_to_top), (stack_get_window_list), (stack_cycle_forward), (stack_cycle_backward), (stack_get_highest), (stack_get_lowest), (stack_get_above), (stack_get_below), (stack_dump), (main): * src/stack.h: * src/structs.h: * src/toolbar_client.c: (toolbar_client_new), (toolbar_client_configure), (toolbar_client_move_resize), (toolbar_client_show), (toolbar_client_hide), (toolbar_client_destroy): * src/wm.c: (wm_new), (wm_usage), (wm_load_config), (wm_find_client), (wm_handle_button_event), (wm_handle_keypress), (wm_handle_configure_notify), (wm_handle_configure_request), (wm_handle_unmap_event), (wm_handle_client_message), (wm_handle_property_change), (wm_make_new_client), (wm_remove_client), (wm_update_layout), (wm_activate_client), (wm_get_visible_main_client), (wm_get_offsets_size), (wm_toggle_desktop), (wm_get_desktop), (wm_sn_monitor_event_func): * src/wm.h: Much restructing of WM stacking. Is not 100% stable yet. Many --enable options probably broken. 2004-10-20 mallum,,, * src/Makefile.am: * src/stack.c: (stack_add_below_client), (stack_add_above_client), (stack_append_top), (stack_prepend_bottom), (stack_remove), (stack_preppend), (stack_update_transients), (stack_move_above_type), (stack_move_below_type), (stack_move_below_client), (stack_move_above_client), (stack_get_window_list), (stack_sync_to_display), (main): * src/stack.h: * src/structs.h: Add initial new stack API. Note nothing uses it as yet. * src/wm.c: (wm_make_new_client): Remove extra ';' typo ausing probs on gcc2.96 2004-10-15 mallum,,, * src/wm.c: (wm_handle_unmap_event): Fix for unmap ( to really unmap ) when no destroy event present. 2004-10-15 mallum * src/wm.c: (wm_handle_configure_request): Make sure a toolbar that resizes itself gets repositioned correctly. ( Bug #94 ) 2004-09-22 0.8.4 released. 2004-09-28 mallum,,, * configure.ac: Bump up version * src/dialog_client.c: (dialog_client_redraw): Avoid uneeded call on redraw. 2004-09-24 mallum,,, * src/base_client.c: (base_client_new): * src/dialog_client.c: (dialog_client_drag), (_draw_outline): Revert back to non problematic hidden dialog drag. * src/structs.h: * src/wm.c: (wm_usage), (wm_load_config), (wm_handle_configure_request), (wm_win_force_dialog), (wm_make_new_client): Add support for new -force_dialogs option. Add missing configure notify from dialog resize 2004-09-21 mallum * src/ewmh.c: (ewmh_state_set): * src/ewmh.h: * src/main_client.c: (main_client_toggle_fullscreen), (main_client_redraw): Add support for setting _NET_WM_STATE correctly so apps like Gnumeric which depend on this work right in switching fullscreen * src/wm.c: (wm_load_config), (wm_find_client), (wm_make_new_client): Minor optimisations to reduce freq of some uneeded calls 2004-09-07 mallum * src/mbtheme.c: (mbtheme_switch): Resest window shapes for theme change to shapeless theme. 2004-09-07 mallum,,, * src/mbtheme.c: (_theme_paint_core): * src/toolbar_client.c: (toolbar_client_new): * src/wm.c: (wm_sn_monitor_event_func): Various bug fixes to random bugs, inclusing; - startup notification crash with bad data and no clients - over large toolbars - bad theme.xml data 2004-09-01 mallum,,, * src/wm.c: (wm_handle_property_change): Actually update client sub name prop on change. 2004-08-30 mallum,,, * src/toolbar_client.c: (toolbar_client_show): Stop toolbar raising on desktop from showing wrong dialogs 2004-08-30 mallum,,, * src/main_client.c: (main_client_manage_toolbars_for_fullscreen), (main_client_toggle_fullscreen): More fullscreen fixes. 2004-08-30 mallum,,, * src/dockbar_client.c: (dockbar_client_configure): Fix east panel positioning 2004-08-30 mallum,,, * src/main_client.c: (main_client_manage_toolbars_for_fullscreen): Fullscreen fixes for vertical panels 2004-08-28 mallum,,, * src/matchbox-remote.c: (mbpanelcommand), (mbcommand), (usage), Add support for -panel-toggle. Based on patch from Tom Hui. 2004-08-23 0.8.3 released. 2004-08-23 mallum,,, * configure.ac: bump of version. check for libmb1.3 2004-08-21 mallum,,, * src/dialog_client.c: (dialog_client_configure): * src/main_client.c: (main_client_hide), (main_client_show), (main_client_destroy): * src/wm.c: (wm_handle_configure_request), (wm_toggle_desktop): source cleanups. remove #if 0's. rid compiler warnings 2004-08-18 mallum,,, * src/client_common.c: (client_want_focus): Never give message windows input focus. * src/ewmh.c: (ewmh_set_active): Remove silly debug crasher. 2004-08-18 mallum,,, * src/wm.c: (wm_handle_configure_request): Allow toolbars to resize height. 2004-08-17 mallum,,, * src/dialog_client.c: (dialog_client_check_for_state_hints), (dialog_client_show), (dialog_client_reparent), (dialog_get_available_area), (dialog_check_geometry), (dialog_init_geometry), (dialog_client_button_press), (dialog_client_drag), (_get_mouse_position), (_draw_outline), (dialog_client_destroy): Quick dialog code cleanup 2004-08-17 mallum,,, * src/client_common.c: (client_button_do_ops): * src/dialog_client.c: (dialog_client_destroy): * src/mbtheme.c: (theme_frame_button_paint), (mbtheme_button_new): * src/mbtheme.h: * src/structs.h: Fix for button press-only crazziness. 2004-08-17 mallum,,, * src/structs.h: * src/wm.c: (wm_load_config), (wm_handle_configure_request): Make awt workaround set via env var rather than ifdef Safer vaue_mask checks for dialog resizing. 2004-08-13 mallum,,, * src/ewmh.c: (ewmh_init): * src/structs.h: * src/wm.c: (wm_make_new_client): Add new _NET_WM_WINDOW_TYPE_INPUT support 2004-08-12 mallum,,, * src/composite-engine.c: (comp_engine_client_configure): * src/wm.c: (wm_handle_configure_request): Attempted shadow fix for self resizing dialogs 2004-08-12 mallum,,, * src/dialog_client.c: (dialog_init_geometry): Eek, fix typo. 2004-08-11 mallum,,, * src/composite-engine.c: (comp_engine_theme_init), (comp_engine_render): Use red rectangles for visual debug. * src/dialog_client.c: (dialog_init_geometry): Message window positioning fixes * src/ewmh.c: (ewmh_set_active): * src/main_client.c: (main_client_manage_toolbars_for_fullscreen), (main_client_configure), (main_client_hide), (main_client_show), (main_client_destroy): * src/main_client.h: * src/structs.h: * src/toolbar_client.c: (toolbar_client_configure), (toolbar_client_show): * src/wm.c: (wm_restack): Add intial support for showing toolbar windows for fullscreen windows 2004-08-06 mallum,,, * src/wm.c: (wm_handle_button_event), (wm_handle_configure_request), (wm_restack): * src/dialog_client.c: (dialog_check_geometry): * src/dialog_client.h: Allow dialog resizing / repostioning via new dialog stuff. Raise a dialog on click ( not just titlebar anymore ). * src/ewmh.c: (ewmh_set_active): Minor optimisation - avoid setting active win prop if not changed. 2004-08-06 mallum,,, * data/themes/blondie/theme.xml: Fix min+max toolbars having different sizes. Note, Matchbox probably should handle this. * src/dialog_client.c: (dialog_client_new), (dialog_get_available_area), (dialog_check_gemoetry): * src/structs.h: More dialog positioning/sizing improvements. * src/toolbar_client.c: (toolbar_client_new), (toolbar_client_configure), (toolbar_client_move_resize), (toolbar_client_show), (toolbar_client_hide), (toolbar_client_destroy), (toolbar_client_get_coverage), (toolbar_client_button_press), (toolbar_win_offset), (toolbar_client_redraw): Speed up toolbar handling removing the numerous get_state() roundtrips and using a local flag instead. 2004-08-05 mallum,,, * src/dialog_client.c: (dialog_client_show), (dialog_get_available_area), (dialog_check_gemoetry), (dialog_init_geometry), (dialog_client_configure): * src/dialog_client.h: * src/dockbar_client.c: (dockbar_client_show), (dockbar_client_hide), (dockbar_client_destroy): * src/main_client.c: (main_client_title_height): * src/structs.h: * src/toolbar_client.c: (_fix_dialogs_for_toolbars), (toolbar_client_show), (toolbar_client_destroy): * src/wm.c: (wm_restack), (wm_get_offsets_size): Initial dialog postioning/sizing rewrite 2004-08-03 mallum,,, * src/client_common.c: (client_deliver_wm_protocol), (client_deliver_message), (client_button_do_ops): * src/client_common.h: * src/ewmh.c: (ewmh_init): * src/mbtheme.c: (mbtheme_button_new): * src/structs.h: More subname work and grab message functionality added. 2004-07-30 mallum,,, * data/schemas/Makefile.am: Fix disable schemas install. * src/base_client.c: (base_client_new): * src/client_common.c: (client_button_do_ops): * src/ewmh.c: (ewmh_init): * src/main_client.c: (main_client_destroy): * src/mbtheme.c: (theme_frame_button_paint), (theme_frame_paint), (param_parse), (mbtheme_button_press_activates), (mbtheme_button_new), (mbtheme_sublabel_new), (parse_frame_layer_tag), (mbtheme_init): * src/mbtheme.h: * src/structs.h: * src/wm.c: (wm_handle_property_change), (wm_toggle_desktop): Add initial support for sub name/label property. 2004-07-19 Matthew Allum,,, * data/themes/blondie/theme.xml: * src/mbtheme.c: (parse_lowlight_tag): Improve blondie lowlight color. 2004-07-16 Matthew Allum * src/composite-engine.c: (comp_engine_render), (comp_engine_time): * src/structs.h: * src/wm.c: (wm_handle_client_message): Add suport for visual composite debugging. Toggle via matchbox-remote -x 2004-07-13 Matthew Allum,,, * src/dialog_client.c: (dialog_client_configure): Initial attempt at 'corner postioning' rules for message dialogs 2004-06-29 Matthew Allum,,, * src/dialog_client.c: (dialog_client_new), (dialog_client_get_offsets), (dialog_client_check_for_state_hints), (dialog_client_show), (dialog_client_reparent), (dialog_client_redraw), (dialog_client_drag): * src/main_client.c: (main_client_configure), (main_client_reparent), (main_client_move_resize), (main_client_toggle_fullscreen), (main_client_redraw), (main_client_button_press), (main_client_show): * src/mbtheme.c: (theme_frame_icon_paint), (theme_frame_button_paint), (_theme_paint_core), (theme_frame_paint), (theme_frame_menu_get_dimentions), (_theme_frame_menu_paint_text_entry): * src/wm.c: (wm_new), (wm_load_config), (wm_init_existing), (get_xevent_timed), (wm_handle_map_notify), (wm_event_loop), (wm_handle_button_event), (wm_handle_configure_request), (wm_handle_property_change), (wm_make_new_client), (wm_remove_client), (wm_restack), (wm_xsettings_notify_cb), (wm_sn_exec), (wm_sn_monitor_event_func), (wm_msg_win_queue_add), (wm_msg_win_queue_process), (gconf_key_changed_callback): minor source cleanups. 2004-06-18 Matthew Allum,,, * src/wm.c: (wm_handle_configure_request), (wm_make_new_client): Hacks to make kaffe awt apps paint the UI's ok when sized by mb. 2004-06-11 Matthew Allum,,, * src/toolbar_client.c: (toolbar_client_new): If theres no vertical space for a new toolbar turn it into a main client. 2004-06-04 Matthew Allum,,, * src/ewmh.c: (ewmh_handle_root_message): fix for _NET_SHOWING_DESKTOP - dont hide desktop if already showing and show is requested. 2004-06-04 Matthew Allum,,, * src/mbtheme.c: (_theme_paint_core): Clip pixmap image if calculated dimentions bigger than are to be painted on. Attempted fix for bug #81 2004-06-03 Matthew Allum,,, * src/dialog_client.c: (dialog_client_drag): Call Xsync so dialog hidden drag background gets updated ok * src/mbtheme.c: (theme_frame_paint): Dont dont image/char substitution for dialog titles 2004-06-01 Matthew Allum,,, * src/wm.c: (wm_handle_configure_request): Fixes for dialog self moving in 'free dialog mode' 2004-05-28 Matthew Allum,,, * data/themes/blondie/theme.xml: * src/client_common.c: (client_init_backing): * src/composite-engine.c: (stack_last), (stack_prev), (stack_push), (comp_engine_get_argb32_visual), (comp_engine_init), (comp_engine_client_init), (_render_a_client), (comp_engine_render): * src/composite-engine.h: * src/dialog_client.c: (dialog_client_new), (dialog_client_reparent), (dialog_client_redraw): * src/mbtheme.c: (theme_frame_button_paint), (theme_frame_paint): * src/structs.h: * src/wm.c: (wm_handle_configure_request), (wm_make_new_client): Added initial support for ARGB Windows. Changed blondie theme to use simple shadows. Possible fix for allowing message wins to move themselves. 2004-05-06 mb-wm 0.8.2 release RELEASE_0_8_2 2004-05-06 Matthew Allum,,, * configure.ac: Make ping support selection get reported 2004-04-27 Matthew Allum,,, * configure.ac: * data/Makefile.am: Bump up version. Fix schema Makefile gubbins for BSD Make 2004-04-26 Matthew Allum,,, * src/base_client.c: (base_client_show): * src/dialog_client.c: (dialog_client_show), (dialog_client_drag), (dialog_client_destroy): * src/structs.h: * src/wm.c: (wm_make_new_client), (wm_msg_win_queue_add): More work on new message window types. Stacking and composite fixes. 2004-04-22 Matthew Allum,,, * src/dockbar_client.c: (dockbar_client_orientation_calc), (dockbar_client_show): * src/ewmh.c: (ewmh_init): * src/structs.h: * src/wm.c: (wm_make_new_client), (wm_toggle_desktop): - Add support for keeping embedded titlebar panels visible when desktop is shown. - Initial support for new message window types 2004-04-13 Matthew Allum,,, * src/Makefile.am: Make clean target clean gcov data files 2004-04-13 Matthew Allum,,, * src/ewmh.c: (ewmh_handle_root_message), (ewmh_hung_app_check): * src/wm.c: (wm_usage), (wm_load_config), (wm_event_loop): ping related cleanups. remove -ping_handler cmd line option, shorten time to kill hung app. 2004-04-06 Matthew Allum,,, * configure.ac: Add disable ping option. * src/base_client.c: (base_client_new), (base_client_destroy): * src/client_common.c: (client_obliterate), (client_deliver_delete): * src/client_common.h: * src/ewmh.c: (ewmh_hung_app_check): * src/structs.h: * src/wm.c: (wm_new), (get_xevent_timed), (wm_event_loop), (wm_sn_timeout_check): - Many ping handling changes; - initiate only when close button pressed. - make code more modular / smaller / ifdef'd - Attempt to kill -9 apps by defualt if PID given and app offers no WM_DELETE proto. - Improve event loop to only use select timeouts when really needed. ( XXX. needs more testing may have broken stuff ) 2004-04-05 Matthew Allum,,, * configure.ac: Add support for test builds with gconf/gprof Clean up the configure --help output 2004-03-26 Matthew Allum,,, * src/dialog_client.c: (dialog_client_drag): Fix underlying apps getting expose for invisable dialog drag. 2004-03-22 matchbox-window-manager-0.8.1 released released tag: RELEASE_0_8_1 2004-03-22 Matthew Allum,,, * src/dialog_client.c: (dialog_client_get_offsets), (dialog_client_configure): Allow decorationless dialog to position themselves anywhere Dont add invisible border to decorationless dialogs * src/wm.c: (wm_handle_configure_request): Fix Composite for self moving dialogs 2004-03-17 Matthew Allum,,, * configure.ac: bump up version number 2004-03-12 Matthew Allum,,, * src/dialog_client.c: (dialog_client_drag): Fix invisible dialog dragging for composite 2004-03-10 Matthew Allum,,, * AUTHORS: * README: Added *some* content to these * src/dialog_client.c: (dialog_client_drag): Dragging mode experimental work 2004-03-09 Matthew Allum,,, * data/Makefile.am: * data/themes/Makefile.am: Install kdbconfig for standalone, dont install themes files 2004-03-09 Matthew Allum,,, * src/composite-engine.c: (comp_engine_time): Disable lowlight timings define - shouldn't be in release * src/dialog_client.c: (dialog_client_drag), (_draw_outline): Initial hiding dialog when dragged experiments 2004-03-08 Matthew Allum,,, * src/wm.c: (wm_usage), (wm_load_config): Remove -use_lowlight option for composite and make it always on. 2004-03-08 Matthew Allum,,, * src/composite-engine.c: (comp_engine_render): Dont shadow CM_TRANSLUCENCY windows ( at least for now ) 2004-02-26 Matthew Allum,,, * src/mbtheme.c: (_theme_paint_core), (theme_frame_paint): Make sure overlarge theme pixmaps are clipped if not scaled 2004-02-25 Matthew Allum,,, * src/main_client.c: (main_client_toggle_fullscreen): Fix titlebar panel for fullscreen toggling 2004-02-24 Matthew Allum,,, * src/base_client.c: (base_client_destroy): * src/desktop_client.c: (desktop_client_new): * src/main_client.c: (main_client_show): * src/structs.h: * src/wm.c: (wm_toggle_desktop): Fix decorated desktop toggling. 2004-02-18 Matthew Allum,,, * src/composite-engine.c: (comp_engine_client_hide): Uncomment and improve previous fix clearing lowlights. 2004-02-16 Matthew Allum,,, * data/themes/bluebox/theme.xml: Improve bluebox shadow color 2004-02-15 Matthew Allum,,, * src/dialog_client.c: (dialog_client_destroy): Fix for possible crash from dialog destroy. 2004-02-10 matchbox-panel-0.8 released released tag: RELEASE_0_8 2004-02-10 Matthew Allum,,, * src/base_client.c: (base_client_new), (base_client_destroy): Fix reading of UTF8 Win titles 2004-02-09 Matthew Allum,,, * data/themes/borillo/theme.desktop: Fixed menu highlight color 2004-02-09 Matthew Allum,,, * configure.ac: Fix xsettings in summary * data/themes/borillo/theme.xml: Change borillo to autofit font 2004-02-08 Matthew Allum,,, * src/wm.c: (wm_usage): fix MB_USE_JPEG typo 2004-02-07 Matthew Allum,,, * configure.ac: fix startup notification 2004-02-06 Matthew Allum,,, * data/themes/borillo/theme.xml: correct alpha attribute 2004-02-06 Matthew Allum,,, * src/keys.c: (keys_load_config): * src/structs.h: Fixed kbdconfig load. fixed defualt icon load 2004-02-05 Matthew Allum, * configure.ac: Fixed GConf checking, added message window option * src/wm.c: (wm_usage): Fixed help output matchbox-window-manager-1.2/matchbox-window-manager/COPYING0000664000211500234210000004311011307441354022517 0ustar bifh1bifhs GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. matchbox-window-manager-1.2/matchbox-window-manager/matchbox-window-manager.doap0000664000211500234210000000610011307441355027052 0ustar bifh1bifhs Matchbox Window Manager matchbox-window-manager 2007-01-02 Matchbox Window Manager is an X11 window manager for non desktop platforms. Matchbox Window Manager is an Open Source window manager for the X Window System targeted at non-desktop embedded platforms such as handhelds, set-top boxes, kiosks and anything else for which screen space, input mechanisms or system resources are limited. The window manager implements arestrictive stack based PDA like management policy. It supports modern window management standards, cutting edge X capabilities, advanced themeing and various window types. linux C Matthew Allum Matthew Allum matchbox-window-manager-1.1 2006-08-04 1.1 matchbox-window-manager-1.0 2006-03-07 1.0 matchbox-window-manager-0.9.3 2006-02-08 0.9.3 matchbox-window-manager-1.2/matchbox-window-manager/data/0000775000211500234210000000000011307441355022377 5ustar bifh1bifhsmatchbox-window-manager-1.2/matchbox-window-manager/data/themes/0000775000211500234210000000000011307441355023664 5ustar bifh1bifhsmatchbox-window-manager-1.2/matchbox-window-manager/data/themes/MBOpus/0000775000211500234210000000000011307441355025031 5ustar bifh1bifhsmatchbox-window-manager-1.2/matchbox-window-manager/data/themes/MBOpus/closebutton.png0000664000211500234210000000074011307441355030101 0ustar bifh1bifhsPNG  IHDRbwbKGD pHYsiTStIMEױ"amIDAT8SKKBA=m{P+@.ޟmܕ n6bVBeQʍ[Aun_^ZDf9}3߃ yc;ӈ1,x"|H|Mˀ[qˢXDXD#qT39lD<,kx^E9l9[XBk+*KV@0GٰasjwUT4tu `]ܫл_~+ʙT3|fd3Iɛh@ 4ޠ\ֶ-WKTFӓ9޾_ab#"LOxqIENDB`matchbox-window-manager-1.2/matchbox-window-manager/data/themes/MBOpus/Makefile.am0000664000211500234210000000025711307441355027071 0ustar bifh1bifhspngs = panelbg.png closebutton.png themesdir = $(datadir)/themes/MBOpus/matchbox themes_DATA = theme.xml $(pngs) theme.desktop EXTRA_DIST = theme.xml $(pngs) theme.desktop matchbox-window-manager-1.2/matchbox-window-manager/data/themes/MBOpus/theme.xml0000664000211500234210000001656611307441355026673 0ustar bifh1bifhs matchbox-window-manager-1.2/matchbox-window-manager/data/themes/MBOpus/panelbg.png0000664000211500234210000000032711307441355027151 0ustar bifh1bifhsPNG  IHDR ( pHYs  ~tIME;چvIDAT8˽ D{` $ 'SKg;ȽtUD} ]-sBUmaP d >d ገnz_ Xr@B1 A/> _:c(IENDB`matchbox-window-manager-1.2/matchbox-window-manager/data/themes/MBOpus/theme.desktop0000664000211500234210000000060311307441355027525 0ustar bifh1bifhs[Desktop Entry] Type=MBTheme Name=MBOpus Preview=XXX Comment=Blondie theme ThemePath=@prefix@/themes/blondie MenuBgColor=#e1e6da MenuFgColor=#222222 MenuBdColor=#8f9489 MenuHlColor=#ccd2c6 PanelFgColor=#111111 #PanelBgColor=#e0e5d9 PanelBgPixmap=panelbg.png DesktopBgSpec=col-solid:#aeb4b4 PanelMsgBgCol=#e1e6da PanelMsgBgUrgentCol=#e1e6da PanelMsgFgCol=#22222 DesktopHlCol=#656b7bmatchbox-window-manager-1.2/matchbox-window-manager/data/themes/Default/0000775000211500234210000000000011307441355025250 5ustar bifh1bifhsmatchbox-window-manager-1.2/matchbox-window-manager/data/themes/Default/closebutton.xpm0000664000211500234210000000104711307441355030341 0ustar bifh1bifhs/* XPM */ static char *closebutton[] = { /* columns rows colors chars-per-pixel */ "16 20 3 1", " c black", ". c #020202", "X c None", /* pixels */ "XXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXX", "XXXX..XXXX..XXXX", "XXX ...XX....XXX", "XXX .........XXX", "XXXX........XXXX", "XXXXX......XXXXX", "XXXXX......XXXXX", "XXXX........XXXX", "XXX..........XXX", "XXX....XX....XXX", "XXXX..XXXX..XXXX", "XXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXX" }; matchbox-window-manager-1.2/matchbox-window-manager/data/themes/Default/acceptbutton.xpm0000664000211500234210000000105011307441355030465 0ustar bifh1bifhs/* XPM */ static char *acceptbutton[] = { /* columns rows colors chars-per-pixel */ "16 20 3 1", " c black", ". c #020202", "X c None", /* pixels */ "XXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXX", "XXXXXXXXXXX. XXX", "XXXXXXXXXX....XX", "XXXXXXXXX.... XX", "XX..XXXX.....XXX", "X....XX.....XXXX", "X..........XXXXX", "XX........XXXXXX", "XXX......XXXXXXX", "XXXX....XXXXXXXX", "XXXXX..XXXXXXXXX", "XXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXX" }; matchbox-window-manager-1.2/matchbox-window-manager/data/themes/Default/Makefile.am0000664000211500234210000000030511307441355027302 0ustar bifh1bifhspngs = acceptbutton.xpm closebutton.xpm menubutton.xpm themesdir = $(datadir)/themes/Default/matchbox themes_DATA = theme.xml $(pngs) theme.desktop EXTRA_DIST = theme.xml $(pngs) theme.desktop matchbox-window-manager-1.2/matchbox-window-manager/data/themes/Default/theme.xml0000664000211500234210000001527211307441355027103 0ustar bifh1bifhs matchbox-window-manager-1.2/matchbox-window-manager/data/themes/Default/menubutton.xpm0000664000211500234210000000104611307441355030177 0ustar bifh1bifhs/* XPM */ static char *menubutton[] = { /* columns rows colors chars-per-pixel */ "16 20 3 1", " c black", ". c #020202", "X c None", /* pixels */ "XXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXX", "XXXX XXXX..XXXX", "XXX....XX....XXX", "XXX..........XXX", "XXXX........XXXX", "XXXXX......XXXXX", "XXXXXX....XXXXXX", "XXXXXXX..XXXXXXX", "XXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXX" }; matchbox-window-manager-1.2/matchbox-window-manager/data/themes/Default/theme.desktop0000664000211500234210000000055211307441355027747 0ustar bifh1bifhs[Desktop Entry] Type=MBTheme Name=Human Preview=XXX Comment=Blondie theme ThemePath=@prefix@/themes/blondie MenuBgColor=#dadad5 MenuFgColor=#000000 MenuBdColor=#acaaa5 MenuHlColor=#486880 PanelFgColor=#22264a PanelBgColor=#dadad5 DesktopBgSpec=col-solid:#9ab0c2 DesktopHlCol=#486880 PanelMsgBgCol=#e8e0b0 PanelMsgBgUrgentCol=#f8f0c0 PanelMsgFgCol=#000000 matchbox-window-manager-1.2/matchbox-window-manager/data/themes/borillo/0000775000211500234210000000000011307441355025326 5ustar bifh1bifhsmatchbox-window-manager-1.2/matchbox-window-manager/data/themes/borillo/minimise.png0000664000211500234210000000052411307441355027647 0ustar bifh1bifhsPNG  IHDR Vu\bKGD pHYs  ~tIME IDATx}A+Da߽cN#[66V`?_BWQHY*vaܰcAQ"WS$X6V>ܣ {8X"`Me̐*8C\ы<9bjk lc0[b Vy|=?NX0E~h"c[[ wUK):AIENDB`matchbox-window-manager-1.2/matchbox-window-manager/data/themes/borillo/theme.xml0000664000211500234210000001100411307441355027146 0ustar bifh1bifhs matchbox-window-manager-1.2/matchbox-window-manager/data/themes/borillo/close.png0000664000211500234210000000103711307441355027142 0ustar bifh1bifhsPNG  IHDR bKGD pHYs  ~tIME %Y'IDATxԽkAG1ZQ4hN`.Xbh!J"QPl1BH<j0F,v_ޑ{`agga%8<1`؇7Xq 5kޅ*E%-&G{a/u@Ak4j]1;ip$f0*xCh0^jǑ. J 撤5\UJg?kIHhʓ$o\= 9m w4 eKMɡ ;2;h\{,jCda?Ş\9Tcu|8.+V'$- ,pN]_&(kh VlДվh>e?0-u+(&+CԈ^\Ǚ%KI+LFfq VZkAX?Xltĥ%oiIENDB`matchbox-window-manager-1.2/matchbox-window-manager/data/themes/borillo/theme.desktop0000664000211500234210000000043311307441355030023 0ustar bifh1bifhs[Desktop Entry] Type=MBTheme Name=Borillo Preview=XXX Comment=Blondie theme ThemePath=@prefix@/themes/blondie DockBgColor=#e0e0e0 MenuBgColor=#e0e0e0 MenuFgColor=#11111d MenuBdColor=#7297ce #MenuTransparency=240 MenuHlColor=#7297ce PanelFgColor=black DesktopBgSpec=col-solid:#e0e0e0matchbox-window-manager-1.2/matchbox-window-manager/data/themes/borillo/next.png0000664000211500234210000000073311307441355027015 0ustar bifh1bifhsPNG  IHDR bKGD pHYs  ~tIME 2RhIDATxԿKVQ-A@C\\+~NJD4758 eҤCC)#EO9>~sr B-`0ޣ ^؏,7nMOI}XGր 4"ֈ<6K8(]mW))aGR \2]>R*h1a,;Vٻe 1~f ݹa^emLN{%S'OZ*w3y\xH pC`RRĦG:$ ۆUCX/ |hs#|Lu_:zC)IENDB`matchbox-window-manager-1.2/matchbox-window-manager/data/themes/Makefile.am0000664000211500234210000000007211307441355025717 0ustar bifh1bifhsif WANT_STANDALONE SUBDIRS = else SUBDIRS = Default endif matchbox-window-manager-1.2/matchbox-window-manager/data/themes/blondie/0000775000211500234210000000000011307441355025300 5ustar bifh1bifhsmatchbox-window-manager-1.2/matchbox-window-manager/data/themes/blondie/dialogtopright2.png0000664000211500234210000000024711307441355031113 0ustar bifh1bifhsPNG  IHDRo&bKGD pHYs  #utIME C4IDATxc`C10͝0wV{3000pp 2Ij200002a37f IENDB`matchbox-window-manager-1.2/matchbox-window-manager/data/themes/blondie/titlestrip.png0000664000211500234210000000022111307441355030204 0ustar bifh1bifhsPNG  IHDRHbKGD pHYs  d_tIME !9lIDATxcd``e S*54IENDB`matchbox-window-manager-1.2/matchbox-window-manager/data/themes/blondie/dialogtopleft.png0000664000211500234210000000026311307441355030644 0ustar bifh1bifhsPNG  IHDRtbKGD pHYs  ~tIME 7{@IDATxc`z~EWϯ3 (pL,(, 7G^R_WIENDB`matchbox-window-manager-1.2/matchbox-window-manager/data/themes/blondie/dialogbottomright.png0000664000211500234210000000025411307441355031531 0ustar bifh1bifhsPNG  IHDRo&bKGD pHYs  d_tIME BZ9IDATxcxtG;?&,e# ie 0 63gI(ZIENDB`matchbox-window-manager-1.2/matchbox-window-manager/data/themes/blondie/que.png0000664000211500234210000000025711307441355026604 0ustar bifh1bifhsPNG  IHDR+>}bKGDC pHYs  #utIME w EqyP IENDB`matchbox-window-manager-1.2/matchbox-window-manager/data/themes/blondie/titleright.png0000664000211500234210000000027711307441355030173 0ustar bifh1bifhsPNG  IHDREbKGD pHYs  tIME #1hmLIDATx匱 @ /2!7~rH2@+mUum[q'dft771;qIENDB`matchbox-window-manager-1.2/matchbox-window-manager/data/themes/blondie/dialogtopleft2.png0000664000211500234210000000023411307441355030724 0ustar bifh1bifhsPNG  IHDRo&bKGD pHYs  #utIME! J)IDATxc`ϝՅY] .6 L=J>IENDB`matchbox-window-manager-1.2/matchbox-window-manager/data/themes/blondie/Makefile.am0000664000211500234210000000110611307441355027332 0ustar bifh1bifhspngs = close.png dialogbottomleft.png dialogbottomright.png \ dialogbottomtile.png dialogtopleft.png dialogtopright.png \ dialogtoptile.png menu.png next.png \ prev.png titleleft.png titleright.png titlestrip.png \ hide.png dialogtopleft2.png dialogtoptile2.png \ dialogtopright2.png que.png accept.png close-small.png themesdir = $(datadir)/themes/blondie/matchbox themes_DATA = theme.xml $(pngs) theme.desktop EXTRA_DIST = theme.xml $(pngs) theme.desktop matchbox-window-manager-1.2/matchbox-window-manager/data/themes/blondie/dialogtopright.png0000664000211500234210000000026311307441355031027 0ustar bifh1bifhsPNG  IHDRtbKGD pHYs  d_tIME# `7@IDATxc`C10z~ L?g=Y]p &l]]l,s(Z64IENDB`matchbox-window-manager-1.2/matchbox-window-manager/data/themes/blondie/accept.png0000664000211500234210000000024211307441355027243 0ustar bifh1bifhsPNG  IHDR+>}bKGDC pHYs  #utIME4:Y1/IDATxc`ܠ$.HzF$ztI Ȃ(V`!;,IENDB`matchbox-window-manager-1.2/matchbox-window-manager/data/themes/blondie/hide.png0000664000211500234210000000025611307441355026722 0ustar bifh1bifhsPNG  IHDRabKGD pHYs  #utIME 5+s{$;IDATxc`0"+Hׁ.@fL$j,8qף 6`*@0pDIENDB`matchbox-window-manager-1.2/matchbox-window-manager/data/themes/blondie/prev.png0000664000211500234210000000023111307441355026756 0ustar bifh1bifhsPNG  IHDRtbKGD pHYs  #utIME ?&IDATxc`=hd````D@lDgDL w Bf~IENDB`matchbox-window-manager-1.2/matchbox-window-manager/data/themes/blondie/theme.xml0000664000211500234210000003057011307441355027131 0ustar bifh1bifhs matchbox-window-manager-1.2/matchbox-window-manager/data/themes/blondie/dialogtoptile.png0000664000211500234210000000023411307441355030645 0ustar bifh1bifhsPNG  IHDR1bKGD pHYs  ~tIME#6Q)IDATxcd``πX^=΀"{&40Xv9"8IENDB`matchbox-window-manager-1.2/matchbox-window-manager/data/themes/blondie/close.png0000664000211500234210000000031211307441355027107 0ustar bifh1bifhsPNG  IHDR&bKGD pHYs  #utIME  - WIDATxcd cp07ep#lX.N !h(4p N@( yP&Mg ݫIENDB`matchbox-window-manager-1.2/matchbox-window-manager/data/themes/blondie/dialogbottomleft.png0000664000211500234210000000024511307441355031346 0ustar bifh1bifhsPNG  IHDRo&bKGD pHYs  d_tIME ׂ2IDATxcd_g=?wV l: Jz]IENDB`matchbox-window-manager-1.2/matchbox-window-manager/data/themes/blondie/menu.png0000664000211500234210000000022411307441355026750 0ustar bifh1bifhsPNG  IHDRNCbKGD pHYs  ~tIME qi`!IDATxcd``hd 20000Bit]ȜFd_BSIENDB`matchbox-window-manager-1.2/matchbox-window-manager/data/themes/blondie/titleleft.png0000664000211500234210000000030311307441355027776 0ustar bifh1bifhsPNG  IHDREbKGD pHYs  d_tIME %0}PIDATx͐ 0` ϔ1LCPA?]TJ1C=$P7mUǽz5 l.- ܁S'P8}ZsIENDB`matchbox-window-manager-1.2/matchbox-window-manager/data/themes/blondie/theme.desktop0000664000211500234210000000230211307441355027772 0ustar bifh1bifhs[Desktop Entry] # # The theme.desktop file for a matchbox theme is a basic way to # set the look of things other than the window manager when the # theme is changed. # # Currently it controls the dock and mbmenu's look . # 'Standard' .desktop entries. # Type=MBTheme Name=Blondie Comment=Blondie theme # # Dock/Panel settings # # you can set the docks background color, or to a tiled pixmap / transparent DockBgColor=#e2dec6 #DockBgTrans= 0-255, 0 being totally transparent #DockBgPixmap=/path/to/a xpm or png # The foreground color is used by things like minitime PanelFgColor=black # Panel bubble message propertys PanelMsgBgCol=#e2dec6 PanelMsgBgUrgentCol=#ffdec6 PanelMsgFgCol=#000000 # # Menu settings, used by both the dock popup menu and mbmenu. # MenuBgColor=#e2dec6 MenuFgColor=black # menu Border color MenuBdColor=#9d9a8a # selected entry color. # MenuHlColor=black XXX DEPRECIATED in 0.7 , border col used instead # Menu transparency set like the panel # MenuTransparency=0-255 # Set to a '|' seperated list of font names. # if set will overide Gtk font from xsettings #MenuFont=xxx|xxx|xxx # Value same as mbdesktop --bg option DesktopBgSpec=col-solid:#8395ac DesktopHlCol=#9d9a8a matchbox-window-manager-1.2/matchbox-window-manager/data/themes/blondie/next.png0000664000211500234210000000023011307441355026757 0ustar bifh1bifhsPNG  IHDRtbKGD pHYs  d_tIME &v%IDATxc`hD0 U3"q8Ubv IENDB`matchbox-window-manager-1.2/matchbox-window-manager/data/themes/bluebox/0000775000211500234210000000000011307441355025324 5ustar bifh1bifhsmatchbox-window-manager-1.2/matchbox-window-manager/data/themes/bluebox/buttsmallclosedown.xpm0000664000211500234210000000043111307441355031775 0ustar bifh1bifhs/* XPM */ static char * unknown[] = { "10 10 6 1", ". c #b3bbc3", "# c #b7bec6", "a c #b0b8c1", "b c #dfe6ee", "c c #6c8db1", "d c #ffffff", "bddddddddb", "dccccccccd", "dccccccccd", "dcdaccadcd", "dc#d##d#cd", "dcc#dd#ccd", "dcc#dd#ccd", "dc#d##d#cd", "dcd.cc#dcd", "bddddddddb"};matchbox-window-manager-1.2/matchbox-window-manager/data/themes/bluebox/buttclosedown.xpm0000664000211500234210000000127611307441355030754 0ustar bifh1bifhs/* XPM */ static char * buttclosedown_xpm[] = { "14 19 20 1", " c None", ". c #FFFFFF", "+ c #D7D7D7", "@ c #D6D6D6", "# c #D5D5D5", "$ c #D4D4D4", "% c #D3D3D3", "& c #D2D2D2", "* c #D0D0D0", "= c #CFCFCF", "- c #CECECE", "; c #CDCDCD", "> c #CCCCCC", ", c #CBCBCB", "' c #C9C9C9", ") c #C8C8C8", "! c #C7C7C7", "~ c #C6C6C6", "{ c #C5C5C5", "] c #828282", "..............", "++++++++++++++", "@@@@@@@@@@@@@@", "##############", "$$$..$$$$..$$$", "%%....%%....%%", "&&..........&&", "***........***", "====......====", "----......----", ";;;........;;;", ">>..........>>", ",,....,,....,,", "'''..''''..'''", "))))))))))))))", "!!!!!!!!!!!!!!", "~~~~~~~~~~~~~~", "{{{{{{{{{{{{{{", "]]]]]]]]]]]]]]"}; matchbox-window-manager-1.2/matchbox-window-manager/data/themes/bluebox/titlebg.xpm0000664000211500234210000000140611307441355027505 0ustar bifh1bifhs/* XPM */ static char * titlebg_xpm[] = { "17 20 20 1", " c None", ". c #000000", "+ c #FFFFFF", "@ c #DBDBDB", "# c #DADADA", "$ c #D9D9D9", "% c #D7D7D7", "& c #D6D6D6", "* c #D5D5D5", "= c #D4D4D4", "- c #D2D2D2", "; c #D1D1D1", "> c #D0D0D0", ", c #CFCFCF", "' c #CECECE", ") c #CBCBCB", "! c #CACACA", "~ c #C9C9C9", "{ c #C8C8C8", "] c #828282", ".................", "+++++++++++++++++", "@@@@@@@@@@@@@@@@@", "#################", "$$$$$$$$$$$$$$$$$", "%%%%%%%%%%%%%%%%%", "&&&&&&&&&&&&&&&&&", "*****************", "=================", "-----------------", ";;;;;;;;;;;;;;;;;", ">>>>>>>>>>>>>>>>>", ",,,,,,,,,,,,,,,,,", "'''''''''''''''''", ")))))))))))))))))", "!!!!!!!!!!!!!!!!!", "~~~~~~~~~~~~~~~~~", "~~~~~~~~~~~~~~~~~", "{{{{{{{{{{{{{{{{{", "]]]]]]]]]]]]]]]]]"}; matchbox-window-manager-1.2/matchbox-window-manager/data/themes/bluebox/buttmenudown.xpm0000664000211500234210000000133611307441355030610 0ustar bifh1bifhs/* XPM */ static char * buttmenudown_xpm[] = { "14 20 21 1", " c None", ". c #000000", "+ c #FFFFFF", "@ c #D7D7D7", "# c #D6D6D6", "$ c #D5D5D5", "% c #D4D4D4", "& c #D3D3D3", "* c #D2D2D2", "= c #D0D0D0", "- c #CFCFCF", "; c #CECECE", "> c #CDCDCD", ", c #CCCCCC", "' c #CBCBCB", ") c #C9C9C9", "! c #C8C8C8", "~ c #C7C7C7", "{ c #C6C6C6", "] c #C5C5C5", "^ c #828282", "..............", "++++++++++++++", "@@@@@@@@@@@@@@", "##############", "$$$$$$$$$$$$$$", "%%%%%%%%%%%%%%", "&&++&&&&&&++&&", "*++++****++++*", "=+++++==+++++=", "--++++++++++--", ";;;++++++++;;;", ">>>>++++++>>>>", ",,,,,++++,,,,,", "''''''++''''''", "))))))))))))))", "!!!!!!!!!!!!!!", "~~~~~~~~~~~~~~", "{{{{{{{{{{{{{{", "]]]]]]]]]]]]]]", "^^^^^^^^^^^^^^"}; matchbox-window-manager-1.2/matchbox-window-manager/data/themes/bluebox/buttcloseup.xpm0000664000211500234210000000140711307441355030425 0ustar bifh1bifhs/* XPM */ static char * buttcloseup_xpm[] = { "14 19 25 1", " c None", ". c #FFFFFF", "+ c #D7D7D7", "@ c #D6D6D6", "# c #D5D5D5", "$ c #D4D4D4", "% c #999999", "& c #D3D3D3", "* c #D2D2D2", "= c #989898", "- c #D0D0D0", "; c #CFCFCF", "> c #979797", ", c #CECECE", "' c #CDCDCD", ") c #CCCCCC", "! c #CBCBCB", "~ c #969696", "{ c #C9C9C9", "] c #959595", "^ c #C8C8C8", "/ c #C7C7C7", "( c #C6C6C6", "_ c #C5C5C5", ": c #828282", "..............", "++++++++++++++", "@@@@@@@@@@@@@@", "##############", "$$$%%$$$$%%$$$", "&&%%%%&&%%%%&&", "**==========**", "---========---", ";;;;>>>>>>;;;;", ",,,,>>>>>>,,,,", "'''>>>>>>>>'''", "))>>>>>>>>>>))", "!!~~~~!!~~~~!!", "{{{]]{{{{]]{{{", "^^^^^^^^^^^^^^", "//////////////", "((((((((((((((", "______________", "::::::::::::::"}; matchbox-window-manager-1.2/matchbox-window-manager/data/themes/bluebox/Makefile.am0000664000211500234210000000073511307441355027365 0ustar bifh1bifhsxpms = buttclosedown.xpm buttsmallcloseup.xpm \ buttcloseup.xpm buttsmallmaxdown.xpm titlebg.xpm \ buttmenudown.xpm buttsmallmaxup.xpm titleleft.xpm \ buttmenuup.xpm buttsmallmindown.xpm titleright.xpm \ buttsmallclosedown.xpm buttsmallminup.xpm themesdir = $(datadir)/themes/bluebox/matchbox themes_DATA = theme.xml $(xpms) theme.desktop EXTRA_DIST = theme.xml $(xpms) theme.desktop matchbox-window-manager-1.2/matchbox-window-manager/data/themes/bluebox/buttsmallcloseup.xpm0000664000211500234210000000043111307441355031452 0ustar bifh1bifhs/* XPM */ static char * unknown[] = { "10 10 6 1", ". c #b3bbc3", "# c #b7bec6", "a c #b0b8c1", "b c #dfe6ee", "c c #6c8db1", "d c #ffffff", "bddddddddb", "dccccccccd", "dcdaccadcd", "dc#d##d#cd", "dcc#dd#ccd", "dcc#dd#ccd", "dc#d##d#cd", "dcd.cc#dcd", "dccccccccd", "bddddddddb"};matchbox-window-manager-1.2/matchbox-window-manager/data/themes/bluebox/buttsmallmaxdown.xpm0000664000211500234210000000050611307441355031460 0ustar bifh1bifhs/* XPM */ static char * unknown[] = { "10 10 9 1", ". c #a5adb8", "# c #b3bbc3", "a c #b7bec6", "b c #a9b1bb", "c c #acb4be", "d c #b0b8c1", "e c #dfe6ee", "f c #6c8db1", "g c #ffffff", "egggggggge", "gffffffffg", "gffffffffg", "gffffffffg", "gfffdcfffg", "gffbggaffg", "gf#gbbgdfg", "gfg.ffbgfg", "gffffffffg", "egggggggge"};matchbox-window-manager-1.2/matchbox-window-manager/data/themes/bluebox/titleright.xpm0000664000211500234210000000167011307441355030235 0ustar bifh1bifhs/* XPM */ static char * titleright_xpm[] = { "25 20 21 1", " c None", ". c #000000", "+ c #595353", "@ c #FFFFFF", "# c #DBDBDB", "$ c #DADADA", "% c #D9D9D9", "& c #D7D7D7", "* c #D6D6D6", "= c #D5D5D5", "- c #D4D4D4", "; c #D2D2D2", "> c #D1D1D1", ", c #D0D0D0", "' c #CFCFCF", ") c #CECECE", "! c #CBCBCB", "~ c #CACACA", "{ c #C9C9C9", "] c #C8C8C8", "^ c #828282", ".....................++++", "@@@@@@@@@@@@@@@@@@@@@..++", "#####################@@.+", "$$$$$$$$$$$$$$$$$$$$$$$@.", "%%%%%%%%%%%%%%%%%%%%%%%@.", "&&&&&&&&&&&&&&&&&&&&&&&&@", "************************@", "========================@", "------------------------@", ";;;;;;;;;;;;;;;;;;;;;;;;@", ">>>>>>>>>>>>>>>>>>>>>>>>@", ",,,,,,,,,,,,,,,,,,,,,,,,@", "''''''''''''''''''''''''@", "))))))))))))))))))))))))@", "!!!!!!!!!!!!!!!!!!!!!!!!@", "~~~~~~~~~~~~~~~~~~~~~~~~@", "{{{{{{{{{{{{{{{{{{{{{{{{@", "{{{{{{{{{{{{{{{{{{{{{{{{@", "]]]]]]]]]]]]]]]]]]]]]]]]@", "^^^^^^^^^^^^^^^^^^^^^^^^^"}; matchbox-window-manager-1.2/matchbox-window-manager/data/themes/bluebox/buttsmallminup.xpm0000664000211500234210000000050611307441355031133 0ustar bifh1bifhs/* XPM */ static char * unknown[] = { "10 10 9 1", ". c #acb4be", "# c #b7bec6", "a c #b3bbc3", "b c #b0b8c1", "c c #a5adb8", "d c #a9b1bb", "e c #dfe6ee", "f c #6c8db1", "g c #ffffff", "egggggggge", "gffffffffg", "gffffffffg", "gfgdffcgfg", "gfbgddgafg", "gff#ggdffg", "gfff.bfffg", "gffffffffg", "gffffffffg", "egggggggge"};matchbox-window-manager-1.2/matchbox-window-manager/data/themes/bluebox/theme.xml0000664000211500234210000001046011307441355027151 0ustar bifh1bifhs matchbox-window-manager-1.2/matchbox-window-manager/data/themes/bluebox/titleleft.xpm0000664000211500234210000000166711307441355030060 0ustar bifh1bifhs/* XPM */ static char * titleleft_xpm[] = { "25 20 21 1", " c None", ". c #595353", "+ c #000000", "@ c #FFFFFF", "# c #DBDBDB", "$ c #DADADA", "% c #D9D9D9", "& c #D7D7D7", "* c #D6D6D6", "= c #D5D5D5", "- c #D4D4D4", "; c #D2D2D2", "> c #D1D1D1", ", c #D0D0D0", "' c #CFCFCF", ") c #CECECE", "! c #CBCBCB", "~ c #CACACA", "{ c #C9C9C9", "] c #C8C8C8", "^ c #828282", "....+++++++++++++++++++++", "..++@@@@@@@@@@@@@@@@@@@@@", ".+@@#####################", "+@$$$$$$$$$$$$$$$$$$$$$$$", "+@%%%%%%%%%%%%%%%%%%%%%%%", "@&&&&&&&&&&&&&&&&&&&&&&&&", "@************************", "@========================", "@------------------------", "@;;;;;;;;;;;;;;;;;;;;;;;;", "@>>>>>>>>>>>>>>>>>>>>>>>>", "@,,,,,,,,,,,,,,,,,,,,,,,,", "@''''''''''''''''''''''''", "@))))))))))))))))))))))))", "@!!!!!!!!!!!!!!!!!!!!!!!!", "@~~~~~~~~~~~~~~~~~~~~~~~~", "@{{{{{{{{{{{{{{{{{{{{{{{{", "@{{{{{{{{{{{{{{{{{{{{{{{{", "@]]]]]]]]]]]]]]]]]]]]]]]]", "^^^^^^^^^^^^^^^^^^^^^^^^^"}; matchbox-window-manager-1.2/matchbox-window-manager/data/themes/bluebox/buttmenuup.xpm0000664000211500234210000000135311307441355030264 0ustar bifh1bifhs/* XPM */ static char * buttmenuup_xpm[] = { "14 20 22 1", " c None", ". c #000000", "+ c #FFFFFF", "@ c #D7D7D7", "# c #D6D6D6", "$ c #D5D5D5", "% c #D4D4D4", "& c #D3D3D3", "* c #979797", "= c #D2D2D2", "- c #D0D0D0", "; c #CFCFCF", "> c #CECECE", ", c #CDCDCD", "' c #CCCCCC", ") c #CBCBCB", "! c #C9C9C9", "~ c #C8C8C8", "{ c #C7C7C7", "] c #C6C6C6", "^ c #C5C5C5", "/ c #828282", "..............", "++++++++++++++", "@@@@@@@@@@@@@@", "##############", "$$$$$$$$$$$$$$", "%%%%%%%%%%%%%%", "&&**&&&&&&**&&", "=****====****=", "-*****--*****-", ";;**********;;", ">>>********>>>", ",,,,******,,,,", "'''''****'''''", "))))))**))))))", "!!!!!!!!!!!!!!", "~~~~~~~~~~~~~~", "{{{{{{{{{{{{{{", "]]]]]]]]]]]]]]", "^^^^^^^^^^^^^^", "//////////////"}; matchbox-window-manager-1.2/matchbox-window-manager/data/themes/bluebox/buttsmallmaxup.xpm0000664000211500234210000000050611307441355031135 0ustar bifh1bifhs/* XPM */ static char * unknown[] = { "10 10 9 1", ". c #a5adb8", "# c #b3bbc3", "a c #b7bec6", "b c #a9b1bb", "c c #acb4be", "d c #b0b8c1", "e c #dfe6ee", "f c #6c8db1", "g c #ffffff", "egggggggge", "gffffffffg", "gffffffffg", "gfffdcfffg", "gffbggaffg", "gf#gbbgdfg", "gfg.ffbgfg", "gffffffffg", "gffffffffg", "egggggggge"};matchbox-window-manager-1.2/matchbox-window-manager/data/themes/bluebox/buttsmallmindown.xpm0000664000211500234210000000050611307441355031456 0ustar bifh1bifhs/* XPM */ static char * unknown[] = { "10 10 9 1", ". c #acb4be", "# c #b7bec6", "a c #b3bbc3", "b c #b0b8c1", "c c #a5adb8", "d c #a9b1bb", "e c #dfe6ee", "f c #6c8db1", "g c #ffffff", "egggggggge", "gffffffffg", "gffffffffg", "gffffffffg", "gfgdffcgfg", "gfbgddgafg", "gff#ggdffg", "gfff.bfffg", "gffffffffg", "egggggggge"};matchbox-window-manager-1.2/matchbox-window-manager/data/themes/bluebox/theme.desktop0000664000211500234210000000051211307441355030017 0ustar bifh1bifhs[Desktop Entry] Type=MBTheme Name=Bluebox Preview=XXX Comment=Bluebox theme ThemePath=@prefix@/themes/bluebox DockBgColor=#d2d2d2 MenuBgColor=#d2d2d2 MenuFgColor=black MenuBdColor=#828282 MenuHlColor=#828282 #MenuTransparency=220 PanelFgColor=black DesktopBgSpec= col-gradient-vertical:#516979,#718ab6 DesktopHlCol=#828282 matchbox-window-manager-1.2/matchbox-window-manager/data/kbdconfig0000664000211500234210000000000011307441355024236 0ustar bifh1bifhsmatchbox-window-manager-1.2/matchbox-window-manager/data/mbnoapp.xpm0000664000211500234210000000114311307441355024560 0ustar bifh1bifhs/* XPM */ static char * icon_xpm[] = { "16 16 16 1", " c None", ". c #323232", "+ c #535353", "@ c #4A8A8E", "# c #DEE2E2", "$ c #7E827A", "% c #8A9292", "& c #D6D6D6", "* c #36767E", "= c #9E9E9E", "- c #FAFAFA", "; c #B2B2B2", "> c #DEEEEA", ", c #464646", "' c #5EA2A2", ") c #52969A", " ", " ", " --#>>>>>>#-#-; ", " -&%')))))=&=&+ ", " >;$@*****=;%;+ ", " &$$$$$$$$$$$$, ", " &;;;;;;;;;;;;+ ", " &;;;;;;;;;;;;+ ", " #;;;;;;;;;;;;+ ", " &;;;;;;;;;;;;+ ", " #;;;;;;;;;;;;+ ", " #;;;;;;;;;;;;+ ", " &;;;;;;;;;;;;+ ", " $............. ", " ", " "}; matchbox-window-manager-1.2/matchbox-window-manager/data/schemas/0000775000211500234210000000000011307441355024022 5ustar bifh1bifhsmatchbox-window-manager-1.2/matchbox-window-manager/data/schemas/Makefile.am0000664000211500234210000000041311307441355026054 0ustar bifh1bifhsEXTRA_DIST = matchbox.schemas if GCONF_SCHEMAS_INSTALL schemadir = @GCONF_SCHEMA_FILE_DIR@ schema_DATA = matchbox.schemas install-data-local: GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-install-rule $(srcdir)/$(schema_DATA) endif matchbox-window-manager-1.2/matchbox-window-manager/data/schemas/matchbox.schemas0000664000211500234210000002650211307441355027201 0ustar bifh1bifhs /schemas/apps/matchbox/general/theme /apps/matchbox/general/theme matchbox string Simple Current theme The theme determines the appearance of window borders, titlebar, and so forth. /schemas/apps/matchbox/general/animations /apps/matchbox/general/animations matchbox bool true Sets application startup animations If true, applications started by the desktop and panel will have a simple animation. /schemas/apps/matchbox/window_keybindings/activate_window_menu /apps/matchbox/window_keybindings/activate_window_menu matchbox string <Alt>space Activate window menu The keybinding used to activate the window task menu. The format looks like "<Control>a" or "<Shift><Alt>F1. The parser is fairly liberal and allows lower or upper case, and also abbreviations such as "<Ctl>" and "<Ctrl>". If you set the option to the special string "disabled", then there will be no keybinding for this action. /schemas/apps/matchbox/window_keybindings/toggle_fullscreen /apps/matchbox/window_keybindings/toggle_fullscreen matchbox string disabled Toggle fullscreen mode The keybinding used to toggle fullscreen mode. The format looks like "<Control>a" or "<Shift><Alt>F1. The parser is fairly liberal and allows lower or upper case, and also abbreviations such as "<Ctl>" and "<Ctrl>". If you set the option to the special string "disabled", then there will be no keybinding for this action. /schemas/apps/matchbox/window_keybindings/toggle_titlebar /apps/matchbox/window_keybindings/toggle_titlebar matchbox string <Alt>F12 Toggle window titlebar visability /schemas/apps/matchbox/window_keybindings/close /apps/matchbox/window_keybindings/close matchbox string <Alt>F4 Close a window The keybinding used to close a window. The format looks like "<Control>a" or "<Shift><Alt>F1. The parser is fairly liberal and allows lower or upper case, and also abbreviations such as "<Ctl>" and "<Ctrl>". If you set the option to the special string "disabled", then there will be no keybinding for this action. /schemas/apps/matchbox/global_keybindings/cycle_windows /apps/matchbox/global_keybindings/cycle_windows matchbox string <Alt>Escape Move between windows immediately The keybinding used to move focus between windows without a popup window. (Traditionally <Alt>Escape) Holding the "shift" key while using this binding reverses the direction of movement. The format looks like "<Control>a" or "<Shift><Alt>F1. The parser is fairly liberal and allows lower or upper case, and also abbreviations such as "<Ctl>" and "<Ctrl>". If you set the option to the special string "disabled", then there will be no keybinding for this action. /schemas/apps/matchbox/global_keybindings/cycle_windows_backward /apps/matchbox/global_keybindings/cycle_windows_backward matchbox string disabled Move backwards between windows immediately The keybinding used to move focus backwards between windows without a popup window. Holding "shift" together with this binding makes the direction go forward again. The format looks like "<Control>a" or "<Shift><Alt>F1. The parser is fairly liberal and allows lower or upper case, and also abbreviations such as "<Ctl>" and "<Ctrl>". If you set the option to the special string "disabled", then there will be no keybinding for this action. /schemas/apps/matchbox/global_keybindings/show_desktop /apps/matchbox/global_keybindings/show_desktop matchbox string <Control><Alt>d Hide all windows and focus desktop The keybinding used to hide all normal windows and set the focus to the desktop background. The format looks like "<Control>a" or "<Shift><Alt>F1. The parser is fairly liberal and allows lower or upper case, and also abbreviations such as "<Ctl>" and "<Ctrl>". If you set the option to the special string "disabled", then there will be no keybinding for this action. /schemas/apps/matchbox/global_keybindings/panel_main_menu /apps/matchbox/global_keybindings/panel_main_menu matchbox string <Alt>F1 Show the panel menu The keybinding which shows the panel's main menu. The format looks like "<Control>a" or "<Shift><Alt>F1. The parser is fairly liberal and allows lower or upper case, and also abbreviations such as "<Ctl>" and "<Ctrl>". If you set the option to the special string "disabled", then there will be no keybinding for this action. /schemas/apps/matchbox/global_keybindings/panel_run_dialog /apps/matchbox/global_keybindings/panel_run_dialog matchbox string <Alt>F2 Show the panel run dialog The keybinding which display's the panel's "Run Program" dialog box. The format looks like "<Control>a" or "<Shift><Alt>F1. The parser is fairly liberal and allows lower or upper case, and also abbreviations such as "<Ctl>" and "<Ctrl>". If you set the option to the special string "disabled", then there will be no keybinding for this action. /schemas/apps/matchbox/keybinding_commands/command /apps/matchbox/keybinding_commands/command_1 /apps/matchbox/keybinding_commands/command_2 /apps/matchbox/keybinding_commands/command_3 /apps/matchbox/keybinding_commands/command_4 /apps/matchbox/keybinding_commands/command_5 /apps/matchbox/keybinding_commands/command_6 /apps/matchbox/keybinding_commands/command_7 /apps/matchbox/keybinding_commands/command_8 /apps/matchbox/keybinding_commands/command_9 /apps/matchbox/keybinding_commands/command_10 /apps/matchbox/keybinding_commands/command_11 /apps/matchbox/keybinding_commands/command_12 matchbox string disabled Commands to run in response to keybindings The /apps/matchbox/global_keybindings/run_command_N keys define keybindings that correspond to these commands. Pressing the keybinding for run_command_N will execute command_N. /schemas/apps/matchbox/global_keybindings/run_command /apps/matchbox/global_keybindings/run_command_1 /apps/matchbox/global_keybindings/run_command_2 /apps/matchbox/global_keybindings/run_command_3 /apps/matchbox/global_keybindings/run_command_4 /apps/matchbox/global_keybindings/run_command_5 /apps/matchbox/global_keybindings/run_command_6 /apps/matchbox/global_keybindings/run_command_7 /apps/matchbox/global_keybindings/run_command_8 /apps/matchbox/global_keybindings/run_command_9 /apps/matchbox/global_keybindings/run_command_10 /apps/matchbox/global_keybindings/run_command_11 /apps/matchbox/global_keybindings/run_command_12 matchbox string disabled Run a defined command The keybinding that runs the correspondingly-numbered command in /apps/matchbox/keybinding_commands The format looks like "<Control>a" or "<Shift><Alt>F1. The parser is fairly liberal and allows lower or upper case, and also abbreviations such as "<Ctl>" and "<Ctrl>". If you set the option to the special string "disabled", then there will be no keybinding for this action. matchbox-window-manager-1.2/matchbox-window-manager/data/Makefile.am0000664000211500234210000000043411307441355024434 0ustar bifh1bifhsif ENABLE_SCHEMAS SUBDIRS = themes schemas else SUBDIRS = themes endif confdir = $(sysconfdir)/matchbox conf_DATA = kbdconfig defaultsdir = $(datadir)/matchbox if WANT_STANDALONE defaults_DATA = else defaults_DATA = mbnoapp.xpm endif EXTRA_DIST = mbnoapp.xpm kbdconfig matchbox-window-manager-1.2/matchbox-window-manager/Makefile.am0000664000211500234210000000107711307441354023526 0ustar bifh1bifhsSUBDIRS = src data snapshot: $(MAKE) dist distdir=$(PACKAGE)-snap`date +"%Y%m%d"` upload: dist cvs2cl --hide-filenames; \ scp README handhelds.org:~/public_html/downloadables/matchbox/matchbox-readme.txt; \ scp ChangeLog handhelds.org:~/public_html/downloadables/matchbox/matchbox-changelog.txt; \ scp matchbox-@VERSION@.tar.gz handhelds.org:~/public_html/downloadables/matchbox/ make -C ./doc manual.html scp -r doc/manual doc/img doc/screenshots handhelds.org:~/public_html/matchbox/ scp -r doc/home.html handhelds.org:~/public_html/matchbox/index.html matchbox-window-manager-1.2/matchbox-window-manager/NEWS0000664000211500234210000000053011307441354022162 0ustar bifh1bifhs1.1 Release =========== * Support for decoration-less application windows. * New command line option for keyboard shortcuts config file path. * Various fixes for key shortcut handling ( i.e Shifted ) * Window gravity support for dialogs. * Various Maemo related and other minor bug fixes tweaks ( see ChangeLog ) * Start using NEWS file... matchbox-window-manager-1.2/matchbox-window-manager/src/0000775000211500234210000000000011307441355022255 5ustar bifh1bifhsmatchbox-window-manager-1.2/matchbox-window-manager/src/matchbox-remote.c0000664000211500234210000001700211307441355025517 0ustar bifh1bifhs/* * Matchbox Window Manager - A lightweight window manager not for the * desktop. * * Authored By Matthew Allum * * Copyright (c) 2002, 2004 OpenedHand Ltd - http://o-hand.com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #define _GNU_SOURCE #include #include #include #include #include #include #include #define MB_CMD_SET_THEME 1 #define MB_CMD_EXIT 2 #define MB_CMD_DESKTOP 3 #define MB_CMD_NEXT 4 #define MB_CMD_PREV 5 #define MB_CMD_SHOW_EXT_MENU 6 #define MB_CMD_MISC 7 #define MB_CMD_COMPOSITE 8 #define MB_CMB_KEYS_RELOAD 9 #define MB_CMD_PANEL_TOGGLE_VISIBILITY 1 #define MB_CMD_PANEL_SIZE 2 #define MB_CMD_PANEL_ORIENTATION 3 #define MB_PANEL_ORIENTATION_NORTH 1 #define MB_PANEL_ORIENTATION_EAST 2 #define MB_PANEL_ORIENTATION_SOUTH 3 #define MB_PANEL_ORIENTATION_WEST 4 Display* dpy; static void getRootProperty(char * name, Bool delete) { Atom prop; Atom realType; unsigned long n; unsigned long extra; int format; int status; char * value; prop = XInternAtom(dpy, name, True); if (prop == None) { fprintf(stderr, "mbcontrol: Unable to find theme name\n"); return; } status = XGetWindowProperty(dpy, DefaultRootWindow(dpy), prop, 0L, 512L, delete, AnyPropertyType, &realType, &format, &n, &extra, (unsigned char **) &value); if (status != Success) { // || value == 0 || *value == 0 || n == 0) { fprintf(stderr, "Unable to find theme name\n"); return; } if (value) printf("%s\n", value); } static void mbpanelcommand(int cmd_id, int panel_id) { XEvent ev; Window root, panel; Atom cmd_prop, system_tray_atom; char atomName[64]; root = DefaultRootWindow(dpy); snprintf(atomName, 64, "_NET_SYSTEM_TRAY_S%d", panel_id); system_tray_atom = XInternAtom(dpy, atomName, False); cmd_prop = XInternAtom(dpy, "_MB_COMMAND", False); if (cmd_id == MB_CMD_PANEL_TOGGLE_VISIBILITY) { panel = XGetSelectionOwner(dpy, system_tray_atom); if (panel != None) { memset(&ev, '\0', sizeof ev); ev.xclient.type = ClientMessage; ev.xclient.window = root; ev.xclient.message_type = cmd_prop; ev.xclient.format = 8; ev.xclient.data.l[0] = cmd_id; XSendEvent(dpy, panel,False, SubstructureRedirectMask|SubstructureNotifyMask, &ev); } else { fprintf(stderr, "Cant find panel %i\n", panel_id); exit(1); } } } static void mbcommand(int cmd_id, char *data) { XEvent ev; Window root; Atom theme_prop, cmd_prop, desktop_manager_atom; desktop_manager_atom = XInternAtom(dpy, "_NET_DESKTOP_MANGER",False); root = DefaultRootWindow(dpy); if (cmd_id == MB_CMD_SET_THEME) { theme_prop = XInternAtom(dpy, "_MB_THEME", False); XChangeProperty(dpy, root, theme_prop, XA_STRING, 8, PropModeReplace, (unsigned char*)data, strlen(data)); } if (cmd_id == MB_CMD_DESKTOP) { /* Check if desktop is running */ if (!XGetSelectionOwner(dpy, desktop_manager_atom)) { fprintf(stderr, "Desktop not running, exiting...\n"); switch (fork()) { case 0: execvp ("mbdesktop", NULL); break; case -1: fprintf(stderr, "failed to exec mbdesktop"); break; } exit(0); } } cmd_prop = XInternAtom(dpy, "_MB_COMMAND", False); memset(&ev, '\0', sizeof ev); ev.xclient.type = ClientMessage; ev.xclient.window = root; /* we send it _from_ root as we have no win */ ev.xclient.message_type = cmd_prop; ev.xclient.format = 8; ev.xclient.data.l[0] = cmd_id; XSendEvent(dpy, root, False, SubstructureRedirectMask|SubstructureNotifyMask, &ev); } void send_input_manager_request(int show) { XEvent ev; Window root; Atom atom_input; atom_input = XInternAtom(dpy, "_MB_INPUT_REQUEST",False); root = DefaultRootWindow(dpy); memset(&ev, '\0', sizeof ev); ev.xclient.type = ClientMessage; ev.xclient.window = root; /* we send it _from_ root as we have no win */ ev.xclient.message_type = atom_input; ev.xclient.format = 8; ev.xclient.data.l[0] = show; printf("valie : %i\n", show); XSendEvent(dpy, root, False, SubstructureRedirectMask|SubstructureNotifyMask, &ev); } static void usage(char *progname) { printf("Usage: %s [options...]\n", progname); printf("Options:\n"); printf(" -t switch matchbox theme\n"); printf(" -r Print current matchbox theme to stdout \n"); printf(" -exit Request matchbox to exit \n"); printf(" -next Page to next window \n"); printf(" -prev Page to previous window \n"); printf(" -desktop Toggle desktop visibility\n"); printf(" -menu Activate mb-applet-menu-launcher\n"); printf(" -panel-toggle [panel id] Toogle panel visibility\n"); printf(" -input-toggle [1|0] Toggle Input method ( requires input-manager )\n"); printf(" -composite-toggle Toggle Compositing Engine ( if enabled )\n"); printf(" -keys-reload Reload key shortcut config ( if enabled )\n"); /* printf(" -panel-size \n"); printf(" -panel-orientate \n"); */ printf(" -h this help\n\n"); exit(1); } int main(int argc, char* argv[]) { char *display_name = (char *)getenv("DISPLAY"); int i; if (argc < 2) usage(argv[0]); dpy = XOpenDisplay(display_name); if (dpy == NULL) { printf("Cant connect to display: %s\n", display_name); exit(1); } /* pass command line */ for (i=1; argv[i]; i++) { char *arg = argv[i]; if (*arg=='-') { switch (arg[1]) { case 't' : if (argv[i+1] != NULL) mbcommand(MB_CMD_SET_THEME, argv[i+1]); i++; break; case 'r' : getRootProperty("_MB_THEME", False); i++; break; case 'e': mbcommand(MB_CMD_EXIT, NULL); break; case 'd': mbcommand(MB_CMD_DESKTOP, NULL); break; case 'n': mbcommand(MB_CMD_NEXT, NULL); break; case 'c': mbcommand(MB_CMD_COMPOSITE, NULL); break; case 'k': mbcommand(MB_CMB_KEYS_RELOAD, NULL); break; case 'p': if (!strcmp(arg+1,"panel-toggle")) { int panel_id = 0; if (argc > i+1) panel_id = atoi(argv[i+1]); mbpanelcommand(MB_CMD_PANEL_TOGGLE_VISIBILITY, panel_id); } else if (strcmp(arg+1,"prev") == 0 || strlen(arg+1) == 1) { mbcommand(MB_CMD_PREV, NULL); } else usage(argv[0]); break; case 'm': mbcommand(MB_CMD_SHOW_EXT_MENU, NULL); break; case 'x': mbcommand(MB_CMD_MISC, NULL); break; case 'i': if (argv[i+1] != NULL) send_input_manager_request(atoi(argv[i+1])); else usage(argv[0]); break; default: usage(argv[0]); break; } } } XSync(dpy, False); XCloseDisplay(dpy); return 0; } matchbox-window-manager-1.2/matchbox-window-manager/src/ewmh.c0000664000211500234210000010752211307441355023370 0ustar bifh1bifhs/* * Matchbox Window Manager - A lightweight window manager not for the * desktop. * * Authored By Matthew Allum * * Copyright (c) 2002, 2004 OpenedHand Ltd - http://o-hand.com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #include "ewmh.h" static void set_supported(Wm *w); static void set_compliant(Wm *w); void ewmh_init(Wm *w) { /* The list below *MUST* be kept in the same order as the corresponding emun in structs.h or *everything* will break. Doing it like this avoids a mass of round trips on startup. */ char *atom_names[] = { "WM_STATE", "WM_CHANGE_STATE", "WM_PROTOCOLS", "WM_DELETE_WINDOW", "WM_COLORMAP_WINDOWS", "_MB_THEME", "_MB_THEME_NAME", "_NET_WM_WINDOW_TYPE_TOOLBAR", "_NET_WM_WINDOW_TYPE_DOCK", "_NET_WM_WINDOW_TYPE_DIALOG", "_NET_WM_WINDOW_TYPE_SPLASH", "_NET_WM_WINDOW_TYPE_DESKTOP", "_NET_WM_WINDOW_TYPE_NORMAL", "_MB_COMMAND", "_MB_CLIENT_EXEC_MAP", "_MB_CLIENT_STARTUP_LIST", "_NET_WM_STATE", "_NET_WM_STATE_FULLSCREEN", "_NET_WM_STATE_MODAL", "_NET_SUPPORTED", "_NET_CLIENT_LIST", "_NET_NUMBER_OF_DESKTOPS", "_NET_ACTIVE_WINDOW", "_NET_SUPPORTING_WM_CHECK", "_NET_CLOSE_WINDOW", "_NET_WM_NAME", "UTF8_STRING", "_NET_CLIENT_LIST_STACKING", "_NET_CURRENT_DESKTOP", "_NET_WM_DESKTOP", "_NET_WM_ICON", "_NET_WM_ICON_GEOMETRY", "_NET_DESKTOP_GEOMETRY", "_NET_WORKAREA", "_NET_INPUT_AREAS", "_NET_SHOWING_DESKTOP", "_MOTIF_WM_HINTS", "_NET_WM_CONTEXT_HELP", "_NET_WM_CONTEXT_ACCEPT", "_NET_WM_ALLOWED_ACTIONS", "_NET_WM_ACTION_MOVE", "_NET_WM_ACTION_RESIZE", "_NET_WM_ACTION_MINIMIZE", "_NET_WM_ACTION_SHADE", "_NET_WM_ACTION_STICK", "_NET_WM_ACTION_MAXIMIZE_HORZ", "_NET_WM_ACTION_MAXIMIZE_VERT", "_NET_WM_ACTION_FULLSCREEN", "_NET_WM_ACTION_CHANGE_DESKTOP", "_NET_WM_ACTION_CLOSE", "_NET_STARTUP_ID", "_WIN_SUPPORTING_WM_CHECK", "_MB_WM_WINDOW_TYPE_MESSAGE", "_NET_WM_WINDOW_TYPE", "_NET_WM_PING", "_NET_WM_PID", "WM_CLIENT_MACHINE", "_MB_WM_STATE_DOCK_TITLEBAR", "_NET_WM_CONTEXT_CUSTOM", "_NET_WM_WINDOW_TYPE_MENU", "CM_TRANSLUCENCY", "_MB_DOCK_TITLEBAR_SHOW_ON_DESKTOP", "_MB_GRAB_TRANSFER", "_NET_WM_WINDOW_TYPE_INPUT", "_NET_WM_STATE_ABOVE", "WM_TRANSIENT_FOR", "_NET_WM_SYNC_REQUEST_COUNTER", "_NET_WM_SYNC_REQUEST", "_MB_CURRENT_APP_WINDOW", "_MB_APP_WINDOW_LIST_STACKING", "_NET_WM_USER_TIME", "_MB_NUM_MODAL_WINDOWS_PRESENT", "_MB_WM_STATE", "_NET_WM_WINDOW_TYPE_NOTIFICATION", "_NET_WM_WINDOW_TYPE_DROPDOWN_MENU", "_NET_WM_WINDOW_TYPE_POPUP_MENU", "_MB_NUM_SYSTEM_MODAL_WINDOWS_PRESENT" }; XInternAtoms (w->dpy, atom_names, ATOM_COUNT, False, w->atoms); #ifdef USE_XSYNC ewmh_sync_init(w); #endif } void ewmh_init_props(Wm *w) { int num_desktops = 1; set_compliant(w); set_supported(w); XChangeProperty(w->dpy, w->root, w->atoms[_NET_NUMBER_OF_DESKTOPS], XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&num_desktops, 1); XChangeProperty(w->dpy, w->root, w->atoms[_NET_CURRENT_DESKTOP], XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&num_desktops, 0); } int ewmh_handle_root_message(Wm *w, XClientMessageEvent *e) { /* Handle client messages _sent_ to root window */ Client *c = NULL; dbg("%s() called\n", __func__); if (e->message_type == w->atoms[_NET_ACTIVE_WINDOW]) { dbg("%s() got active window message for win %li", __func__, e->window); if ((c = wm_find_client(w, e->window, WINDOW)) != NULL) { if (c->type == MBCLIENT_TYPE_DIALOG && c->trans != NULL) { /* * If an attempt has been made to activate a hidden * dialog, activate its parent app first. * * Note this is mainly to work with some task selectors * ( eg the gnome one, which activates top dialog ). * * XXX wm_activate_client() should probably do this. */ Client *parent = c->trans; while (parent->trans != NULL) parent = parent->trans; if (parent != wm_get_visible_main_client(w)) wm_activate_client(parent); } /* Likely activated by a TN so start pinging if aggresive setup */ if (w->config->ping_aggressive && c->type == MBCLIENT_TYPE_APP && c != wm_get_visible_main_client(w)) ewmh_ping_client_start (c); wm_activate_client(c); } return 1; } else if (e->message_type == w->atoms[_NET_CLOSE_WINDOW]) { if ((c = wm_find_client(w, e->window, WINDOW)) != NULL) client_deliver_delete(c); return 1; } else if (e->message_type == w->atoms[WM_PROTOCOLS] && e->data.l[0] == w->atoms[_NET_WM_PING]) { if ((c = wm_find_client(w, e->data.l[1], WINDOW)) != NULL) { dbg("%s() pong from %s\n", __func__, c->name); /* We got a response to a ping. stop pinging it now * until close button is pressed again. */ if (c->ping_handler_called) { int len; char *buf; /* aha! this was thought be be dead but has come * alive again.. */ len = strlen(w->config->ping_handler) + 32; buf = malloc(len); if (buf) { snprintf(buf, len-1, "%s %i %li 1", w->config->ping_handler, c->pid, c->window); fork_exec(buf); free(buf); } } if (w->config->ping_aggressive) { if (c->pings_pending >= 0) c->pings_pending--; } else { /* Regular pinging, assume 1 reply and the * app is alive. */ if (c->pings_pending > 0) { ewmh_ping_client_stop(c); } } } } else if (e->message_type == w->atoms[WINDOW_STATE]) { if (e->data.l[1] == w->atoms[WINDOW_STATE_FULLSCREEN] && ((c = wm_find_client(w, e->window, WINDOW)) != NULL) && c->type == MBCLIENT_TYPE_APP) { dbg("got EWMH fullscreen state change\n"); switch (e->data.l[0]) { case _NET_WM_STATE_REMOVE: if (c->flags & CLIENT_FULLSCREEN_FLAG) main_client_toggle_fullscreen(c); break; case _NET_WM_STATE_ADD: if (!(c->flags & CLIENT_FULLSCREEN_FLAG)) main_client_toggle_fullscreen(c); break; case _NET_WM_STATE_TOGGLE: main_client_toggle_fullscreen(c); break; } } else if (e->data.l[1] == w->atoms[WINDOW_STATE_ABOVE] && ((c = wm_find_client(w, e->window, WINDOW)) != NULL) && c->type == MBCLIENT_TYPE_DIALOG) { dbg("got EWMH above state change\n"); switch (e->data.l[0]) { case _NET_WM_STATE_REMOVE: c->flags &= ~CLIENT_HAS_ABOVE_STATE; break; case _NET_WM_STATE_ADD: c->flags |= CLIENT_HAS_ABOVE_STATE; break; case _NET_WM_STATE_TOGGLE: c->flags ^= CLIENT_HAS_ABOVE_STATE; break; } wm_activate_client(c); } return 1; } else if (e->message_type == w->atoms[_NET_SHOW_DESKTOP] && wm_get_desktop(w) ) { dbg("%s() got desktop message\n", __func__); if (e->data.l[0] == 1) { /* Show the desktop, if not shown */ if (!(w->flags & DESKTOP_RAISED_FLAG)) wm_toggle_desktop(w); } else { /* Hide the desktop, if shown */ if (w->flags & DESKTOP_RAISED_FLAG) wm_toggle_desktop(w); } } return 0; } void ewmh_update_lists(Wm *w) { Client *c = NULL; Window *wins = NULL; int cnt = 0; dbg("%s(): called %i\n", __func__, n_stack_items(w)); #ifdef USE_LIBSN unsigned char *bin_map_str = NULL; int bin_map_cnt = 0; SnCycle *current_cycle = w->sn_cycles; dbg("%s() called\n", __func__); while(current_cycle != NULL) { dbg("%s() checking cycle %s\n", __func__, current_cycle->bin_name); if (current_cycle->xid != None) { dbg("%s() has xid %li\n", __func__, current_cycle->xid); bin_map_cnt += (strlen(current_cycle->bin_name) + 32); dbg("%s(): bin_map_cnt : %i, name: %s\n", __func__, bin_map_cnt, current_cycle->bin_name) ; } current_cycle = current_cycle->next; } if (bin_map_cnt) { bin_map_str = malloc(sizeof(unsigned char)*bin_map_cnt); memset( bin_map_str, 0, bin_map_cnt); current_cycle = w->sn_cycles; while(current_cycle != NULL) { if (current_cycle->xid != None) { char str_tmp[256] = ""; snprintf(str_tmp, 256, "%s=%li|", current_cycle->bin_name, current_cycle->xid); strcat(bin_map_str, str_tmp); dbg("%s(): bin_map_str : %s , str_tmp: %s \n", __func__, bin_map_str, str_tmp) ; } current_cycle = current_cycle->next; } if (bin_map_str) { XChangeProperty(w->dpy, w->root, w->atoms[MB_CLIENT_EXEC_MAP] , XA_STRING, 8, PropModeReplace, (unsigned char *)bin_map_str, strlen(bin_map_str) ); free(bin_map_str); } else { dbg("%s() deleting MB_CLIENT_EXEC_MAP\n", __func__); XDeleteProperty(w->dpy, w->root, w->atoms[MB_CLIENT_EXEC_MAP]); } XFlush(w->dpy); } else { dbg("%s() deleting MB_CLIENT_EXEC_MAP\n", __func__); XDeleteProperty(w->dpy, w->root, w->atoms[MB_CLIENT_EXEC_MAP]); } #endif /* Root window client win lists */ if (!stack_empty(w)) { MBList *item = NULL; Window *app_wins = NULL; int app_win_cnt = 0; dbg("%s(): updating ewmh list props %i items\n", __func__, n_stack_items(w) ) ; wins = malloc(sizeof(Window)*n_stack_items(w)); app_wins = malloc(sizeof(Window)*n_stack_items(w)); stack_enumerate(w,c) { wins[cnt++] = c->window; if (c->type == MBCLIENT_TYPE_APP) app_wins[app_win_cnt++] = c->window; } XChangeProperty(w->dpy, w->root, w->atoms[_NET_CLIENT_LIST_STACKING] , XA_WINDOW, 32, PropModeReplace, (unsigned char *)wins, n_stack_items(w)); XChangeProperty(w->dpy, w->root, w->atoms[_MB_APP_WINDOW_LIST_STACKING], XA_WINDOW, 32, PropModeReplace, (unsigned char *)app_wins, app_win_cnt); free(app_wins); /* Update _NET_CLIENT_LIST but with 'age' order rather than stacking */ cnt = 0; list_enumerate(w->client_age_list, item) { c = (Client*)item->data; wins[cnt++] = c->window; dbg("%s() adding %s\n", __func__, c->name); } XChangeProperty(w->dpy, w->root, w->atoms[_NET_CLIENT_LIST] , XA_WINDOW, 32, PropModeReplace, (unsigned char *)wins, n_stack_items(w)); } else { /* No managed windows */ XChangeProperty(w->dpy, w->root, w->atoms[_NET_CLIENT_LIST_STACKING] , XA_WINDOW, 32, PropModeReplace, NULL, 0); XChangeProperty(w->dpy, w->root, w->atoms[_MB_APP_WINDOW_LIST_STACKING], XA_WINDOW, 32, PropModeReplace, NULL, 0); XChangeProperty(w->dpy, w->root, w->atoms[_NET_CLIENT_LIST] , XA_WINDOW, 32, PropModeReplace, NULL, 0); } if (wins) free(wins); /* Set an MB only prop listing number of modal windows currently mapped. * Behaviour needed by certain maemo elements to avoid hammering window * tree to check this. It will only work with 'super modal'. */ if (w->config->super_modal) { XChangeProperty(w->dpy, w->root, w->atoms[_MB_NUM_MODAL_WINDOWS_PRESENT], XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&w->n_modals_present, 1); XChangeProperty(w->dpy, w->root, w->atoms[_MB_NUM_SYSTEM_MODAL_WINDOWS_PRESENT], XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&w->n_modal_blocker_wins, 1); } } void ewmh_update_desktop_hint(Wm *w) { /* Desktop showing hint */ int val = (w->flags & DESKTOP_RAISED_FLAG) ? 1 : 0; XChangeProperty(w->dpy, w->root, w->atoms[_NET_SHOW_DESKTOP], XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&val, 1); } void ewmh_update_rects(Wm *w) { CARD32 val[4]; val[0] = wm_get_offsets_size(w, WEST, NULL, True); val[1] = wm_get_offsets_size(w, NORTH, NULL, True); val[2] = w->dpy_width - wm_get_offsets_size(w, WEST, NULL, True) - wm_get_offsets_size(w, EAST, NULL, True); val[3] = w->dpy_height - wm_get_offsets_size(w, NORTH, NULL, True) - wm_get_offsets_size(w, SOUTH, NULL, True); if (w->flags & DESKTOP_DECOR_FLAG) { /* Desktop is decorated, needs to know frame border sizes */ val[0] += theme_frame_defined_width_get(w->mbtheme, FRAME_MAIN_WEST ); val[2] -= theme_frame_defined_width_get(w->mbtheme, FRAME_MAIN_EAST ); val[3] -= theme_frame_defined_height_get(w->mbtheme, FRAME_MAIN); } dbg("%s(): vals now is %li, %li, %li, %li ( root: %li )\n", __func__, val[0], val[1], val[2], val[3], w->root ); XChangeProperty(w->dpy, w->root, w->atoms[_NET_WORKAREA], XA_CARDINAL, 32, PropModeReplace, (unsigned char *)val, 4); XChangeProperty(w->dpy, w->root, w->atoms[_NET_DESKTOP_GEOMETRY], XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&val[2], 2); } void ewmh_state_set(Client *c) { Wm *w = c->wm; Atom atom_states[4]; int n_atom_states = 0; /* We need to set ewmh state as some apps need to know when they * return from fullscreen */ if (c->flags & CLIENT_FULLSCREEN_FLAG) atom_states[n_atom_states++] = w->atoms[WINDOW_STATE_FULLSCREEN]; if (c->flags & CLIENT_IS_MODAL_FLAG) atom_states[n_atom_states++] = w->atoms[WINDOW_STATE_MODAL]; if (c->flags & CLIENT_DOCK_TITLEBAR) atom_states[n_atom_states++] = w->atoms[MB_WM_STATE_DOCK_TITLEBAR]; if (c->flags & CLIENT_DOCK_TITLEBAR_SHOW_ON_DESKTOP) atom_states[n_atom_states++] = w->atoms[MB_DOCK_TITLEBAR_SHOW_ON_DESKTOP]; /* XXX Should avoid trashing states here we dont handle. * Otherwise things like skip taskbar state get trashed. */ if (n_atom_states) XChangeProperty(w->dpy, c->window, w->atoms[WINDOW_STATE], XA_ATOM, 32, PropModeReplace, (unsigned char *)atom_states, n_atom_states); else XChangeProperty(w->dpy, c->window, w->atoms[WINDOW_STATE], XA_ATOM, 32, PropModeReplace, (unsigned char *)NULL, 0); } static Bool state_check (Client *c, Atom check, Atom atom_state_wanted) { Wm *w = c->wm; unsigned long n; unsigned long extra; int format, status, i; Atom realType, *value = NULL; status = XGetWindowProperty(w->dpy, c->window, check, 0L, 1000000L, 0, XA_ATOM, &realType, &format, &n, &extra, (unsigned char **) &value); if (status == Success) { if (realType == XA_ATOM && format == 32 && n > 0) { for(i=0; i < n; i++) if (value[i] && value[i] == atom_state_wanted) { if (value) XFree(value); return True; } } } if (value) XFree(value); return False; } Bool ewmh_state_check(Client *c, Atom atom_state_wanted) { if (state_check(c, c->wm->atoms[WINDOW_STATE], atom_state_wanted)) return True; /* gtk does not let you overide standard states, so we also check * an mb only state prop for things like panel in titlebar states. * FIXME: This is kludgy. */ if (state_check(c, c->wm->atoms[_MB_WM_STATE], atom_state_wanted)) return True; return False; } void ewmh_set_allowed_actions(Wm *w, Client *c) { int num_actions = 1; Atom actions[] = { w->atoms[_NET_WM_ACTION_CLOSE], 0, 0 }; if (c->type == MBCLIENT_TYPE_APP) actions[num_actions++] = w->atoms[_NET_WM_ACTION_FULLSCREEN]; if (c->type == MBCLIENT_TYPE_PANEL || c->type == MBCLIENT_TYPE_DIALOG) actions[num_actions++] = w->atoms[_NET_WM_ACTION_MOVE]; XChangeProperty(w->dpy, c->window, w->atoms[_NET_WM_ALLOWED_ACTIONS], XA_ATOM, 32, PropModeReplace, (unsigned char *)actions, num_actions); } void ewmh_set_active(Wm *w) { static unsigned long last_active; unsigned long val[1] = { 0 }; if (w->focused_client != NULL) val[0] = w->focused_client->window; if (last_active == val[0]) /* avoid the roundtrip if pos */ return; last_active = val[0]; dbg("%s() setting %li as active\n", __func__, val[0] ); XChangeProperty(w->dpy, w->root, w->atoms[_NET_ACTIVE_WINDOW] , XA_WINDOW, 32, PropModeReplace, (unsigned char *)val, 1); } int ewmh_get_user_time (Client *c) { Wm *w = c->wm; Atom real_type; int real_format; unsigned long items_read, items_left; int *data = NULL, result = -1; if (XGetWindowProperty(w->dpy, c->window, w->atoms[_NET_WM_USER_TIME], 0L, 2L, False, XA_CARDINAL, &real_type, &real_format, &items_read, &items_left, (unsigned char **) &data) == Success && items_read) result = *data; if (data) XFree(data); return result; } void ewmh_set_current_app_window(Wm *w) { Client *c; static unsigned long last_active; unsigned long val[1] = { 0 }; if ((c = wm_get_visible_main_client(w)) != NULL) val[0] = c->window; if (last_active == val[0]) /* avoid the roundtrip if pos */ return; last_active = val[0]; XChangeProperty(w->dpy, w->root, w->atoms[_MB_CURRENT_APP_WINDOW] , XA_WINDOW, 32, PropModeReplace, (unsigned char *)val, 1); } void ewmh_ping_client_start (Client *c) { #ifndef NO_PING if (c->has_ping_protocol && c->pings_pending == -1) { c->pings_pending = 0; c->pings_sent = 0; c->ping_handler_called = False; c->wm->n_active_ping_clients++; dbg("starting pinging '%s' , active: %i\n", c->name, c->wm->n_active_ping_clients); } #endif } void ewmh_ping_client_stop (Client *c) { #ifndef NO_PING if (c->has_ping_protocol && c->pings_pending != -1) { dbg("stopping pinging '%s' , pending: %i\n", c->name, c->pings_pending); c->pings_pending = -1; c->wm->n_active_ping_clients--; dbg("stopping pinging '%s' , active: %i\n", c->name, c->wm->n_active_ping_clients); } #endif } void ewmh_hung_app_check(Wm *w) { #ifndef NO_PING Client *c = NULL; if (stack_empty(w)) return; dbg("%s() called\n", __func__ ); stack_enumerate(w, c) { if (c->has_ping_protocol && c->pings_pending != -1) { XEvent e; c->pings_pending++; dbg("%s() pinging %s\n", __func__, c->name); e.type = ClientMessage; e.xclient.window = c->window; e.xclient.message_type = w->atoms[WM_PROTOCOLS]; e.xclient.format = 32; e.xclient.data.l[0] = w->atoms[_NET_WM_PING]; /* To save a load of code bloat, we just set the timestamp * to the client window ID. This could be slightly evil but * makes things much more compact. */ e.xclient.data.l[1] = c->window; XSendEvent(w->dpy, c->window, False, 0, &e); XSync(w->dpy, False); c->pings_sent++; if (c->pings_pending > PING_PENDING_MAX) { if (w->config->ping_handler && c->pid) { /* fire off external binary to handle hung app * if env var is set. */ int len; char *buf = NULL; if (!c->ping_handler_called) { len = strlen(w->config->ping_handler) + 32; buf = malloc(len); if (buf) { snprintf(buf, len-1, "%s %i %li", w->config->ping_handler, c->pid, c->window); fork_exec(buf); free(buf); c->ping_handler_called = True; } } /* dont ping any more */ if ( !w->config->ping_aggressive ) { ewmh_ping_client_stop (c); } } else client_obliterate(c); } if (w->config->ping_aggressive && c->pings_sent >= PING_CHECK_DURATION) ewmh_ping_client_stop (c); } } #endif } static void set_supported(Wm *w) /* */ { int num_supported = 0; Atom supported[] = { w->atoms[WINDOW_TYPE_TOOLBAR], w->atoms[WINDOW_TYPE_DOCK], w->atoms[WINDOW_TYPE_DIALOG], w->atoms[WINDOW_TYPE_DESKTOP], w->atoms[WINDOW_TYPE_SPLASH], w->atoms[WINDOW_TYPE_MENU], w->atoms[WINDOW_STATE], w->atoms[WINDOW_STATE_FULLSCREEN], w->atoms[WINDOW_STATE_MODAL], w->atoms[_NET_SUPPORTED], w->atoms[_NET_CLIENT_LIST], w->atoms[_NET_NUMBER_OF_DESKTOPS], w->atoms[_NET_ACTIVE_WINDOW], w->atoms[_NET_SUPPORTING_WM_CHECK], w->atoms[_NET_CLOSE_WINDOW], w->atoms[_NET_CURRENT_DESKTOP], w->atoms[_NET_CLIENT_LIST_STACKING], w->atoms[_NET_SHOW_DESKTOP], w->atoms[_NET_WM_NAME], w->atoms[_NET_WM_ICON], w->atoms[_NET_WM_ALLOWED_ACTIONS], w->atoms[_NET_WM_ACTION_MOVE], w->atoms[_NET_WM_ACTION_FULLSCREEN], w->atoms[_NET_WM_ACTION_CLOSE], w->atoms[_NET_STARTUP_ID], w->atoms[_NET_WM_PING], w->atoms[_NET_WORKAREA], w->atoms[_NET_DESKTOP_GEOMETRY], w->atoms[_NET_WM_PING], w->atoms[_NET_WM_PID], w->atoms[CM_TRANSLUCENCY], 0, 0 }; num_supported = sizeof(supported)/sizeof(Atom) - 2; /* Check to see if the theme supports help / accept buttons */ if (( theme_frame_supports_button_type(w->mbtheme, FRAME_MAIN, BUTTON_ACTION_ACCEPT) || w->config->use_title == False ) && theme_frame_supports_button_type(w->mbtheme, FRAME_DIALOG, BUTTON_ACTION_ACCEPT)) supported[num_supported++] = w->atoms[_NET_WM_CONTEXT_ACCEPT]; if (( theme_frame_supports_button_type(w->mbtheme, FRAME_MAIN, BUTTON_ACTION_HELP) || w->config->use_title == False ) && theme_frame_supports_button_type(w->mbtheme, FRAME_DIALOG, BUTTON_ACTION_HELP)) supported[num_supported++] = w->atoms[_NET_WM_CONTEXT_HELP]; XChangeProperty(w->dpy, w->root, w->atoms[_NET_SUPPORTED], XA_ATOM, 32, PropModeReplace, (unsigned char *)supported, num_supported); } unsigned char * ewmh_get_utf8_prop(Wm *w, Window win, Atom req_atom) { Atom type; int format, result; unsigned long bytes_after, n_items; unsigned char *str = NULL; misc_trap_xerrors(); result = XGetWindowProperty (w->dpy, win, req_atom, 0, 1024L, False, w->atoms[UTF8_STRING], &type, &format, &n_items, &bytes_after, (unsigned char **)&str); if (misc_untrap_xerrors() || result != Success || str == NULL) { if (str) XFree (str); return NULL; } if (type != w->atoms[UTF8_STRING] || format != 8 || n_items == 0) { XFree (str); return NULL; } if (ewmh_utf8_validate(str, n_items)) { dbg("%s() got %s\n", __func__, str); return str; } fprintf(stderr, "matchbox: UTF8 encoding bad on win %li\n", win); return NULL; /* XXX check this value is correctly Xfree'd */ } int* ewmh_get_icon_geometry (Wm *w, Window win) { Atom type; int format, result; unsigned long bytes_after, n_items; unsigned char *data = NULL; misc_trap_xerrors(); result = XGetWindowProperty (w->dpy, win, w->atoms[_NET_WM_ICON_GEOMETRY], 0, 100000L, False, XA_CARDINAL, &type, &format, &n_items, &bytes_after, (unsigned char **)&data); if (misc_untrap_xerrors() || result != Success || data == NULL) { if (data) XFree (data); return NULL; } return (int *)data; } #ifndef REDUCE_BLOAT int* ewmh_get_icon_prop_data(Wm *w, Window win) { Atom type; int format, result; unsigned long bytes_after, n_items; unsigned char *data = NULL; misc_trap_xerrors(); result = XGetWindowProperty (w->dpy, win, w->atoms[_NET_WM_ICON], 0, 100000L, False, XA_CARDINAL, &type, &format, &n_items, &bytes_after, (unsigned char **)&data); if (misc_untrap_xerrors() || result != Success || data == NULL) { if (data) XFree (data); return NULL; } return (int *)data; } #endif static void set_compliant(Wm *w) /* lets clients know were compliant (ish) */ { unsigned long val[1]; Window win; XSetWindowAttributes attr; char *app_name = "matchbox"; attr.override_redirect = True; win = XCreateWindow(w->dpy, w->root, -200, -200, 5, 5, 0, CopyFromParent, CopyFromParent, CopyFromParent, CWOverrideRedirect, &attr ); val[0] = win; /* Crack Needed to stop gnome session hanging ? */ XChangeProperty(w->dpy, w->root,w->atoms[_WIN_SUPPORTING_WM_CHECK], XA_WINDOW, 32, PropModeReplace, (unsigned char *)val, 1); XChangeProperty(w->dpy, win, w->atoms[_WIN_SUPPORTING_WM_CHECK], XA_WINDOW, 32, PropModeReplace, (unsigned char *)val, 1); /* Correct way of doing it */ XChangeProperty(w->dpy, w->root, w->atoms[_NET_SUPPORTING_WM_CHECK], XA_WINDOW, 32, PropModeReplace, (unsigned char *)val, 1); XChangeProperty(w->dpy, win, w->atoms[_NET_SUPPORTING_WM_CHECK], XA_WINDOW, 32, PropModeReplace, (unsigned char *)val, 1); /* set utf8 name */ XChangeProperty(w->dpy, win, w->atoms[_NET_WM_NAME], w->atoms[UTF8_STRING], 8, PropModeReplace, (unsigned char *)app_name, strlen(app_name)+1); XStoreName(w->dpy, win, app_name); } /* _NET_WM_SYNC_REQUEST This protocol uses the XSync extension the protocol specification and the library documentation<) to let client and window manager synchronize the repaint of the window manager frame and the client window. A client indicates that it is willing to participate in the protocol by listing _NET_WM_SYNC_REQUEST in the WM_PROTOCOLS property of the client window and storing the XID of an XSync counter in the property _NET_WM_SYNC_REQUEST_COUNTER. The initial value of this counter is not defined by this specification. A window manager uses this protocol by preceding a ConfigureNotify event sent to a client by a client message as follows: type = ClientMessage window = the respective client window message_type = WM_PROTOCOLS format = 32 data.l[0] = _NET_WM_SYNC_REQUEST data.l[1] = timestamp data.l[2] = low 32 bits of the update request number data.l[3] = high 32 bits of the update request number other data.l[] elements = 0 After receiving one or more such message/ConfigureNotify pairs, and having handled all repainting associated with the ConfigureNotify events, the client MUST set the _NET_WM_SYNC_REQUEST_COUNTER to the 64 bit number indicated by the data.l[2] and data.l[3] fields of the last client message received. By using either the Alarm or the Await mechanisms of the XSync extension, the window manager can know when the client has finished handling the ConfigureNotify events. The window manager SHOULD not resize the window faster than the client can keep up. The update request number in the client message is determined by the window manager subject to the restriction that it MUST NOT be 0. The number is generally intended to be incremented by one for each message sent. Since the initial value of the XSync counter is not defined by this specification, the window manager MAY set the value of the XSync counter at any time, and MUST do so when it first manages a new window. */ #ifdef USE_XSYNC static void sync_value_increment (XSyncValue *value) { XSyncValue one; int overflow; XSyncIntToValue (&one, 1); XSyncValueAdd (value, *value, one, &overflow); } void ewmh_sync_init(Wm *w) { if (!XSyncQueryExtension (w->dpy, &w->sync_event_base, &w->sync_error_base)) { dbg("%s() XSyncQueryExtension FAILED.\n", __func__); w->have_xsync = False; return; } w->have_xsync = True; } void ewmh_sync_handle_event(Wm *w, XSyncAlarmNotifyEvent *ev) { Client *client = NULL; stack_enumerate(w, client) { if (client->ewmh_sync_alarm == ev->alarm) break; } if (client) /* XXX should check alarm matches */ { dbg("%s() found client %s\n", __func__, client->name); client->move_resize(client); } } Bool ewmh_sync_client_move_resize(Client *client) { Wm *w = client->wm; unsigned long highval, lowval; if (!w->have_xsync) return False; if (!client->has_ewmh_sync) return False; if (client->ewmh_sync_is_waiting) return False; /* XXX WRONG XXX */ ewmh_sync_client_init_counter(client); lowval = XSyncValueLow32 (client->ewmh_sync_value); highval = XSyncValueHigh32 (client->ewmh_sync_value); sync_value_increment (&client->ewmh_sync_value); dbg("%s() delivering _NET_WM_SYNC_REQUEST\n", __func__); client_deliver_message(client, w->atoms[WM_PROTOCOLS], w->atoms[_NET_WM_SYNC_REQUEST], CurrentTime, lowval, highval, 0); client->ewmh_sync_is_waiting = True; return True; } Bool ewmh_sync_client_init_counter(Client *client) { Wm *w = client->wm; XSyncAlarmAttributes values; Atom type; int format, result; long bytes_after, n_items; XID *value; if (!w->have_xsync) return False; if (!client->has_ewmh_sync) return False; result = XGetWindowProperty (w->dpy, client->window, w->atoms[_NET_WM_SYNC_REQUEST_COUNTER], 0, 1024L, False, XA_CARDINAL, &type, &format, &n_items, &bytes_after, (unsigned char **)&value); if (result != Success || value == NULL || format != 32) { dbg("%s() _NET_WM_SYNC_REQUEST_COUNTER failed\n", __func__); if (value) XFree (value); return False; } dbg("%s() creating alarm\n", __func__); client->ewmh_sync_counter = *value; XSyncIntsToValue (&client->ewmh_sync_value, random(), 0); XSyncSetCounter (w->dpy, client->ewmh_sync_counter, client->ewmh_sync_value); sync_value_increment (&client->ewmh_sync_value); values.events = True; values.trigger.counter = client->ewmh_sync_counter; values.trigger.wait_value = client->ewmh_sync_value; values.trigger.value_type = XSyncAbsolute; values.trigger.test_type = XSyncPositiveComparison; XSyncIntToValue (&values.delta, 1); values.events = True; /* Note that by default, the alarm increments the trigger value * when it fires until the condition (counter.value < trigger.value) * is FALSE again. */ client->ewmh_sync_alarm = XSyncCreateAlarm (w->dpy, XSyncCACounter | XSyncCAValue | XSyncCAValueType | XSyncCATestType | XSyncCADelta | XSyncCAEvents, &values); XSync (w->dpy, False); /* XXX untrap error here */ return True; } #endif /* UTF8 - borrowed from glib. XXX fontconfig may actually provide these calls*/ #define UTF8_COMPUTE(Char, Mask, Len) \ if (Char < 128) \ { \ Len = 1; \ Mask = 0x7f; \ } \ else if ((Char & 0xe0) == 0xc0) \ { \ Len = 2; \ Mask = 0x1f; \ } \ else if ((Char & 0xf0) == 0xe0) \ { \ Len = 3; \ Mask = 0x0f; \ } \ else if ((Char & 0xf8) == 0xf0) \ { \ Len = 4; \ Mask = 0x07; \ } \ else if ((Char & 0xfc) == 0xf8) \ { \ Len = 5; \ Mask = 0x03; \ } \ else if ((Char & 0xfe) == 0xfc) \ { \ Len = 6; \ Mask = 0x01; \ } \ else \ Len = -1; #define UTF8_LENGTH(Char) \ ((Char) < 0x80 ? 1 : \ ((Char) < 0x800 ? 2 : \ ((Char) < 0x10000 ? 3 : \ ((Char) < 0x200000 ? 4 : \ ((Char) < 0x4000000 ? 5 : 6))))) #define UTF8_GET(Result, Chars, Count, Mask, Len) \ (Result) = (Chars)[0] & (Mask); \ for ((Count) = 1; (Count) < (Len); ++(Count)) \ { \ if (((Chars)[(Count)] & 0xc0) != 0x80) \ { \ (Result) = -1; \ break; \ } \ (Result) <<= 6; \ (Result) |= ((Chars)[(Count)] & 0x3f); \ } #define UNICODE_VALID(Char) \ ((Char) < 0x110000 && \ ((Char) < 0xD800 || (Char) >= 0xE000) && \ (Char) != 0xFFFE && (Char) != 0xFFFF) int ewmh_utf8_len(unsigned char *str) /* Only parse _validated_ utf8 */ { unsigned char *p = str; int mask, len, result = 0; while (*p != '\0') { UTF8_COMPUTE(*p, mask, len); p += len; result++; } return result; } int ewmh_utf8_get_byte_cnt(unsigned char *str, int num_chars) { unsigned char *p = str; int mask, len, result = 0; while (*p != '\0' && num_chars-- > 0) { UTF8_COMPUTE(*p, mask, len); p += len; result += len; } return result; } Bool ewmh_utf8_validate(unsigned char *str, int max_len) { unsigned char *p; if (str == NULL) return False; p = str; while ((max_len < 0 || (p - str) < max_len) && *p) { int i, mask = 0, len; unsigned int result; unsigned char c = (unsigned char) *p; UTF8_COMPUTE (c, mask, len); if (len == -1) break; /* check that the expected number of bytes exists in str */ if (max_len >= 0 && ((max_len - (p - str)) < len)) break; UTF8_GET (result, p, i, mask, len); if (UTF8_LENGTH (result) != len) /* Check for overlong UTF-8 */ break; if (result == -1) break; if (!UNICODE_VALID (result)) break; p += len; } if (max_len >= 0 && p != (str + max_len)) return False; else if (max_len < 0 && *p != '\0') return False; else return True; } matchbox-window-manager-1.2/matchbox-window-manager/src/mbtheme.c0000664000211500234210000021250711307441355024051 0ustar bifh1bifhs/* * Matchbox Window Manager - A lightweight window manager not for the * desktop. * * Authored By Matthew Allum * * Copyright (c) 2002, 2004 OpenedHand Ltd - http://o-hand.com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #include "mbtheme.h" #ifdef HAVE_XCURSOR #include #endif #define GET_INT_ATTR(n,k,v) \ { if (get_attr((n), (k))) (v) = atoi(get_attr((n), (k))); else (v) = 0; } static struct layer_lookup_t { char* name; int id; } layer_lookup[] = { { "plain", LAYER_PLAIN }, { "gradient-horiz", LAYER_GRADIENT_HORIZ }, { "gradient-vert", LAYER_GRADIENT_VERT }, { "pixmap", LAYER_PIXMAP }, { "pixmap-tiled", LAYER_PIXMAP_TILED }, { "picture", LAYER_PICTURE }, { "picture-tiled", LAYER_PICTURE_TILED }, { "label", LAYER_LABEL }, { "sublabel", LAYER_SUB_LABEL }, { "icon", LAYER_ICON } }; #define layer_lookup_cnt (sizeof(layer_lookup)/sizeof(struct layer_lookup_t)) static struct button_lookup_t { char* name; int id; } button_lookup[] = { { "next", BUTTON_ACTION_NEXT }, { "prev", BUTTON_ACTION_PREV }, { "close", BUTTON_ACTION_CLOSE }, { "minimize", BUTTON_ACTION_MIN }, { "maximize", BUTTON_ACTION_MAX }, { "menu", BUTTON_ACTION_MENU }, { "hide", BUTTON_ACTION_HIDE }, { "accept", BUTTON_ACTION_ACCEPT }, { "help", BUTTON_ACTION_HELP }, { "desktop", BUTTON_ACTION_DESKTOP }, { "custom", BUTTON_ACTION_CUSTOM }, }; #define button_lookup_cnt (sizeof(button_lookup)/sizeof(struct button_lookup_t)) static struct frame_lookup_t { char* name; int id; } frame_lookup[] = { { "main", FRAME_MAIN }, { "main-east", FRAME_MAIN_EAST }, { "main-west", FRAME_MAIN_WEST }, { "main-south", FRAME_MAIN_SOUTH }, { "dialog", FRAME_DIALOG }, { "dialog-north", FRAME_DIALOG_NORTH }, { "dialog-east", FRAME_DIALOG_EAST }, { "dialog-west", FRAME_DIALOG_WEST }, { "dialog-south", FRAME_DIALOG_SOUTH }, { "dialog-nt-north", FRAME_DIALOG_NT_NORTH }, { "dialog-nt-east", FRAME_DIALOG_NT_EAST }, { "dialog-nt-west", FRAME_DIALOG_NT_WEST }, { "dialog-nt-south", FRAME_DIALOG_NT_SOUTH }, { "utility-min", FRAME_UTILITY_MIN }, { "utility-max", FRAME_UTILITY_MAX }, { "menu", FRAME_MENU }, { "message", FRAME_MSG }, { "message-east", FRAME_MSG_EAST }, { "message-west", FRAME_MSG_WEST }, { "message-south", FRAME_MSG_SOUTH }, }; #define frame_lookup_cnt (sizeof(frame_lookup)/sizeof(struct frame_lookup_t)) static int parse_panel_tag (MBTheme *theme, XMLNode *node); static int param_get( MBThemeFrame *frame, MBThemeParam *p, int max ); static void show_parse_error(Wm *w, XMLNode *node, char *theme_file, int err_num); /* ---------------------------------------------------- Painting Code -- */ static int lookup_frame_type(char *name) { int i; for (i=0; i < frame_lookup_cnt; i++) if (!strcmp(name, frame_lookup[i].name)) return frame_lookup[i].id; return -1; } void theme_frame_icon_paint(MBTheme *t, Client *c, MBPixbufImage *img_dest, int x, int y) { MBPixbufImage *img = NULL; int *data = NULL; if (c->icon_rgba_data != NULL) { data = c->icon_rgba_data; img = mb_pixbuf_img_new_from_int_data(t->wm->pb, (data+2), data[0], data[1]); } else { if (c->icon) { Window win_foo; int foo; unsigned int icon_w, icon_h, ufoo; XGetGeometry(t->wm->dpy, c->icon, &win_foo, &foo, &foo, &icon_w, &icon_h, &ufoo, &ufoo); img = mb_pixbuf_img_new_from_drawable(t->wm->pb, c->icon, c->icon_mask, 0, 0, (int)icon_w, (int)icon_h); } } if( img == NULL) img = mb_pixbuf_img_clone(t->wm->pb, c->wm->img_generic_icon); if (img->width != 16 || img->height != 16) { MBPixbufImage *tmp_img; tmp_img = mb_pixbuf_img_scale(t->wm->pb, img, 16, 16); mb_pixbuf_img_free(t->wm->pb, img); img = tmp_img; } mb_pixbuf_img_composite(t->wm->pb, img_dest, img, x, y); if (img != NULL) mb_pixbuf_img_free(t->wm->pb, img); } void theme_frame_button_paint(MBTheme *theme, Client *c, int action, int state, int frame_type, int dest_w, int dest_h ) { Wm *w = c->wm; MBThemeFrame *frame = NULL; MBList *client_button_obj = c->buttons; /* Client 'WM' buttons */ MBList *theme_button_list = NULL; /* Theme button defs */ int button_x, button_y, button_w, button_h; frame = (MBThemeFrame *)list_find_by_id(theme->frames, frame_type); dbg("%s called\n", __func__); if (frame == NULL) { dbg("%s failed to find frame\n", __func__); return; } theme_button_list = frame->buttons; while (theme_button_list != NULL) { /* Go through defined theme frames button list, find matching action */ if (theme_button_list->id == action) { MBThemeButton *button = (MBThemeButton *)theme_button_list->data; Window button_xid = None; Bool found = False; /* Figure out actual wm button geometry from the defined theme * button. */ /* HACK. param_get() has no client* ref so need to * do stuff here to get position relevant to * label end point :(. */ if (button->x->unit == MBParamLabelEnd) { button_x = c->name_rendered_end_pos + button->x->offset; } else button_x = param_get(frame, button->x, dest_w); button_y = param_get(frame, button->y, dest_h); if (button->w->unit == MBParamTotalLabelWidth) { button_w = c->name_total_width + button->w->offset; } else button_w = param_get(frame, button->w, dest_w); button_h = param_get(frame, button->h, dest_h); dbg("%s() button x is %i, destw %i\n", __func__, button_x, dest_w); /* See if the clien already has a wm button object created */ while (client_button_obj != NULL) { if (client_button_obj->id == action) { found = True; button_xid = ((MBClientButton*)client_button_obj->data)->win; dbg("%s found button action %i, win id is %li\n", __func__, action, button_xid); break; } client_button_obj = client_button_obj->next; } /* Did we find a valid window ID for the button */ if (button_xid == None) { MBClientButton *b = NULL; if (!found) { /* We didn't so create a new client button 'on demand'. */ b = client_button_new(c, client_title_frame(c), button_x, button_y, button_w, button_h, button->inputonly, NULL); if (button->press_activates) b->press_activates = True; list_add(&c->buttons, NULL, action, (void *)b); } else { /* We found a button with no win ID ( win probably removed * so it can be updated ). So we simply re-init it. */ b = (MBClientButton *)client_button_obj->data; client_button_init(c, client_title_frame(c), b, button_x, button_y, button_w, button_h, button->inputonly, b->data); } button_xid = b->win; } if (!button->inputonly) { /* Now paint the actual button if required */ int copy_w, copy_h; MBPixbufImage *img_backing = NULL; Pixmap pxm_button; MBPixbuf *pb = w->pb; #ifdef USE_COMPOSITE /* 32 ARGB wins require 'special' pixbuf ref */ if (c->is_argb32) pb = w->argb_pb; #endif pxm_button = XCreatePixmap(w->dpy, w->root, button_w, button_h, pb->depth); /* Grab any background from caches so can composite to it */ if (c->type == MBCLIENT_TYPE_APP || c->type == MBCLIENT_TYPE_TOOLBAR || c->type == MBCLIENT_TYPE_DIALOG) { img_backing = mb_pixbuf_img_rgb_new(pb, button_w, button_h); if (!theme->disable_pixbuf_cache) mb_pixbuf_img_copy(pb, img_backing, theme->img_caches[frame_type], button_x, button_y, button_w, button_h, 0, 0 ); } /* Now actually paint depending on button state */ if (state == ACTIVE) { if (button->img_active->width > button_w) copy_w = button_w; else copy_w = button->img_active->width; if (button->img_active->height > button_h) copy_h = button_h; else copy_h = button->img_active->height; mb_pixbuf_img_copy_composite_with_alpha(pb, img_backing, button->img_active, 0, 0, copy_w, copy_h, 0, 0, button->img_active_blend); } else { if (button->img_inactive->width > button_w) copy_w = button_w; else copy_w = button->img_inactive->width; if (button->img_inactive->height > button_h) copy_h = button_h; else copy_h = button->img_inactive->height; mb_pixbuf_img_copy_composite_with_alpha(pb, img_backing, button->img_inactive, 0, 0, copy_w, copy_h, 0, 0, button->img_inactive_blend); } mb_pixbuf_img_render_to_drawable(pb, img_backing, pxm_button, 0, 0); XSetWindowBackgroundPixmap(w->dpy, button_xid, pxm_button); XClearWindow(w->dpy, button_xid); XFreePixmap(w->dpy, pxm_button); mb_pixbuf_img_free(pb, img_backing); } XMapWindow(w->dpy, button_xid); } theme_button_list = theme_button_list->next; } } Bool theme_frame_wants_shaped_window( MBTheme *theme, int frame_type) { MBThemeFrame *frame = NULL; if ((frame = (MBThemeFrame *)list_find_by_id(theme->frames, frame_type)) == NULL) return False; return frame->wants_shape; } Bool theme_has_message_decor( MBTheme *theme ) { MBThemeFrame *frame = (MBThemeFrame *)list_find_by_id(theme->frames, FRAME_MSG); if (frame == NULL) return False; else return True; } Bool theme_has_borders_only_decor( MBTheme *theme ) { MBThemeFrame *frame = (MBThemeFrame *)list_find_by_id(theme->frames, FRAME_DIALOG_NT_NORTH); if (frame == NULL) return False; else return True; } static void _theme_paint_gradient(MBTheme* theme, MBThemeLayer* layer_cur, MBPixbufImage* img_dest, int w, int h, int direction) { int tx, ty, r, rs, re, b, bs, be, g, gs, ge, a, as, ae; rs = mb_col_red(layer_cur->color); re = mb_col_red(layer_cur->color_end); gs = mb_col_green(layer_cur->color); ge = mb_col_green(layer_cur->color_end); bs = mb_col_blue(layer_cur->color); be = mb_col_blue(layer_cur->color_end); as = mb_col_alpha(layer_cur->color); ae = mb_col_alpha(layer_cur->color_end); if (rs == re && gs == ge && bs == be && as == ae) { /* If start and end points are the same, fastpath it */ mb_pixbuf_img_fill(theme->wm->pb, img_dest, rs, gs, bs, as); return; } if (direction == VERTICAL) { for(ty=0; tywm->pb, img_dest, tx, ty, r, g, b); mb_pixbuf_img_set_pixel_alpha(img_dest, tx, ty, a); } } } else { for(tx=0; txwm->pb, img_dest, tx, ty, r, g, b); mb_pixbuf_img_set_pixel_alpha(img_dest, tx, ty, a); } } } } static void _theme_paint_core( MBTheme *theme, Client *c, MBThemeFrame *frame, MBPixbufImage *img, int dx, int dy, int dw, int dh ) { /* Basically render a frame layers to 'img' */ MBThemeLayer *layer_cur = NULL; MBList *layer_list_item = frame->layers; while (layer_list_item != NULL) { MBPixbufImage *img_tmp = NULL; int tx, ty, tw, th, x, y, w, h; layer_cur = (MBThemeLayer *)layer_list_item->data; /* Get Layer Rect */ x = param_get(frame, layer_cur->x, dw); y = param_get(frame, layer_cur->y, dh); w = param_get(frame, layer_cur->w, dw); h = param_get(frame, layer_cur->h, dh); /* Minor hack to handle 'object' size attribute */ if ( layer_list_item->id == LAYER_PIXMAP || layer_list_item->id == LAYER_PIXMAP_TILED) { if ( layer_cur->w->unit == object) w = layer_cur->img->width; if ( layer_cur->h->unit == object) h = layer_cur->img->height; } /* Clip if calculated sizes are bigger than dest */ if (w > dw) w = dw; if (h > dh) h = dh; /* ..And more safety */ if (w <= 0) w = 1; if (h <= 0) h = 1; if (x < 0) x = 0; if (y < 0) y = 0; switch (layer_list_item->id) { case LAYER_PLAIN: img_tmp = mb_pixbuf_img_new(theme->wm->pb, w, h); mb_pixbuf_img_fill(theme->wm->pb, img_tmp, mb_col_red(layer_cur->color), mb_col_green(layer_cur->color), mb_col_blue(layer_cur->color), mb_col_alpha(layer_cur->color) ); break; case LAYER_GRADIENT_HORIZ: img_tmp = mb_pixbuf_img_new(theme->wm->pb, w, h); _theme_paint_gradient(theme, layer_cur, img_tmp, w, h, HORIZONTAL); break; case LAYER_GRADIENT_VERT: img_tmp = mb_pixbuf_img_new(theme->wm->pb, w, h); _theme_paint_gradient(theme, layer_cur, img_tmp, w, h, VERTICAL); break; case LAYER_PIXMAP: /* Same as LAYER_PIXMAP_TILED: NB#119151 */ case LAYER_PIXMAP_TILED: dbg("%s() Layer is pixmap tiled %i x %i\n", __func__, w, h); img_tmp = mb_pixbuf_img_new(theme->wm->pb, w, h); for (ty=0; ty < h; ty += layer_cur->img->height) for (tx=0; tx < w; tx += layer_cur->img->width) { if ( (tx + layer_cur->img->width) > w ) tw = layer_cur->img->width - ((tx+layer_cur->img->width)-w); else tw = layer_cur->img->width; if ( (ty + layer_cur->img->height) > h ) th = layer_cur->img->height-((ty+layer_cur->img->height)-h); else th = layer_cur->img->height; dbg("%s() Tiling %i x %i, +%i+%i\n", __func__, tw, th, tx, ty); mb_pixbuf_img_copy_composite(theme->wm->pb, img, layer_cur->img, 0, 0, tw, th, tx + x, ty + y); } break; case LAYER_ICON: /* We cant cache the icon, so we dont paint it here */ break; } if (img_tmp) { /* Clip image if needed ( more safety ) -*/ if (w > img->width) w = img->width; if (h > img->height) h = img->height; mb_pixbuf_img_copy_composite(theme->wm->pb, img, img_tmp, 0, 0, w, h, x, y); mb_pixbuf_img_free(theme->wm->pb, img_tmp); } layer_list_item = layer_list_item->next; } } Bool theme_frame_paint( MBTheme *theme, Client *c, int frame_type, int dw, int dh ) { Wm *w = c->wm; MBFontRenderOpts text_render_opts = MB_FONT_RENDER_OPTS_CLIP_TRAIL; Bool have_img_cached = False, free_img = False; MBThemeFrame *frame; MBPixbufImage *img; MBThemeLayer *layer_label = NULL, *layer_icon = NULL; struct list_item *layer_list_item; int label_rendered_width; int decor_idx = 0; MBDrawable *drawable = NULL; MBPixbuf *pixbuf = w->pb; if (dw == 0 || dh == 0) return False; frame = (MBThemeFrame *)list_find_by_id(theme->frames, frame_type); if (frame == NULL) return False; #ifdef USE_COMPOSITE if (c->is_argb32) pixbuf = w->argb_pb; #endif /* Figure out what frame we are painting to */ switch(frame_type) { case FRAME_MAIN_SOUTH: case FRAME_DIALOG_SOUTH: case FRAME_DIALOG_NT_SOUTH: case FRAME_MSG_SOUTH: decor_idx = SOUTH; break; case FRAME_MAIN_EAST: case FRAME_DIALOG_EAST: case FRAME_DIALOG_NT_EAST: case FRAME_MSG_EAST: decor_idx = EAST; break; case FRAME_MAIN_WEST: case FRAME_DIALOG_WEST: case FRAME_DIALOG_NT_WEST: case FRAME_MSG_WEST: decor_idx = WEST; break; /* FRAME_MAIN, FRAME_DIALOG, FRAME_MSG, FRAME_DIALOG_NORTH: */ default: decor_idx = NORTH; break; } /* * The pixmaps for side decorations ( east, west, south ) rarely * change for app wins and dont have text. We can therefore cache * the generated pixmaps to save both mem and cpu */ if (frame_type == FRAME_MAIN_SOUTH || frame_type == FRAME_MAIN_EAST || frame_type == FRAME_MAIN_WEST) { if (theme->app_win_pxm_cache[decor_idx] != None) { dbg("%s() getting pixmap frame from cache\n", __func__); XSetWindowBackgroundPixmap(w->dpy, c->frames_decor[decor_idx], theme->app_win_pxm_cache[decor_idx]); XClearWindow(w->dpy, c->frames_decor[decor_idx]); XSync(w->dpy, False); return True; } } drawable = mb_drawable_new(pixbuf, dw, dh); /* Cacheing */ if (frame_type == FRAME_MAIN && theme->img_caches[frame_type] != NULL) { /* We only reuse app titlebar images. */ img = theme->img_caches[frame_type]; have_img_cached = True; } else { /* Other window decors are just kept around whilst the client exists * so things like buttons can composite onto them. */ theme_img_cache_clear (theme, frame_type); if (c->backing_masks[MSK_NORTH] != None /* Need alpha chan for shape */ || c->backing_masks[MSK_SOUTH]!= None || c->backing_masks[MSK_EAST] != None || c->backing_masks[MSK_WEST] != None ) theme->img_caches[frame_type] = mb_pixbuf_img_rgba_new(theme->wm->pb, dw,dh); else theme->img_caches[frame_type] = mb_pixbuf_img_rgb_new(theme->wm->pb, dw,dh); img = theme->img_caches[frame_type]; } layer_list_item = frame->layers; layer_label = (MBThemeLayer*)list_find_by_id(frame->layers, LAYER_LABEL); /* Figure out text alignment + positioning */ if (layer_label && c->name) { if (layer_label->label->justify == ALIGN_CENTER) text_render_opts |= MB_FONT_RENDER_ALIGN_CENTER; else if (layer_label->label->justify == ALIGN_RIGHT) text_render_opts |= MB_FONT_RENDER_ALIGN_RIGHT; frame->label_x = param_get(frame, layer_label->x, dw); frame->label_w = param_get(frame, layer_label->w, dw); label_rendered_width = mb_font_render_simple_get_width (layer_label->label->font, frame->label_w, (unsigned char*) c->name, (c->name_is_utf8) ? MB_ENCODING_UTF8 : MB_ENCODING_LATIN, text_render_opts ); dbg("%s() label_rendered_width = %i, frame clip width = %i\n", __func__, label_rendered_width, frame->label_w); /* Has text changed or first render */ if (c->name_rendered_end_pos != (frame->label_x + label_rendered_width)) { c->name_rendered_end_pos = (frame->label_x + label_rendered_width); } c->name_total_width = label_rendered_width; } /* Paint the acout pixbuf image, if not cached */ if (!have_img_cached) _theme_paint_core( theme, c, frame, img, 0, 0, dw, dh ); /* Icons - are a pain as we cant cache them */ if ((layer_icon = (MBThemeLayer*)list_find_by_id(frame->layers, LAYER_ICON)) != NULL) { MBPixbufImage *img_tmp = NULL; dbg("%s() painting icon\n", __func__); if (have_img_cached) { img_tmp = mb_pixbuf_img_clone(theme->wm->pb, theme->img_caches[frame_type]); theme_frame_icon_paint(theme, c, img_tmp, param_get(frame, layer_icon->x, dw), param_get(frame, layer_icon->y, dh)); img = img_tmp; } else { img = mb_pixbuf_img_clone(theme->wm->pb, img); } free_img = True; theme_frame_icon_paint(theme, c, img, param_get(frame, layer_icon->x, dw), param_get(frame, layer_icon->y, dh)); } /* Finally paint to the pixmap. */ mb_pixbuf_img_render_to_drawable(pixbuf, img, mb_drawable_pixmap(drawable), 0, 0); /* and masks for shaping */ if (c->backing_masks[MSK_NORTH] != None && ( frame_type == FRAME_MAIN || frame_type == FRAME_DIALOG || frame_type == FRAME_MSG || frame_type == FRAME_DIALOG_NORTH || frame_type == FRAME_DIALOG_NT_NORTH) ) mb_pixbuf_img_render_to_mask(theme->wm->pb, img, c->backing_masks[MSK_NORTH], 0, 0); if (c->backing_masks[MSK_SOUTH] != None && ( frame_type == FRAME_MAIN_SOUTH || frame_type == FRAME_DIALOG_SOUTH || frame_type == FRAME_MSG_SOUTH || frame_type == FRAME_DIALOG_NT_SOUTH) ) mb_pixbuf_img_render_to_mask(theme->wm->pb, img, c->backing_masks[MSK_SOUTH], 0, 0); if (c->backing_masks[MSK_EAST] != None && ( frame_type == FRAME_MAIN_EAST || frame_type == FRAME_DIALOG_EAST || frame_type == FRAME_MSG_EAST || frame_type == FRAME_DIALOG_NT_EAST) ) mb_pixbuf_img_render_to_mask(theme->wm->pb, img, c->backing_masks[MSK_EAST], 0, 0); if (c->backing_masks[MSK_WEST] != None && ( frame_type == FRAME_MAIN_WEST || frame_type == FRAME_DIALOG_WEST || frame_type == FRAME_MSG_WEST || frame_type == FRAME_DIALOG_NT_WEST ) ) mb_pixbuf_img_render_to_mask(theme->wm->pb, img, c->backing_masks[MSK_WEST], 0, 0); /* If we've painted an icon we need to free up our temporary image */ if (free_img) mb_pixbuf_img_free(theme->wm->pb, img); /* No point caching frame images which dont have buttons */ if (decor_idx != NORTH || theme->disable_pixbuf_cache == True) theme_img_cache_clear (theme, frame_type); /* Now paint text onto pixmap */ if (layer_label && c->name && !(c->flags & CLIENT_BORDERS_ONLY_FLAG)) { int fy = param_get(frame, layer_label->y, dh); dbg("%s() rendering '%s' text\n", __func__, c->name); mb_font_set_color (layer_label->label->font, layer_label->label->col); dbg("%s() painting text '%s' with r: %i, g: %i, b: %i, a: %i\n", __func__, (unsigned char*) c->name, mb_col_red(layer_label->label->col), mb_col_green(layer_label->label->col), mb_col_blue(layer_label->label->col), mb_col_alpha(layer_label->label->col)); mb_font_render_simple (layer_label->label->font, drawable, frame->label_x, fy, frame->label_w, (unsigned char*) c->name, (c->name_is_utf8) ? MB_ENCODING_UTF8 : MB_ENCODING_LATIN, text_render_opts); dbg("%s() rendered text\n", __func__); /* FIXME: we really need an mb_font_unset_color() here..? */ mb_col_unref(layer_label->label->col); layer_label->label->font->col = NULL; } /* Finally put the drawable on the decoration frame background */ XSetWindowBackgroundPixmap(w->dpy, c->frames_decor[decor_idx], mb_drawable_pixmap(drawable)); XClearWindow(w->dpy, c->frames_decor[decor_idx]); XSync(c->wm->dpy, False); /* Cache the pixmaps of these frame types. * ( note we copy so xft part of drawable gets freed ok ). */ if (frame_type == FRAME_MAIN_SOUTH || frame_type == FRAME_MAIN_EAST || frame_type == FRAME_MAIN_WEST) { dbg("%s() cacheing pixmap frame\n", __func__); theme->app_win_pxm_cache[decor_idx] = XCreatePixmap(w->dpy, mb_drawable_pixmap(drawable), dw, dh, DefaultDepth(w->dpy, w->screen)); XCopyArea(w->dpy, mb_drawable_pixmap(drawable), theme->app_win_pxm_cache[decor_idx], theme->gc, 0, 0, dw, dh, 0, 0); } mb_drawable_unref(drawable); return True; } /**** Task list painting *******/ Bool theme_frame_menu_get_dimentions(MBTheme* theme, int *w, int *h) { Client *p = NULL; MBThemeFrame *frame = NULL; int width = 0, height = 0, space_avail = 0; space_avail = theme->wm->dpy_width - theme->wm->config->use_icons - 16; frame = (MBThemeFrame*)list_find_by_id(theme->frames, FRAME_MENU ); if (frame == NULL) return False; if (frame->font == NULL) return False; stack_enumerate(theme->wm, p) { if ((p->type == MBCLIENT_TYPE_APP || p->type == MBCLIENT_TYPE_DESKTOP) && p->name /* && p->mapped */ /* Include iconsized clients in sizing */ && p != wm_get_visible_main_client(theme->wm)) { int this_width = mb_font_get_txt_width (frame->font, (unsigned char *)p->name, strlen(p->name), (p->name_is_utf8) ? MB_ENCODING_UTF8 : MB_ENCODING_LATIN); this_width += ( MENU_ENTRY_PADDING + theme->wm->config->use_icons ); height += MBMAX(theme->wm->config->use_icons, mb_font_get_height(frame->font) + MENU_ENTRY_PADDING ); if (this_width > width) width = this_width; } } if (!height) return False; /* No clients */ width += MENU_ENTRY_PADDING; width += frame->border_e + frame->border_w; height += frame->border_s + frame->border_n; if (width > space_avail) width = space_avail; if (frame->fixed_width) *w = frame->fixed_width; else *w = width; *h = height; return True; } static void _theme_frame_menu_paint_text_entry(MBTheme *theme, MBFont *font, MBColor *color, Client *c, Client *entry, MBDrawable *dest, int x, int y) { int text_height, text_width, y_offset; text_height = MBMAX( c->wm->config->use_icons + MENU_ICON_PADDING, mb_font_get_height(font) + MENU_ENTRY_PADDING ); text_width = c->width - c->wm->config->use_icons - MENU_ENTRY_PADDING; y_offset = y + (text_height - (mb_font_get_height(font)))/2; mb_font_set_color (font, color); mb_font_render_simple (font, dest, x, y_offset, text_width, (unsigned char*)entry->name, (entry->name_is_utf8) ? MB_ENCODING_UTF8 : MB_ENCODING_LATIN, MB_FONT_RENDER_OPTS_CLIP_TRAIL); mb_col_unref(color); /* set_color refs */ } void theme_frame_menu_highlight_entry(Client *c, MBClientButton *button, int mode) { Wm *w = c->wm; MBTheme *theme = w->mbtheme; MBPixbufImage *img = NULL; int xx, yy; unsigned char r=0x99, g = 0x99, b = 0x99; MBDrawable *drw; MBThemeFrame *frame; MBFont *font; MBColor *color; Client *entry = (Client *)button->data; int offset, item_h; frame = (MBThemeFrame *)list_find_by_id(theme->frames, FRAME_MENU); if (frame == NULL) return; font = frame->font; color = frame->color; if (frame->hl_color) { r = mb_col_red(frame->hl_color); g = mb_col_green(frame->hl_color); b = mb_col_blue(frame->hl_color); } dbg("%s() painting +%i+%i %ix%i\n", __func__, button->x, button->y, button->w, button->h); if (mode == INACTIVE) { XClearWindow(w->dpy, c->frame); } else { img = mb_pixbuf_img_rgba_new(c->wm->pb, button->w, button->h); mb_pixbuf_img_copy (w->pb, img, w->mbtheme->img_caches[FRAME_MENU], button->x, button->y, button->w, button->h, 0, 0); for ( xx=4; xx < (button->w - 4); xx++) { mb_pixbuf_img_plot_pixel(w->pb, img, xx, 0, r, g, b); mb_pixbuf_img_plot_pixel(w->pb, img, xx, button->h-2, r, g, b); } for ( xx=3; xx < (button->w - 3); xx++) { mb_pixbuf_img_plot_pixel(w->pb, img, xx, 1, r, g, b); mb_pixbuf_img_plot_pixel(w->pb, img, xx, button->h-3, r, g, b); } for ( xx=2; xx < button->w-2; xx++) for ( yy=2; yy < button->h-3; yy++) mb_pixbuf_img_plot_pixel(w->pb, img, xx, yy,r, g, b); drw = mb_drawable_new(w->pb, button->w, button->h); theme_frame_icon_paint(w->mbtheme, (Client *)button->data, img, MENU_ENTRY_PADDING/2, (button->h - w->config->use_icons)/2); mb_pixbuf_img_render_to_drawable(w->pb, img, mb_drawable_pixmap(drw), 0, 0); /* Now repaint font */ item_h = MBMAX( c->wm->config->use_icons + MENU_ICON_PADDING, mb_font_get_height(font) + MENU_ENTRY_PADDING ); offset = (item_h - (mb_font_get_height(font))) / 2; mb_font_render_simple (font, drw, c->wm->config->use_icons + MENU_ENTRY_PADDING, offset, c->width - c->wm->config->use_icons - MENU_ENTRY_PADDING, (unsigned char*)entry->name, (entry->name_is_utf8) ? MB_ENCODING_UTF8 : MB_ENCODING_LATIN, MB_FONT_RENDER_OPTS_CLIP_TRAIL); XCopyArea(w->dpy, mb_drawable_pixmap(drw), c->frame, w->mbtheme->gc, 0, 0, button->w, button->h, button->x, button->y); mb_pixbuf_img_free(w->pb, img); mb_drawable_unref(drw); } XSync(w->dpy, False); /* XXX * This really shouldn't need to go below. */ #ifdef USE_COMPOSITE comp_engine_client_show(c->wm, c); if (w->all_damage) { comp_engine_render(w, w->all_damage); XFixesDestroyRegion (w->dpy, w->all_damage); w->all_damage = None; } #endif } void theme_frame_menu_paint(MBTheme* theme, Client *c) { Wm *w = c->wm; Client *p; MBThemeFrame *frame; MBPixbufImage *img; MBFont *font ; MBColor *color; MBClientButton *button = NULL; MBList *item; MBDrawable *drawable; int item_h, item_x, item_current_y, item_text_w, icon_offset = 0; frame = (MBThemeFrame *)list_find_by_id(theme->frames, FRAME_MENU); if (frame == NULL) return; font = frame->font; color = frame->color; item_h = MBMAX( c->wm->config->use_icons + MENU_ICON_PADDING, mb_font_get_height(font) + MENU_ENTRY_PADDING ); icon_offset = (item_h - c->wm->config->use_icons) / 2; if (icon_offset < 0) icon_offset = 0; drawable = mb_drawable_new(w->pb, c->width, c->height); img = mb_pixbuf_img_new(theme->wm->pb, c->width, c->height); /* render background */ _theme_paint_core( theme, c, frame, img, 0, 0, c->width, c->height ); /* render icons */ item_current_y = frame->border_n; list_enumerate(w->client_age_list, item) { p = (Client*)item->data; if (p->type == MBCLIENT_TYPE_APP && p->name && !(p->flags & CLIENT_IS_DESKTOP_FLAG) && p->mapped && p != wm_get_visible_main_client(w)) { theme_frame_icon_paint(theme, p, img, frame->border_w + MENU_ENTRY_PADDING/2, item_current_y + icon_offset); item_current_y += item_h; } } list_enumerate(w->client_age_list, item) { p = (Client*)item->data; if (p->type == MBCLIENT_TYPE_APP && p->name && !(p->flags & CLIENT_IS_DESKTOP_FLAG) && !p->mapped /* client_get_state(p) == IconicState */ && p != wm_get_visible_main_client(w)) { theme_frame_icon_paint(theme, p, img, frame->border_w + MENU_ENTRY_PADDING/2, item_current_y + icon_offset); item_current_y += item_h; } } if ((p = wm_get_desktop(c->wm)) != NULL) { dbg("%s() got desktop menu entry\n", __func__); theme_frame_icon_paint(theme, p, img, frame->border_w + MENU_ENTRY_PADDING/2, item_current_y + icon_offset); } /* render the pixbuf */ mb_pixbuf_img_render_to_drawable(theme->wm->pb, img, mb_drawable_pixmap(drawable), 0, 0); if (c->backing_masks[MSK_NORTH] != None) mb_pixbuf_img_render_to_mask(theme->wm->pb, img, c->backing_masks[MSK_NORTH], 0, 0); if (theme->img_caches[FRAME_MENU] != NULL) mb_pixbuf_img_free(theme->wm->pb, theme->img_caches[FRAME_MENU]); theme->img_caches[FRAME_MENU] = img; /* Now render fonts */ item_current_y = frame->border_n; item_x = MENU_ENTRY_PADDING + c->wm->config->use_icons + frame->border_w; item_text_w = c->width - (frame->border_e + frame->border_w); /* Visible apps */ list_enumerate(w->client_age_list, item) { p = (Client*)item->data; if (p->type == MBCLIENT_TYPE_APP && p->name && !(p->flags & CLIENT_IS_DESKTOP_FLAG) && p->mapped && p != wm_get_visible_main_client(w)) { _theme_frame_menu_paint_text_entry(theme, font, color, c, p, drawable, item_x, item_current_y); button = client_button_new(c, c->frame, frame->border_w, item_current_y, item_text_w, item_h, True, (void* )p ); list_add(&c->buttons, NULL, 0, (void *)button); item_current_y += item_h; } } /* Iconized / hidden apps */ list_enumerate(w->client_age_list, item) { p = (Client*)item->data; if (p->type == MBCLIENT_TYPE_APP && p->name && !(p->flags & CLIENT_IS_DESKTOP_FLAG) && !p->mapped && p != wm_get_visible_main_client(w)) { _theme_frame_menu_paint_text_entry(theme, font, color, c, p, drawable, item_x, item_current_y); button = client_button_new(c, c->frame, frame->border_w, item_current_y, item_text_w, item_h, True, (void* )p ); list_add(&c->buttons, NULL, 0, (void *)button); item_current_y += item_h; } } /* The desktop at the bottom, if there is one. */ if ((p = wm_get_desktop(c->wm)) != NULL) { _theme_frame_menu_paint_text_entry(theme, font, color, c, p, drawable, item_x, item_current_y); button = client_button_new(c, c->frame, frame->border_w, item_current_y, item_text_w, item_h, True, (void* )p ); list_add(&c->buttons, NULL, 0, (void *)button); } XSetWindowBackgroundPixmap(w->dpy, c->frame, mb_drawable_pixmap(drawable)); XClearWindow(w->dpy, c->frame); XSync(c->wm->dpy, False); mb_drawable_unref(drawable); return; } /* ------- General Utils ------------------------------------------ */ Bool theme_frame_supports_button_type(MBTheme *theme, int frame_type, int button_type) { MBThemeFrame* frame = (MBThemeFrame*)list_find_by_id(theme->frames, frame_type ); if (frame == NULL) return False; if (list_find_by_id(frame->buttons, button_type)) return True; else return False; } Bool theme_has_frame_type_defined(MBTheme *theme, int frame_type) { if (list_find_by_id (theme->frames, frame_type)) return True; else return False; } int theme_frame_button_get_x_pos(MBTheme *theme, int frame_type, int button_type, int width) { MBThemeFrame *frame; MBThemeButton *button; frame = (MBThemeFrame*)list_find_by_id(theme->frames, frame_type ); if (frame) { button = (MBThemeButton *)list_find_by_id(frame->buttons, button_type ); return param_get( frame, button->x, width); } return 0; } int theme_frame_defined_width_get( MBTheme *theme, int frame_type ) { MBThemeFrame *frame = NULL; if (theme->wm->config->use_title == False && ( frame_type == FRAME_MAIN_EAST || frame_type == FRAME_MAIN_WEST)) return 0; frame = (MBThemeFrame *)list_find_by_id(theme->frames, frame_type); if (frame) { return frame->set_width; } return 0; } int theme_frame_defined_height_get( MBTheme *theme, int frame_type ) { MBThemeFrame *frame = NULL; if (theme->wm->config->use_title == False && frame_type == FRAME_MAIN_SOUTH ) return 0; frame = (MBThemeFrame *)list_find_by_id(theme->frames, frame_type); if (frame) { return frame->set_height; } return 0; } void theme_img_cache_clear( MBTheme *theme, int frame_ref ) { if (theme->img_caches[frame_ref] != NULL) mb_pixbuf_img_free(theme->wm->pb, theme->img_caches[frame_ref]); theme->img_caches[frame_ref] = NULL; } void theme_pixmap_cache_clear_all( MBTheme *theme ) { int i; for (i=0; i < 3; i++) if (theme->app_win_pxm_cache[i] != None) { dbg("%s() clearing pixmap cache\n", __func__); XFreePixmap(theme->wm->dpy, theme->app_win_pxm_cache[i]); theme->app_win_pxm_cache[i] = None; } } void theme_img_cache_clear_all( MBTheme *theme ) { int i; for (i=0; i < N_FRAME_TYPES; i++) theme_img_cache_clear( theme, i ); } /* ------------------------------------------ Creation / Parsing Code -- */ static char * get_attr(XMLNode *node, char *key) { Params *p; for(p = node->attr; p != NULL; p = p->next) { if (!(strcmp(p->key, key))) return p->value; } return NULL; } /* Parsing calls */ static MBThemeParam * param_parse(char *def_str) { MBThemeParam *g; char *p = def_str; if (def_str == NULL) return NULL; g = (MBThemeParam *)malloc(sizeof(MBThemeParam)); g->offset = 0; if (!strncmp(def_str,"object",5)) { g->unit = object; g->value = 1; /* TODO pass offset */ return g; } if (!strncmp(def_str,"labelx",6)) { g->unit = textx; g->value = 1; if (def_str[6] != '\0') g->offset = strtol(&def_str[6], (char **)NULL, 10); return g; } if (!strncmp(def_str,"labelw",6)) { g->unit = textw; g->value = 1; if (def_str[6] != '\0') g->offset = strtol(&def_str[6], (char **)NULL, 10); return g; } if (!strncmp(def_str,"labelend",8)) { g->unit = MBParamLabelEnd; g->value = 1; if (def_str[8] != '\0') g->offset = strtol(&def_str[8], (char **)NULL, 10); return g; } if (!strncmp(def_str,"totallabelw",11)) { g->unit = MBParamTotalLabelWidth; g->value = 1; if (def_str[11] != '\0') g->offset = strtol(&def_str[11], (char **)NULL, 10); return g; } while(*p != '%' && *p != '\0') { p++; } if (*p == '%') { *p = '\0'; g->unit = percentage; g->value = strtol(def_str, (char **)NULL, 10); if (*(p+1) != '\0') { g->offset = strtol(p+1, (char **)NULL, 10); } } else { g->unit = pixel; g->value = strtol(def_str, (char **)NULL, 10); } return g; } static int param_get( MBThemeFrame *frame, MBThemeParam *p, int max ) { if (p->unit == pixel && p->value >= 0) return p->value; if (p->unit == textx) return frame->label_x + p->offset; if (p->unit == textw) return frame->label_w + p->offset; if (p->unit == pixel) return max + p->value; /* Note value is negaive */ if (p->unit == percentage) { int tmp = ( p->value / 100.00 ) * max ; /* XXX REMOVE FP */ return ( p->value > 0 ? tmp : max + tmp ) + p->offset; } return 0; } static int lookup_button_action(char *name) { int i; for (i=0; i < button_lookup_cnt; i++) if (!strcmp(name, button_lookup[i].name)) return button_lookup[i].id; return -1; } Bool mbtheme_button_press_activates(MBThemeButton* button) { return button->press_activates; } MBThemeButton* mbtheme_button_new (MBTheme *theme, char *x, char *y, char *w, char *h, char *img_active_id, char *img_inactive_id, int active_blend, int inactive_blend, char *options) { MBThemeButton *button = malloc(sizeof(MBThemeButton)); memset(button, 0, sizeof(MBThemeButton)); if ( (button->x = param_parse(x)) == NULL) return NULL; if ( (button->y = param_parse(y)) == NULL) return NULL; if ( (button->w = param_parse(w)) == NULL) return NULL; if ( (button->h = param_parse(h)) == NULL) return NULL; dbg("%s() params parsed ok\n", __func__); button->inputonly = False; button->wants_dbl_click = False; button->img_active_blend = active_blend; button->img_inactive_blend = inactive_blend; button->press_activates = False; if (options != NULL) { if (strstr(options, "inputonly")) { button->inputonly = True; if (strstr(options, "doubleclick")) button->wants_dbl_click = True; } if (strstr(options, "pressonly")) { dbg("%s(), pressonly : %s\n", __func__, options); button->press_activates = True; } } button->img_active = (MBPixbufImage*)list_find_by_name(theme->images, img_active_id); button->img_inactive = (MBPixbufImage*)list_find_by_name(theme->images, img_inactive_id); if (button->img_inactive == NULL && button->inputonly == False) { return NULL; } if (button->img_active == NULL) button->img_active = button->img_inactive; return button; } static int parse_frame_button_tag(MBTheme *theme, MBThemeFrame *frame, XMLNode *inode) { MBThemeButton* button_new = NULL; char *x = get_attr(inode, "x"); char *y = get_attr(inode, "y"); char *w = get_attr(inode, "w"); char *h = get_attr(inode, "h"); char *action = get_attr(inode, "action"); char *options = get_attr(inode, "options"); char *active_spec = NULL, *inactive_spec = NULL; int active_blend = 0, inactive_blend = 0; int action_id = 0; dbg("%s() parsing button tag\n", __func__); if ( x == NULL || y == NULL || w == NULL || h == NULL || action == NULL) return ERROR_MISSING_PARAMS; dbg("%s() params ok\n", __func__); if ((action_id = lookup_button_action(action)) == 0) return ERROR_INCORRECT_PARAMS; if (inode->kids) { Nlist *nn; XMLNode *iinode; for(nn = inode->kids; nn != NULL; nn = nn->next) { iinode = nn->data; if (!(strcmp("active", iinode->tag))) { active_spec = get_attr(iinode, "pixmap"); if (active_spec == NULL) get_attr(iinode, "picture"); GET_INT_ATTR(iinode, "blend", active_blend); continue; } if (!(strcmp("inactive", iinode->tag))) { inactive_spec = get_attr(iinode, "pixmap"); if (inactive_spec == NULL) get_attr(iinode, "picture"); GET_INT_ATTR(iinode, "blend", inactive_blend); continue; } } } button_new = mbtheme_button_new(theme, x, y, w, h, active_spec, inactive_spec, active_blend, inactive_blend, options); if (button_new == NULL) return ERROR_INCORRECT_PARAMS; dbg("%s() adding new button with action : %i\n", __func__, action_id); list_add(&frame->buttons, NULL, action_id, (void *)button_new); return 1; } MBThemeLabel * mbtheme_label_new(MBTheme* theme, char* font_id, char* col_id, char* justify) { MBThemeLabel *label = malloc(sizeof(MBThemeLabel)); memset(label, 0, sizeof(MBThemeLabel)); if (!strcmp(justify, "left")) { label->justify = ALIGN_LEFT; } else if (!strcmp(justify, "center")) { label->justify = ALIGN_CENTER; } else if (!strcmp(justify, "right")) { label->justify = ALIGN_RIGHT; } else { label->justify = ALIGN_LEFT; } label->font = (MBFont *)list_find_by_name(theme->fonts, font_id); if (label->font == NULL) return NULL; label->col = (MBColor *)list_find_by_name(theme->colors, col_id); if (label->col == NULL) return NULL; return label; } MBThemeLabel * mbtheme_sublabel_new(MBTheme* theme, char* sublabel_label_clip_w) { MBThemeLabel *label = malloc(sizeof(MBThemeLabel)); memset(label, 0, sizeof(MBThemeLabel)); label->sublabel_label_clip_w = param_parse(sublabel_label_clip_w); return label; } static int lookup_layer_type(char *name) { int i; for (i=0; i < layer_lookup_cnt; i++) if (!strcmp(name, layer_lookup[i].name)) return layer_lookup[i].id; return -1; } MBThemeLayer * mbtheme_layer_new (MBTheme *theme, char *x, char *y, char *w, char *h ) { MBThemeLayer *layer = malloc(sizeof(MBThemeLayer)); memset(layer, 0, sizeof(MBThemeLayer)); if ( (layer->x = param_parse(x)) == NULL) return NULL; if ( (layer->y = param_parse(y)) == NULL) return NULL; if ( (layer->w = param_parse(w)) == NULL) return NULL; if ( (layer->h = param_parse(h)) == NULL) return NULL; return layer; } static int parse_frame_layer_tag (MBTheme *theme, MBThemeFrame *frame, XMLNode *inode) { MBThemeLayer *layer_new; int type_id; char *attr = NULL; char *x = get_attr(inode, "x"); char *y = get_attr(inode, "y"); char *w = get_attr(inode, "w"); char *h = get_attr(inode, "h"); char *type = get_attr(inode, "type"); if ( x == NULL || y == NULL || w == NULL || h == NULL || type == NULL) return ERROR_MISSING_PARAMS; layer_new = mbtheme_layer_new( theme, x, y, w, h ); type_id = lookup_layer_type(type); if (layer_new == NULL || type_id == 0) return ERROR_INCORRECT_PARAMS; list_add(&frame->layers, NULL, type_id, (void *)layer_new); switch (type_id) { case LAYER_PLAIN: attr = get_attr(inode, "color"); layer_new->color = (MBColor*)list_find_by_name(theme->colors, attr); if (layer_new->color == NULL) return ERROR_INCORRECT_PARAMS; break; case LAYER_GRADIENT_HORIZ: case LAYER_GRADIENT_VERT: attr = get_attr(inode, "startcol"); layer_new->color = (MBColor*)list_find_by_name(theme->colors, attr); attr = get_attr(inode, "endcol"); layer_new->color_end = (MBColor*)list_find_by_name(theme->colors, attr); if (layer_new->color == NULL || layer_new->color_end == NULL) return ERROR_INCORRECT_PARAMS; break; case LAYER_PIXMAP: case LAYER_PIXMAP_TILED: attr = get_attr(inode, "pixmap"); layer_new->img = (MBPixbufImage*)list_find_by_name(theme->images, attr); if (layer_new->img == NULL) return ERROR_INCORRECT_PARAMS; break; case LAYER_PICTURE_TILED: case LAYER_PICTURE: attr = get_attr(inode, "picture"); layer_new->img = (MBPixbufImage*)list_find_by_name(theme->images, attr); if (layer_new->img == NULL) return ERROR_INCORRECT_PARAMS; break; case LAYER_LABEL: layer_new->label = mbtheme_label_new( theme, get_attr(inode, "font"), get_attr(inode, "color"), get_attr(inode, "justify") ); if (layer_new->label == NULL) return ERROR_INCORRECT_PARAMS; break; } return 1; } MBThemeFrame * mbtheme_frame_new (MBTheme *theme, char *name, int width, int height, char *options) { MBThemeFrame *frame = NULL; frame = malloc(sizeof(MBThemeFrame)); memset(frame, 0, sizeof(MBThemeFrame)); frame->type = lookup_frame_type(name); frame->set_height = height; frame->set_width = width; frame->wants_shape = False; if (options) { frame->options = strdup(options); if (strstr(options, "shaped")) frame->wants_shape = True; } return frame; } void mbtheme_frame_free (MBTheme *theme, MBThemeFrame *frame) { struct list_item* next = NULL, *cur = NULL; cur = frame->layers; while (cur != NULL) { MBThemeLayer *layer; next = cur->next; layer = (MBThemeLayer *)cur->data; if (layer->label) free(layer->label); free(layer->x); free(layer->y); free(layer->w); free(layer->h); free(layer); free(cur); cur = next; } frame->layers = NULL; cur = frame->buttons; while (cur != NULL) { MBThemeButton *button; next = cur->next; button = (MBThemeButton *)cur->data; free(button->x); free(button->y); free(button->w); free(button->h); free(button); free(cur); cur = next; } frame->buttons = NULL; if (frame->options) free(frame->options); free(frame); } static int parse_frame_tag (MBTheme *theme, XMLNode *node, char *theme_filename) { MBThemeFrame* frame_new; Nlist *n; XMLNode *inode; int size, wanted_width, wanted_height, result; char* id = get_attr(node, "id"); char* options = get_attr(node, "options"); char *font_def = NULL, *color_def = NULL; int frame_type = 0; dbg("%s() Frame id is %s\n", __func__, id); GET_INT_ATTR(node, "size", size); GET_INT_ATTR(node, "width", wanted_width); GET_INT_ATTR(node, "height", wanted_height); dbg("%s size is %i\n", __func__, wanted_width); if (wanted_height == 0) wanted_height = size; /* Workaround depreciated size attribute. */ frame_new = mbtheme_frame_new(theme, id, wanted_width, wanted_height, options); if (frame_new == NULL) return ERROR_INCORRECT_PARAMS; frame_type = lookup_frame_type(id); if (!frame_type) return ERROR_INCORRECT_PARAMS; if (frame_type == FRAME_MENU) /* HACK HACK HACK */ { dbg("%s() frame_type is MENU\n", __func__); font_def = get_attr(node, "font"); if (font_def == NULL) return ERROR_MISSING_PARAMS; frame_new->font = list_find_by_name(theme->fonts, font_def); if (frame_new->font == NULL) return ERROR_INCORRECT_PARAMS; color_def = get_attr(node, "color"); if (color_def == NULL) return ERROR_MISSING_PARAMS; frame_new->color = list_find_by_name(theme->colors, color_def); if (frame_new->color == NULL) return ERROR_MISSING_PARAMS; /* XXX Hack around for highlight color */ color_def = get_attr(node, "highlight"); if (color_def != NULL) { frame_new->hl_color = list_find_by_name(theme->colors, color_def); if (frame_new->hl_color == NULL) return ERROR_INCORRECT_PARAMS; } else frame_new->hl_color = NULL; GET_INT_ATTR(node, "border_east", frame_new->border_e); GET_INT_ATTR(node, "border_west", frame_new->border_w); GET_INT_ATTR(node, "border_north", frame_new->border_n); GET_INT_ATTR(node, "border_south", frame_new->border_s); GET_INT_ATTR(node, "fixed_width", frame_new->fixed_width); frame_new->fixed_x = -1; if (get_attr(node, "fixed_x")) { GET_INT_ATTR(node, "fixed_x", frame_new->fixed_x); } } list_add(&theme->frames, NULL, frame_type, (void *)frame_new); for(n = node->kids; n != NULL; n = n->next) { inode = n->data; if (!(strcmp("layer", inode->tag))) { result = parse_frame_layer_tag(theme, frame_new, inode); if (result < 0) { show_parse_error(theme->wm, inode, theme_filename, result); return -1; } continue; } if (!(strcmp("button", inode->tag))) { result = parse_frame_button_tag(theme, frame_new, inode); if (result < 0) { show_parse_error(theme->wm, inode, theme_filename, result); return -1; } continue; } if (!strcmp("panel",inode->tag)) { if ((result = parse_panel_tag(theme, inode)) < 0) { show_parse_error(theme->wm, inode, theme_filename, result); return -1; } continue; } } return 1; } static int parse_color_tag (MBTheme *theme, XMLNode *node) { MBColor *color = NULL; int alpha; char *id = get_attr(node, "id"); char *spec = get_attr(node, "def"); if (get_attr(node, "alpha")) { fprintf(stderr, "matchbox *warning*: alpha attribute in theme.xml color tar is depreciated\n Use def='rrggbbaa' format instead to specify alpha\n"); } else alpha = 0xff; dbg("%s() id : %s , def : %s\n", __func__, id, spec); if ( id == NULL || spec == NULL ) return ERROR_MISSING_PARAMS; if ((color = mb_col_new_from_spec(theme->wm->pb, spec)) == NULL) return ERROR_INCORRECT_PARAMS; dbg("%s() got color r: %i, g: %i, b: %i, a: %i\n", __func__, mb_col_red(color), mb_col_green(color), mb_col_blue(color), mb_col_alpha(color)); list_add(&theme->colors, id, 0, (void *)color); return 1; } static int parse_font_tag (MBTheme *theme, XMLNode *node) { MBFont *font = NULL; char *id = get_attr(node, "id"); char *spec = get_attr(node, "def"); if ( id == NULL || spec == NULL ) return ERROR_MISSING_PARAMS; if ((font = mb_font_new_from_string(theme->wm->dpy, spec)) == NULL) return ERROR_INCORRECT_PARAMS; dbg("%s() got font family: %s size: %i\n", __func__, mb_font_get_family(font), mb_font_get_point_size(font)); list_add(&theme->fonts, id, 0, (void *)font); return 1; } static int parse_pixmap_tag (MBTheme *theme, XMLNode *node) { MBPixbufImage *img = NULL; char *id = get_attr(node, "id"); char *filename = get_attr(node, "filename"); if ( id == NULL || filename == NULL ) return ERROR_MISSING_PARAMS; if ((img = mb_pixbuf_img_new_from_file(theme->wm->pb, filename)) == NULL) return ERROR_LOADING_RESOURCE; list_add(&theme->images, id, 0, (void *)img); return 1; } static int parse_panel_tag (MBTheme *theme, XMLNode *node) { Wm *wm = theme->wm; char *x = get_attr(node, "x"); char *y = get_attr(node, "y"); char *w = get_attr(node, "w"); char *h = get_attr(node, "h"); dbg("%s() parsing panel tag\n", __func__); if ( x == NULL || y == NULL || wm == NULL || h == NULL) return ERROR_MISSING_PARAMS; theme->have_toolbar_panel = True; theme->toolbar_panel_x = param_parse(x); theme->toolbar_panel_y = param_parse(y); theme->toolbar_panel_w = param_parse(w); theme->toolbar_panel_h = param_parse(h); return 1; } static int parse_lowlight_tag (MBTheme *theme, XMLNode *node) { MBColor *color = NULL; char *color_attr = get_attr(node, "color"); /* matchbox not running with lowlight switch */ #ifndef USE_COMPOSITE if (!theme->wm->config->dialog_shade) return 1; #endif if ( color_attr == NULL ) return ERROR_MISSING_PARAMS; color = (MBColor*)list_find_by_name(theme->colors, color_attr); if (color == NULL) return ERROR_INCORRECT_PARAMS; theme->wm->config->lowlight_params[0] = mb_col_red(color); theme->wm->config->lowlight_params[1] = mb_col_green(color); theme->wm->config->lowlight_params[2] = mb_col_blue(color); theme->wm->config->lowlight_params[3] = mb_col_alpha(color); return 1; } static int parse_app_icon_tag (MBTheme *theme, XMLNode *node) { MBPixbufImage *img = NULL; char *pixmap_attr = get_attr(node, "pixmap"); if ( pixmap_attr == NULL ) return ERROR_MISSING_PARAMS; img = (MBPixbufImage*)list_find_by_name(theme->images, pixmap_attr); if (img == NULL) return ERROR_INCORRECT_PARAMS; if (theme->wm->img_generic_icon) mb_pixbuf_img_free(theme->wm->pb, theme->wm->img_generic_icon); theme->wm->img_generic_icon = mb_pixbuf_img_clone(theme->wm->pb, img); misc_scale_wm_app_icon(theme->wm); return 1; } #ifdef USE_FRAME_ANIMATION static int parse_rectangle (const char *str, XRectangle *dst) { if (sscanf (str, "%hd %hd %hd %hd", &dst->x, &dst->y, &dst->width, &dst->height) == 4) { return 1; } return -1; } static int parse_frame_animation_tag (MBTheme *theme, XMLNode *node) { char *anim_id = get_attr(node, "id"); char *src_rect = get_attr(node, "src"); char *dst_rect = get_attr(node, "dst"); if (anim_id && src_rect && dst_rect) { dbg ("parsing animation for '%s'\n", anim_id); if (!strncmp(anim_id, "close", 5)) { if (!parse_rectangle(src_rect, &theme->wm->config->animations[MB_FRAME_ANIMATION_CLOSE].src)) return ERROR_INCORRECT_PARAMS; if (!parse_rectangle(dst_rect, &theme->wm->config->animations[MB_FRAME_ANIMATION_CLOSE].dst)) return ERROR_INCORRECT_PARAMS; } else if (!strncmp(anim_id, "minimize", 8)) { if (!parse_rectangle(src_rect, &theme->wm->config->animations[MB_FRAME_ANIMATION_MINIMIZE].src)) return ERROR_INCORRECT_PARAMS; if (!parse_rectangle(dst_rect, &theme->wm->config->animations[MB_FRAME_ANIMATION_MINIMIZE].dst)) return ERROR_INCORRECT_PARAMS; } else if (!strncmp(anim_id, "maximize", 8)) { if (!parse_rectangle(src_rect, &theme->wm->config->animations[MB_FRAME_ANIMATION_MAXIMIZE].src)) return ERROR_INCORRECT_PARAMS; if (!parse_rectangle(dst_rect, &theme->wm->config->animations[MB_FRAME_ANIMATION_MAXIMIZE].dst)) return ERROR_INCORRECT_PARAMS; } else { return ERROR_INCORRECT_PARAMS; } } else return ERROR_MISSING_PARAMS; return 1; } #endif #ifdef USE_COMPOSITE static int parse_shadow_tag (MBTheme *theme, XMLNode *node) { /* attributes are; style : off ?, none, simple, gaussian * only needed one * color : ref to defined color dx : x offset of shadow ( can be -ive ) dy : y offset of shadow ( can be -ive ) width : extra width of shadow - only used for simple shadows ? height : extra height of shadow */ MBColor *color = NULL; Wm *w = theme->wm; char *style = get_attr(node, "style"); char *color_attr = get_attr(node, "color"); if ( style == NULL ) return ERROR_MISSING_PARAMS; if (!strcasecmp(style, "simple")) { w->config->shadow_style = SHADOW_STYLE_SIMPLE; } else if (!strcasecmp(style, "gaussian")) { w->config->shadow_style = SHADOW_STYLE_GAUSSIAN; } else if (!strcasecmp(style, "none")) { w->config->shadow_style = SHADOW_STYLE_NONE; return 1; } else return ERROR_INCORRECT_PARAMS; if (color_attr) { color = (MBColor*)list_find_by_name(theme->colors, color_attr); if (color == NULL) return ERROR_INCORRECT_PARAMS; w->config->shadow_color[0] = mb_col_red(color); w->config->shadow_color[1] = mb_col_green(color); w->config->shadow_color[2] = mb_col_blue(color); w->config->shadow_color[3] = mb_col_alpha(color); } if (get_attr(node, "dx")) { GET_INT_ATTR(node, "dx", w->config->shadow_dx); } if (get_attr(node, "dy")) { GET_INT_ATTR(node, "dy", w->config->shadow_dy); } if (get_attr(node, "width")) { GET_INT_ATTR(node, "width", w->config->shadow_padding_width); } if (get_attr(node, "height")) { GET_INT_ATTR(node, "height", w->config->shadow_padding_height); } return 1; } #endif MBTheme * mbtheme_new (Wm *w) { XGCValues gv; int i; MBTheme *t = (MBTheme *)malloc(sizeof(MBTheme)); memset(t, 0, sizeof(MBTheme)); for (i=0; i<3; i++) t->app_win_pxm_cache[i] = None; gv.graphics_exposures = False; gv.function = GXcopy; t->gc = XCreateGC(w->dpy, w->root, GCGraphicsExposures|GCFunction, &gv); XSetForeground(w->dpy, t->gc, w->grey_col.pixel); gv.function = GXinvert; gv.subwindow_mode = IncludeInferiors; gv.line_width = 1; t->band_gc = XCreateGC(w->dpy, w->root, GCFunction|GCSubwindowMode|GCLineWidth, &gv); t->mask_gc = None; t->wm = w; t->frames = NULL; t->images = NULL; t->pictures = NULL; t->colors = NULL; t->fonts = NULL; t->have_toolbar_panel = False; return t; } void mbtheme_free (Wm *w, MBTheme *theme) { struct list_item* next = NULL, *cur = NULL; if (theme->toolbar_panel_x) free(theme->toolbar_panel_x); if (theme->toolbar_panel_y) free(theme->toolbar_panel_y); if (theme->toolbar_panel_w) free(theme->toolbar_panel_w); if (theme->toolbar_panel_h) free(theme->toolbar_panel_h); cur = theme->frames; while (cur != NULL) { next = cur->next; if (cur->name) free(cur->name); mbtheme_frame_free (theme, (MBThemeFrame*)cur->data); free(cur); cur = next; } theme->frames = NULL; cur = theme->images; while (cur != NULL) { next = cur->next; if (cur->name) free(cur->name); mb_pixbuf_img_free(w->pb, (MBPixbufImage *)cur->data); free(cur); cur = next; } theme->images = NULL; cur = theme->colors; while (cur != NULL) { next = cur->next; if (cur->name) free(cur->name); mb_col_unref((MBColor*)cur->data); free(cur); cur = next; } theme->colors = NULL; cur = theme->fonts; while (cur != NULL) { next = cur->next; if (cur->name) free(cur->name); mb_font_unref((MBFont*)cur->data); free(cur); cur = next; } theme->fonts = NULL; if (theme->gc) XFreeGC(w->dpy, theme->gc); if (theme->band_gc) XFreeGC(w->dpy, theme->band_gc); if (theme->mask_gc) XFreeGC(w->dpy, theme->mask_gc); theme_img_cache_clear_all (theme); theme_pixmap_cache_clear_all( theme ); free(theme); w->mbtheme = NULL; } void mbtheme_switch (Wm *w, char *new_theme_name) { Client *p = NULL; XGrabServer(w->dpy); /* now the fun part */ mbtheme_free(w, w->mbtheme); /* load the new theme */ mbtheme_init(w, new_theme_name); theme_img_cache_clear( w->mbtheme, FRAME_MAIN ); /* sort having titlebar panel, no theme defintion */ if (w->have_titlebar_panel) { if (mbtheme_has_titlebar_panel(w->mbtheme)) { dbg("%s() mapping titlebar\n", __func__ ); XMapWindow(w->dpy, w->have_titlebar_panel->frame); } else { w->have_titlebar_panel->ignore_unmap++; XUnmapWindow(w->dpy, w->have_titlebar_panel->frame); } } /* Now resize ( due to new frames ) + repaint everything */ stack_enumerate(w, p) { client_buttons_delete_all(p); if (p->type == MBCLIENT_TYPE_DIALOG) { XRectangle rect; Region xregion; /* Old theme may have been shaped and this one not. * Therefore we 'clear' any possible shapes set on * the window frames. */ xregion = XCreateRegion (); rect.x = 0; rect.y = 0; rect.width = p->width + 100; rect.height = p->height + 100; XUnionRectWithRegion (&rect, xregion, xregion); XShapeCombineRegion (w->dpy, client_title_frame(p), ShapeBounding, 0, 0, xregion, ShapeSet); XShapeCombineRegion (w->dpy, p->frame,ShapeBounding, 0, 0, xregion, ShapeSet); XDestroyRegion (xregion); } p->configure(p); p->move_resize(p); p->redraw(p, False); } ewmh_update_rects(w); /* theme *could* affect this */ XSync(w->dpy, False); XUngrabServer(w->dpy); comp_engine_render(w, None); } static void show_parse_error (Wm *w, XMLNode *node, char *theme_file, int err_num) { Params *p; if (w->mbtheme == NULL) return; /* We've already been called no doubt */ fprintf(stderr, "Matchbox: error parsing %s\n", theme_file); switch (err_num) { case ERROR_MISSING_PARAMS: fprintf(stderr, "Missing Params in "); break; case ERROR_INCORRECT_PARAMS: fprintf(stderr, "Incorrect Params in "); break; case ERROR_LOADING_RESOURCE: fprintf(stderr, "Error loading resource from "); break; default : fprintf(stderr, "Unknown error in "); break; } fprintf(stderr, "<%s", node->tag); for(p = node->attr; p != NULL; p = p->next) fprintf(stderr, " %s='%s'", p->key, p->value); fprintf(stderr, "/>\n"); if (!strncmp(theme_file, DEFAULTTHEME, 255)) exit(1); fflush(stderr); mbtheme_free(w, w->mbtheme); } static Bool file_exists(char *filename) { struct stat st; if (stat(filename, &st)) return False; return True; } void mbtheme_init (Wm *w, char *theme_name) { int err = 0; XMLNode *root_node, *cnode; Nlist *n; int k; XMLParser *parser = xml_parser_new(); char theme_filename[255] = DEFAULTTHEME; char *theme_path = NULL; #ifndef MAXPATHLEN #define MAXPATHLEN 256 #endif char orig_wd[MAXPATHLEN]; if (theme_name != NULL) { if (theme_name[0] == '/') strncpy(theme_filename, theme_name, 255); else { snprintf(theme_filename, 255, "%s/.themes/%s/matchbox/theme.xml", getenv("HOME"), theme_name); if (!file_exists(theme_filename)) { snprintf(theme_filename, 255, "%s/themes/%s/matchbox/theme.xml", DATADIR, theme_name); } } } else { theme_name = DEFAULTTHEMENAME; } if (!file_exists(theme_filename)) { fprintf(stderr, "matchbox-wm: unable to open theme: %s\n", theme_filename); /* If the defualt is not openable either - give up :( */ if (!file_exists(DEFAULTTHEME)) exit(1); strncpy(theme_filename, DEFAULTTHEME, 255); } if (getcwd(orig_wd, MAXPATHLEN) == (char *)NULL) { fprintf(stderr, "matchbox: cant get current directory\n"); exit(1); } theme_path = strdup(theme_filename); theme_path[strlen(theme_filename)-9] = '\0'; chdir(theme_path); XChangeProperty(w->dpy, w->root, w->atoms[_MB_THEME], XA_STRING, 8, PropModeReplace, (unsigned char*)theme_path, strlen(theme_path)); XChangeProperty(w->dpy, w->root, w->atoms[_MB_THEME_NAME], XA_STRING, 8, PropModeReplace, (unsigned char*)theme_name, strlen(theme_name)); free(theme_path); comp_engine_set_defualts(w); #ifdef USE_FRAME_ANIMATION w->config->use_frame_animation=0; for (k=0; kconfig->animations[k], 0, sizeof(MBFrameAnimation)); } #endif root_node = xml_parse_file_dom(parser, theme_filename); if (root_node == NULL) { fprintf(stderr, "matchbox-wm: Failed to parse theme file: %s\n", theme_filename); fprintf(stderr, "matchbox-wm: Please check this file contains valid XML\n") ; if (!strncmp(theme_filename, DEFAULTTHEME, 255)) exit(1); /* give up, the defualt theme is corrupt */ fprintf(stderr, "matchbox-wm: switching to default\n"); xml_parser_free(parser, root_node); return mbtheme_init (w, NULL); /* try again with defualt */ } /* Check version info */ if (!get_attr(root_node, "engine_version") || (strcmp(get_attr(root_node, "engine_version"), "1") != 0)) { fprintf(stderr, "matchbox-wm: %s is not valid for this version of matchbox.\n", theme_filename ); if (!strncmp(theme_filename, DEFAULTTHEME, 255)) exit(1); /* give up, the defualt theme is corrupt */ fprintf(stderr, "matchbox: switching to default\n"); xml_parser_free(parser, root_node); return mbtheme_init (w, NULL); } w->mbtheme = mbtheme_new(w); if (get_attr(root_node, "cache") && !strcasecmp(get_attr(root_node, "cache"), "false")) { if (!getenv("MB_THEME_ALWAYS_CACHE")) w->mbtheme->disable_pixbuf_cache = True; } for(n = root_node->kids; n != NULL; n = n->next) { cnode = n->data; if (!strcmp("color",cnode->tag)) { if ((err = parse_color_tag(w->mbtheme, cnode)) < 0) { show_parse_error(w, cnode, theme_filename, err); xml_parser_free(parser, root_node); return mbtheme_init (w, NULL); } continue; } if (!strcmp("font",cnode->tag)) { if ((err = parse_font_tag(w->mbtheme, cnode)) < 0) { show_parse_error(w, cnode, theme_filename, err); xml_parser_free(parser, root_node); return mbtheme_init (w, NULL); } continue; } if (!strcmp("frame", cnode->tag)) { if ((err = parse_frame_tag(w->mbtheme, cnode, theme_filename)) < 0) { show_parse_error(w, cnode, theme_filename, err); xml_parser_free(parser, root_node); return mbtheme_init (w, NULL); } continue; } if (!strcmp("pixmap",cnode->tag)) { if ((err =parse_pixmap_tag(w->mbtheme, cnode)) < 0) { show_parse_error(w, cnode, theme_filename, err); xml_parser_free(parser, root_node); return mbtheme_init (w, NULL); } continue; } if (!strcmp("lowlight",cnode->tag)) { if ((err =parse_lowlight_tag(w->mbtheme, cnode)) < 0) { show_parse_error(w, cnode, theme_filename, err); xml_parser_free(parser, root_node); return mbtheme_init (w, NULL); } continue; } if (!strcmp("appicon",cnode->tag)) { if ((err =parse_app_icon_tag(w->mbtheme, cnode)) < 0) { show_parse_error(w, cnode, theme_filename, err); xml_parser_free(parser, root_node); return mbtheme_init (w, NULL); } continue; } #ifdef USE_FRAME_ANIMATION if (!strcmp("frame-animation", cnode->tag)) { if ((err =parse_frame_animation_tag(w->mbtheme, cnode)) < 0) { show_parse_error(w, cnode, theme_filename, err); xml_parser_free(parser, root_node); return mbtheme_init (w, NULL); } w->config->use_frame_animation=1; continue; } #endif #ifdef USE_COMPOSITE if (!strcmp("shadow", cnode->tag)) { if ((err =parse_shadow_tag(w->mbtheme, cnode)) < 0) { show_parse_error(w, cnode, theme_filename, err); xml_parser_free(parser, root_node); return mbtheme_init (w, NULL); } continue; } #endif #ifdef HAVE_XCURSOR if (!strcmp("cursor", cnode->tag)) { char *cursor_theme = NULL; int cursor_size = -1; cursor_theme = get_attr(cnode, "theme"); GET_INT_ATTR(cnode, "size", cursor_size); dbg ("Got cursor theme:%s size:%i\n", cursor_theme, cursor_size); if (cursor_theme) XcursorSetTheme (w->dpy, cursor_theme); if (cursor_size > -1) XcursorSetDefaultSize (w->dpy, cursor_size); dbg ("cursor size is %i\n", XcursorGetDefaultSize (w->dpy)); continue; } #endif } chdir(orig_wd); xml_parser_free(parser, root_node); comp_engine_theme_init(w); } Bool mbtheme_has_titlebar_panel(MBTheme *theme) { return theme->have_toolbar_panel; } Bool mbtheme_get_titlebar_panel_rect(MBTheme *theme, XRectangle *rect, Client *ignore_client) { MBThemeFrame *frame; int width, height; if (!theme->have_toolbar_panel) return False; frame = (MBThemeFrame*)list_find_by_id(theme->frames, FRAME_MAIN ); if (!frame) return False; height = theme_frame_defined_height_get(theme, FRAME_MAIN); width = theme->wm->dpy_width - wm_get_offsets_size(theme->wm, EAST, ignore_client, True) - wm_get_offsets_size(theme->wm, WEST, ignore_client, True); rect->x = param_get( frame, theme->toolbar_panel_x, width ); rect->y = param_get( frame, theme->toolbar_panel_y, height ); rect->width = param_get( frame, theme->toolbar_panel_w, width ); rect->height = param_get( frame, theme->toolbar_panel_h, height ); return True; } matchbox-window-manager-1.2/matchbox-window-manager/src/wm.h0000664000211500234210000000622011307441355023051 0ustar bifh1bifhs/* * Matchbox Window Manager - A lightweight window manager not for the * desktop. * * Authored By Matthew Allum * * Copyright (c) 2002, 2004 OpenedHand Ltd - http://o-hand.com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #ifndef _WM_H_ #define _WM_H_ #include "structs.h" #include "stack.h" #include "base_client.h" #include "main_client.h" #include "toolbar_client.h" #include "dockbar_client.h" #include "dialog_client.h" #include "desktop_client.h" #include "client_common.h" #include "misc.h" #include "ewmh.h" #include "composite-engine.h" #include "session.h" #ifdef STANDALONE #include "mbtheme-standalone.h" #else #include "mbtheme.h" #endif #include "keys.h" /* Atoms */ #define WITHDRAW 1 #define FRAME 1 #define WINDOW 2 #define ChildMask (SubstructureRedirectMask|SubstructureNotifyMask) #define ButtonMask (ButtonPressMask|ButtonReleaseMask) #define MouseMask (ButtonMask|PointerMotionMask) #define KeyMask (KeyPressMask|KeyReleaseMask) Wm *wm_new(int argc, char **argv); void wm_usage(char *progname); void wm_load_config(Wm *w, int *argc, char *argv[]); void wm_init_existing(Wm *w); /* events */ void wm_event_loop(Wm* w); void wm_handle_button_event(Wm *w, XButtonEvent *e); void wm_handle_keypress(Wm *w, XKeyEvent *e); void wm_handle_map_request(Wm *w, XMapRequestEvent *e); void wm_handle_unmap_event(Wm *w, XUnmapEvent *e); void wm_handle_expose_event(Wm *w, XExposeEvent *e); void wm_handle_configure_request(Wm *w, XConfigureRequestEvent *e); void wm_handle_configure_notify(Wm *w, XConfigureEvent *e); void wm_handle_destroy_event(Wm *w, XDestroyWindowEvent *e); void wm_handle_client_message(Wm *w, XClientMessageEvent *e); void wm_handle_property_change(Wm *w, XPropertyEvent *e); void wm_handle_enter_notify(Wm *w, XEnterWindowEvent *e); Client * wm_find_client(Wm *w, Window win, int mode); Client * wm_make_new_client(Wm *w, Window win); void wm_remove_client(Wm *w, Client *c); void wm_activate_client(Client *c); void wm_lowlight(Wm *w, Client *c); void wm_update_layout(Wm *w, Client *c, signed int amount); int wm_get_offsets_size(Wm* w, int wanted_direction, Client* ignore_client, Bool include_toolbars ); void wm_set_cursor_visibility(Wm *w, Bool visible); Client * /* Returns either desktop or main app client */ wm_get_visible_main_client(Wm *w); void wm_toggle_desktop(Wm *w); Client *wm_get_desktop(Wm *w); #ifdef USE_LIBSN void wm_sn_cycle_remove(Wm *w, Window xid); #endif #ifdef USE_GCONF void gconf_key_changed_callback (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer user_data); #endif #endif matchbox-window-manager-1.2/matchbox-window-manager/src/base_client.c0000664000211500234210000003245111307441355024676 0ustar bifh1bifhs/* * Matchbox Window Manager - A lightweight window manager not for the * desktop. * * Authored By Matthew Allum * * Copyright (c) 2002, 2004 OpenedHand Ltd - http://o-hand.com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #include "base_client.h" Client* base_client_new(Wm *w, Window win) { XWindowAttributes attr; XSizeHints sz_hints; long mask; Client *c = NULL; int i = 0, format; XWMHints *wmhints = NULL; XTextProperty text_prop; Atom type; unsigned long bytes_after, n_items; long *data = NULL; unsigned long val[1]; dbg("%s() called \n", __func__); c = malloc(sizeof(Client)); if (c == NULL) return NULL; memset(c, 0, sizeof(Client)); /* Stardard bits */ c->type = MBCLIENT_TYPE_APP; /* start off with common case */ c->window = win; c->wm = w; /* Set up the 'methods' - expect to be overidden */ base_client_set_funcs(c); stack_prepend_bottom(c); for (i=0; ibacking_masks[i] = None; for (i=0; iframes_decor[i] = None; /* UTF8 Window Name */ if ((c->name = (char*)ewmh_get_utf8_prop(w, win, w->atoms[_NET_WM_NAME])) != NULL) c->name_is_utf8 = True; /* Basic attributes */ XGetWindowAttributes(w->dpy, win, &attr); /* * What todo about attr.class == InputOnly case ? * Should never happen and likely throw X error to untrap. */ c->x = attr.x; c->y = attr.y; c->cmap = attr.colormap; c->visual = attr.visual; if (attr.win_gravity != NorthWestGravity) { XSetWindowAttributes set_attrs; set_attrs.win_gravity = NorthWestGravity; XChangeWindowAttributes (w->dpy, c->window, CWWinGravity, &set_attrs); } c->width = attr.width; c->height = attr.height; if (c->x < 0) c->x = (w->dpy_width + c->x - c->width); if (c->y < 0) c->y = (w->dpy_height + c->y - c->height); c->gravity = NorthWestGravity; if (XGetWMNormalHints(w->dpy, c->window, &sz_hints, &mask)) { if (mask & PWinGravity) c->gravity = sz_hints.win_gravity; } #if 0 /* Get size hints */ c->size = XAllocSizeHints(); /* * Dont bother with WMNormalHints anymore, reasoning; * * - mb forces app window sizes anyway ( and static ) * - We dont let users resize dialogs * ( so base_height, width_inc etc not that useful. but *could* * be used if xterms were dialogs and therefore likely to get * resized. ) */ if ( !XGetWMNormalHints(w->dpy, c->window, c->size, &icccm_mask) ) { c->width = attr.width; c->height = attr.height; } else { if (c->size->flags & PBaseSize) { c->width = c->size->base_width; c->height = c->size->base_height; /* - tk windows set this to 1x1 which currently causes problems } else if (c->size->flags & PMinSize) { c->width = c->size->min_width; c->height = c->size->min_height; dbg("got min window size"); */ } else { c->width = attr.width; c->height = attr.height; } } #endif /* EWMH Icon */ #ifndef STANDALONE c->icon_rgba_data = ewmh_get_icon_prop_data(w, win); #endif /* WM Hints */ if ((wmhints = XGetWMHints(w->dpy, c->window)) != NULL) { dbg("%s() checking WMHints\n", __func__); if (wmhints->window_group) c->win_group = wmhints->window_group; else c->win_group = 0; if (wmhints->flags & XUrgencyHint) { dbg("%s() WMHints, has urgency hint\n", __func__); c->flags |= CLIENT_HAS_URGENCY_FLAG; } c->icon = None; c->icon_mask = None; if (w->config->use_icons && c->icon_rgba_data == NULL) { if (wmhints->flags & IconPixmapHint) { dbg("%s() got icon hint\n", __func__); c->icon = wmhints->icon_pixmap; if (wmhints->flags & IconMaskHint) { c->icon_mask = wmhints->icon_mask; } } } if ((wmhints->flags & StateHint) && wmhints->initial_state == IconicState) c->flags |= CLIENT_IS_MINIMIZED; } dbg("%s() window group %li\n", __func__, c->win_group); if (wmhints) XFree(wmhints); #ifdef USE_LIBSN /* Startup Notification */ c->startup_id = ewmh_get_utf8_prop(w, win, w->atoms[_NET_STARTUP_ID]); if (c->startup_id == NULL && c->win_group) c->startup_id = ewmh_get_utf8_prop(w, c->win_group, w->atoms[_NET_STARTUP_ID]); #endif /* Where is client running ? */ if (XGetWMClientMachine(c->wm->dpy, c->window, &text_prop)) { c->host_machine = strdup((char *) text_prop.value); XFree((char *) text_prop.value); dbg("%s() got host machine for ewmh : %s\n", __func__, c->host_machine); } /* EWMH PID */ if (XGetWindowProperty (w->dpy, win, w->atoms[_NET_WM_PID], 0, 2L, False, XA_CARDINAL, &type, &format, &n_items, &bytes_after, (unsigned char **)&data) == Success && n_items && data != NULL) { c->pid = *data; dbg("%s() got ewmh pid : %i\n", __func__, c->pid); } else { dbg("%s() got ewmh pid : FAILED\n", __func__ ); } c->has_ping_protocol = False; c->pings_pending = -1; if (data) XFree(data); /* EWMH User time - only support value being set to 0 */ if (XGetWindowProperty(w->dpy, win, w->atoms[_NET_WM_USER_TIME], 0L, 2L, False, XA_CARDINAL, &type, &format, &n_items, &bytes_after, (unsigned char **) &data) == Success && n_items && data != NULL && *data == 0) c->flags |= CLIENT_NO_FOCUS_ON_MAP; if (data) XFree(data); client_get_wm_protocols(c); /* We detect any errors here to check the window hasn't dissapeared half * way through. A bit hacky ... */ misc_trap_xerrors(); /* We dont do workspaces! */ val[0] = 1; XChangeProperty(w->dpy, c->window, w->atoms[_NET_WM_DESKTOP] , XA_CARDINAL, 32, PropModeReplace, (unsigned char *)val, 1); ewmh_set_allowed_actions(w, c); if (w->config->no_cursor && w->blank_curs) XDefineCursor(w->dpy, c->window, w->blank_curs); client_set_state(c, WithdrawnState); XSync(w->dpy, False); if (misc_untrap_xerrors()) /* An X error occured */ { /* Likely client died */ dbg("%s() looks like client just died on us\n", __func__); c->frame = None; base_client_destroy(c); return NULL; } list_add(&w->client_age_list, NULL, 0, (void*)c); return c; } void base_client_process_name(Client *c) { Wm *w = c->wm; /* Crazily handle what to set the clients name too. * Note there is normally a check for utf8 name before this. */ XTextProperty text_prop; /* Patching away window numbering - Tapani 24.4.2006 Client *p = NULL; int i, max = 0; char *tmp_name = NULL; */ dbg("%s() called, name is %s\n", __func__, c->name); if (c->name == NULL) { c->name_is_utf8 = False; if (XGetWMName(w->dpy, c->window, &text_prop) != 0) { dbg("%s() name is from XGetWMName\n", __func__ ); c->name = strdup((char *) text_prop.value); XFree((char *) text_prop.value); } else { XFetchName(w->dpy, c->window, (char **)&c->name); if (c->name == NULL) { XStoreName(w->dpy, c->window, ""); XFetchName(w->dpy, c->window, (char **) &c->name); if (c->name == NULL) { /* Something is seriously wrong if we get here * Its likely the client window has dissapered. */ c->name = strdup("unknown"); /* something to free */ dbg("%s() WARNING, name is still null after store/fetch\n", __func__ ); return; } } } } /* If window name already exists, rename, adding <%i> to it if app window */ /* Patching away window numbering - Tapani 24.4.2006 if (!stack_empty(w) && c->type == MBCLIENT_TYPE_APP) { stack_enumerate(w, p) { if (strncmp(p->name, c->name, strlen(c->name)) == 0 && p != c) { if (strcmp(p->name, c->name) == 0) { if (!max) max = 1; } else { i = atoi(p->name+strlen(c->name)+2); if (i > max) max = i; } } } if (max) { int tmp_name_sz; tmp_name_sz = strlen(c->name) + 7;; tmp_name = alloca(tmp_name_sz); snprintf(tmp_name, tmp_name_sz, "%s <%i>", c->name, ++max); free(c->name); XStoreName(w->dpy, c->window, tmp_name); XFetchName(w->dpy, c->window, (char **)&c->name); } } */ dbg("%s() end, name is now %s\n", __func__, c->name); } void base_client_set_funcs(Client *c) { c->configure = &base_client_configure; c->reparent = &base_client_reparent; c->redraw = &base_client_redraw; c->button_press = &base_client_button_press; c->get_coverage = &base_client_get_coverage; c->move_resize = &base_client_move_resize; c->hide = &base_client_hide; c->show = &base_client_show; c->destroy = &base_client_destroy; c->iconize = &base_client_iconize; } /* This will set the window attributes to what _we_ want */ void base_client_configure(Client *c) { ; } /* Frame the window if needed */ void base_client_reparent(Client *c) { ; } /* redraw the clients frame */ void base_client_redraw(Client *c, Bool use_cache) { ; } /* button press on frame */ void base_client_button_press(Client *c, XButtonEvent *e) { ; } void base_client_iconize(Client *c) { client_set_state(c,IconicState); c->hide(c); } /* move and resize the window */ void base_client_move_resize(Client *c) { int i; for (i=0; ibacking_masks[i] != None) { XFreePixmap(c->wm->dpy, c->backing_masks[i]); c->backing_masks[i] = None; } } /* return the 'area' covered by the window. Including the frame Would return 0 for an unmapped window */ void base_client_get_coverage(Client *c, int *x, int *y, int *w, int *h) { *x = c->x; *y = c->y;*w = c->width;*h = c->height; } void /* TODO: Method not needed any more ? */ base_client_hide(Client *c) { ; } void base_client_show(Client *c) { ; } void /* cb for this needed, or let wm handle it */ base_client_destroy(Client *c) { Wm *w = c->wm; int i = 0; Client *p = NULL; #ifdef USE_ALT_INPUT_WIN Client *input_method = NULL; #endif /* Free its memory + remove from list */ dbg("%s() called\n", __func__); /* Update focus list and anything that is transient for this */ stack_enumerate(w, p) { if (p->next_focused_client == c) p->next_focused_client = c->next_focused_client; /* TODO: It may be safer to destroy any transients automatically * This is what we used to do. Its 'assumed' however the app * will do this its self. */ if (p->trans == c) #ifdef USE_ALT_INPUT_WIN { if (p->flags & (CLIENT_TB_ALT_TRANS_FOR_DIALOG|CLIENT_TB_ALT_TRANS_FOR_APP)) { /* alt input methods ( maemo ) are special cased and * we need to focibly remove them. We do this later * ( see below ) to be safer with tranciencys and * no removing in middle of enumeration. */ input_method = p; } else p->trans = c->trans; } #else p->trans = c->trans; #endif } /* Whatever we do the below is very likely to fire off a ( harmless ) * X Error or two. Therefore we trap, just to quiten the warnings. */ misc_trap_xerrors(); #ifdef USE_LIBSN wm_sn_cycle_remove(w, c->window); #endif if (c->has_ping_protocol && c->pings_pending != -1) w->n_active_ping_clients--; comp_engine_client_destroy(w, c); list_remove(&w->client_age_list, (void*)c); stack_remove(c); /* Now free up various resources */ if (c->type != MBCLIENT_TYPE_OVERRIDE) { client_buttons_delete_all(c); if (c->frame && c->frame != c->window) { XDestroySubwindows(w->dpy, c->frame); XDestroyWindow(w->dpy, c->frame); } for (i=0; ibacking_masks[i] != None) XFreePixmap(w->dpy, c->backing_masks[i]); /* No need to free up pixmap icon data client resource */ if (c->icon_rgba_data) XFree(c->icon_rgba_data); XUngrabButton(w->dpy, Button1, 0, c->window); } if (c->name) XFree(c->name); if (c->startup_id) XFree(c->startup_id); if (c->size) XFree(c->size); if (c->host_machine) free(c->host_machine); if (c == w->focused_client) w->focused_client = NULL; /* Be sure to flush out all calls before we untrap. * Important here as the above does alot. */ XSync(w->dpy, False); misc_untrap_xerrors(); ewmh_update_lists(w); free(c); #ifdef USE_ALT_INPUT_WIN if (input_method) { /* were now gone */ input_method->trans = NULL; /* Hide will destroy the client */ input_method->hide(input_method); } #endif } matchbox-window-manager-1.2/matchbox-window-manager/src/dialog_client.h0000664000211500234210000000327311307441355025230 0ustar bifh1bifhs/* * Matchbox Window Manager - A lightweight window manager not for the * desktop. * * Authored By Matthew Allum * * Copyright (c) 2002, 2004 OpenedHand Ltd - http://o-hand.com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #ifndef _DIALOG_CLIENT_H_ #define _DIALOG_CLIENT_H_ #include "structs.h" #include "wm.h" #include "client_common.h" #include "base_client.h" #include "main_client.h" #include "dialog_client.h" #include "misc.h" Client* dialog_client_new (Wm *w, Window win, Client *trans); void dialog_client_get_coverage (Client *c, int *x, int *y, int *w, int *h); void dialog_client_move_resize (Client *c); void dialog_client_reparent (Client *c); void dialog_client_hide (Client *c); void dialog_client_show (Client *c); void dialog_client_configure (Client *c); void dialog_client_redraw (Client *c, Bool use_cache); void dialog_client_button_press (Client *c, XButtonEvent *e); void dialog_client_iconize(Client *c); void dialog_client_destroy (Client *c); /* dialog only methods */ int dialog_client_title_height (Client *c); Bool dialog_constrain_geometry(Client *c, int *req_x, int *req_y, int *req_width, int *req_height); #endif matchbox-window-manager-1.2/matchbox-window-manager/src/stack.c0000664000211500234210000003025211307441355023530 0ustar bifh1bifhs/* * Matchbox Window Manager - A lightweight window manager not for the * desktop. * * Authored By Matthew Allum * * Copyright (c) 2002, 2004 OpenedHand Ltd - http://o-hand.com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #include "stack.h" void stack_add_above_client(Client *client, Client *client_below) { Wm *w = client->wm; if (client_below == NULL) { /* NULL so nothing below add at bottom */ if (w->stack_bottom) { client->above = w->stack_bottom; w->stack_bottom->below = client; } w->stack_bottom = client; } else { client->below = client_below; client->above = client_below->above; if (client->below) client->below->above = client; if (client->above) client->above->below = client; } if (client_below == w->stack_top) w->stack_top = client; w->stack_n_items++; } void /* can this call above client ? */ stack_append_top(Client *client) { Wm *w = client->wm; stack_add_above_client(client, w->stack_top); } void /* can this call above client ? */ stack_prepend_bottom(Client *client) { stack_add_above_client(client, NULL); } void stack_remove(Client *client) { Wm *w = client->wm; if (w->stack_top == w->stack_bottom) { w->stack_top = w->stack_bottom = NULL; } else { if (client == w->stack_top) w->stack_top = client->below; if (client == w->stack_bottom) w->stack_bottom = client->above; if (client->below != NULL) client->below->above = client->above; if (client->above != NULL) client->above->below = client->below; } client->above = client->below = NULL; w->stack_n_items--; } void stack_move_client_above_type(Client *client, int type_below) { Wm *w = client->wm; Client *highest_client = NULL, *c = NULL; stack_enumerate(w,c) { if ((c->type & type_below) && c->mapped) highest_client = c; } if (highest_client) stack_move_above_client(client, highest_client); } void stack_move_above_client(Client *client, Client *client_below) { if (client == client_below) return; stack_remove(client); stack_add_above_client(client, client_below); } void stack_get_type_list(Wm *w, MBList **list, MBClientTypeEnum wanted_type) { Client *p = NULL; stack_enumerate(w,p) if (p->type & wanted_type) list_add(list, NULL, 0, p); } void stack_move_type_above_client(Wm *w, MBClientTypeEnum wanted_type, Client *client) { MBList *list = NULL, *list_item = NULL; stack_get_type_list(w, &list, wanted_type); list_enumerate(list, list_item) { Client *cur = (Client *)list_item->data; if (cur->mapped) stack_move_above_client(cur, client); } list_destroy(&list); } void stack_move_transients_to_top(Wm *w, Client *client_trans_for, int flags) { /* This function shifts a clients transients to the top * of the stack keeping there respective order. * */ MBList *transient_list = NULL, *list_item = NULL; client_get_transient_list(w, &transient_list, client_trans_for); list_enumerate(transient_list, list_item) { Client *cur = (Client *)list_item->data; if (flags && !(cur->flags & flags)) continue; dbg("%s() moving %s to top (trans for %s)\n", __func__, cur->name, client_trans_for ? client_trans_for->name : "NULL" ); stack_move_top(cur); } list_destroy(&transient_list); } /* returns top -> bottom */ Window* stack_get_window_list(Wm *w) { Window *win_list; Client *c; int i = 0; if (!w->stack_n_items) return NULL; win_list = malloc(sizeof(Window)*(w->stack_n_items+w->n_modal_blocker_wins)); dbg("%s() called, list is ", __func__); stack_enumerate_reverse(w, c) { dbg("%i:%li, ", i, c->frame); win_list[i++] = c->frame; if (c->win_modal_blocker) { dbg("%i: ,", i ); win_list[i++] = c->win_modal_blocker; } } dbg("\n"); return win_list; } /* returns the new highest wanted type */ Client* stack_cycle_forward(Wm *w, MBClientTypeEnum type_to_cycle) { Client *c = NULL; c = stack_get_highest(w, type_to_cycle); /* Move to stack bottom */ if (c) stack_move_above_client(c, NULL); /* now return the new highest */ return stack_get_highest(w, type_to_cycle); } /* returns the new highest wanted type */ Client* stack_cycle_backward(Wm *w, MBClientTypeEnum type_to_cycle) { Client *c = NULL; c = stack_get_lowest(w, type_to_cycle); if (c) stack_move_client_above_type(c, type_to_cycle); return c; } Client* stack_get_highest(Wm *w, MBClientTypeEnum wanted_type) { Client *c = NULL; stack_enumerate_reverse(w,c) if (c->type == wanted_type && c->mapped) return c; return NULL; } Client* stack_get_lowest(Wm *w, MBClientTypeEnum wanted_type) { Client *c = NULL; stack_enumerate(w,c) if (c->type == wanted_type && c->mapped) return c; return NULL; } Client* stack_get_above(Client* client_below, MBClientTypeEnum wanted_type) { Wm *w = client_below->wm; Client *c = client_below->above; if (wanted_type == MBCLIENT_TYPE_ANY) return (client_below->above) ? client_below->above : w->stack_bottom; while ( c != client_below ) { if (c == NULL) c = w->stack_bottom; if (c->type == wanted_type && c->mapped) return c; c = c->above; } return client_below; } /* Returns client_above if nothing below */ Client* stack_get_below(Client* client_above, MBClientTypeEnum wanted_type) { Wm *w = client_above->wm; Client *c = client_above->below; while ( c != client_above ) { if (c == NULL) c = w->stack_top; if (c->type == wanted_type && c->mapped) return c; c = c->below; } return client_above; } void stack_dump(Wm *w) { #ifdef DEBUG Client *c = NULL; printf("\n----------------------------------------------------------\n"); stack_enumerate_reverse(w,c) { printf("%s:: modal: %s, group: %li, geom: %ix%i+%i+%i%s\n", c->name ? c->name : "Unkown", c->flags & CLIENT_IS_MODAL_FLAG ? "yes" : "no", c->win_group, c->width, c->height, c->x, c->y, w->focused_client == c ? " [FOCUSED] " : ""); if (c->type == MBCLIENT_TYPE_DIALOG) printf(" \\ trans for '%s'\n", c->trans ? c->trans->name : "root"); } printf("\n---------------------------------------------------------\n\n"); #endif } void stack_sync_to_display(Wm *w) { /* int XRestackWindows(Display *display, Window windows[], int nwindows); The XRestackWindows function restacks the windows in the order speci- fied, from top to bottom. The stacking order of the first window in the windows array is unaffected, but the other windows in the array are stacked underneath the first window, in the order of the array. The stacking order of the other windows is not affected. For each window in the window array that is not a child of the specified window, a Bad- Match error results. */ Window *win_list = stack_get_window_list(w); if (win_list) { misc_trap_xerrors(); XRestackWindows(w->dpy, win_list, w->stack_n_items + w->n_modal_blocker_wins); free(win_list); misc_untrap_xerrors(); } } #if STACK_STUFF_DEPRECIATED void stack_add_below_client(Client *client, Client *client_above); void stack_move_type_below_client(MBClientTypeEnum wanted_type, Client *client); void stack_move_below_type(Client *client, int type, int flags); void stack_move_below_client(Client *client, Client *client_above); void stack_update_transients(Client *client, Client *client_below); void stack_move_above_extended(Client *client, Client *client_below, int type, int flags); void stack_add_below_client(Client *client, Client *client_above) { Wm *w = client->wm; if (client_above == NULL) { /* nothing above raising to top */ if (w->stack_top) { client->below = w->stack_top; w->stack_top->below = client; } w->stack_top = client; } else { client->above = client_above; client->below = client_above->below; if (client_above->below) client_above->below->above = client; client_above->below = client; } if (client_above == w->stack_bottom) w->stack_bottom = client; w->stack_n_items++; } void stack_move_type_below_client(MBClientTypeEnum wanted_type, Client *client) { Wm *w = client->wm; Client *c = NULL; stack_enumerate_reverse(w,c) if ((c->type & wanted_type) && c->mapped) stack_move_below_client(c, client); } void stack_move_below_client(Client *client, Client *client_above) { if (client == client_above) return; stack_remove(client); stack_add_below_client(client, client_above); /* must move any transients too */ } void /* XXX needed ? should sync with above */ stack_move_below_type(Client *client, int type, int flags) { Wm *w = client->wm; Client *client_above = NULL, *client_cur; stack_enumerate_reverse(w, client_cur) { if (client_cur->type == type) { if (flags) { if (client_cur->flags & flags) client_above = client_cur; } else client_above = client_cur; } } if (client_above) /* TODO: what if this is NULL ?? */ stack_move_below_client(client, client_above); /* must move any transients too */ } void stack_update_transients(Client *client, Client *client_below) { Wm *w = client->wm; Client *client_cur; stack_enumerate_transients(w,client_cur,client) { stack_move_above_client(client_cur, client); } stack_enumerate_transients(w,client_cur,client_below) { stack_move_below_client(client_cur, client); } } void stack_move_above_extended(Client *client, Client *client_below, int type, int flags) { Wm *w = client->wm; Client *client_found_below = NULL, *client_cur; if (client_below == NULL) client_below = w->stack_bottom; else client_below = client_below->above; for (client_cur = client_below; client_cur; client_cur = client_cur->above) { if (client_cur->type & type) { if (flags) { if (client_cur->flags & flags) client_found_below = client_cur; } else client_found_below = client_cur; } } if (client_found_below) /* TODO: what if this is NULL ?? */ { dbg("%s() moving %s just above %s\n", __func__, client->name, client_found_below->name); stack_move_above_client(client, client_found_below); } } #endif #if 0 /* Test bits for stack */ int main(int argc, char **argv) { Wm *w; int i = 0; Client *c, *midc, *midc2; w = malloc(sizeof(Wm)); memset(w, 0, sizeof(Wm)); for (i=0; i<10; i++) { char buf[64]; sprintf(buf, "Client-%i", i); c = client_new(w, buf); stack_append_top(c); if (i == 5) midc = c; if (i == 6) midc2 = c; } printf("w->stack_top : %s, next %p w->stack_bottom : %s, prev %p\n", w->stack_top->name, w->stack_top->above, w->stack_bottom->name, w->stack_bottom->below); stack_move_below_client(w->stack_top, w->stack_bottom); stack_move_above_client(w->stack_bottom, w->stack_top); printf("w->stack_top : %s, next %p w->stack_bottom : %s, prev %p\n", w->stack_top->name, w->stack_top->above, w->stack_bottom->name, w->stack_bottom->below); stack_enumerate(w,c) { printf("%s\n", c->name); } printf("\n"); printf("\n"); stack_remove(w->stack_top); stack_remove(w->stack_bottom); stack_enumerate(w,c) { printf("%s\n", c->name); } stack_move_below_client(w->stack_top, w->stack_bottom); stack_move_above_client(midc, midc2); printf("\n"); stack_enumerate(w,c) { printf("%s\n", c->name); } } #endif matchbox-window-manager-1.2/matchbox-window-manager/src/keys.h0000664000211500234210000000210011307441355023372 0ustar bifh1bifhs/* * Matchbox Window Manager - A lightweight window manager not for the * desktop. * * Authored By Matthew Allum * * Copyright (c) 2002, 2004 OpenedHand Ltd - http://o-hand.com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #ifndef _MB_KEYS_H_ #define _MB_KEYS_H_ #ifndef NO_KBD #include "structs.h" #include "misc.h" Bool keys_add_entry(Wm *w, char *keysstr, int action, int idata, char *sdata) ; Bool keys_load_config(Wm *w); void keys_get_modifiers(Wm *w); void keys_reinit(Wm *w); void keys_init(Wm *w); void keys_grab(Wm *w, Bool want_ungrab); #endif #endif matchbox-window-manager-1.2/matchbox-window-manager/src/toolbar_client.c0000664000211500234210000002452311307441355025427 0ustar bifh1bifhs/* * Matchbox Window Manager - A lightweight window manager not for the * desktop. * * Authored By Matthew Allum * * Copyright (c) 2002, 2004 OpenedHand Ltd - http://o-hand.com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ /* Toolbar windows are small collapsable 'panel' like windows at bottom * of display. They are mainly to hold input methods like software keyboards * stroke recognisers etc. */ #include "toolbar_client.h" #ifndef USE_ALT_INPUT_WIN Client* toolbar_client_new(Wm *w, Window win) { Client *c = base_client_new(w, win); if (!c) return NULL; /* If theres not room for the toolbar, just make it an app window */ /* In practise one would expect this to never happen */ if ((c->height) > w->dpy_height - (theme_frame_defined_height_get(w->mbtheme, FRAME_MAIN)*2) ) { dbg("%s() not enough room for toolbar client\n", __func__); base_client_destroy(c); return main_client_new(w, win); } c->type = MBCLIENT_TYPE_TOOLBAR; c->configure = &toolbar_client_configure; c->reparent = &toolbar_client_reparent; c->button_press = &toolbar_client_button_press; c->redraw = &toolbar_client_redraw; c->hide = &toolbar_client_hide; c->iconize = &toolbar_client_hide; c->show = &toolbar_client_show; c->move_resize = &toolbar_client_move_resize; c->get_coverage = &toolbar_client_get_coverage; c->destroy = &toolbar_client_destroy; client_set_state(c,WithdrawnState); /* set initially to signal show() */ return c; } void toolbar_client_configure(Client *c) { Wm *w = c->wm; if (c->flags & CLIENT_IS_MINIMIZED) return; c->y = w->dpy_height - wm_get_offsets_size(w, SOUTH, c, True) - c->height; c->x = toolbar_win_offset(c) + wm_get_offsets_size(w, WEST, NULL, False); c->width = w->dpy_width - toolbar_win_offset(c) - wm_get_offsets_size(w, WEST, NULL, False) - wm_get_offsets_size(w, EAST, NULL, False); } void toolbar_client_move_resize(Client *c) { Wm *w = c->wm; int max_offset = theme_frame_defined_width_get(w->mbtheme, FRAME_UTILITY_MAX); int min_offset = theme_frame_defined_height_get(w->mbtheme, FRAME_UTILITY_MIN); int offset = toolbar_win_offset(c); base_client_move_resize(c); if (!(c->flags & CLIENT_IS_MINIMIZED)) { if (c->flags & CLIENT_TITLE_HIDDEN_FLAG) max_offset = 0; XResizeWindow(w->dpy, c->window, c->width, c->height); XMoveResizeWindow(w->dpy, c->frame, c->x - max_offset, c->y, c->width + max_offset, c->height ); if (client_title_frame(c)) XMoveResizeWindow(w->dpy, client_title_frame(c), 0, 0, max_offset , c->height ); } else { if (min_offset) { XMoveResizeWindow(w->dpy, c->frame, c->x, c->y, c->width + max_offset, offset ); if (client_title_frame(c)) XMoveResizeWindow(w->dpy, client_title_frame(c), 0, 0, c->width + max_offset , min_offset ); } } } void toolbar_client_reparent(Client *c) { Wm *w = c->wm; XSetWindowAttributes attr; int frm_size = theme_frame_defined_width_get(w->mbtheme, FRAME_UTILITY_MAX ); attr.override_redirect = True; attr.background_pixel = w->grey_col.pixel; attr.event_mask = ChildMask|ButtonPressMask|ExposureMask; c->frame = XCreateWindow(w->dpy, w->root, 0, c->y, w->dpy_width, c->height, 0, CopyFromParent, CopyFromParent, CopyFromParent, CWOverrideRedirect|CWEventMask|CWBackPixel, &attr); attr.background_pixel = w->grey_col.pixel; if (frm_size && !(c->flags & CLIENT_TITLE_HIDDEN_FLAG)) c->frames_decor[NORTH] = XCreateWindow(w->dpy, c->frame, 0, 0, frm_size, c->height, 0, CopyFromParent, CopyFromParent, CopyFromParent, CWOverrideRedirect|CWBackPixel|CWEventMask, &attr); XSetWindowBorderWidth(w->dpy, c->window, 0); XAddToSaveSet(w->dpy, c->window); XSelectInput(w->dpy, c->window, PropertyChangeMask); XReparentWindow(w->dpy, c->window, c->frame, toolbar_win_offset(c), 0); } void toolbar_client_show(Client *c) { Wm *w = c->wm; long win_state; c->mapped = True; if (w->stack_top_app && (w->stack_top_app->flags & CLIENT_FULLSCREEN_FLAG)) main_client_manage_toolbars_for_fullscreen(c, True); win_state = client_get_state(c); if (win_state == WithdrawnState) /* initial show() state */ { client_set_state(c,NormalState); wm_update_layout(c->wm, c, - c->height); } else if (win_state == IconicState) /* minimised, set maximised */ { client_set_state(c,NormalState); /* Make sure desktop flag is unset */ c->flags &= ~CLIENT_IS_MINIMIZED; wm_update_layout(c->wm, c, -(c->height - toolbar_win_offset(c))); if (c->flags & CLIENT_TITLE_HIDDEN_FLAG) { c->x = wm_get_offsets_size(c->wm, WEST, NULL, False); } else { c->x = theme_frame_defined_width_get(w->mbtheme, FRAME_UTILITY_MAX ) + wm_get_offsets_size(c->wm, WEST, NULL, False); c->y = c->y - ( c->height - toolbar_win_offset(c)); } /* destroy buttons so they get recreated ok */ client_buttons_delete_all(c); toolbar_client_move_resize(c); toolbar_client_redraw(c, False); } stack_move_client_above_type(c, MBCLIENT_TYPE_APP|MBCLIENT_TYPE_DESKTOP); XMapSubwindows(w->dpy, c->frame); XMapWindow(w->dpy, c->frame); comp_engine_client_show(w, c); } void toolbar_client_hide(Client *c) { Wm *w = c->wm; if (c->flags & CLIENT_IS_MINIMIZED || client_get_state(c) == IconicState) return; client_set_state(c,IconicState); c->flags |= CLIENT_IS_MINIMIZED; c->ignore_unmap++; XUnmapWindow(w->dpy, c->window); if (c->flags & CLIENT_TITLE_HIDDEN_FLAG) { XUnmapWindow(w->dpy, c->frame); } else { client_buttons_delete_all(c); c->x = wm_get_offsets_size(c->wm, WEST, NULL, False); c->y = c->y + c->height - theme_frame_defined_height_get(c->wm->mbtheme, FRAME_UTILITY_MIN); } toolbar_client_move_resize(c); toolbar_client_redraw(c, False); dbg("hiding toolbar y is now %i", c->y); wm_update_layout(c->wm, c, c->height - toolbar_win_offset(c)); } void toolbar_client_destroy(Client *c) { Wm *w = c->wm; dbg("%s() called\n", __func__); c->mapped = False; /* Setting mapped to false will allow the dialog resizing/repositioning via restack to ignore use */ if (c->x == theme_frame_defined_width_get(w->mbtheme, FRAME_UTILITY_MAX ) || (c->flags & CLIENT_TITLE_HIDDEN_FLAG) ) { wm_update_layout(w, c, c->height); } else { wm_update_layout(w, c, theme_frame_defined_height_get(w->mbtheme, FRAME_UTILITY_MIN)); } base_client_destroy(c); } void toolbar_client_get_coverage(Client *c, int *x, int *y, int *w, int *h) { *x = c->x; *y = c->y; *w = c->width + toolbar_win_offset(c); if (!(c->flags & CLIENT_IS_MINIMIZED)) { *x = c->x - toolbar_win_offset(c); *h = c->height; } else { *h = toolbar_win_offset(c); } } void toolbar_client_button_press(Client *c, XButtonEvent *e) { Wm *w = c->wm; int frame_id, cw, ch; int max_offset = theme_frame_defined_width_get(w->mbtheme, FRAME_UTILITY_MAX); int min_offset = theme_frame_defined_height_get(w->mbtheme, FRAME_UTILITY_MIN); if (!(c->flags & CLIENT_IS_MINIMIZED)) { frame_id = FRAME_UTILITY_MAX; cw = max_offset; ch = c->height; } else { frame_id = FRAME_UTILITY_MIN; cw = c->width + max_offset; ch = min_offset; } switch (client_button_do_ops(c, e, frame_id, cw, ch)) { case BUTTON_ACTION_CLOSE: client_deliver_delete(c); break; case BUTTON_ACTION_MIN: toolbar_client_hide(c); break; case BUTTON_ACTION_MAX: toolbar_client_show(c); break; case -1: /* Cancelled */ break; case 0: /* Not on button */ break; } } int toolbar_win_offset(Client *c) { if (c->flags & CLIENT_TITLE_HIDDEN_FLAG) { dbg("return 0\n"); return 0; } if (c->flags & CLIENT_IS_MINIMIZED) { return theme_frame_defined_height_get(c->wm->mbtheme, FRAME_UTILITY_MIN); } else { return theme_frame_defined_width_get(c->wm->mbtheme, FRAME_UTILITY_MAX); } } void toolbar_client_redraw(Client *c, Bool use_cache) { Wm *w = c->wm; int max_offset = theme_frame_defined_width_get(w->mbtheme, FRAME_UTILITY_MAX); int min_offset = theme_frame_defined_height_get(w->mbtheme, FRAME_UTILITY_MIN); comp_engine_client_show(w, c); if (c->flags & CLIENT_TITLE_HIDDEN_FLAG) return; if (use_cache) return; client_buttons_delete_all(c); if (c->flags & CLIENT_IS_MINIMIZED) { if (!min_offset) return; theme_frame_paint(w->mbtheme, c, FRAME_UTILITY_MIN, c->width + max_offset, min_offset); theme_frame_button_paint(w->mbtheme, c, BUTTON_ACTION_CLOSE, INACTIVE, FRAME_UTILITY_MIN, c->width + max_offset, min_offset); theme_frame_button_paint(w->mbtheme, c, BUTTON_ACTION_MAX, INACTIVE, FRAME_UTILITY_MIN, c->width + max_offset, min_offset); } else { if (!max_offset) return; theme_frame_paint( w->mbtheme, c, FRAME_UTILITY_MAX, max_offset, c->height); dbg("%s() painting close button\n", __func__); theme_frame_button_paint(w->mbtheme, c, BUTTON_ACTION_CLOSE, INACTIVE, FRAME_UTILITY_MAX, max_offset, c->height); dbg("%s() painting min button\n", __func__); theme_frame_button_paint(w->mbtheme, c, BUTTON_ACTION_MIN, INACTIVE, FRAME_UTILITY_MAX, max_offset, c->height); } } #endif /* USE_ALT_INPUT_WIN */ matchbox-window-manager-1.2/matchbox-window-manager/src/client_common.c0000664000211500234210000004741211307441355025257 0ustar bifh1bifhs/* * Matchbox Window Manager - A lightweight window manager not for the * desktop. * * Authored By Matthew Allum * * Copyright (c) 2002, 2004 OpenedHand Ltd - http://o-hand.com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #include "client_common.h" /* Common functions for use by all client types */ void client_set_state(Client *c, int state) { Wm *w = c->wm; CARD32 data[2]; data[0] = state; data[1] = None; XChangeProperty(w->dpy, c->window, w->atoms[WM_STATE], w->atoms[WM_STATE], 32, PropModeReplace, (unsigned char *)data, 2); } long client_get_state(Client *c) { Wm *w = c->wm; Atom real_type; int real_format; unsigned long items_read, items_left; long *data = NULL, state = WithdrawnState; misc_trap_xerrors(); if (XGetWindowProperty(w->dpy, c->window, w->atoms[WM_STATE], 0L, 2L, False, w->atoms[WM_STATE], &real_type, &real_format, &items_read, &items_left, (unsigned char **) &data) == Success && items_read) state = *data; if (misc_untrap_xerrors()) /* Just in case */ state = WithdrawnState; if (data) XFree(data); return state; } void client_deliver_config(Client *c) { Wm *w = c->wm; XConfigureEvent ce; ce.type = ConfigureNotify; ce.event = c->window; ce.window = c->window; ce.x = c->x; ce.y = c->y; ce.width = c->width; ce.height = c->height; ce.border_width = 0; ce.above = None; ce.override_redirect = 0; dbg("%s() to %s x: %i , y: %i w: %i h: %i \n", __func__, c->name, ce.x, ce.y, ce.width, ce.height); XSendEvent(w->dpy, c->window, False, StructureNotifyMask, (XEvent *)&ce); } void client_deliver_wm_protocol(Client *c, Atom delivery) { Wm *w = c->wm; client_deliver_message(c, w->atoms[WM_PROTOCOLS], delivery, CurrentTime, 0, 0, 0); } void client_get_wm_protocols(Client *c) { Atom *protocols = NULL; int n = 0, i = 0; Status status; /* Check for 'special' extra button/ping protocols */ misc_trap_xerrors(); status = XGetWMProtocols(c->wm->dpy, c->window, &protocols, &n); if (status && n && !misc_untrap_xerrors()) { dbg("%s() checking wm protocols ( %i found )\n", __func__, n); c->flags &= ~(CLIENT_HELP_BUTTON_FLAG|CLIENT_ACCEPT_BUTTON_FLAG|CLIENT_CUSTOM_BUTTON_FLAG); for (i=0; iwm->atoms[_NET_WM_CONTEXT_HELP]) { dbg("%s() got _NET_WM_CONTEXT_HELP protocol\n", __func__ ); c->flags |= CLIENT_HELP_BUTTON_FLAG; } else if (protocols[i] == c->wm->atoms[_NET_WM_CONTEXT_ACCEPT]) { dbg("%s() got _NET_WM_CONTEXT_ACCEPT protocol\n", __func__ ); c->flags |= CLIENT_ACCEPT_BUTTON_FLAG; } else if (protocols[i] == c->wm->atoms[_NET_WM_CONTEXT_CUSTOM]) { dbg("%s() got _NET_WM_CONTEXT_CUSTOM protocol\n", __func__ ); c->flags |= CLIENT_CUSTOM_BUTTON_FLAG; } #ifndef NO_PNG else if (protocols[i] == c->wm->atoms[_NET_WM_PING] && c->host_machine && c->pid) { dbg("%s() has PING ewmh\n", __func__); c->has_ping_protocol = True; } #endif #ifdef USE_XSYNC else if (protocols[i] == c->wm->atoms[_NET_WM_SYNC_REQUEST]) { c->has_ewmh_sync = True; dbg("%s() client has _NET_WM_SYNC_REQUEST\n", __func__); } #endif } } if (protocols) XFree(protocols); } void client_deliver_message(Client *c, Atom delivery_atom, unsigned long data0, unsigned long data1, unsigned long data2, unsigned long data3, unsigned long data4) { Wm *w = c->wm; XEvent ev; memset(&ev, 0, sizeof(ev)); ev.xclient.type = ClientMessage; ev.xclient.window = c->window; ev.xclient.message_type = delivery_atom; ev.xclient.format = 32; ev.xclient.data.l[0] = data0; ev.xclient.data.l[1] = data1; ev.xclient.data.l[2] = data2; ev.xclient.data.l[3] = data3; ev.xclient.data.l[4] = data4; XSendEvent(w->dpy, c->window, False, NoEventMask, &ev); XSync(w->dpy, False); } /* 'Really' kill an app if it gives us enough info */ Bool client_obliterate(Client *c) { char buf[257]; int sig = 9; if (c->host_machine == NULL || !c->pid) return False; if (gethostname (buf, sizeof(buf)-1) == 0) { if (!strcmp (buf, c->host_machine)) { if (kill (c->pid, sig) < 0) { fprintf(stderr, "matchbox: kill %i on %s failed.\n", sig, c->name); return False; } } else return False; /* on a different host */ } else { fprintf(stderr, "matchbox: gethostname failed\n"); return False; } return True; } void client_deliver_delete(Client *c) { Wm *w = c->wm; int i, n, found = 0; Atom *protocols; if (XGetWMProtocols(w->dpy, c->window, &protocols, &n)) { for (i=0; iatoms[WM_DELETE_WINDOW]) found++; XFree(protocols); } /* Initiate pinging the app - to really kill hung applications */ if (c->has_ping_protocol && c->pings_pending == -1) { ewmh_ping_client_start (c); } if (found) client_deliver_wm_protocol(c, w->atoms[WM_DELETE_WINDOW]); else { if (!client_obliterate(c)) XKillClient(w->dpy, c->window); } } int client_want_focus(Client *c) { Wm *w = c->wm; int ret = 1; XWMHints *hints = NULL; misc_trap_xerrors(); hints = XGetWMHints(w->dpy, c->window); /* TODO: Oddly the above will sometimes fire an X Error, yet hints get set. * Check this. */ if (misc_untrap_xerrors()) { dbg("%s() called, gave X Error for %s but going to focus it anyway\n", __func__, c->name); } if (hints != NULL) { if ((hints->flags & InputHint) && (hints->input == False)) ret = 0; XFree(hints); } return ret; } Bool client_set_focus(Client *c) { Wm *w; if (!c) return False; w = c->wm; dbg("%s() called, checking if %s wants focus\n", __func__, c->name); if (client_want_focus(c)) { if (w->focused_client == c) return True; misc_trap_xerrors(); XSetInputFocus(w->dpy, c->window, RevertToPointerRoot, CurrentTime); /* TODO: - Should we handle WM_TAKE_FOCUS ? * - Handle focs in/out message on root ? */ /* Rememeber what was focused last */ if (w->focused_client) { Client *trans_old = w->focused_client; Client *trans_new = c; while (trans_old->trans != NULL) trans_old = trans_old->trans; while (trans_new->trans != NULL) trans_new = trans_new->trans; /* Are we both transient for the same thing */ if (trans_new && trans_old && trans_new == trans_old) c->next_focused_client = w->focused_client; /* From regular dialog to transient for root dialogs */ if (w->focused_client->type == MBCLIENT_TYPE_DIALOG && c->type == MBCLIENT_TYPE_DIALOG && c->trans == NULL) c->next_focused_client = w->focused_client; } if (misc_untrap_xerrors()) { w->focused_client = NULL; } else w->focused_client = c; dbg("%s() called, setting focus to %s\n", __func__, c->name); ewmh_set_active(w); return True; } return False; } void client_get_transient_list(Wm *w, MBList **list, Client *c) { Client *p = NULL; stack_enumerate(w,p) { if (p != c && p->type == MBCLIENT_TYPE_DIALOG) { Client *trans = p->trans; dbg("%s() checking <%s> trans for <%s>\n", __func__, p->name, trans ? trans->name : "nothing"); if (c == NULL) { /* Transient for root dialogs */ if (trans == NULL) { list_add(list, NULL, 0, p); } else { /* The dialog isn't transient for root directly * but possibly one of its transient parents are */ while (trans->trans != NULL) trans = trans->trans; /* trans is now transient for nothing * so if its a dialog add it. */ if (trans->type == MBCLIENT_TYPE_DIALOG) list_add(list, NULL, 0, p); } } else { /* Follow transients 'down', for a match. */ while (trans != NULL && trans != c) trans = trans->trans; if (trans == c) { list_add(list, NULL, 0, p); } else if (p->trans && c->win_group && (c->type == MBCLIENT_TYPE_APP || c->type == MBCLIENT_TYPE_DESKTOP)) { /* Handle window groups and transiency. * App windows with matchbox window groups * 'share' transients */ trans = p->trans; while (trans->trans != NULL) trans = trans->trans; if ((trans->type == MBCLIENT_TYPE_APP || trans->type == MBCLIENT_TYPE_DESKTOP) && trans->win_group == c->win_group) list_add(list, NULL, 0, p); } } } } } static Client* client_get_highest_transient_recurse (Client *c, int client_flags, Client *ignore, int *depth) { Wm *w = c->wm; Client *p = NULL; Client *highest = c, *tmp; int this_depth = 0, max_depth = 0; /* FIXME: its likely this can be combined into * client_get_highest_transient() somehow.. */ stack_enumerate(w,p) { if (p != c && p->trans && p->trans == c && p != ignore) { if (client_flags && !(p->flags & client_flags)) continue; this_depth++; tmp = client_get_highest_transient_recurse(p, client_flags, ignore, &this_depth); if (this_depth > max_depth) { max_depth = this_depth; highest = tmp; } } } *depth += max_depth; return highest; } Client* client_get_highest_transient(Client *c, int client_flags, Client *ignore) { Wm *w = c->wm; Client *p = NULL; Client *highest = c, *tmp; int depth = 0, depth_max = 0; stack_enumerate(w,p) { if (p != c && p->trans && p->trans == c && p != ignore) { depth = 0; if (client_flags && !(p->flags & client_flags)) continue; /* Recurse for each directly transient client, getting the depth * for any extra matchbox children. */ tmp = client_get_highest_transient_recurse (p, client_flags, ignore, &depth); if (depth >= depth_max) { highest = tmp; depth_max = depth; } } } return highest; } void client_decor_frames_move_resize(Client *c, int width_west, int width_east, int height_north, int height_south) { Wm *w = c->wm; if (c->frames_decor[NORTH] && height_north > 0) XMoveResizeWindow(w->dpy, c->frames_decor[NORTH], 0, 0, c->width + width_east + width_west, height_north); if (c->frames_decor[SOUTH]) XMoveResizeWindow(w->dpy, c->frames_decor[SOUTH], 0, height_north + c->height, c->width + width_east + width_west, height_south); if (c->frames_decor[EAST]) XMoveResizeWindow(w->dpy, c->frames_decor[EAST], c->width + width_west, height_north, width_east, c->height); if (c->frames_decor[WEST]) XMoveResizeWindow(w->dpy, c->frames_decor[WEST], 0, height_north, width_west, c->height); } void client_decor_frames_init(Client *c, int width_west, int width_east, int height_north, int height_south) { Wm *w = c->wm; XSetWindowAttributes attr; int i; for(i=0; iframes_decor[i] != None) { XDestroyWindow(w->dpy, c->frames_decor[i]); c->frames_decor[i] = None; } attr.override_redirect = True; attr.background_pixel = w->grey_col.pixel; attr.event_mask = ButtonMask; if (height_north > 0) c->frames_decor[NORTH] = XCreateWindow(w->dpy, c->frame, 0, 0, c->width + width_east + width_west, height_north, 0, CopyFromParent, CopyFromParent, CopyFromParent, CWBackPixel|CWEventMask, &attr); if (width_east > 0) c->frames_decor[EAST] = XCreateWindow(w->dpy, c->frame, c->width + width_west, height_north, width_east, c->height, 0, CopyFromParent, CopyFromParent, CopyFromParent, CWBackPixel, &attr); if (width_west > 0) c->frames_decor[WEST] = XCreateWindow(w->dpy, c->frame, 0, height_north, width_west, c->height, 0, CopyFromParent, CopyFromParent, CopyFromParent, CWBackPixel, &attr); if (height_south > 0) c->frames_decor[SOUTH] = XCreateWindow(w->dpy, c->frame, 0, c->height + height_north, c->width + width_east + width_west, height_south, 0, CopyFromParent, CopyFromParent, CopyFromParent, CWBackPixel, &attr); } /* Create masks used for shaped decorations */ void client_init_backing_mask (Client *c, int width, int height, int height_north, int height_south, int width_east, int width_west ) { Wm *w = c->wm; GC shape_gc; int i = 0; for (i=0; ibacking_masks[i] != None) XFreePixmap(w->dpy, c->backing_masks[i]); c->backing_masks[MSK_NORTH] = XCreatePixmap(w->dpy, w->root, width, height_north, 1); shape_gc = XCreateGC( w->dpy, c->backing_masks[MSK_NORTH], 0, 0 ); XSetForeground(w->dpy, shape_gc, WhitePixel( w->dpy, w->screen )); XFillRectangle(w->dpy, c->backing_masks[MSK_NORTH], shape_gc, 0, 0, width, height_north); if (height_south) { c->backing_masks[MSK_SOUTH] = XCreatePixmap(w->dpy, w->root, width, height_south, 1); XFillRectangle(w->dpy, c->backing_masks[MSK_SOUTH], shape_gc, 0, 0, width, height_south); } if (width_east) { c->backing_masks[MSK_EAST] = XCreatePixmap(w->dpy, w->root, width_east, height, 1); XFillRectangle(w->dpy, c->backing_masks[MSK_EAST], shape_gc, 0, 0, width_east, height); } if (width_west) { c->backing_masks[MSK_WEST] = XCreatePixmap(w->dpy, w->root, width_west, height, 1); XFillRectangle(w->dpy, c->backing_masks[MSK_WEST], shape_gc, 0, 0, width_west, height); } XFreeGC(w->dpy, shape_gc); } void client_button_init(Client *c, Window win_parent, MBClientButton *b, int x, int y, int width, int height, Bool want_inputonly, void *data) { Wm *w = c->wm; int class = CopyFromParent; XSetWindowAttributes attr; attr.override_redirect = True; attr.event_mask = ExposureMask; if (want_inputonly ) class = InputOnly; b->x = x; b->y = y; b->w = width; b->h = height; b->data = data; b->win = XCreateWindow(w->dpy, win_parent, x, y, width, height, 0, CopyFromParent, class, CopyFromParent, CWOverrideRedirect|CWEventMask, &attr); XMapWindow(w->dpy, b->win); } MBClientButton* client_button_new(Client *c, Window win_parent, int x, int y, int width, int height, Bool want_inputonly, void *data ) { MBClientButton *b = malloc(sizeof(MBClientButton)); memset(b, 0, sizeof(MBClientButton)); client_button_init(c, win_parent, b, x, y, width, height, want_inputonly, data); return b; } void client_button_remove(Client *c, int button_action) { Wm *w = c->wm; struct list_item *l = c->buttons; MBClientButton *b = NULL; while (l != NULL) { if (l->id == button_action) { b = (MBClientButton *)l->data; dbg("%s() destroying a button ( %li ) for %s\n", __func__, b->win, c->name); XDestroyWindow(w->dpy, b->win); b->win = None; } l = l->next; } } void client_buttons_delete_all(Client *c) { Wm *w = c->wm; struct list_item *l = c->buttons, *p = NULL; MBClientButton *b = NULL; while (l != NULL) { b = (MBClientButton *)l->data; dbg("%s() destroying a button\n", __func__); if (b->win != None) XDestroyWindow(w->dpy, b->win); free(b); p = l->next; free(l); l = p; } c->buttons = NULL; } MBClientButton* client_get_button_from_event(Client *c, XButtonEvent *e) { struct list_item *l = c->buttons; MBClientButton *b = NULL; while (l != NULL) { b = (MBClientButton *)l->data; if (b->win == e->subwindow) { return b; } l = l->next; } return NULL; } struct list_item* client_get_button_list_item_from_event(Client *c, XButtonEvent *e) { struct list_item *l = c->buttons; MBClientButton *b = NULL; while (l != NULL) { b = (MBClientButton *)l->data; if (b->win == e->subwindow) { return l; } l = l->next; } return NULL; } int client_button_do_ops(Client *c, XButtonEvent *e, int frame_type, int width, int height) { Wm *w = c->wm; int button_action; struct list_item *button_item = NULL; MBClientButton *b = NULL; XEvent ev; if ((button_item = client_get_button_list_item_from_event(c, e)) != NULL && button_item->id != -1 ) { /* XXX hack hack hack - stop dubious 'invisible' text menu button working when it shouldn't..... */ if (frame_type == FRAME_MAIN && w->flags & SINGLE_FLAG && button_item->id == BUTTON_ACTION_MENU && ( !wm_get_desktop(c->wm) || w->flags & DESKTOP_DECOR_FLAG)) return -1; b = (MBClientButton *)button_item->data; if (b->press_activates) { XUngrabPointer(w->dpy, CurrentTime); client_deliver_message(c, w->atoms[MB_GRAB_TRANSFER], e->time, e->subwindow, e->button, 0, 0); return button_item->id; } if (XGrabPointer(w->dpy, e->subwindow, False, ButtonPressMask|ButtonReleaseMask| PointerMotionMask|EnterWindowMask|LeaveWindowMask, GrabModeAsync, GrabModeAsync, None, w->curs, CurrentTime) == GrabSuccess) { Bool canceled = False; button_action = button_item->id; theme_frame_button_paint(w->mbtheme, c, button_action, ACTIVE, frame_type, width, height); comp_engine_client_repair (c->wm, c); comp_engine_render(c->wm, w->all_damage); for (;;) { XMaskEvent(w->dpy, ButtonPressMask|ButtonReleaseMask| PointerMotionMask|EnterWindowMask|LeaveWindowMask , &ev); switch (ev.type) { case MotionNotify: break; case EnterNotify: theme_frame_button_paint(w->mbtheme, c, button_action, ACTIVE, frame_type, width, height ); comp_engine_client_repair (c->wm, c); comp_engine_render(c->wm, w->all_damage); canceled = False; break; case LeaveNotify: theme_frame_button_paint(w->mbtheme, c, button_action, INACTIVE,frame_type, width, height); comp_engine_client_repair (c->wm, c); comp_engine_render(c->wm, w->all_damage); canceled = True; break; case ButtonRelease: theme_frame_button_paint(w->mbtheme, c, button_action, INACTIVE,frame_type, width, height); XUngrabPointer(w->dpy, CurrentTime); if (!canceled) { return button_action; } else return -1; /* cancelled */ } #ifdef USE_COMPOSITE if (w->all_damage) { dbg("%s() adding damage\n", __func__); comp_engine_render(c->wm, w->all_damage); XFixesDestroyRegion (w->dpy, w->all_damage); w->all_damage = None; } #endif } } } return 0; } matchbox-window-manager-1.2/matchbox-window-manager/src/mbtheme-standalone.c0000664000211500234210000005463411307441355026204 0ustar bifh1bifhs/* * Matchbox Window Manager - A lightweight window manager not for the * desktop. * * Authored By Matthew Allum * * Copyright (c) 2002, 2004 OpenedHand Ltd - http://o-hand.com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #include "mbtheme-standalone.h" #ifdef USE_PANGO #error Standalone builds do not currently support Pango. #endif #define BUTTON_CROSS 1 #define BUTTON_ARROW 2 typedef struct MBMiniDrawable { Pixmap pxm; #ifdef USE_XFT XftDraw *xftdraw; #endif } MBMiniDrawable; /* Simple font abstraction - previously in font.c*/ #ifdef USE_XFT Bool font_load (Wm *w, char *spec, XftFont **font) #else Bool font_load (Wm *w, char *spec, XFontStruct **font) #endif { const char delim[] = "|"; char *orig = NULL, *str = NULL, *token = NULL; orig = str = strdup(spec); while( (token = strsep (&str, delim)) != NULL ) { #ifdef USE_XFT if ((*font = XftFontOpenName(w->dpy, w->screen, token)) != NULL) { if (orig) free(orig); return True; } #else if ((*font = XLoadQueryFont(w->dpy, token)) != NULL) { if (orig) free(orig); return True; } #endif } if (orig) free(orig); fprintf(stderr, "Matchbox: *warning* unable to load font : %s\n", spec); return False; } #ifdef USE_XFT void font_paint (Wm *w, XftDraw *drawable, XftColor *color, XftFont *font, unsigned char *text, int text_len, Bool text_is_utf8, int x, int y) #else void font_paint (Wm *w, Drawable drawable, XColor *color, XFontStruct *font, GC gc, unsigned char *text, int text_len, int x, int y) #endif { #ifdef USE_XFT if (text_is_utf8) XftDrawStringUtf8(drawable, color, font, x, y, text, ewmh_utf8_get_byte_cnt(text, text_len)); else XftDrawString8(drawable, color, font, x, y, text, text_len); #else XSetFont(w->dpy, gc, font->fid); XSetForeground(w->dpy, gc, color->pixel); XDrawString(w->dpy, drawable, gc, x, y, text, text_len); #endif } #ifdef USE_XFT int font_get_str_width (Wm *w, XftFont *font, unsigned char *text, int text_len, Bool text_is_utf8) #else int font_get_str_width (Wm *w, XFontStruct *font, unsigned char *text, int text_len, Bool text_is_utf8) #endif { #ifdef USE_XFT XGlyphInfo extents; if (text_is_utf8) XftTextExtentsUtf8(w->dpy, font, (unsigned char *)text, ewmh_utf8_get_byte_cnt(text, text_len), &extents); else XftTextExtents8(w->dpy, font, (unsigned char *)text, text_len, &extents); return extents.width; #else return XTextWidth(font, text, text_len); #endif } static void _draw_button(MBTheme *theme, Drawable drw, int type, int size, int state) { Pixmap pxm_backing; dbg("%s() called \n", __func__); pxm_backing = XCreatePixmap(theme->wm->dpy, theme->wm->root, size, size, DefaultDepth(theme->wm->dpy, theme->wm->screen)); /* Draw button background */ XSetForeground(theme->wm->dpy, theme->gc, theme->col_fg.pixel); XFillRectangle(theme->wm->dpy, pxm_backing, theme->gc, 0, 0, size, size); XSetLineAttributes(theme->wm->dpy, theme->gc, THEME_LINE_WIDTH, LineSolid, CapRound, JoinRound); if (state == ACTIVE) XSetForeground(theme->wm->dpy, theme->gc, BlackPixel(theme->wm->dpy, theme->wm->screen)); else XSetForeground(theme->wm->dpy, theme->gc, theme->col_text.pixel); if (type == BUTTON_CROSS) { size--; XDrawLine(theme->wm->dpy, pxm_backing, theme->gc, 0, 0, size, size); XDrawLine(theme->wm->dpy, pxm_backing, theme->gc, size, 0, 0, size); } else { int i; for (i=0; i<6; i++) { XFillRectangle(theme->wm->dpy, pxm_backing, theme->gc, i, i+2, size-(2*i), 1); } } XSetWindowBackgroundPixmap(theme->wm->dpy, drw, pxm_backing); XClearWindow(theme->wm->dpy, drw); XFlush(theme->wm->dpy); XFreePixmap(theme->wm->dpy, pxm_backing); } void theme_paint_rgba_icon(MBTheme *t, Client *c, Drawable drw, int x, int y, int *data) { return; } Bool theme_frame_wants_shaped_window( MBTheme *theme, int frame_type) { return False; } Bool theme_frame_supports_button_type(MBTheme *theme, int frame_type, int button_type) { return True; /* XXX THIS ISN'T RIGHT */ } int theme_frame_defined_width_get( MBTheme *theme, int frame_type ) { if (frame_type == FRAME_UTILITY_MAX) return FRAME_TOOLBAR_MAX_SIZE; if (frame_type == FRAME_DIALOG_EAST || frame_type == FRAME_DIALOG_WEST || frame_type == FRAME_MAIN_EAST || frame_type == FRAME_MAIN_WEST) return FRAME_DIALOG_BORDER_SIZE; return 0; } int theme_frame_defined_height_get( MBTheme *theme, int frame_type ) { switch (frame_type) { case FRAME_MAIN: return FRAME_MAIN_HEIGHT; case FRAME_DIALOG: return FRAME_DIALOG_HEIGHT; case FRAME_UTILITY_MIN: return FRAME_TOOLBAR_MIN_SIZE; case FRAME_DIALOG_SOUTH: case FRAME_DIALOG_NORTH: case FRAME_MAIN_SOUTH: return FRAME_DIALOG_BORDER_SIZE; } return 0; } Bool theme_has_frame_type_defined (MBTheme *theme, int frame_type) { switch (frame_type) { case FRAME_MAIN: case FRAME_MAIN_EAST: case FRAME_MAIN_WEST: case FRAME_MAIN_SOUTH: case FRAME_DIALOG: case FRAME_UTILITY_MAX: case FRAME_UTILITY_MIN: case FRAME_DIALOG_NORTH: case FRAME_DIALOG_EAST: case FRAME_DIALOG_WEST: case FRAME_DIALOG_SOUTH: return True; } return False; } void theme_img_cache_clear( MBTheme *theme, int frame_ref ) { return; } void theme_img_cache_clear_all( MBTheme *theme ) { return; } void theme_frame_button_paint(MBTheme *theme, Client *c, int action, int state, int frame_type, int dest_w, int dest_h ) { MBClientButton *button = NULL; int button_size = FRAME_MAIN_HEIGHT - 8; int button_small_size = FRAME_TOOLBAR_MAX_SIZE - 6; struct list_item* client_button_obj = c->buttons; while (client_button_obj != NULL) { if (client_button_obj->id == action) { button = (MBClientButton*)client_button_obj->data; break; } client_button_obj = client_button_obj->next; } switch(frame_type) { case FRAME_MAIN: switch (action) { case BUTTON_ACTION_CLOSE: if (button == NULL) { button = client_button_new (c, client_title_frame(c), dest_w - button_size - 4, (FRAME_MAIN_HEIGHT-button_size)/2, button_size, button_size, False, NULL ); list_add(&c->buttons, NULL, action, (void *)button); } _draw_button(theme, button->win, BUTTON_CROSS, button_size, state); break; case BUTTON_ACTION_MENU: dbg("%s() painting menu button %p\n", __func__, button ); if (button == NULL) { dbg("%s() button is NULL\n", __func__ ); button = client_button_new (c, client_title_frame(c), 4, (FRAME_MAIN_HEIGHT-button_size)/2, button_size, button_size, False, NULL ); list_add(&c->buttons, NULL, action, (void *)button); } else if (button->win == None) { /* XXX Hack, to work round desktop window issues removing the button window.. */ XSetWindowAttributes attr; attr.override_redirect = True; attr.event_mask = ExposureMask; button->win = XCreateWindow(c->wm->dpy, client_title_frame(c), 4, (FRAME_MAIN_HEIGHT-button_size)/2, button_size, button_size, 0, CopyFromParent, CopyFromParent, CopyFromParent, CWOverrideRedirect|CWEventMask, &attr); XMapWindow(c->wm->dpy, button->win); } _draw_button(theme, button->win, BUTTON_ARROW, button_size, state); dbg("%s() painting close button at %i\n", __func__, dest_w - 20 ); break; } break; case FRAME_DIALOG: if (action == BUTTON_ACTION_CLOSE) { if (button == NULL) { button = client_button_new (c, client_title_frame(c), dest_w - button_size - 4, (FRAME_MAIN_HEIGHT-button_size)/2, button_size, button_size, False, NULL ); list_add(&c->buttons, NULL, action, (void *)button); } _draw_button(theme, button->win, BUTTON_CROSS, button_size, state); } break; case FRAME_UTILITY_MAX: if (action == BUTTON_ACTION_MIN) { if (button == NULL) { button = client_button_new (c, client_title_frame(c), 2, 2, button_small_size, button_small_size, False, NULL ); list_add(&c->buttons, NULL, action, (void *)button); } _draw_button(theme, button->win, BUTTON_ARROW, button_small_size, state); dbg("%s() painting min button at %i\n", __func__, dest_w - 20 ); } break; case FRAME_UTILITY_MIN: if (action == BUTTON_ACTION_CLOSE) { if (button == NULL) { button = client_button_new (c, client_title_frame(c), dest_w - FRAME_TOOLBAR_MIN_SIZE + 2, 2, button_small_size, button_small_size, False, NULL ); list_add(&c->buttons, NULL, action, (void *)button); } _draw_button(theme, button->win, BUTTON_CROSS, button_small_size, state); dbg("%s() painting close button at %i\n", __func__, dest_w - 20 ); } else if (action == BUTTON_ACTION_MAX) { if (button == NULL) { button = client_button_new (c, client_title_frame(c), 0, 2, dest_w - FRAME_TOOLBAR_MIN_SIZE, dest_h, True, NULL ); list_add(&c->buttons, NULL, action, (void *)button); } } break; default: break; } } static void _theme_paint_pixmap_border( MBTheme *theme, Pixmap pxm_backing, int dw, int dh) { XSetForeground(theme->wm->dpy, theme->gc, BlackPixel(theme->wm->dpy, theme->wm->screen)); XFillRectangle(theme->wm->dpy, pxm_backing, theme->gc, 0, 0, dw, dh); XSetForeground(theme->wm->dpy, theme->gc, theme->col_fg_highlight.pixel); XFillRectangle(theme->wm->dpy, pxm_backing, theme->gc, 1, 1, dw-2, dh-2); XSetForeground(theme->wm->dpy, theme->gc, theme->col_fg_lowlight.pixel); XFillRectangle(theme->wm->dpy, pxm_backing, theme->gc, 2, 2, dw-3, dh-3); XSetForeground(theme->wm->dpy, theme->gc, theme->col_fg.pixel); XFillRectangle(theme->wm->dpy, pxm_backing, theme->gc, 2, 2, dw-4, dh-4); } Bool theme_frame_paint( MBTheme *theme, Client *c, int frame_ref, int dw, int dh ) { Wm *w = theme->wm; int decor_idx = 0; Pixmap pxm_backing = None; pxm_backing = XCreatePixmap(theme->wm->dpy, theme->wm->root, dw, dh, DefaultDepth(theme->wm->dpy, theme->wm->screen)); switch(frame_ref) { case FRAME_MAIN_SOUTH: case FRAME_DIALOG_SOUTH: case FRAME_MSG_SOUTH: decor_idx = SOUTH; break; case FRAME_MAIN_EAST: case FRAME_DIALOG_EAST: case FRAME_MSG_EAST: decor_idx = EAST; break; case FRAME_MAIN_WEST: case FRAME_DIALOG_WEST: case FRAME_MSG_WEST: decor_idx = WEST; break; /* FRAME_MAIN, FRAME_DIALOG, FRAME_MSG, FRAME_DIALOG_NORTH: */ default: decor_idx = NORTH; break; } if (frame_ref == FRAME_DIALOG_EAST || frame_ref == FRAME_DIALOG_WEST || frame_ref == FRAME_DIALOG_SOUTH || frame_ref == FRAME_DIALOG_NORTH || frame_ref == FRAME_MAIN_EAST || frame_ref == FRAME_MAIN_WEST || frame_ref == FRAME_MAIN_SOUTH) { XSetForeground(theme->wm->dpy, theme->gc, BlackPixel(theme->wm->dpy, theme->wm->screen)); XFillRectangle(theme->wm->dpy, pxm_backing, theme->gc, 0, 0, dw, dh); goto SetBackground; } _theme_paint_pixmap_border( theme, pxm_backing, dw, dh); if (c->name && ( frame_ref == FRAME_MAIN || frame_ref == FRAME_DIALOG || frame_ref == FRAME_UTILITY_MIN ) ) { int xoffset = 0; int tmp_w = 0, space_avail; #ifdef USE_XFT XftFont *font; XftDraw *xftdraw; #else XFontStruct* font; #endif int title_bytes = (c->name_is_utf8) ? ewmh_utf8_len(c->name) : strlen(c->name); if (frame_ref == FRAME_MAIN) xoffset = FRAME_MAIN_HEIGHT; else xoffset = 4; if (frame_ref == FRAME_UTILITY_MIN) font = theme->font_toolbar; else font = theme->font; space_avail = c->width - ( (frame_ref == FRAME_MAIN ? 2 : 1 ) * FRAME_MAIN_HEIGHT); while ((tmp_w = font_get_str_width (theme->wm, font, c->name, title_bytes, c->name_is_utf8)) > space_avail && title_bytes > 0) title_bytes--; #ifdef USE_XFT xftdraw = XftDrawCreate(w->dpy, (Drawable) pxm_backing, DefaultVisual(w->dpy, w->screen), DefaultColormap(w->dpy, w->screen)); if (xftdraw != NULL) { font_paint (theme->wm, xftdraw, &theme->xftcol, font, c->name, title_bytes, c->name_is_utf8, xoffset, font->ascent + 3); XftDrawDestroy(xftdraw); } #else font_paint (theme->wm, pxm_backing, &theme->col_text, font, theme->gc, c->name, title_bytes, xoffset, font->ascent + 2); #endif } SetBackground: XSetWindowBackgroundPixmap(w->dpy, c->frames_decor[decor_idx], pxm_backing); XClearWindow(w->dpy, c->frames_decor[decor_idx]); XSync(w->dpy, False); XFreePixmap(w->dpy, pxm_backing); return True; } static void _theme_frame_menu_paint_text_entry(MBTheme* theme, Client *c, Client *entry, MBMiniDrawable *drw, int y) { MBClientButton* button = NULL; int offset = ( 16 + theme->font->ascent ) / 2; int str_len = 0; int item_h = theme->font->ascent + theme->font->descent + MENU_ENTRY_PADDING; if (entry->name_is_utf8) str_len = ewmh_utf8_len(entry->name); else str_len = strlen(entry->name); while (font_get_str_width (theme->wm, theme->font, entry->name, str_len, entry->name_is_utf8) > c->width && str_len > 0) str_len--; #ifdef USE_XFT font_paint (theme->wm, drw->xftdraw, &theme->xftcol, theme->font, entry->name, str_len, entry->name_is_utf8, MENU_ENTRY_PADDING, y + offset); #else font_paint (theme->wm, drw->pxm, &theme->col_text, theme->font, theme->gc, entry->name, str_len, MENU_ENTRY_PADDING, y + offset); #endif /* We also create a button here */ button = client_button_new(c, c->frame, 0, y, c->width, item_h, True, (void* )entry ); list_add(&c->buttons, NULL, 0, (void *)button); } void theme_frame_menu_paint(MBTheme* theme, Client *c) { Wm *w = c->wm; Client *p; MBList *item; int item_h = 0, item_current_y = 0; MBMiniDrawable drw; item_h = theme->font->ascent + theme->font->descent + MENU_ENTRY_PADDING; /* Now render fonts */ item_current_y = 0; drw.pxm = XCreatePixmap(w->dpy, w->root, c->width, c->height, DefaultDepth(w->dpy, w->screen)); #ifdef USE_XFT drw.xftdraw = XftDrawCreate(w->dpy, (Drawable) drw.pxm, DefaultVisual(w->dpy, w->screen), DefaultColormap(w->dpy, w->screen)); #endif _theme_paint_pixmap_border( theme, drw.pxm, c->width, c->height); list_enumerate(w->client_age_list, item) { p = (Client*)item->data; if (p->type == MBCLIENT_TYPE_APP && p->name && client_get_state(p) == NormalState ) { _theme_frame_menu_paint_text_entry(theme, c, p, &drw, item_current_y); item_current_y += item_h; } } list_enumerate(w->client_age_list, item) { p = (Client*)item->data; if (p->type == MBCLIENT_TYPE_APP && p->name && client_get_state(p) == IconicState ) { _theme_frame_menu_paint_text_entry(theme, c, p, &drw, item_current_y); item_current_y += item_h; } } if ((p = wm_get_desktop(c->wm)) != NULL) { _theme_frame_menu_paint_text_entry(theme, c, p, &drw, item_current_y); } #ifdef USE_XFT XftDrawDestroy(drw.xftdraw); #endif XSetWindowBackgroundPixmap(w->dpy, c->frame, drw.pxm); XClearWindow(w->dpy, c->frame); XSync(w->dpy, False); XFreePixmap(w->dpy, drw.pxm); return; } Bool theme_frame_menu_get_dimentions(MBTheme* theme, int* w, int *h) { Client *p = NULL; int width = 0, height = 0, tmp_w = 0, str_len = 0, space_avail = 0; space_avail = theme->wm->dpy_width - 16; stack_enumerate(theme->wm, p) { if ((p->type == MBCLIENT_TYPE_APP || p->type == MBCLIENT_TYPE_DESKTOP) && p->name) { unsigned char *name = p->name; if (p->name_is_utf8) str_len = ewmh_utf8_len(p->name); else str_len = strlen(p->name); while ((tmp_w = font_get_str_width (theme->wm, theme->font, name, str_len, p->name_is_utf8)) > space_avail && str_len > 0) str_len--; tmp_w += MENU_ENTRY_PADDING; height += theme->font->ascent + theme->font->descent + MENU_ENTRY_PADDING; if (tmp_w > width) width = tmp_w; } } width += MENU_ENTRY_PADDING; *w = width; *h = height; return True; } MBTheme* mbtheme_new(Wm *w) { XGCValues gv; #ifdef USE_XFT XRenderColor colortmp; #endif MBTheme *t = (MBTheme *)malloc(sizeof(MBTheme)); memset(t, 0, sizeof(MBTheme)); t->wm = w; #ifndef STANDALONE t->have_toolbar_panel = False; #endif gv.graphics_exposures = False; gv.function = GXcopy; t->gc = XCreateGC(w->dpy, w->root, GCGraphicsExposures|GCFunction, &gv); gv.function = GXinvert; gv.subwindow_mode = IncludeInferiors; gv.line_width = 1; t->band_gc = XCreateGC(w->dpy, w->root, GCFunction|GCSubwindowMode|GCLineWidth, &gv); t->mask_gc = None; /* XXX Condense The Below XXX */ if (!XParseColor(w->dpy, DefaultColormap(w->dpy, w->screen), THEME_FG_COLOR, &t->col_fg)) { fprintf(stderr, "matchbox: failed to parse color %s\n", THEME_FG_COLOR); exit(1); } else { XAllocColor(w->dpy, DefaultColormap(w->dpy, w->screen), &t->col_fg); } if (!XParseColor(w->dpy, DefaultColormap(w->dpy, w->screen), THEME_FG_HIGHLIGHT_COLOR, &t->col_fg_highlight)) { fprintf(stderr, "matchbox: failed to parse color %s\n", THEME_FG_HIGHLIGHT_COLOR); exit(1); } else { XAllocColor(w->dpy, DefaultColormap(w->dpy, w->screen), &t->col_fg_highlight); } if (!XParseColor(w->dpy, DefaultColormap(w->dpy, w->screen), THEME_FG_LOWLIGHT_COLOR, &t->col_fg_lowlight)) { fprintf(stderr, "matchbox: failed to parse color %s\n", THEME_FG_LOWLIGHT_COLOR); exit(1); } else { XAllocColor(w->dpy, DefaultColormap(w->dpy, w->screen), &t->col_fg_lowlight); } if (!XParseColor(w->dpy, DefaultColormap(w->dpy, w->screen), THEME_TEXT_COLOR, &t->col_text)) { fprintf(stderr, "matchbox: failed to parse color %s\n", THEME_TEXT_COLOR); exit(1); } else { XAllocColor(w->dpy, DefaultColormap(w->dpy, w->screen), &t->col_text); } #ifdef USE_XFT colortmp.red = t->col_text.red; colortmp.green = t->col_text.green; colortmp.blue = t->col_text.blue; colortmp.alpha = 0xffff; XftColorAllocValue(w->dpy, DefaultVisual(w->dpy, w->screen), DefaultColormap(w->dpy, w->screen), &colortmp, &t->xftcol); #endif if (!font_load (w, THEME_FONT_MAIN, &t->font)) { fprintf(stderr, "matchbox: failed to load font %s\n", THEME_FONT_TOOLBAR); exit(1); }; if (!font_load (w, THEME_FONT_TOOLBAR, &t->font_toolbar)) { fprintf(stderr, "matchbox: failed to load font %s\n", THEME_FONT_TOOLBAR); exit(1); }; return t; } void theme_frame_menu_highlight_entry(Client *c, MBClientButton *button, int mode) { MBTheme *t = c->wm->mbtheme; XDrawLine(t->wm->dpy, c->frame, t->band_gc, button->x + 3, button->y, button->x + button->w - 4, button->y); XDrawLine(t->wm->dpy, c->frame, t->band_gc, button->x + 3, button->y + button->h, button->x + button->w - 4, button->y + button->h); XDrawLine(t->wm->dpy, c->frame, t->band_gc, button->x + 2, button->y + 1, button->x + 2, button->y + button->h); XDrawLine(t->wm->dpy, c->frame, t->band_gc, button->x + button->w - 4, button->y + 1, button->x + button->w - 4, button->y + button->h); } void mbtheme_switch(Wm *w, char *new_theme_conf) { return; } void mbtheme_init(Wm *w, char *theme_conf) { w->mbtheme = mbtheme_new(w); } int theme_frame_button_get_x_pos(MBTheme *theme, int frame_type, int button_type, int width) { return 0; } Bool mbtheme_has_titlebar_panel(MBTheme *theme) { return theme->wm->have_toolbar_panel; } Bool mbtheme_get_titlebar_panel_rect(MBTheme *theme, XRectangle *rect, Client *ignore_client) { if (!theme->wm->have_toolbar_panel) return False; rect->x = theme->wm->toolbar_panel_x; rect->y = theme->wm->toolbar_panel_y; rect->width = theme->wm->toolbar_panel_w; rect->height = theme->wm->toolbar_panel_h; return True; } Bool theme_has_message_decor( MBTheme *theme ) { return False; } Bool theme_has_borders_only_decor( MBTheme *theme ) { return False; } void theme_pixmap_cache_clear_all( MBTheme *theme ) { return; /* No caching here */ } matchbox-window-manager-1.2/matchbox-window-manager/src/client_common.h0000664000211500234210000000624611307441355025264 0ustar bifh1bifhs/* * Matchbox Window Manager - A lightweight window manager not for the * desktop. * * Authored By Matthew Allum * * Copyright (c) 2002, 2004 OpenedHand Ltd - http://o-hand.com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #ifndef _CLIENT_COMMON_H_ #define _CLIENT_COMMON_H_ #include "structs.h" #include "main_client.h" #include "toolbar_client.h" #include "dockbar_client.h" #include "dialog_client.h" #include "list.h" #include "misc.h" #define client_title_frame(c) (c)->frames_decor[NORTH] void client_set_state (Client *c, int state); long client_get_state (Client *c); void client_deliver_config (Client *c); void client_deliver_wm_protocol (Client *c, Atom delivery); void client_get_wm_protocols(Client *c); void client_deliver_message(Client *c, Atom delivery, unsigned long data0, unsigned long data1, unsigned long data2, unsigned long data3, unsigned long data4); Bool client_obliterate(Client *c); void client_deliver_delete (Client *c); int client_want_focus (Client *c); Bool client_set_focus(Client *c); void client_get_transient_list(Wm *w, MBList **list, Client *c); Client* client_get_highest_transient(Client *c, int client_flags, Client *ignore); Client * client_get_next (Client* c, MBClientTypeEnum wanted); Client * client_get_prev (Client* c, MBClientTypeEnum wanted); void client_decor_frames_move_resize(Client *c, int width_west, int width_east, int height_north, int height_south); void client_decor_frames_init(Client *c, int width_west, int width_east, int height_north, int height_south); void client_init_backing_mask (Client *c, int width, int height, int height_north, int height_south, int width_east, int width_west ); struct list_item* client_get_button_list_item_from_event (Client *c, XButtonEvent *e); int client_do_button_ops (Client *c, int frame_id, XButtonEvent *e); int client_button_do_ops (Client *c, XButtonEvent *e, int frame_type, int w, int h); void client_button_init(Client *c, Window win_parent, MBClientButton *b, int x, int y, int width, int height, Bool want_inputonly, void *data); MBClientButton * client_button_new (Client *c, Window win_parent, int x, int y, int w, int h, Bool want_inputonly, void *data ); void client_button_remove (Client *c, int button_action); void client_buttons_delete_all (Client *c); #endif matchbox-window-manager-1.2/matchbox-window-manager/src/session.h0000664000211500234210000000170711307441355024116 0ustar bifh1bifhs/* * Matchbox Window Manager - A lightweight window manager not for the * desktop. * * Authored By Matthew Allum * * Copyright (c) 2002, 2004 OpenedHand Ltd - http://o-hand.com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #ifndef _MB_SESSION_H_ #define _MB_SESSION_H_ #include "structs.h" #include "wm.h" #include "config.h" #if USE_SM #include void sm_process_event(Wm *w); Bool sm_connect(Wm *w); #endif /* USE_SM */ #endif matchbox-window-manager-1.2/matchbox-window-manager/src/structs.h0000664000211500234210000004221511307441355024141 0ustar bifh1bifhs/* * Matchbox Window Manager - A lightweight window manager not for the * desktop. * * Authored By Matthew Allum * * Copyright (c) 2002, 2004 OpenedHand Ltd - http://o-hand.com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #define _GNU_SOURCE #ifndef _STRUCTS_H_ #define _STRUCTS_H_ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "config.h" #ifndef STANDALONE #include #endif #ifdef USE_XFT #include #include #include #endif #ifdef USE_LIBSN #define SN_API_NOT_YET_FROZEN 1 #define MB_SN_APP_TIMEOUT 30 /* 30 second timeout for app startup */ #include #endif #ifdef USE_GCONF /* #include */ #include #endif #ifdef USE_COMPOSITE #include #include #include #endif #ifdef USE_XSYNC #include #endif #if USE_SM #include #endif #ifdef USE_FRAME_ANIMATION enum { MB_FRAME_ANIMATION_CLOSE = 0, MB_FRAME_ANIMATION_MINIMIZE, MB_FRAME_ANIMATION_MAXIMIZE, MB_FRAME_ANIMATION_TYPES }; #endif #define GENERIC_ICON PKGDATADIR "/mbnoapp.xpm" #ifdef MB_HAVE_PNG #define DEFAULT_THEME DATADIR "/themes/Default/matchbox/theme.xml" #define DEFAULTTHEME DATADIR "/themes/Default/matchbox/theme.xml" #define DEFAULT_THEMENAME "Default" #define DEFAULTTHEMENAME "Default" #else #define DEFAULT_THEME DATADIR "/themes/Default/matchbox/theme.xml" #define DEFAULT_THEME_NAME "Default" #endif #define CONFDEFAULTS PKGDATADIR "/defaults" /* Simple Macros */ #define MBMAX(x,y) ((x>y)?(x):(y)) #ifdef DEBUG #define dbg(txt, args... ) fprintf(stderr, "WM-DEBUG: " txt, ##args ) #else #define dbg(txt, args... ) /* nothing */ #endif /* General Defines */ #define EAST 0 #define SOUTH 1 #define WEST 2 #define NORTH 3 /* Note, North must be last or pixmap caching will fail*/ #define ACTIVE 1 #define INACTIVE 2 #define VERTICAL 1 #define HORIZONTAL 2 #define MENU_ENTRY_PADDING 6 #define MENU_ICON_PADDING 4 #define N_DECOR_FRAMES 4 /* Shadow defaults, only used with composite */ #define SHADOW_RADIUS 6 #define SHADOW_OPACITY 0.75 #define SHADOW_OFFSET_X (-SHADOW_RADIUS) #define SHADOW_OFFSET_Y (-SHADOW_RADIUS) /* Defines for MB_COMMAND values, for matchbox-remote */ #define MB_CMD_SET_THEME 1 #define MB_CMD_EXIT 2 #define MB_CMD_DESKTOP 3 #define MB_CMD_NEXT 4 #define MB_CMD_PREV 5 #define MB_CMD_MISC 7 /* spare, used for debugging */ #define MB_CMD_COMPOSITE 8 #define MB_CMB_KEYS_RELOAD 9 /* Atoms, if you change these check ewmh_init() first */ enum { WM_STATE = 0, WM_CHANGE_STATE, WM_PROTOCOLS, WM_DELETE_WINDOW, WM_COLORMAP_WINDOWS, _MB_THEME, _MB_THEME_NAME, WINDOW_TYPE_TOOLBAR, WINDOW_TYPE_DOCK, WINDOW_TYPE_DIALOG, WINDOW_TYPE_SPLASH, WINDOW_TYPE_DESKTOP, WINDOW_TYPE_NORMAL, MB_COMMAND, MB_CLIENT_EXEC_MAP, MB_CLIENT_STARTUP_LIST, WINDOW_STATE, WINDOW_STATE_FULLSCREEN, WINDOW_STATE_MODAL, _NET_SUPPORTED, _NET_CLIENT_LIST, _NET_NUMBER_OF_DESKTOPS, _NET_ACTIVE_WINDOW, _NET_SUPPORTING_WM_CHECK, _NET_CLOSE_WINDOW, _NET_WM_NAME, UTF8_STRING, _NET_CLIENT_LIST_STACKING, _NET_CURRENT_DESKTOP, _NET_WM_DESKTOP, _NET_WM_ICON, _NET_WM_ICON_GEOMETRY, _NET_DESKTOP_GEOMETRY, _NET_WORKAREA, _NET_INPUT_AREAS, _NET_SHOW_DESKTOP, _MOTIF_WM_HINTS, _NET_WM_CONTEXT_HELP, _NET_WM_CONTEXT_ACCEPT, _NET_WM_ALLOWED_ACTIONS, _NET_WM_ACTION_MOVE, _NET_WM_ACTION_RESIZE, _NET_WM_ACTION_MINIMIZE, _NET_WM_ACTION_SHADE, _NET_WM_ACTION_STICK, _NET_WM_ACTION_MAXIMIZE_HORZ, _NET_WM_ACTION_MAXIMIZE_VERT, _NET_WM_ACTION_FULLSCREEN, _NET_WM_ACTION_CHANGE_DESKTOP, _NET_WM_ACTION_CLOSE, _NET_STARTUP_ID, _WIN_SUPPORTING_WM_CHECK, WINDOW_TYPE_MESSAGE, WINDOW_TYPE, _NET_WM_PING, _NET_WM_PID, WM_CLIENT_MACHINE, MB_WM_STATE_DOCK_TITLEBAR, _NET_WM_CONTEXT_CUSTOM, WINDOW_TYPE_MENU, CM_TRANSLUCENCY, MB_DOCK_TITLEBAR_SHOW_ON_DESKTOP, MB_GRAB_TRANSFER, WINDOW_TYPE_INPUT, WINDOW_STATE_ABOVE, WM_TRANSIENT_FOR, _NET_WM_SYNC_REQUEST_COUNTER, _NET_WM_SYNC_REQUEST, _MB_CURRENT_APP_WINDOW, _MB_APP_WINDOW_LIST_STACKING, _NET_WM_USER_TIME, _MB_NUM_MODAL_WINDOWS_PRESENT, _MB_WM_STATE, _NET_WM_WINDOW_TYPE_NOTIFICATION, _NET_WM_WINDOW_TYPE_DROPDOWN_MENU, _NET_WM_WINDOW_TYPE_POPUP_MENU, _MB_NUM_SYSTEM_MODAL_WINDOWS_PRESENT, ATOM_COUNT } MBAtomEnum; /*** Client Window Structs etc. ***/ /* Client window types */ typedef enum { MBCLIENT_TYPE_DIALOG = (1<<1), MBCLIENT_TYPE_TOOLBAR = (1<<2), MBCLIENT_TYPE_PANEL = (1<<3), MBCLIENT_TYPE_TASK_MENU = (1<<4), MBCLIENT_TYPE_APP = (1<<5), MBCLIENT_TYPE_DESKTOP = (1<<6), MBCLIENT_TYPE_OVERRIDE = (1<<7), MBCLIENT_TYPE_ANY = (1<<8) } MBClientTypeEnum; enum { MSK_NORTH = 0, MSK_SOUTH, MSK_EAST, MSK_WEST, MSK_COUNT }; /* Decoration buttons */ typedef struct _mb_client_button { Window win; int x; int y; int w; int h; Bool press_activates; void *data; } MBClientButton; /* Client Struct State flags */ #define CLIENT_FULLSCREEN_FLAG (1<<1) #define CLIENT_TITLE_HIDDEN_FLAG (1<<2) #define CLIENT_SHRUNK_FOR_TB_FLAG (1<<3) /* Set if dialog cover toolbar */ #define CLIENT_HELP_BUTTON_FLAG (1<<4) #define CLIENT_ACCEPT_BUTTON_FLAG (1<<5) #define CLIENT_CUSTOM_BUTTON_FLAG (1<<18) #define CLIENT_DOCK_NORTH (1<<6) #define CLIENT_DOCK_SOUTH (1<<7) #define CLIENT_DOCK_EAST (1<<8) #define CLIENT_DOCK_WEST (1<<9) #define CLIENT_WANTS_MASK_FLAG (1<<10) #define CLIENT_IS_MODAL_FLAG (1<<11) #define CLIENT_BORDERS_ONLY_FLAG (1<<12) #define CLIENT_IS_MESSAGE_DIALOG (1<<14) #define CLIENT_IS_DESKTOP_FLAG (1<<15) /* Used in 'borked' desktop win Handling mode :/ */ #define CLIENT_NEW_FOR_DESKTOP (1<<16) #define CLIENT_DOCK_TITLEBAR (1<<17) #define CLIENT_IS_MOVING (1<<19) /* Used by comosite engine */ #define CLIENT_DOCK_TITLEBAR_SHOW_ON_DESKTOP (1<<20) #define CLIENT_NO_FOCUS_ON_MAP (1<<21) /* for _NET_WM_USER_TIME = 0 */ #define CLIENT_IS_MINIMIZED (1<<23) /* used by toolbars + icon on map*/ #define CLIENT_TOOLBARS_MOVED_FOR_FULLSCREEN (1<<24) #define CLIENT_IS_TRANSIENT_FOR_ROOT (1<<25) #define CLIENT_HAS_URGENCY_FLAG (1<<26) #define CLIENT_HAS_ABOVE_STATE (1<<27) #define CLIENT_IS_MENU_DIALOG ( 1<<30) #define CLIENT_DELAY_MAPPING ( 1<<31) #define CLIENT_IS_SPLASH_WIN ( 1<<0) #ifdef USE_ALT_INPUT_WIN #define CLIENT_TB_ALT_TRANS_FOR_DIALOG (1<<28) #define CLIENT_TB_ALT_TRANS_FOR_APP (1<<29) #endif /* Main Client structure */ typedef struct _client { /* What type of client this instance is */ MBClientTypeEnum type; /* Window identification / title stuff */ #if USE_XFT unsigned char *name; #else char *name; #endif int name_rendered_end_pos; /* used by theme engine */ int name_total_width; Bool is_argb32; /* This is composite only, but saves on a few ifdefs keeping it here */ #ifdef USE_COMPOSITE int damaged; Damage damage; Picture picture; XserverRegion extents; XserverRegion border_clip; int transparency; /* Below togo ? */ Bool want_shadow; Picture shadow; XserverRegion borderSize; #endif Bool name_is_utf8; char *bin_name; unsigned char *startup_id; Window window; /* General Window props */ XSizeHints *size; struct _client *trans; Visual *visual; Colormap cmap; int x, y, width, height; int init_width, init_height; int gravity; XID win_group; Pixmap icon, icon_mask; Bool mapped; /* Bogus ? */ #ifndef REDUCE_BLOAT int *icon_rgba_data; #endif /* Decoration etc */ Window frame, frames_decor[N_DECOR_FRAMES]; Pixmap backing_masks[MSK_COUNT]; Bool have_cache, have_set_bg; struct list_item *buttons; /* InputOnly modal 'blocker' win */ Window win_modal_blocker; /* State stuff */ int ignore_unmap; long flags; /* Hung app support */ Bool has_ping_protocol; int pings_pending; /* below used just for 'aggressive pinging' */ int pings_sent; Bool ping_handler_called; char *host_machine; pid_t pid; #ifdef USE_XSYNC Bool has_ewmh_sync; XSyncCounter ewmh_sync_counter; XSyncValue ewmh_sync_value; XSyncAlarm ewmh_sync_alarm; Bool ewmh_sync_is_waiting; #endif /* References */ struct _wm *wm; /* New */ struct _client *above, *below; struct _client *next_focused_client; /* Client methods */ void (* reparent)( struct _client* c ); void (* redraw)( struct _client* c, Bool use_cache ); void (* button_press) (struct _client *c, XButtonEvent *e); void (* move_resize)( struct _client* c ); void (* configure)( struct _client* c ); void (* get_coverage)( struct _client* c, int* x, int* y, int* h, int* w ); void (* hide)( struct _client* c ); void (* show)( struct _client* c ); void (* iconize)( struct _client* c ); void (* destroy)( struct _client* c ); /* new */ void (* raise)( struct _client* c ); void (* unmap)( struct _client* c ); } Client; /*** Window Manager Instance Structs ***/ /* Keyboard Shortcut information */ enum { KEY_ACTN_EXEC = 1, KEY_ACTN_EXEC_SINGLE, KEY_ACTN_EXEC_SN, KEY_ACTN_NEXT_CLIENT, KEY_ACTN_PREV_CLIENT, KEY_ACTN_CLOSE_CLIENT, KEY_ACTN_TOGGLE_DESKTOP, KEY_ACTN_TASK_MENU_ACTIVATE, KEY_ACTN_FULLSCREEN, KEY_ACTN_HIDE_TITLEBAR, }; typedef struct _kbdconfig_entry { int action; KeySym key; int ModifierMask; int index; char *sdata; int idata; struct _kbdconfig_entry *next_entry; } MBConfigKbdEntry; typedef struct _kbdconfig { struct _kbdconfig_entry *entrys; int MetaMask, HyperMask, SuperMask, AltMask, ModeMask, NumLockMask, ScrollLockMask, lock_mask; } MBConfigKbd; /* Window Manager Runtime Configuration */ enum { WM_DIALOGS_STRATERGY_CONSTRAINED, WM_DIALOGS_STRATERGY_STATIC, WM_DIALOGS_STRATERGY_CONSTRAINED_HORIZ, WM_DIALOGS_STRATERGY_FREE, }; typedef struct _mb_frame_animation { XRectangle src; XRectangle dst; } MBFrameAnimation; typedef struct _wm_config { char *theme; char display_name[256]; Bool use_title; Bool no_cursor; int dialog_stratergy; Bool super_modal; Bool dialog_shade; int lowlight_params[4]; #ifdef USE_COMPOSITE int shadow_dx; int shadow_dy; int shadow_padding_width; int shadow_padding_height; int shadow_style; unsigned char shadow_color[4]; #endif #ifdef USE_FRAME_ANIMATION Bool use_frame_animation; MBFrameAnimation animations[MB_FRAME_ANIMATION_TYPES]; #endif Time dbl_click_time; int use_icons; char *ping_handler; Bool ping_aggressive; MBConfigKbd *kb; char *kbd_conf_file; char *force_dialogs; char *sm_client_id; } Wm_config; /* Queue like structs for startup notification and msg win compile opts */ #ifdef USE_LIBSN typedef struct _sncycles { char *bin_name; Window xid; struct _sncycles *next; } SnCycle; typedef struct _sn_execmapping_item { char *bin_name; Window xid; } SnExecMappingItem; #endif /* WM Struct state flags XXX enum ? */ #define MENU_FLAG (1<<1) #define SINGLE_FLAG (1<<2) /* when only a single main client */ #define DBL_CLICK_FLAG (1<<3) #define TITLE_HIDDEN_FLAG (1<<4) #define DESKTOP_RAISED_FLAG (1<<5) #define STARTUP_FLAG (1<<6) #define THEME_SWITCH_FLAG (1<<7) #define DESKTOP_DECOR_FLAG (1<<8) #ifdef DEBUG #define DEBUG_COMPOSITE_VISIBLE_FLAG (1<<9) #endif typedef struct list_item MBList; /* Main WM struct */ typedef struct _wm { /* X varibles */ Display* dpy; int screen; Window root; Atom atoms[ATOM_COUNT]; int dpy_width, dpy_height; /* State stuff */ int flags; Client* focused_client; /* currently focused client */ /* Stack stuff */ Client *stack_top, *stack_bottom; int stack_n_items; Client *stack_top_app; Client *client_desktop; MBList *client_age_list; /* List of clients ordered by age */ int n_modal_blocker_wins; /* needed for restack() call */ /*******************/ Wm_config *config; Window last_click_window; Time last_click_time; Bool next_click_is_not_double; /* Theme / visual look related date */ Cursor curs, curs_busy, curs_drag, blank_curs; struct _mbtheme *mbtheme; Pixmap generic_icon, generic_icon_mask; Client *have_titlebar_panel; XColor grey_col; /* Used for window backgrounds.*/ /* Extra data need for various compile time opts */ #ifndef STANDALONE MBPixbufImage *img_generic_icon; MBPixbuf *pb; #endif #ifdef USE_LIBSN SnDisplay *sn_display; SnMonitorContext *sn_context; int sn_busy_cnt; time_t sn_init_time; SnCycle *sn_cycles; struct list_item *sn_mapping_list; #endif #ifdef USE_XSETTINGS XSettingsClient *xsettings_client; #endif #ifdef USE_GCONF GConfClient *gconf_client; GMainContext *gconf_context; #endif #ifdef USE_COMPOSITE Bool have_comp_engine; Bool comp_engine_disabled; Picture root_picture; Picture root_buffer; Picture rootTile; XserverRegion all_damage; int damage_event; /* various pictures for effects */ Picture trans_picture; Picture black_picture; Picture lowlight_picture; #ifdef DEBUG Picture red_picture; /* for visual composite debugging */ #endif /* shadow pieces */ Picture shadow_n_pic; Picture shadow_e_pic; Picture shadow_s_pic; Picture shadow_w_pic; Picture shadow_ne_pic; Picture shadow_nw_pic; Picture shadow_se_pic; Picture shadow_sw_pic; Picture shadow_pic; MBPixbuf *argb_pb; /* special 32 bpp pixbuf ref */ #endif #ifdef USE_XSYNC Bool have_xsync; int sync_event_base; int sync_error_base; #endif #if USE_SM int sm_ice_fd; IceConn ice_conn; #endif #ifdef STANDALONE Bool have_toolbar_panel; int toolbar_panel_x; int toolbar_panel_y; int toolbar_panel_w; int toolbar_panel_h; #endif int n_active_ping_clients; /* Number of apps we are pinging */ int n_modals_present; /* Number of modal windows present */ } Wm; #ifdef USE_PANGO typedef struct MBPangoFont { PangoFontDescription *fontdes; PangoFont *font; PangoFontMetrics *metrics; int ascent; int descent; } MBPangoFont; #endif /*** Various enums used by all, mainly for themeing. ***/ enum { SHADOW_STYLE_NONE = 0, SHADOW_STYLE_SIMPLE, SHADOW_STYLE_GAUSSIAN }; typedef enum { ALIGN_LEFT, ALIGN_CENTER, ALIGN_RIGHT } Alignment; enum { BUTTON_ACTION_CLOSE = 1, BUTTON_ACTION_NEXT, BUTTON_ACTION_PREV, BUTTON_ACTION_MIN, BUTTON_ACTION_MAX, BUTTON_ACTION_MENU, BUTTON_ACTION_HIDE, BUTTON_ACTION_MENU_EXTRA, BUTTON_ACTION_MAX_EXTRA, BUTTON_ACTION_MIN_EXTRA, BUTTON_ACTION_HELP, BUTTON_ACTION_ACCEPT, BUTTON_ACTION_DESKTOP, BUTTON_ACTION_CUSTOM }; enum { FRAME_MAIN = 1, FRAME_MAIN_EAST, FRAME_MAIN_WEST, FRAME_MAIN_SOUTH, FRAME_DIALOG, FRAME_UTILITY_MAX, FRAME_UTILITY_MIN, FRAME_MENU, FRAME_DIALOG_NORTH, FRAME_DIALOG_EAST, FRAME_DIALOG_WEST, FRAME_DIALOG_SOUTH, FRAME_DIALOG_NT_NORTH, FRAME_DIALOG_NT_EAST, FRAME_DIALOG_NT_WEST, FRAME_DIALOG_NT_SOUTH, FRAME_MSG, FRAME_MSG_EAST, FRAME_MSG_WEST, FRAME_MSG_SOUTH, N_FRAME_TYPES }; #endif matchbox-window-manager-1.2/matchbox-window-manager/src/session.c0000664000211500234210000001271411307441355024111 0ustar bifh1bifhs/* * Matchbox Window Manager - A lightweight window manager not for the * desktop. * * Authored By Matthew Allum * * Copyright (c) 2002, 2004 OpenedHand Ltd - http://o-hand.com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #include "session.h" #if USE_SM /* mostly based on twm/metacity code */ static void sm_save_yourself_cb (SmcConn smcConn, SmPointer clientData, int saveType, Bool shutdown, int interactStyle, Bool fast) { /* Wm *w = (Wm *)clientData; */ /* XXX This needs much work */ SmProp prop1, prop2, prop3, prop4, prop5, prop6, *props[6]; SmPropValue prop1val, prop2val, prop3val, prop4val, prop5val, prop6val; static int first_time = 1; dbg("%s() session mark\n", __func__); if (first_time) { char userId[20], pid[20]; char hint = SmRestartImmediately; char priority = 20; dbg("%s() session mark\n", __func__); prop1.name = SmProgram; prop1.type = SmARRAY8; prop1.num_vals = 1; prop1.vals = &prop1val; prop1val.value = "matchbox-window-manager"; /* Argv[0]; */ prop1val.length = strlen ("matchbox-window-manager"); snprintf (userId, 20, "%s", getenv("USER") ? getenv("USER") : "unknown"); prop2.name = SmUserID; prop2.type = SmARRAY8; prop2.num_vals = 1; prop2.vals = &prop2val; prop2val.value = (SmPointer) userId; prop2val.length = strlen (userId); prop3.name = SmRestartStyleHint; prop3.type = SmCARD8; prop3.num_vals = 1; prop3.vals = &prop3val; prop3val.value = (SmPointer) &hint; prop3val.length = 1; snprintf (pid, 20, "%d", getpid ()); prop4.name = SmProcessID; prop4.type = SmARRAY8; prop4.num_vals = 1; prop4.vals = &prop4val; prop4val.value = pid; prop4val.length = strlen (prop4val.value); /* Always start in home directory */ prop5.name = SmCurrentDirectory; prop5.type = SmARRAY8; prop5.num_vals = 1; prop5.vals = &prop5val; prop5val.value = (char*) ( getenv("HOME") ? getenv("HOME") : "unknown" ); prop5val.length = strlen (prop5val.value); prop6.name = "_GSM_Priority"; prop6.type = SmCARD8; prop6.num_vals = 1; prop6.vals = &prop6val; prop6val.value = &priority; prop6val.length = 1; props[0] = &prop1; props[1] = &prop2; props[2] = &prop3; props[3] = &prop4; props[4] = &prop5; props[5] = &prop6; SmcSetProperties (smcConn, 6, props); first_time = 0; } /* Below is obviously wrong and needs work. * Need to rebuild command line arguments */ prop1.name = SmRestartCommand; prop1.type = SmLISTofARRAY8; prop1.vals = &prop1val; prop1.num_vals = 1; prop1val.value = (SmPointer) "matchbox-window-manager" ; prop1val.length = strlen ("matchbox-window-manager"); props[0] = &prop1; SmcSetProperties (smcConn, 1, props); SmcSaveYourselfDone (smcConn, True); } static void sm_die_cb (SmcConn smcConn, SmPointer clientData) { Wm *w = (Wm*)clientData; dbg("%s() session mark\n", __func__); SmcCloseConnection (smcConn, 0, NULL); w->sm_ice_fd = -1; } static void sm_save_complete_cb (SmcConn smcConn, SmPointer clientData) { dbg("%s() session mark\n", __func__); } static void sm_shutdown_cancelled_cb (SmcConn smcConn, SmPointer clientData) { dbg("%s() session mark\n", __func__); /* if (!sent_save_done) { SmcSaveYourselfDone (smcConn, False); sent_save_done = 1; } */ } void sm_process_event(Wm *w) { dbg("%s() session mark\n", __func__); IceProcessMessages (w->ice_conn, NULL, NULL); } Bool sm_connect(Wm *w) { char error[256], *mb_client_id; unsigned long mask; SmcCallbacks callbacks; SmcConn smc_conn = NULL; mask = SmcSaveYourselfProcMask | SmcDieProcMask | SmcSaveCompleteProcMask | SmcShutdownCancelledProcMask; callbacks.save_yourself.callback = sm_save_yourself_cb; callbacks.save_yourself.client_data = (SmPointer)w; callbacks.die.callback = sm_die_cb; callbacks.die.client_data = (SmPointer)w; callbacks.save_complete.callback = sm_save_complete_cb; callbacks.save_complete.client_data = (SmPointer)w; callbacks.shutdown_cancelled.callback = sm_shutdown_cancelled_cb; callbacks.shutdown_cancelled.client_data = (SmPointer) w; w->sm_ice_fd = -1; smc_conn = SmcOpenConnection ( NULL, /* use SESSION_MANAGER env */ NULL, SmProtoMajor, SmProtoMinor, mask, &callbacks, w->config->sm_client_id, &mb_client_id, 256, error); if (smc_conn == NULL) { fprintf(stderr, "matchbox-window-manager: Failed to connect to session manager\n"); return False; } w->ice_conn = SmcGetIceConnection (smc_conn); w->sm_ice_fd = IceConnectionNumber (w->ice_conn); dbg("connected to session manager\n"); return True; } #endif matchbox-window-manager-1.2/matchbox-window-manager/src/ewmh.h0000664000211500234210000000475411307441355023400 0ustar bifh1bifhs/* * Matchbox Window Manager - A lightweight window manager not for the * desktop. * * Authored By Matthew Allum * * Copyright (c) 2002, 2004 OpenedHand Ltd - http://o-hand.com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #ifndef _EWMH_H_ #define _EWMH_H_ #include "structs.h" #include "wm.h" /* Number of failed pending pings to kill a ping supporting app on */ #define PING_PENDING_MAX 2 /* Time in seconds between each hung app check */ #define PING_CHECK_FREQ 2 /* Max num of pings to send to an app - used only when in aggresive mode */ #define PING_CHECK_DURATION 5 /* Non aton defines */ #define _NET_WM_STATE_REMOVE 0 /* remove/unset property */ #define _NET_WM_STATE_ADD 1 /* add/set property */ #define _NET_WM_STATE_TOGGLE 2 /* toggle property */ void ewmh_init (Wm *w); void ewmh_init_props (Wm *w); void ewmh_update_lists(Wm *w); void ewmh_update_desktop_hint(Wm *w); void ewmh_update_rects(Wm *w); void ewmh_set_active (Wm *w); void ewmh_set_current_app_window(Wm *w); int ewmh_handle_root_message (Wm *w, XClientMessageEvent *e); unsigned char * ewmh_get_utf8_prop (Wm *w, Window win, Atom req_atom); void ewmh_state_set(Client *c); Bool ewmh_state_check (Client *c, Atom atom_state_wanted); int ewmh_get_user_time (Client *c); void ewmh_set_allowed_actions (Wm *w, Client *c); void ewmh_ping_client_start (Client *c); void ewmh_ping_client_stop (Client *c); void ewmh_hung_app_check (Wm *w); int* ewmh_get_icon_geometry (Wm *w, Window win); #ifndef REDUCE_BLOAT int *ewmh_get_icon_prop_data (Wm *w, Window win); #endif int ewmh_utf8_len(unsigned char *str); int ewmh_utf8_get_byte_cnt(unsigned char *str, int num_chars); Bool ewmh_utf8_validate(unsigned char *str, int max_len); #ifdef USE_XSYNC void ewmh_sync_init(Wm *w); void ewmh_sync_handle_event(Wm *w, XSyncAlarmNotifyEvent *ev); Bool ewmh_sync_client_move_resize(Client *client); Bool ewmh_sync_client_init_counter(Client *client); #endif /* USE_XSYNC */ #endif matchbox-window-manager-1.2/matchbox-window-manager/src/Makefile.am0000664000211500234210000000354311307441355024316 0ustar bifh1bifhsEXTRA_DIST = \ mbtheme-standalone.c mbtheme-standalone.h mbtheme.c mbtheme.h xml.c xml.h if WANT_STANDALONE standalone_src = mbtheme-standalone.c mbtheme-standalone.h else standalone_src = mbtheme.c mbtheme.h xml.c xml.h endif PREFIXDIR = $(prefix) PKGDATADIR = $(datadir)/matchbox DATADIR = $(datadir) CONFDIR = $(sysconfdir)/matchbox bin_PROGRAMS = matchbox-window-manager matchbox-remote INCLUDES = -DDATADIR=\"$(DATADIR)\" -DCONFDIR=\"$(CONFDIR)\" -DPKGDATADIR=\"$(PKGDATADIR)\" -DPREFIX=\"$(PREFIXDIR)\" $(LIBMB_CFLAGS) $(COMPO_CFLAGS) $(EXPAT_CFLAGS) $(SN_CFLAGS) $(GCONF_CFLAGS) $(XFIXES_CFLAGS) $(XCURSOR_CFLAGS) matchbox_remote_LDADD = $(LIBMB_LIBS) matchbox_remote_SOURCES = matchbox-remote.c matchbox_window_manager_LDADD = $(LIBMB_LIBS) $(COMPO_LIBS) $(EXPAT_LIBS) $(SN_LIBS) $(GCONF_LIBS) $(XFIXES_LIBS) $(XCURSOR_LIBS) matchbox_window_manager_SOURCES = \ main.c structs.h wm.c wm.h \ base_client.c base_client.h \ main_client.c main_client.h \ toolbar_client.c toolbar_client.h \ toolbar_client_alt.c \ dockbar_client.c dockbar_client.h \ dialog_client.c dialog_client.h \ select_client.c select_client.h \ desktop_client.c desktop_client.h \ ewmh.c ewmh.h \ misc.c misc.h \ client_common.c client_common.h \ keys.c keys.h \ list.c list.h \ stack.c stack.h \ composite-engine.c composite-engine.h \ session.c session.h \ $(standalone_src) clean-local: /bin/rm *.bb *.bbg *.da *.gcov || true matchbox-window-manager-1.2/matchbox-window-manager/src/desktop_client.c0000664000211500234210000000532411307441355025434 0ustar bifh1bifhs/* * Matchbox Window Manager - A lightweight window manager not for the * desktop. * * Authored By Matthew Allum * * Copyright (c) 2002, 2004 OpenedHand Ltd - http://o-hand.com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #include "desktop_client.h" Client* desktop_client_new(Wm *w, Window win) { Client *c = NULL; if (w->flags & DESKTOP_DECOR_FLAG) { c = main_client_new(w, win); c->flags |= CLIENT_IS_DESKTOP_FLAG; w->client_desktop = c; return c; } c = base_client_new(w, win); c->type = MBCLIENT_TYPE_DESKTOP; c->configure = &desktop_client_configure; c->reparent = &desktop_client_reparent; c->move_resize = &desktop_client_move_resize; c->show = &desktop_client_show; c->destroy = &desktop_client_destroy; c->hide = &main_client_hide; if (w->stack_top_app && (w->flags & SINGLE_FLAG)) main_client_redraw(w->stack_top_app, False); w->client_desktop = c; return c; } void desktop_client_reparent(Client *c) { c->frame = c->window; } void desktop_client_move_resize(Client *c) { XMoveResizeWindow(c->wm->dpy, c->window, c->x, c->y, c->width, c->height ); } void desktop_client_configure(Client *c) { c->width = c->wm->dpy_width; c->height = c->wm->dpy_height; c->x = 0; c->y = 0; } void desktop_client_show(Client *c) { Wm *w = c->wm; stack_move_top(c); /* All clients use the above move to base */ if (!c->mapped) { XMapSubwindows(w->dpy, c->frame); XMapWindow(w->dpy, c->frame); } c->mapped = True; } void desktop_client_unmap(Client *c) { Wm *w = c->wm; dbg("%s called for %s\n", __func__, c->name); c->mapped = False; if (w->stack_top_app) { /* Needed to make sure app window task menu button gets updated */ if (w->stack_top_app == stack_get_below(w->stack_top_app, MBCLIENT_TYPE_APP)) main_client_redraw(w->stack_top_app, False); wm_activate_client(w->stack_top_app); } w->flags &= ~DESKTOP_RAISED_FLAG; ewmh_update_desktop_hint(w); } void desktop_client_destroy(Client *c) { Wm *w = c->wm; desktop_client_unmap(c); base_client_destroy(c); w->client_desktop = NULL; } matchbox-window-manager-1.2/matchbox-window-manager/src/dialog_client.c0000664000211500234210000010402011307441355025213 0ustar bifh1bifhs/* * Matchbox Window Manager - A lightweight window manager not for the * desktop. * * Authored By Matthew Allum * * Copyright (c) 2002, 2004 OpenedHand Ltd - http://o-hand.com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #include "dialog_client.h" static void dialog_client_check_for_state_hints(Client *c); static void dialog_client_drag(Client *c); static void _get_mouse_position(Wm *w, int *x, int *y); Client* dialog_client_new(Wm *w, Window win, Client *trans) { Client *c = base_client_new(w, win); if (!c) return NULL; c->type = MBCLIENT_TYPE_DIALOG; c->reparent = &dialog_client_reparent; c->move_resize = &dialog_client_move_resize; c->iconize = &dialog_client_iconize; c->configure = &dialog_client_configure; c->button_press = &dialog_client_button_press; c->redraw = &dialog_client_redraw; c->show = &dialog_client_show; c->destroy = &dialog_client_destroy; c->get_coverage = &dialog_client_get_coverage; dialog_client_check_for_state_hints(c); c->trans = trans; return c; } static void dialog_client_get_offsets(Client *c, int *e, int *s, int *w) { /* no decor dialogs */ if (c->flags & CLIENT_TITLE_HIDDEN_FLAG) { *s = 0; *e = 0; *w = 0; return; } if (c->flags & CLIENT_BORDERS_ONLY_FLAG && theme_has_borders_only_decor(c->wm->mbtheme)) { *s = theme_frame_defined_height_get(c->wm->mbtheme, FRAME_DIALOG_NT_SOUTH); *e = theme_frame_defined_width_get(c->wm->mbtheme, FRAME_DIALOG_NT_EAST ); *w = theme_frame_defined_width_get(c->wm->mbtheme, FRAME_DIALOG_NT_WEST ); return; } *s = theme_frame_defined_height_get(c->wm->mbtheme, FRAME_DIALOG_SOUTH); *e = theme_frame_defined_width_get(c->wm->mbtheme, FRAME_DIALOG_EAST ); *w = theme_frame_defined_width_get(c->wm->mbtheme, FRAME_DIALOG_WEST ); } static void dialog_client_check_for_state_hints(Client *c) { if (ewmh_state_check(c, c->wm->atoms[WINDOW_STATE_MODAL])) { Client *damaged_client; dbg("%s() got modal hint, setting flag\n", __func__); c->flags ^= CLIENT_IS_MODAL_FLAG; c->wm->n_modals_present++; /* Call comp_engine_client_show to add damage to main window * so it gets fully lowlighted ok. */ if ((damaged_client = wm_get_visible_main_client(c->wm)) != NULL) { comp_engine_client_show(c->wm, damaged_client); } } if (ewmh_state_check(c, c->wm->atoms[WINDOW_STATE_ABOVE])) c->flags |= CLIENT_HAS_ABOVE_STATE; } void dialog_client_get_coverage(Client *c, int *x, int *y, int *w, int *h) { int frm_size = dialog_client_title_height(c); int east,south,west; dialog_client_get_offsets(c, &east, &south, &west); *x = c->x - west; *y = c->y - frm_size; *w = c->width + east + west; *h = c->height + frm_size + south; } void dialog_client_move_resize(Client *c) { Wm *w = c->wm; int frm_size = dialog_client_title_height(c); int offset_south = 0, offset_west = 0, offset_east = 0; dialog_client_get_offsets(c, &offset_east, &offset_south, &offset_west); base_client_move_resize(c); if (c->window != c->frame) /* Non decorated */ XMoveResizeWindow(w->dpy, c->window, offset_west, frm_size, c->width, c->height); #ifndef USE_COMPOSITE if (w->config->dialog_shade && (c->flags & CLIENT_IS_MODAL_FLAG)) { XMoveWindow(w->dpy, c->window, c->x, c->y); } else #endif { XMoveResizeWindow(w->dpy, c->frame, c->x - offset_west, c->y - frm_size, c->width + offset_west + offset_east, c->height + frm_size + offset_south ); } if (!(c->flags & CLIENT_TITLE_HIDDEN_FLAG)) client_decor_frames_move_resize(c, offset_west, offset_east, frm_size, offset_south); if (c->win_modal_blocker) { XMoveResizeWindow(w->dpy, c->win_modal_blocker, 0, 0, w->dpy_width, w->dpy_height); } } int dialog_client_title_height(Client *c) { Wm *w = c->wm; if (c->flags & CLIENT_TITLE_HIDDEN_FLAG) return 0; if (c->flags & CLIENT_BORDERS_ONLY_FLAG) { if (theme_has_borders_only_decor (c->wm->mbtheme)) return theme_frame_defined_height_get(c->wm->mbtheme, FRAME_DIALOG_NT_NORTH); else if (theme_has_frame_type_defined(c->wm->mbtheme, FRAME_DIALOG_NORTH)) return theme_frame_defined_height_get(c->wm->mbtheme, FRAME_DIALOG_NORTH); } return theme_frame_defined_height_get(c->wm->mbtheme, FRAME_DIALOG); } void dialog_client_show(Client *c) { Wm *w = c->wm; Client *highest_client = NULL; MBList *transient_list = NULL, *list_item = NULL; dbg("%s() called for %s\n", __func__, c->name); if (!c->mapped) { if (c->flags & CLIENT_IS_MINIMIZED) { Client *p = NULL; client_set_state(c, NormalState); c->flags &= ~CLIENT_IS_MINIMIZED; /* Make sure any transients are un minimized too */ stack_enumerate(w, p) if (p->trans == c) { p->show(p); XMapSubwindows(w->dpy, p->frame); XMapWindow(w->dpy, p->frame); } if (c->flags & CLIENT_IS_MODAL_FLAG) c->wm->n_modals_present++; } if (c->win_modal_blocker) { XMapWindow(w->dpy, c->win_modal_blocker); dbg("%s() blocker win mapped for '%s'\n", __func__, c->name); } /* Set flag below to delay actual mapping of window * till *after* we've synced the stack. This hacky * solution avoids problem of dialogs mapping for * clients below and causing flicker. * * Note could still cause issues with transients and remmapping * them if minimised.. */ c->flags |= CLIENT_DELAY_MAPPING; } /* * We just need to get the order right in respect * to other dialogs transient to the same app or * transient to root. * This order *should* be kept the same by other * stack operations ( eg wm_activate client ). */ if (c->trans) { /* Were transient for something * - so recursives find the highest transient for this app * ignoring current client. * - raise ourselves above */ Client *lowest_trans = c->trans; int urgent_flag = (c->flags & CLIENT_HAS_URGENCY_FLAG) ? CLIENT_HAS_URGENCY_FLAG : 0; while (lowest_trans->trans != NULL) lowest_trans = lowest_trans->trans; highest_client = client_get_highest_transient(lowest_trans, urgent_flag, c); if (c->mapped && highest_client == c) { /* if were already at the top, logic below will actually * move us below the transient. */ dbg("%s() %s already highest and mapped .. leaving\n", __func__, c->name); } else { if (highest_client == NULL || highest_client == c) { dbg("%s() raising %s above c->trans: %s\n", __func__, c->name, c->trans->name); stack_move_above_client(c, c->trans); } else { dbg("%s() raising %s above highest_client: %s\n", __func__, c->name, highest_client->name); stack_move_above_client(c, highest_client); } } if (c->trans->type != MBCLIENT_TYPE_DIALOG && lowest_trans->win_group && (lowest_trans->type == MBCLIENT_TYPE_DESKTOP || lowest_trans->type == MBCLIENT_TYPE_APP)) { Client *visible; visible = wm_get_visible_main_client(w); if (visible && visible != lowest_trans && visible->win_group == lowest_trans->win_group) stack_move_above_client(c, visible); } } else stack_move_top(c); /* Now move any transients for us above us */ client_get_transient_list(w, &transient_list, c); highest_client = c; list_enumerate(transient_list, list_item) { stack_move_above_client((Client *)list_item->data, highest_client); highest_client = (Client *)list_item->data; } list_destroy(&transient_list); /* Insurance below */ if (wm_get_visible_main_client(w)) { stack_move_transients_to_top(w, wm_get_visible_main_client(w), CLIENT_HAS_ABOVE_STATE); } stack_move_transients_to_top(w, NULL, CLIENT_HAS_ABOVE_STATE); stack_move_transients_to_top(w, NULL, CLIENT_HAS_URGENCY_FLAG); c->mapped = True; } void dialog_client_reparent(Client *c) { Wm *w = c->wm; XSetWindowAttributes attr; unsigned long attr_mask; int offset_north = dialog_client_title_height(c); int offset_south = 0, offset_west = 0, offset_east = 0; dialog_client_get_offsets(c, &offset_east, &offset_south, &offset_west); attr.override_redirect = True; attr.background_pixel = w->grey_col.pixel; attr.border_pixel = 0; attr.event_mask = ChildMask|ButtonPressMask|ExposureMask; attr_mask = CWOverrideRedirect|CWEventMask |CWBackPixel|CWBorderPixel ; #ifdef USE_COMPOSITE /* Needed for argb wins, XXX need to figure this out .. */ attr.colormap = c->cmap; if (c->cmap && !w->comp_engine_disabled) attr_mask = CWOverrideRedirect|CWEventMask |CWBackPixel|CWBorderPixel|CWColormap ; #endif dbg("%s() want lowlight : wm:%i , client:%li\n", __func__, c->wm->config->dialog_shade, (c->flags & CLIENT_IS_MODAL_FLAG)); #ifndef USE_COMPOSITE if (c->wm->config->dialog_shade && (c->flags & CLIENT_IS_MODAL_FLAG)) { dbg("%s() LOWLIGHTING\n", __func__); wm_lowlight(w, c); } else #endif { if (c->flags & CLIENT_TITLE_HIDDEN_FLAG) { c->frame = c->window; } else { c->frame = XCreateWindow(w->dpy, w->root, 0, 0, c->width + offset_east + offset_west, c->height + offset_north + offset_south, 0, #ifdef USE_COMPOSITE c->is_argb32 ? 32 : CopyFromParent, InputOutput, c->is_argb32 ? c->visual : CopyFromParent, #else CopyFromParent, CopyFromParent, CopyFromParent, #endif attr_mask, &attr); } } if (!(c->flags & CLIENT_TITLE_HIDDEN_FLAG)) { client_decor_frames_init(c, offset_west, offset_east, offset_north, offset_south); } if (c->flags & CLIENT_IS_MODAL_FLAG && w->config->super_modal && c->trans == NULL ) /* modal for device. XXX check recursive ? */ { /* Create an InputOnly fullscreen window to aid in making * modal dialogs *really* modal to the whole display by * block button events. */ c->win_modal_blocker = XCreateWindow(w->dpy, w->root, 0, 0, w->dpy_width, w->dpy_height, 0, CopyFromParent, InputOnly, CopyFromParent, CWOverrideRedirect|CWEventMask, &attr); /* Map is show() or gets stacked above dialog */ /* XMapWindow(w->dpy, c->win_modal_blocker); */ dbg("%s() created and mapped blocker win for '%s'\n", __func__, c->name); w->n_modal_blocker_wins++; } XClearWindow(w->dpy, c->frame); XSetWindowBorderWidth(w->dpy, c->window, 0); XAddToSaveSet(w->dpy, c->window); XSelectInput(w->dpy, c->window, ColormapChangeMask|PropertyChangeMask); if (c->frame != c->window) XReparentWindow(w->dpy, c->window, c->frame, offset_west, offset_north); } /* Padding between dialog borders and area available */ #define DIALOG_PADDING 0 /* * dialog_get_available_area() * Get the 'safe' area ( eg no panels / input windows ) covered. */ void dialog_get_available_area(Client *c, int *x, int *y, int *width, int *height) { Wm *w = c->wm; if (c->flags & CLIENT_TITLE_HIDDEN_FLAG) { /* Decorationless dialogs can position themselves anywhere */ *y = 0; *x = 0; *height = w->dpy_height; *width = w->dpy_width; } else { Client *p = NULL, *main_client = wm_get_visible_main_client(w); Bool have_toolbar = False; stack_enumerate(w, p) { if (p->type == MBCLIENT_TYPE_TOOLBAR && p->mapped && !(p->flags & CLIENT_IS_MINIMIZED)) { have_toolbar = True; break; } } *y = wm_get_offsets_size(w, NORTH, NULL, True); if (main_client && (main_client->flags & CLIENT_FULLSCREEN_FLAG)) { /* Fullscreen window present, allow dialogs to position themselves * move or less anywhere * * XXX: should we check is this dialog is trans for it or trans for * root ? */ *height = w->dpy_height - *y; *x = 0; *width = w->dpy_width; /* This mainly for alt toolbars so dialogs get positioned ok * for fullscreen. * Note the above wm_get_offsets calls with NORTH, not SOUTH, * this is what below is basically doing. */ if (p != NULL && have_toolbar) *height -= p->height; dbg("%s() height is %i, y is %i\n", __func__, *height, *y); } else { /* if toolbar ( input window present ) dialogs can cover titlebars * as can transient for root dialogs. */ if (!have_toolbar) *y += main_client_title_height(c->trans); *height = w->dpy_height - *y - wm_get_offsets_size(w, SOUTH, NULL, True); *x = wm_get_offsets_size(w, WEST, NULL, True); *width = w->dpy_width - *x - wm_get_offsets_size(w, EAST, NULL, True); } dbg("%s() (toolbar) offsets south is %i\n", __func__, wm_get_offsets_size(w, SOUTH, NULL, True)); } } /* * dialog_constrain_gemoetry() * * called mainly by wm_restack to suggest better positions for dialogs * in relation to panels and toolbar/input wins. * * req params are reparented window geometry *without* borders * * returns True if geometry supplied fits - is good. * retruns False if geometry supplyied bad, supplied geometry is updated * to fit. */ Bool dialog_constrain_geometry(Client *c, int *req_x, int *req_y, int *req_width, int *req_height) { Wm *w = c->wm; int avail_x, avail_y, avail_width, avail_height; int actual_x, actual_y, actual_width, actual_height; int bdr_south = 0, bdr_west = 0, bdr_east = 0, bdr_north = 0; Bool res = True; if (w->config->dialog_stratergy == WM_DIALOGS_STRATERGY_FREE) return True; /* Decorationless dialogs position anywhere */ if (c->flags & CLIENT_TITLE_HIDDEN_FLAG) return True; dialog_get_available_area(c,&avail_x, &avail_y, &avail_width, &avail_height); dbg("%s() getting available area (toolbar +%i+%i %ix%i)\n", __func__, avail_x, avail_y, avail_width, avail_height); /* Figure out window border offsets */ dialog_client_get_offsets(c, &bdr_east, &bdr_south, &bdr_west); bdr_north = dialog_client_title_height(c); dbg("%s() - \n\t avail_x : %d\n\tavail_y : %d\n\tavail_width : %d" "\n\tavail_height %d\n\tbdr_south : %d\n\tbdr_west : %d" "\n\tbdr_east : %d\n\tbdr_north : %d\n", __func__, avail_x, avail_y, avail_width, avail_height, bdr_south, bdr_west, bdr_east, bdr_north); /* Dialog geometry with decorations */ actual_x = *req_x - bdr_east - DIALOG_PADDING; actual_y = *req_y - bdr_north - DIALOG_PADDING; actual_width = *req_width + bdr_east + bdr_west + (2*DIALOG_PADDING); actual_height = *req_height + bdr_north + bdr_south + (2*DIALOG_PADDING); if (c->init_width && c->init_height && (c->init_width > *req_width || c->init_height > *req_height) ) { actual_width = c->init_width + bdr_east + bdr_west + (2*DIALOG_PADDING); actual_height = c->init_height + bdr_north + bdr_south + (2*DIALOG_PADDING); } if (actual_width > avail_width) /* set width to fit */ { *req_width = avail_width - ( bdr_east + bdr_west + (2*DIALOG_PADDING)); actual_width = avail_width; res = False; } if (actual_height > avail_height) /* and height */ { *req_height = avail_height -(bdr_south + bdr_north + (2*DIALOG_PADDING)); actual_height = avail_height; res = False; } if (actual_x < avail_x) /* move dialog right */ { *req_x = avail_x + bdr_west + DIALOG_PADDING; res = False; } if (actual_y < avail_y) /* move dialog up */ { *req_y = avail_y + bdr_north + DIALOG_PADDING; res = False; } if (actual_x > avail_x /* move dialog right */ && (actual_x + actual_width) > (avail_x + avail_width) ) { *req_x = avail_x + bdr_west + DIALOG_PADDING; res = False; } if ( (actual_y + actual_height) > (avail_y + avail_height) ) { *req_y = (avail_y + avail_height) - actual_height + bdr_north + DIALOG_PADDING; res = False; } return res; } void dialog_init_geometry(Client *c) { Wm *w = c->wm; int avail_x, avail_y, avail_width, avail_height; int bdr_south = 0, bdr_west = 0, bdr_east = 0, bdr_north = 0; /* Check if we actually want to perform any sizing intervention */ if (w->config->dialog_stratergy == WM_DIALOGS_STRATERGY_FREE) return; #if 0 /* Allow decorationless dialogs to position themselves anywhere * But centered initially if 0,0 and a splash screen. */ if (c->flags & (CLIENT_TITLE_HIDDEN_FLAG)) { if ((c->flags & CLIENT_IS_SPLASH_WIN) && c->x == 0 && c->y == 0) { if (c->height < w->dpy_height) c->y = (w->dpy_height - c->height)/2; if (c->width < w->dpy_width) c->x = (w->dpy_width - c->width)/2; } return; } #endif dialog_get_available_area(c,&avail_x, &avail_y, &avail_width, &avail_height); /* Figure out window border offsets */ dialog_client_get_offsets(c, &bdr_east, &bdr_south, &bdr_west); bdr_north = dialog_client_title_height(c); dbg("%s() - \n\t avail_x : %d\n\tavail_y : %d\n\tavail_width : %d" "\n\tavail_height %d\n\tbdr_south : %d\n\tbdr_west : %d" "\n\tbdr_east : %d\n\tbdr_north : %d\n gravity %i\n", __func__, avail_x, avail_y, avail_width, avail_height, bdr_south, bdr_west, bdr_east, bdr_north, c->gravity); switch (c->gravity) { case NorthGravity: c->y += (bdr_north + avail_y); break; case NorthEastGravity: c->y += (bdr_north + avail_y); c->x -= (bdr_east + (w->dpy_width - (avail_x + avail_width))); break; case WestGravity: c->x += (bdr_west + avail_x); break; case EastGravity: c->x -= (bdr_east + (w->dpy_width - (avail_x + avail_width))); break; case SouthWestGravity: c->y -= (bdr_south + (w->dpy_height - (avail_y + avail_height))); c->x += (bdr_west + avail_x); break; case SouthGravity: c->y -= (bdr_south + (w->dpy_height - (avail_y + avail_height))); break; case SouthEastGravity: c->x -= (bdr_east + (w->dpy_width - (avail_x + avail_width))); c->y -= (bdr_south + (w->dpy_height - (avail_y + avail_height))); break; case CenterGravity: case NorthWestGravity: case StaticGravity: default: break; } /* save values for possible resizing later if more space comes available */ c->init_width = c->width; c->init_height = c->height; dbg("%s() set init, %ix%i, wants x:%d y:%d\n", __func__, c->init_width, c->init_height, c->x, c->y); /* Fix width/height */ if ((c->width + bdr_east + bdr_west) > avail_width) c->width = (avail_width - bdr_east - bdr_west - (2*DIALOG_PADDING)); if ((c->height + bdr_north + bdr_south) > avail_height) c->height = (avail_height - bdr_north - bdr_south - (2*DIALOG_PADDING)); /* Reposition dialog to center of avialable space if ; * + positioned at 0,0 * + positioned offscreen */ if ( (c->x - bdr_west) < avail_x || (c->x + c->width + bdr_east) > (avail_x + avail_width)) { dbg("%s() centering x pos\n", __func__); c->x = (avail_width - (c->width + bdr_east + bdr_west))/2 + bdr_west + avail_x; } if ( (c->y - bdr_north) < avail_y || (c->y + c->height + bdr_south) > (avail_y+avail_height)) { dbg("%s() centering y pos\n", __func__); c->y = (avail_height - (c->height + bdr_south + bdr_north))/2 + avail_y + bdr_north; } /* horiz contarined mode - force dialog to be full width*/ /* but hacked by tthurman to happen in all modes */ { c->x = avail_x + bdr_west; c->width = avail_width - (bdr_east + bdr_west); c->y = w->dpy_height - c->height; } } void dialog_client_configure(Client *c) { dbg("%s() client has border only hint: %s\n", __func__, (c->flags & CLIENT_BORDERS_ONLY_FLAG) ? "yes" : "no"); dbg("%s() client has menu hint: %s\n", __func__, (c->flags & CLIENT_IS_MENU_DIALOG) ? "yes" : "no"); dialog_init_geometry(c); } void dialog_client_redraw(Client *c, Bool use_cache) { Wm *w = c->wm; Bool is_shaped = False; int offset_north = 0, offset_south = 0, offset_west = 0, offset_east = 0; int total_w = 0, total_h = 0; int frame_ref_top = FRAME_DIALOG; int frame_ref_east = FRAME_DIALOG_EAST; int frame_ref_west = FRAME_DIALOG_WEST; int frame_ref_south = FRAME_DIALOG_SOUTH; if (c->flags & CLIENT_TITLE_HIDDEN_FLAG) return; if (use_cache) return; offset_north = dialog_client_title_height(c); dialog_client_get_offsets(c, &offset_east, &offset_south, &offset_west); total_w = offset_east + offset_west + c->width; total_h = offset_north + offset_south + c->height; if (c->flags & CLIENT_BORDERS_ONLY_FLAG && theme_has_frame_type_defined(c->wm->mbtheme, FRAME_DIALOG_NORTH)) frame_ref_top = FRAME_DIALOG_NORTH; /* 'message dialogs have there own decorations */ if (c->flags & CLIENT_HAS_URGENCY_FLAG && theme_has_message_decor(w->mbtheme)) { frame_ref_top = FRAME_MSG; frame_ref_east = FRAME_MSG_EAST; frame_ref_west = FRAME_MSG_WEST; frame_ref_south = FRAME_MSG_SOUTH; } else if (c->flags & CLIENT_BORDERS_ONLY_FLAG && theme_has_borders_only_decor(c->wm->mbtheme)) { frame_ref_top = FRAME_DIALOG_NT_NORTH; frame_ref_east = FRAME_DIALOG_NT_EAST; frame_ref_west = FRAME_DIALOG_NT_WEST; frame_ref_south = FRAME_DIALOG_NT_SOUTH; } dbg("%s() c->width : %i , offset_east : %i, offset_west : %i\n", __func__, c->width, offset_east, offset_west ); is_shaped = theme_frame_wants_shaped_window( c->wm->mbtheme, frame_ref_top); if (is_shaped) client_init_backing_mask(c, total_w, c->height, offset_north, offset_south, offset_east, offset_west); theme_frame_paint(c->wm->mbtheme, c, frame_ref_top, total_w, offset_north); theme_frame_paint(c->wm->mbtheme, c, frame_ref_west, offset_west, c->height); theme_frame_paint(c->wm->mbtheme, c, frame_ref_east, offset_east, c->height); theme_frame_paint(c->wm->mbtheme, c, frame_ref_south, total_w, offset_south); /* We dont paint buttons for borderonly and message dialogs */ if (!(c->flags & CLIENT_BORDERS_ONLY_FLAG)) { theme_frame_button_paint(c->wm->mbtheme, c, BUTTON_ACTION_CLOSE, INACTIVE, FRAME_DIALOG, total_w, offset_north); if (c->flags & CLIENT_ACCEPT_BUTTON_FLAG) theme_frame_button_paint(w->mbtheme, c, BUTTON_ACTION_ACCEPT, INACTIVE, FRAME_DIALOG,total_w, offset_north); if (c->flags & CLIENT_HELP_BUTTON_FLAG) theme_frame_button_paint(w->mbtheme, c, BUTTON_ACTION_HELP, INACTIVE, FRAME_DIALOG,total_w, offset_north); if (c->flags & CLIENT_CUSTOM_BUTTON_FLAG) theme_frame_button_paint(w->mbtheme, c, BUTTON_ACTION_CUSTOM, INACTIVE, FRAME_DIALOG, total_w,offset_north); } if (is_shaped && !c->is_argb32) { XRectangle rects[1]; rects[0].x = offset_west; rects[0].y = offset_north; rects[0].width = total_w - offset_west - offset_east; rects[0].height = total_h - offset_south - offset_north; XShapeCombineRectangles ( c->wm->dpy, c->frame, ShapeBounding, 0, 0, rects, 1, ShapeSet, 0 ); #ifndef USE_COMPOSITE #if 0 if (c->wm->config->dialog_shade && (c->flags & CLIENT_IS_MODAL_FLAG)) { /* client->frame is our lowlighted window, so we only shape * our decor frames. We dont need to do this for composite. * * TODO: the logic for all this is very messy. fix. */ XShapeCombineMask( c->wm->dpy, c->frames_decor[NORTH], ShapeBounding, 0, 0, c->backing_masks[MSK_NORTH], ShapeSet); XShapeCombineMask( c->wm->dpy, c->frames_decor[SOUTH], ShapeBounding, 0, 0, c->backing_masks[MSK_SOUTH], ShapeSet); XShapeCombineMask( c->wm->dpy, c->frames_decor[WEST], ShapeBounding, 0, 0, c->backing_masks[MSK_WEST], ShapeSet); XShapeCombineMask( c->wm->dpy, c->frames_decor[EAST], ShapeBounding, 0, 0, c->backing_masks[MSK_EAST], ShapeSet); } else #endif #endif { XShapeCombineMask( c->wm->dpy, c->frames_decor[NORTH], ShapeBounding, 0, 0, c->backing_masks[MSK_NORTH], ShapeSet); XShapeCombineMask( c->wm->dpy, c->frames_decor[SOUTH], ShapeBounding, 0, 0, c->backing_masks[MSK_SOUTH], ShapeSet); XShapeCombineMask( c->wm->dpy, c->frames_decor[WEST], ShapeBounding, 0, 0, c->backing_masks[MSK_WEST], ShapeSet); XShapeCombineMask( c->wm->dpy, c->frames_decor[EAST], ShapeBounding, 0, 0, c->backing_masks[MSK_EAST], ShapeSet); XShapeCombineShape ( c->wm->dpy, c->frame, ShapeBounding, 0, 0, c->frames_decor[NORTH], ShapeBounding, ShapeUnion); XShapeCombineShape ( c->wm->dpy, c->frame, ShapeBounding, 0, total_h - offset_south, c->frames_decor[SOUTH], ShapeBounding, ShapeUnion); XShapeCombineShape ( c->wm->dpy, c->frame, ShapeBounding, 0, offset_north, c->frames_decor[WEST], ShapeBounding, ShapeUnion); XShapeCombineShape ( c->wm->dpy, c->frame, ShapeBounding, total_w - offset_east, offset_north, c->frames_decor[EAST], ShapeBounding, ShapeUnion); } } } void dialog_client_button_press(Client *c, XButtonEvent *e) { Wm *w = c->wm; int offset_north = dialog_client_title_height(c); int offset_south = 0, offset_west = 0, offset_east = 0; if (w->config->super_modal) { if (w->focused_client != c) { MBList *button_item = client_get_button_list_item_from_event(c, e); /* In the precense of a modal transient dialog ignore * certain buttons. */ if ((button_item && button_item->id == BUTTON_ACTION_HELP) || (button_item && button_item->id == BUTTON_ACTION_CLOSE)) return; } } dialog_client_get_offsets(c, &offset_east, &offset_south, &offset_west); switch (client_button_do_ops(c, e, FRAME_DIALOG, c->width + offset_east + offset_west, offset_north)) { case BUTTON_ACTION_CLOSE: client_deliver_delete(c); break; case BUTTON_ACTION_HELP: client_deliver_wm_protocol(c, w->atoms[_NET_WM_CONTEXT_HELP]); break; case BUTTON_ACTION_ACCEPT: client_deliver_wm_protocol(c, w->atoms[_NET_WM_CONTEXT_ACCEPT]); break; case BUTTON_ACTION_CUSTOM: client_deliver_wm_protocol(c, w->atoms[_NET_WM_CONTEXT_CUSTOM]); break; case -1: /* Cancelled */ break; case 0: /* Not on button */ #if 0 if (w->config->dialog_stratergy == WM_DIALOGS_STRATERGY_STATIC) { /* For static undraggble/stack fixed dialog we simply * hide the dialog when titlebar is clicked on. * * TODO: Ideally this code should go in drag loop. but * it seems the servergrab() stops underlying app * from repainting itself. Need to look more into * this. * Is it safe to simply remove the server grab ? * */ if (e->window != c->frames_decor[NORTH]) return; XUnmapWindow(w->dpy, c->frame); dialog_client_drag(c); misc_trap_xerrors(); XMapWindow(w->dpy, c->frame); if (w->focused_client == c) { w->focused_client = NULL; client_set_focus(c); } misc_untrap_xerrors(); XSync(w->dpy, False); return; } dialog_client_drag(c); #endif break; } } static void dialog_client_drag(Client *c) /* drag box */ { Wm *w = c->wm; XEvent ev; int offset_south = 0, offset_west = 0, offset_east = 0; int x1, y1, old_cx = c->x, old_cy = c->y; int frm_size = dialog_client_title_height(c); XSetWindowAttributes attr; Window win_outline; XRectangle rects[1]; Bool done = False, client_removed = False; dbg("%s called\n", __func__); dialog_client_get_offsets(c, &offset_east, &offset_south, &offset_west); if (XGrabPointer(c->wm->dpy, c->wm->root, False, (ButtonPressMask|ButtonReleaseMask|PointerMotionMask), GrabModeAsync, GrabModeAsync, None, c->wm->curs_drag, CurrentTime) != GrabSuccess) return; attr.override_redirect = True; attr.background_pixel = BlackPixel(w->dpy, w->screen); win_outline = XCreateWindow(w->dpy, w->root, c->x - offset_west, c->y - frm_size, c->width + offset_west + offset_east, c->height + frm_size + offset_south, 0, CopyFromParent, CopyFromParent, CopyFromParent, CWBackPixel|CWOverrideRedirect, &attr); rects[0].x = 2; rects[0].y = 2; rects[0].width = c->width + offset_west + offset_east - 4; rects[0].height = c->height + frm_size + offset_south - 4; XShapeCombineRectangles (w->dpy, win_outline, ShapeBounding, 0, 0, rects, 1, ShapeSubtract, 0 ); XMapWindow (w->dpy, win_outline); XSync (w->dpy, False); comp_engine_client_show(c->wm, c); _get_mouse_position(c->wm, &x1, &y1); XFlush(c->wm->dpy); while (!done) { int wanted_x = 0, wanted_y = 0; XMaskEvent(c->wm->dpy, ButtonPressMask|ButtonReleaseMask |PointerMotionMask|SubstructureNotifyMask, &ev); switch (ev.type) { case MapRequest: wm_handle_map_request(w, &ev.xmaprequest); break; case UnmapNotify: { if (wm_find_client(w, ev.xunmap.window, WINDOW) == c) { client_removed = True; done = True; } wm_handle_unmap_event(w, &ev.xunmap); break; } case MotionNotify: if (w->config->dialog_stratergy == WM_DIALOGS_STRATERGY_STATIC) break; wanted_x = (old_cx + (ev.xmotion.x - x1)); wanted_y = (old_cy + (ev.xmotion.y - y1)); c->x = wanted_x; c->y = wanted_y; XMoveWindow(c->wm->dpy, win_outline, c->x-offset_west, c->y-frm_size); break; case ButtonRelease: XMoveWindow(c->wm->dpy, c->frame, c->x - offset_west, c->y - dialog_client_title_height(c)); done = True; break; } } XUngrabPointer(w->dpy, CurrentTime); misc_trap_xerrors(); XDestroyWindow (w->dpy, win_outline); if (client_removed == False) { c->show(c); if (w->config->dialog_stratergy != WM_DIALOGS_STRATERGY_STATIC) { wm_activate_client(c); client_deliver_config(c); } } misc_untrap_xerrors(); } static void _get_mouse_position(Wm *w, int *x, int *y) { Window mouse_root, mouse_win; int win_x, win_y; unsigned int mask; XQueryPointer(w->dpy, w->root, &mouse_root, &mouse_win, x, y, &win_x, &win_y, &mask); } static Client* dialog_client_set_focus_next(Client *c) { Wm *w = c->wm; /* We dont have focus, therefore dont suggest what to focus next */ if (w->focused_client != c) { dbg("%s we dont have focus\n", __func__); return NULL; } if (c->next_focused_client && c != c->next_focused_client) { dbg("%s setting focus to c->next_focused_client\n", __func__); if (w->focused_client == c) w->focused_client = NULL; client_set_focus(c->next_focused_client); } else { Client *app_client = NULL, *p = NULL; dbg("%s setting focus to visibe_main\n", __func__); if (w->focused_client == c) w->focused_client = NULL; /* Find highest modal */ stack_enumerate_reverse (w,p) { if (p->type == MBCLIENT_TYPE_DIALOG && (p->flags & CLIENT_IS_MODAL_FLAG) && p != c) return p; } /* Check if main window has modals and focus that */ app_client = wm_get_visible_main_client(w); if (app_client) { Client *modal = NULL; modal = client_get_highest_transient(app_client, CLIENT_IS_MODAL_FLAG, c); if (modal) return modal; } return app_client; } return NULL; } void dialog_client_iconize(Client *c) { Wm *w = c->wm; Client *d = NULL, *p = NULL; client_set_state(c, IconicState); c->flags |= CLIENT_IS_MINIMIZED; c->mapped = False; XUnmapWindow(w->dpy, c->frame); if (c->flags & CLIENT_IS_MODAL_FLAG) c->wm->n_modals_present--; if (c->win_modal_blocker) { XUnmapWindow(w->dpy, c->win_modal_blocker); dbg("%s() blocker win unmapped for '%s'\n", __func__, c->name); } /* Make sure any transients get iconized too */ stack_enumerate(w, p) if (p->trans == c) p->iconize(p); if ((d = dialog_client_set_focus_next(c)) != NULL) wm_activate_client(d); } void dialog_client_destroy(Client *c) { Client *d = NULL; /* Focus the saved next or return a likely candidate if none found */ d = dialog_client_set_focus_next(c); if (c->flags & CLIENT_IS_MODAL_FLAG) c->wm->n_modals_present--; if (c->win_modal_blocker) { Wm *w = c->wm; XDestroyWindow(w->dpy, c->win_modal_blocker); w->n_modal_blocker_wins--; dbg("%s() blocker win destroyed for '%s'\n", __func__, c->name); } base_client_destroy(c); /* * We call activate_client mainly to figure out what to focus next. * This probably only happens in the case of transient for root * dialogs which likely have no real focus history. */ if (d) wm_activate_client(d); } matchbox-window-manager-1.2/matchbox-window-manager/src/wm.c0000664000211500234210000026331111307441355023052 0ustar bifh1bifhs/* * Matchbox Window Manager - A lightweight window manager not for the * desktop. * * Authored By Matthew Allum * * Copyright (c) 2002, 2004 OpenedHand Ltd - http://o-hand.com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #include "wm.h" #include "config.h" #ifdef HAVE_XFIXES #include /* Used to *really* hide cursor */ #endif #ifdef HAVE_XCURSOR #include #endif #ifdef USE_XSETTINGS static void wm_xsettings_notify_cb (const char *name, XSettingsAction action, XSettingsSetting *setting, void *data); #endif #ifdef USE_LIBSN static void wm_sn_timeout_check (Wm *w); static void wm_sn_exec(Wm *w, char* name, char* bin_name, char *desc); static void wm_sn_monitor_event_func (SnMonitorEvent *event, void *user_data); static void wm_sn_cycle_update_root_prop(Wm *w); static SnCycle *wm_sn_cycle_new(Wm *w, const char *bin_name); static void wm_sn_cycle_add(Wm *w, const char *bin_name); #endif Wm* wm_new(int argc, char **argv) { XSetWindowAttributes sattr; /* for root win */ Wm *w = NULL; XColor dummy_col; w = malloc(sizeof(Wm)); memset(w, 0, sizeof(Wm)); w->flags = STARTUP_FLAG; wm_load_config(w, &argc, argv); XSetErrorHandler(handle_xerror); w->screen = DefaultScreen(w->dpy); w->root = RootWindow(w->dpy, w->screen); w->dpy_width = DisplayWidth(w->dpy, w->screen); w->dpy_height = DisplayHeight(w->dpy, w->screen); w->n_active_ping_clients = 0; w->next_click_is_not_double = True; #ifdef USE_SM sm_connect(w); /* previous_cliend_id */ #endif sattr.event_mask = SubstructureRedirectMask |SubstructureNotifyMask |StructureNotifyMask |PropertyChangeMask; /* Tell root win we wanna be wm */ XChangeWindowAttributes(w->dpy, w->root, CWEventMask, &sattr); XSelectInput(w->dpy, w->root, sattr.event_mask); /* Use this 'dull' color for 'base' window backgrounds and such. 'Appears' to actually reduce flicker */ XAllocNamedColor(w->dpy, DefaultColormap(w->dpy, w->screen), "grey", &w->grey_col, &dummy_col); #ifdef USE_GCONF g_type_init() ; w->gconf_client = gconf_client_get_default(); w->gconf_context = g_main_context_default (); if (w->gconf_client != NULL) { gconf_client_add_dir(w->gconf_client, "/apps/matchbox", /* GCONF_CLIENT_PRELOAD_NONE */ GCONF_CLIENT_PRELOAD_RECURSIVE, NULL); gconf_client_notify_add(w->gconf_client, "/apps/matchbox", gconf_key_changed_callback, w, NULL, NULL); } else fprintf(stderr, "matchbox: failed to initialise gconf client\n"); #endif #ifdef USE_XSETTINGS w->xsettings_client = xsettings_client_new (w->dpy, w->screen, wm_xsettings_notify_cb, NULL, (void *)w ); #endif #ifndef STANDALONE w->pb = mb_pixbuf_new(w->dpy, w->screen); if (w->config->use_icons) { w->img_generic_icon = mb_pixbuf_img_new_from_file(w->pb, GENERIC_ICON); if (w->img_generic_icon == NULL) { w->config->use_icons = 0; } else misc_scale_wm_app_icon(w); } #endif #ifndef NO_KBD keys_init(w); #endif ewmh_init(w); comp_engine_init (w); mbtheme_init(w, w->config->theme); ewmh_init_props(w); wm_set_cursor_visibility(w, !w->config->no_cursor); w->curs_busy = XCreateFontCursor(w->dpy, XC_watch); w->curs_drag = XCreateFontCursor(w->dpy, XC_fleur); #ifdef USE_LIBSN w->sn_display = sn_display_new (w->dpy, NULL, NULL); /*XXX error callbacks*/ w->sn_context = sn_monitor_context_new (w->sn_display, DefaultScreen (w->dpy), wm_sn_monitor_event_func, (void *)w, NULL); w->sn_busy_cnt = 0; w->sn_cycles = NULL; w->sn_mapping_list = NULL; #endif /* Panel/Dock in titlebar stuff */ w->have_titlebar_panel = NULL; w->flags ^= STARTUP_FLAG; /* Remove startup flag */ return w; } void wm_usage(char *progname) { printf("usage: %s [options ...]\n", progname); printf("\t-display \n"); printf("\t-theme \n"); printf("\t-use_titlebar \n"); printf("\t-use_cursor \n"); #ifndef USE_COMPOSITE printf("\t-use_lowlight \n"); #endif printf("\t-use_dialog_mode \n"); printf("\t-use_desktop_mode \n"); printf("\t-use_super_modal \n"); printf("\t-force_dialogs \n"); #ifndef NO_KBD printf("\t-kbdconfig \n"); #endif #ifdef USE_SM printf("\t--sm-client-id \n"); #endif #ifdef STANDALONE printf("\t-titlebar_panel \n"); #endif printf("\n"); printf("Compile time features;\n"); #ifdef DEBUG printf("\tdebug build yes\n"); #else printf("\tdebug build no\n"); #endif #if defined(USE_XFT) || defined(MB_HAVE_XFT) printf("\tXFT support yes\n"); #else printf("\tXFT support no\n"); #endif #ifdef USE_LIBSN printf("\tStartup Notification support yes\n"); #else printf("\tStartup Notification support no\n"); #endif #ifdef USE_EXPAT printf("\tExpat support yes\n"); #else printf("\tExpat support no\n"); #endif #ifdef USE_XSETTINGS printf("\tXSettings support yes\n"); #else printf("\tXSettings support no\n"); #endif #ifdef MB_HAVE_PNG printf("\tPNG support yes\n"); #else printf("\tPNG support no\n"); #endif #ifdef MB_HAVE_JPEG printf("\tJPG support yes\n"); #else printf("\tJPG support no\n"); #endif #ifdef MB_HAVE_PANGO printf("\tpango support yes\n"); #else printf("\tpango support no\n"); #endif #ifndef STANDALONE printf("\tTheme support yes\n"); #else printf("\tTheme support no\n"); #endif #ifdef USE_GCONF printf("\tgconf support yes\n"); #else printf("\tgconf support no\n"); #endif #ifdef USE_COMPOSITE printf("\tcomposite support yes\n"); #else printf("\tcomposite support no\n"); #endif #ifndef NO_PING printf("\tping protocol support yes\n"); #else printf("\tping protocol support no\n"); #endif #ifndef NO_XRM printf("\tXRM support yes\n"); #else printf("\tXRM support no\n"); #endif #ifdef USE_SM printf("\tSession support yes\n"); #else printf("\tSession support no\n"); #endif printf("\nmatchbox-window-manager %s \nCopyright (C) 2005 Matthew Allum, OpenedHand Ltd.\n", VERSION); printf("This is free software; see the source for copying conditions.\n"); printf("Visit http://projects.o-hand.com/matchbox for more info.\n"); exit(0); } #ifdef NO_XRM void wm_load_config (Wm *w, int *argc, char *argv[]) { int i; /* Configure these now, and let the arguments override them */ w->config = malloc(sizeof(Wm_config)); memset(w->config, 0, sizeof(Wm_config)); /* config defaults */ w->config->use_title = True; w->config->display_name[0] = '\0'; w->config->dbl_click_time = 200; w->config->use_icons = 16; w->config->no_cursor = False; w->config->dialog_shade = False; w->config->dialog_stratergy = WM_DIALOGS_STRATERGY_CONSTRAINED; w->config->ping_handler = getenv("MB_HUNG_APP_HANDLER"); w->config->ping_aggressive = getenv("MB_AGGRESSIVE_PING") ? True : False; #ifdef USE_COMPOSITE w->config->dialog_shade = True; #endif w->config->lowlight_params[0] = 0; w->config->lowlight_params[1] = 0; w->config->lowlight_params[2] = 0; w->config->lowlight_params[3] = 100; if (getenv("DISPLAY") != NULL) strcpy(w->config->display_name, (char *)getenv("DISPLAY")); for (i = 1; i < *argc; i++) { if (!strcmp ("-theme", argv[i])) { if (++i>=*argc) wm_usage (argv[0]); #ifdef STANDALONE fprintf(stderr, "matchbox: This matchbox build does not support themeing\n"); #else w->config->theme = argv[i]; dbg("%s() got theme :%s ", __func__, w->config->theme); #endif continue; } if (!strcmp ("-use_titlebar", argv[i])) { if (++i>=*argc) wm_usage (argv[0]); if (strcmp(argv[i], "no") == 0) w->config->use_title = False; continue; } if (!strcmp("-display", argv[i])) { if (++i>=*argc) wm_usage (argv[0]); strcpy (w->config->display_name, argv[i]); continue; } if (!strcmp ("-use_cursor", argv[i])) { if (++i>=*argc) wm_usage (argv[0]); if (strcmp(argv[i], "no") == 0) w->config->no_cursor = True; continue; } #ifndef USE_COMPOSITE if (!strcmp ("-use_lowlight", argv[i])) { if (++i>=*argc) wm_usage (argv[0]); if (strcmp(argv[i], "yes") == 0) w->config->dialog_shade = True; continue; } #endif if (!strcmp ("-use_super_modal", argv[i])) { if (++i>=*argc) wm_usage (argv[0]); if (strcmp(argv[i], "yes") == 0) w->config->super_modal = True; continue; } if (!strcmp("-use_dialog_mode", argv[i])) { if (++i>=*argc) wm_usage (argv[0]); if (!strcmp("free", argv[i])) { w->config->dialog_stratergy = WM_DIALOGS_STRATERGY_FREE; } else if (!strcmp("const-horiz", argv[i])) { w->config->dialog_stratergy = WM_DIALOGS_STRATERGY_CONSTRAINED_HORIZ; } else if (!strcmp("static", argv[i])) { w->config->dialog_stratergy = WM_DIALOGS_STRATERGY_STATIC; } else wm_usage (argv[0]); continue; } if (!strcmp("-use_desktop_mode", argv[i])) { if (++i>=*argc) wm_usage (argv[0]); if (!strcmp("decorated", argv[i])) w->flags |= DESKTOP_DECOR_FLAG; continue; } #ifdef STANDALONE if (!strcmp("-titlebar_panel", argv[i])) { int flags = 0; if (++i>=*argc) wm_usage (argv[0]); flags = XParseGeometry(argv[i], &w->toolbar_panel_x, &w->toolbar_panel_y, &w->toolbar_panel_w, &w->toolbar_panel_h) ; if ((flags & XValue) && (flags & YValue) && (flags & WidthValue) && (flags & HeightValue)) w->have_toolbar_panel = True; else fprintf(stderr, "matchbox: titlebar panel geometry string invalid\n"); continue; } #endif if (!strcmp ("-force_dialogs", argv[i])) { if (++i>=*argc) wm_usage (argv[0]); w->config->force_dialogs = argv[i]; continue; } #ifndef NO_KBD if (!strcmp ("-kbdconfig", argv[i])) { if (++i>=*argc) wm_usage (argv[0]); w->config->kbd_conf_file = argv[i]; continue; } #endif #ifdef USE_SM if (!strcmp ("--sm-client-id", argv[i])) { if (++i>=*argc) wm_usage (argv[0]); w->config->sm_client_id = strdup(argv[i]); continue; } #endif wm_usage (argv[0]); } if ((w->dpy = XOpenDisplay(w->config->display_name)) == NULL) { fprintf(stderr, "matchbox-wm: can't open display! check your DISPLAY variable.\n"); exit(1); } } #else /* We have memory hungry XRM */ void wm_load_config (Wm *w, int *argc, char *argv[]) { static XrmDatabase rDB, cmdlnDB, srDB; char *type; XrmValue value; static int opTableEntries = 12; static XrmOptionDescRec opTable[] = { {"-theme", ".theme", XrmoptionSepArg, (XPointer) NULL}, {"-use_titlebar",".titlebar", XrmoptionSepArg, (XPointer) NULL}, {"-display", ".display", XrmoptionSepArg, (XPointer) NULL}, {"-use_cursor", ".cursor", XrmoptionSepArg, (XPointer) NULL}, {"-use_lowlight", ".lowlight", XrmoptionSepArg, (XPointer) NULL}, {"-use_dialog_mode", ".dialog", XrmoptionSepArg, (XPointer) NULL}, {"-use_desktop_mode",".desktop", XrmoptionSepArg, (XPointer) NULL}, {"-titlebar_panel", ".titlebarpanel", XrmoptionSepArg, (XPointer) NULL}, {"-force_dialogs", ".forcedialogs", XrmoptionSepArg, (XPointer) NULL}, {"--sm-client-id", ".session", XrmoptionSepArg, (XPointer) NULL}, {"-use_super_modal", ".supermodal", XrmoptionSepArg, (XPointer) NULL}, {"-kbdconfig", ".kbdconfig", XrmoptionSepArg, (XPointer) NULL}, }; XrmInitialize(); rDB = XrmGetFileDatabase(CONFDEFAULTS); XrmParseCommand(&cmdlnDB, opTable, opTableEntries, "matchbox", argc, argv); if (*argc != 1) wm_usage(argv[0]); XrmCombineDatabase(cmdlnDB, &rDB, True); w->config = malloc(sizeof(Wm_config)); memset(w->config, 0, sizeof(Wm_config)); /* config defaults */ w->config->use_title = True; w->config->display_name[0] = '\0'; w->config->dbl_click_time = 200; w->config->use_icons = 16; w->config->no_cursor = False; w->config->dialog_shade = False; w->config->dialog_stratergy = WM_DIALOGS_STRATERGY_CONSTRAINED; w->config->ping_handler = getenv("MB_HUNG_APP_HANDLER"); w->config->ping_aggressive = getenv("MB_AGGRESSIVE_PING") ? True : False; if (XrmGetResource(rDB, "matchbox.display", "Matchbox.Display", &type, &value) == True) { strncpy(w->config->display_name, value.addr, (int) value.size); w->config->display_name[value.size] = '\0'; } else { if (getenv("DISPLAY") != NULL) strcpy(w->config->display_name, (char *)getenv("DISPLAY")); } if ((w->dpy = XOpenDisplay(w->config->display_name)) == NULL) { fprintf(stderr, "matchbox: can't open display! check your DISPLAY variable.\n"); exit(1); } if (XResourceManagerString(w->dpy) != NULL) { srDB = XrmGetStringDatabase(XResourceManagerString(w->dpy)); if (srDB) XrmCombineDatabase(srDB, &rDB, False); } if (XrmGetResource(rDB, "matchbox.theme", "Matchbox.Theme", &type, &value) == True) { #ifdef STANDALONE fprintf(stderr, "matchbox: This matchbox build does not support themeing\n"); #else w->config->theme = (char *)malloc(sizeof(char)*(value.size+1)); strncpy(w->config->theme, value.addr, (int) value.size); w->config->theme[value.size] = '\0'; dbg("%s() got theme :%s ", __func__, w->config->theme); #endif } else { w->config->theme = NULL; } if (XrmGetResource(rDB, "matchbox.forcedialogs", "Matchbox.ForceDialogs", &type, &value) == True) { w->config->force_dialogs = (char *)malloc(sizeof(char)*(value.size+1)); strncpy(w->config->force_dialogs, value.addr, (int) value.size); w->config->force_dialogs[value.size] = '\0'; dbg("%s() got force dialogs :%s ", __func__, w->config->force_dialogs); } #ifndef NO_KBD if (XrmGetResource(rDB, "matchbox.kbdconfig", "Matchbox.Keybdconfig", &type, &value) == True) { w->config->kbd_conf_file = (char *)malloc(sizeof(char)*(value.size+1)); strncpy(w->config->kbd_conf_file, value.addr, (int) value.size); w->config->kbd_conf_file[value.size] = '\0'; dbg("%s() got kbdconfig :%s ", __func__, w->config->kbd_conf_file); } #endif if (XrmGetResource(rDB, "matchbox.titlebar", "Matchbox.Titlebar", &type, &value) == True) { if(strncmp(value.addr, "no", (int) value.size) == 0) { dbg("%s() TURNING TITLE OFF\n", __func__); w->config->use_title = False; } } if (XrmGetResource (rDB, "matchbox.cursor", "Matchbox.Cursor", &type, &value) == True) { if (strncmp (value.addr, "no", (int) value.size) == 0) { dbg("%s() TURNING CURSOR OFF\n", __func__); w->config->no_cursor = True; } } if (XrmGetResource(rDB, "matchbox.supermodal", "Matchbox.Supermodal", &type, &value) == True) { if(strncmp(value.addr, "yes", (int) value.size) == 0) { dbg("%s() TURNING SUPER MODAL ON\n", __func__); w->config->super_modal = True; } } /* * Composite matchbox always uses lowlighting */ #ifndef USE_COMPOSITE if (XrmGetResource (rDB, "matchbox.lowlight", "Matchbox.Lowlight", &type, &value) == True) { if (strncmp (value.addr, "yes", (int) value.size) == 0) { #endif dbg("%s() TURNING LOWLIGHT ON\n", __func__); w->config->dialog_shade = True; /* values below now set in theme */ w->config->lowlight_params[0] = 0; w->config->lowlight_params[1] = 0; w->config->lowlight_params[2] = 0; w->config->lowlight_params[3] = 100; #ifndef USE_COMPOSITE } } #endif if (XrmGetResource (rDB, "matchbox.dialog", "Matchbox.Dialog", &type, &value) == True) { if (strncmp (value.addr, "free", (int) value.size) == 0) { w->config->dialog_stratergy = WM_DIALOGS_STRATERGY_FREE; } else if (strncmp (value.addr, "const-horiz", (int) value.size) == 0) { w->config->dialog_stratergy = WM_DIALOGS_STRATERGY_CONSTRAINED_HORIZ; } else if (strncmp (value.addr, "static", (int) value.size) == 0) { w->config->dialog_stratergy = WM_DIALOGS_STRATERGY_STATIC; } else wm_usage("matchbox"); } if (XrmGetResource (rDB, "matchbox.desktop", "Matchbox.Desktop", &type, &value) == True) { if (strncmp (value.addr, "decorated", (int) value.size) == 0) { w->flags |= DESKTOP_DECOR_FLAG; } } #ifdef STANDALONE if (XrmGetResource(rDB, "matchbox.titlebarpanel", "Matchbox.Titlebarpanel", &type, &value) == True) { int flags = 0; char *geom = (char *)malloc(sizeof(char)*(value.size+1)); strncpy(geom, value.addr, (int) value.size); geom[value.size] = '\0'; flags = XParseGeometry(geom, &w->toolbar_panel_x, &w->toolbar_panel_y, &w->toolbar_panel_w, &w->toolbar_panel_h) ; if ((flags & XValue) && (flags & YValue) && (flags & WidthValue) && (flags & HeightValue)) w->have_toolbar_panel = True; else fprintf(stderr, "matchbox: titlebar panel geometry string invalid\n"); free(geom); } #endif #ifdef USE_SM if (XrmGetResource(rDB, "matchbox.session", "Matchbox.session", &type, &value) == True) { w->config->sm_client_id = (char *)malloc(sizeof(char)*(value.size+1)); strncpy(w->config->sm_client_id, value.addr, (int) value.size); w->config->sm_client_id[value.size] = '\0'; dbg("%s() got sm_client_id: %s ", __func__, w->config->sm_client_id); } #endif } #endif /* NO_XRM */ void wm_init_existing(Wm *w) { unsigned int nwins, i; Window dummyw1, dummyw2, *wins; XWindowAttributes attr; Client *c; /* set blank hints */ ewmh_update_rects(w); ewmh_update_lists(w); ewmh_update_desktop_hint(w); XQueryTree(w->dpy, w->root, &dummyw1, &dummyw2, &wins, &nwins); for (i = 0; i < nwins; i++) { XGetWindowAttributes(w->dpy, wins[i], &attr); if (!attr.override_redirect && attr.map_state == IsViewable) { c = wm_make_new_client(w, wins[i]); #ifdef USE_COMPOSITE if (c) c->ignore_unmap = 2; /* comp seems to unmap twice ? */ #else if (c) c->ignore_unmap++; #endif } } XFree(wins); } Client* wm_find_client(Wm *w, Window win, int mode) { Client *c = NULL; if (stack_empty(w)) return NULL; if (mode == FRAME) { stack_enumerate_reverse(w, c) if (c->frame == win || (client_title_frame(c) && client_title_frame(c) == win) ) return c; } else { stack_enumerate_reverse(w, c) if (c->window == win) return c; } return NULL; } /* Grab an X Event - block but With a timeout */ static Bool get_xevent_timed(Wm *w, XEvent *event_return, struct timeval *tv) { if (tv->tv_usec == 0 && tv->tv_sec == 0) { #ifndef USE_SM XNextEvent(w->dpy, event_return); return True; #else tv->tv_sec = 5; #endif } XFlush(w->dpy); if (XPending(w->dpy) == 0) { int fd = ConnectionNumber(w->dpy); fd_set readset; FD_ZERO(&readset); FD_SET(fd, &readset); #ifdef USE_SM if (w->sm_ice_fd != -1) { FD_SET(w->sm_ice_fd, &readset); if (w->sm_ice_fd > fd) fd = w->sm_ice_fd; /* for +1 below */ } #endif if (select(fd+1, &readset, NULL, NULL, tv) == 0) { return False; } else { #ifdef USE_SM if ( w->sm_ice_fd != -1 && FD_ISSET(w->sm_ice_fd, &readset) ) { sm_process_event(w); return False; } #endif XNextEvent(w->dpy, event_return); return True; } } else { XNextEvent(w->dpy, event_return); return True; } } #ifdef USE_COMPOSITE /* For the compositing engine we need to track overide redirect * windows so the compositor can paint them. * * What we do is make a 'lightweight' client object. * * TODO: base_client_new() should really be able to do this. * and avoid any extra code. */ void wm_handle_map_notify(Wm *w, Window win) { XWindowAttributes attr; Client *new_client = NULL; /* Do we already have it ? */ if (wm_find_client(w, win, WINDOW)) return; if (wm_find_client(w, win, FRAME)) return; dbg("%s() called for unknown window\n", __func__); misc_trap_xerrors(); XGetWindowAttributes(w->dpy, win, &attr); if (misc_untrap_xerrors()) return; /* safety on */ if (attr.class == InputOnly) return; if (attr.override_redirect) { dbg("%s() making new overide redirect window\n", __func__); new_client = malloc(sizeof(Client)); memset(new_client, 0, sizeof(Client)); new_client->x = attr.x; new_client->y = attr.y; new_client->width = attr.width; new_client->height = attr.height; new_client->visual = attr.visual; new_client->want_shadow = True; new_client->type = MBCLIENT_TYPE_OVERRIDE; new_client->frame = new_client->window = win; new_client->mapped = True; new_client->name = strdup(""); new_client->wm = w; /* Set up the 'methods' - expect to be overidden */ base_client_set_funcs(new_client); stack_append_top(new_client); dbg("%s() client frame is %li\n", __func__, new_client->frame); comp_engine_client_init(w, new_client); comp_engine_client_show(w, new_client); } } #endif /* Main event loop, timeout for polling stuff */ void wm_event_loop(Wm* w) { XEvent ev; int hung_app_timer = 0; struct timeval tvt; for (;;) { tvt.tv_usec = 0; tvt.tv_sec = 0; #ifdef USE_LIBSN if (w->sn_busy_cnt) tvt.tv_sec = 1; #endif #ifdef USE_GCONF if (w->gconf_client != NULL) tvt.tv_sec = 1; #endif #ifndef NO_PING if (w->n_active_ping_clients) tvt.tv_sec = 1; #endif if (get_xevent_timed(w, &ev, &tvt)) { switch (ev.type) { #ifdef USE_COMPOSITE case MapNotify: wm_handle_map_notify(w, ev.xmap.window); break; #endif case ButtonPress: wm_handle_button_event(w, &ev.xbutton); break; case MapRequest: wm_handle_map_request(w, &ev.xmaprequest); break; case UnmapNotify: wm_handle_unmap_event(w, &ev.xunmap); break; case Expose: wm_handle_expose_event(w, &ev.xexpose); break; case DestroyNotify: wm_handle_destroy_event(w, &ev.xdestroywindow); break; case ConfigureRequest: wm_handle_configure_request(w, &ev.xconfigurerequest); break; case ConfigureNotify: wm_handle_configure_notify(w, &ev.xconfigure); break; case ClientMessage: wm_handle_client_message(w, &ev.xclient); break; case KeyPress: wm_handle_keypress(w, &ev.xkey); break; case PropertyNotify: wm_handle_property_change(w, &ev.xproperty); break; case GravityNotify: dbg("**** got gravity event ***"); break; #ifndef NO_KBD case MappingNotify: dbg("%s() got MappingNotify\n", __func__); XRefreshKeyboardMapping(&ev.xmapping); break; #endif default: dbg("%s() ignoring event->type : %d\n", __func__, ev.type); break; } comp_engine_handle_events(w, &ev); #ifdef USE_XSYNC if (w->have_xsync && ev.type == w->sync_event_base + XSyncAlarmNotify) { dbg("%s() got ewmh_sync alarm notify\n", __func__); ewmh_sync_handle_event(w, (XSyncAlarmNotifyEvent*)&ev); } #endif #ifdef USE_XSETTINGS if (w->xsettings_client != NULL) xsettings_client_process_event(w->xsettings_client, &ev); #endif #ifdef USE_LIBSN sn_display_process_event (w->sn_display, &ev); #endif } else { /* No X event poll checks here */ #ifdef USE_LIBSN if (w->sn_busy_cnt) wm_sn_timeout_check (w); #endif #ifdef USE_GCONF if (w->gconf_client != NULL) g_main_context_iteration (w->gconf_context, FALSE); #endif #ifndef NO_PING /* check for hung apps every PING_CHECK_FREQ seconds */ if (++hung_app_timer >= PING_CHECK_FREQ && w->n_active_ping_clients) { hung_app_timer = 0; ewmh_hung_app_check(w); } #endif } #ifdef USE_COMPOSITE if (w->all_damage) { comp_engine_render(w, w->all_damage); XFixesDestroyRegion (w->dpy, w->all_damage); w->all_damage = None; } #endif } } void wm_handle_button_event(Wm *w, XButtonEvent *e) { Client *p = NULL; Client *c = wm_find_client(w, e->window, WINDOW); dbg("%s() called\n", __func__); /* Raise dialogs, set focus if needed */ if (c && !(w->flags & MENU_FLAG)) { /* Click was on window rather than decorations */ /* Dont move focus for a modal dialog */ if (w->focused_client && c != w->focused_client && w->focused_client->type == MBCLIENT_TYPE_DIALOG && w->focused_client->flags & CLIENT_IS_MODAL_FLAG) { Client *trans = w->focused_client->trans; /* Burrow down transient list */ while (trans != NULL && trans != c) trans = trans->trans; if (trans == c) { XAllowEvents(w->dpy, ReplayPointer, CurrentTime); return; } } if (c->type == MBCLIENT_TYPE_DIALOG && w->config->dialog_stratergy != WM_DIALOGS_STRATERGY_STATIC) { /* raise the dialog up, handle focus etc */ if (c != w->focused_client) wm_activate_client(c); } else { client_set_focus(c); if (c->type & (MBCLIENT_TYPE_DESKTOP|MBCLIENT_TYPE_APP)) c->next_focused_client = NULL; } /* forward grabbed events */ XAllowEvents(w->dpy, ReplayPointer, CurrentTime); return; } c = wm_find_client(w, e->window, FRAME); /* remove task menu if its up */ if (w->flags & MENU_FLAG) { if (c && c->type == MBCLIENT_TYPE_TASK_MENU ) c->button_press(c,e); stack_enumerate(w, p) if (p->type == MBCLIENT_TYPE_TASK_MENU) { select_client_destroy(p); break; } return; } /* Pass the event on to the window class */ if (c) c->button_press(c,e); } void wm_handle_keypress(Wm *w, XKeyEvent *e) { #ifndef NO_KBD MBConfigKbdEntry *entry = w->config->kb->entrys; Client *p = NULL; #ifdef USE_LIBSN Bool found = False; SnCycle *current_cycle = w->sn_cycles; #endif dbg("%s() called\n", __func__ ); if(w->flags & MENU_FLAG) { stack_enumerate(w, p) if ( p->type == MBCLIENT_TYPE_TASK_MENU) break; if (p->type == MBCLIENT_TYPE_TASK_MENU) { select_client_event_loop( p, NULL ); select_client_destroy (p); return; } } while (entry != NULL) { if (XKeycodeToKeysym(w->dpy, e->keycode, entry->index) == entry->key && e->state == entry->ModifierMask ) { switch (entry->action) { case KEY_ACTN_EXEC: fork_exec(entry->sdata); break; #ifdef USE_LIBSN case KEY_ACTN_EXEC_SINGLE: if (current_cycle != NULL) { while(current_cycle != NULL) { dbg("%s(): checking %s\n", __func__, current_cycle->bin_name); if (!strcmp(current_cycle->bin_name, entry->sdata) && current_cycle->xid == None) { dbg("%s() %s is already starting\n", __func__, entry->sdata); return; /* entry is in process of starting */ } current_cycle = current_cycle->next; } } current_cycle = w->sn_cycles; if (!stack_empty(w)) { while(current_cycle != NULL) { if (current_cycle->xid != None && !strcmp(current_cycle->bin_name, entry->sdata)) { p = wm_find_client(w, current_cycle->xid, WINDOW); if (p) { wm_activate_client(p); found = True; } } current_cycle = current_cycle->next; } } if (!found) wm_sn_exec(w, entry->sdata, entry->sdata, entry->sdata); break; case KEY_ACTN_EXEC_SN: wm_sn_exec(w, entry->sdata, entry->sdata, entry->sdata); break; #endif case KEY_ACTN_NEXT_CLIENT: wm_activate_client(stack_cycle_backward(w, MBCLIENT_TYPE_APP)); break; case KEY_ACTN_PREV_CLIENT: wm_activate_client(stack_cycle_forward(w, MBCLIENT_TYPE_APP)); break; case KEY_ACTN_CLOSE_CLIENT: if (w->stack_top_app) client_deliver_delete(w->stack_top_app); break; case KEY_ACTN_TOGGLE_DESKTOP: wm_toggle_desktop(w); break; case KEY_ACTN_TASK_MENU_ACTIVATE: select_client_new(w); break; case KEY_ACTN_HIDE_TITLEBAR: if (w->stack_top_app) main_client_toggle_title_bar(w->stack_top_app); break; case KEY_ACTN_FULLSCREEN: if (w->stack_top_app) main_client_toggle_fullscreen(w->stack_top_app); break; } } entry = entry->next_entry; } #endif } void wm_handle_configure_notify(Wm *w, XConfigureEvent *e) { Client *p, *cdesktop = NULL; Client *ctitledock = NULL; int height_diff, width_diff; dbg("%s() called\n", __func__); if (e->window == w->root) /* screen rotation */ { /* TODO: * It would probably be cleaner ( though add a dep ) * to use randr here to get more info about the rotation * ( eg. direction ) */ dbg("%s() configure notify event called on root", __func__ ); if (e->width != w->dpy_width || e->height != w->dpy_height) { height_diff = e->height - w->dpy_height; width_diff = e->width - w->dpy_width; w->dpy_width = e->width; w->dpy_height = e->height; if (stack_empty(w)) return; XGrabServer(w->dpy); /* Clear all caches so everything gets redrawn ok */ theme_img_cache_clear_all( w->mbtheme ); theme_pixmap_cache_clear_all( w->mbtheme ); stack_enumerate(w, p) { switch (p->type) { case MBCLIENT_TYPE_APP : p->width += width_diff; p->height += height_diff; p->have_cache = False; break; case MBCLIENT_TYPE_TOOLBAR : p->width += width_diff; p->y += height_diff; break; case MBCLIENT_TYPE_PANEL : if (p->flags & CLIENT_DOCK_WEST) { p->height += height_diff; } else if (p->flags & CLIENT_DOCK_EAST) { p->height += height_diff; p->x += width_diff; } else if (p->flags & CLIENT_DOCK_SOUTH) { p->width += width_diff; p->y += height_diff; } else if (p->flags & CLIENT_DOCK_NORTH) { p->width += width_diff; } else if (p->flags & CLIENT_DOCK_TITLEBAR) { ctitledock = p; } break; case MBCLIENT_TYPE_DIALOG : /* * TODO: * show check if the dialog is centered and make sure * if gets recentered on rotation ? * * - Change x,y,width?,height? rotation size change factors ? * - above may 'just work' * - Set x=0, y=0 so centering is forced * - set a flag is dialog if initally centered ? */ dialog_client_configure(p); break; case MBCLIENT_TYPE_DESKTOP: p->width += width_diff; p->height += height_diff; cdesktop = p; break; default: break; } /* we leave desktop/titlebar dock till last */ if (p != cdesktop && p != ctitledock) { p->move_resize(p); /* destroy buttons so they get reposioned */ client_buttons_delete_all(p); p->redraw(p, False); client_deliver_config(p); } comp_engine_client_repair (w, p); } if (cdesktop) { cdesktop->move_resize(cdesktop); client_deliver_config(cdesktop); } if (ctitledock) { dockbar_client_configure(ctitledock); ctitledock->move_resize(ctitledock); client_deliver_config(ctitledock); } comp_engine_destroy_root_buffer(w); comp_engine_render(w, None); ewmh_update_rects(w); wm_activate_client(wm_get_visible_main_client(w)); XSync(w->dpy, False); XUngrabServer(w->dpy); } } } void wm_handle_configure_request (Wm *w, XConfigureRequestEvent *e ) { Client *c = wm_find_client(w, e->window, WINDOW); XWindowChanges xwc; unsigned long value_mask = e->value_mask; int req_x = e->x; int req_y = e->y; int req_w = e->width; int req_h = e->height; Bool want_activate = False; /* TODO: Double check ICCCM on this code. * see http://tronche.com/gui/x/icccm/sec-4.html#s-4.1.5 * Only send synthetic configure notify on no change. * */ if (!c ) { /* Dont know any thing about this window. Let it have what it * wants and leave. * Can be a window initally mapping, thus the trap as it could * of already dissapeared. */ dbg("%s() could find source client %ix%i\n", __func__, e->width, e->height); xwc.x = req_x; xwc.y = req_y; xwc.width = req_w; xwc.height = req_h; xwc.sibling = e->above; xwc.stack_mode = e->detail; misc_trap_xerrors(); XConfigureWindow(w->dpy, e->window, e->value_mask, &xwc); misc_untrap_xerrors(); return; } /* Process exactly what changes have been reuested */ if (!(value_mask & CWWidth)) req_w = c->width; if (!(value_mask & CWHeight)) req_h = c->height; if ((e->x <= 0 && !(c->flags & CLIENT_TITLE_HIDDEN_FLAG)) || !(value_mask & CWX)) req_x = c->x; if ((e->y <= 0 && !(c->flags & CLIENT_TITLE_HIDDEN_FLAG)) || !(value_mask & CWY)) req_y = c->y; dbg("%s() for win %s - have w: %i vs %i, h: %i" "vs %i, x: %i vs %i, y: %i vs %i,\n", __func__, c->name, c->width, req_w, c->height, req_h, c->x, req_x, c->y, req_y ); /* Deal with raising - needs work, not sure if anything really * relies on this / or how it fits with mb. * * Wins can use _NET_ACTIVATE_WINDOW to raise themselse. * Dialogs should be able to raise / lower theme selves ? */ if (value_mask & (CWSibling|CWStackMode)) { /* e->above is sibling * e->detail is stack_mode */ Client *sibling = wm_find_client(w, e->window, WINDOW); dbg("%s() value_mask & (CWSibling|CWStackMode) sibling is %s (%li vs %li\n", __func__, sibling ? sibling->name : "unkown", e->window, c->window ); if (sibling) { switch (e->detail) { case Above: dbg("%s() (CWSibling|CWStackMode) above %s\n", __func__, sibling->name); /* Dialog 'above its self, call activate to raise it */ if (sibling == c && c->type == MBCLIENT_TYPE_DIALOG) want_activate = True; break; case Below: dbg("%s() (CWSibling|CWStackMode) below %s\n", __func__, sibling->name); /* Unsupported currently clear flags */ value_mask &= ~(CWSibling|CWStackMode); break; case TopIf: /* What do these mean ? */ case BottomIf: case Opposite: default: dbg("%s() (CWSibling|CWStackMode) uh? %s\n", __func__, sibling->name); /* Unsupported currently clear flags */ value_mask &= ~(CWSibling|CWStackMode); break; } } else /* Just clear the flags now to be safe */ value_mask &= ~(CWSibling|CWStackMode); } if (c->type == MBCLIENT_TYPE_PANEL) /* Panels can move */ { if ( c->height != req_h || c->width != req_w || c->x != req_x || c->y != req_y ) { Window win_tmp = c->window; xwc.width = e->width; xwc.height = e->height; xwc.x = e->x; xwc.y = e->y; xwc.border_width = 0; xwc.sibling = 0; xwc.stack_mode = e->detail; XConfigureWindow(w->dpy, e->window, value_mask, &xwc); client_deliver_config(c); /* TODO: Not needed */ client_set_state(c, WithdrawnState); /* Now we destroy the window internally and re-birth it. * A bit of a cheat, but works. */ XReparentWindow(w->dpy, c->window, w->root, e->x, e->y); c->destroy(c); c = wm_make_new_client(w, win_tmp); if (c) c->ignore_unmap++; return; } } if (c->type == MBCLIENT_TYPE_TOOLBAR) /* can change height */ { if (req_h != c->height && !(c->flags & CLIENT_IS_MINIMIZED)) { int change_amount = c->height - e->height; c->y += change_amount; c->height = e->height; c->move_resize(c); wm_update_layout(w, c, change_amount); return; } } if (c->type == MBCLIENT_TYPE_DIALOG) { /* Update the size the dialog is trying to get too eventually * - eg toolbar/panel/input windows may dissapear and make * more space available. */ if (e->width && (value_mask & CWWidth) && e->width != c->width && e->width != c->init_width) c->init_width = e->width; if (e->height && (value_mask & CWHeight) && e->height != c->height && e->height != c->init_height) c->init_height = e->height; /* If any changes, now make them fit it into avaialable area. */ if (req_x != c->x || req_y != c->y || req_w != c->width || req_h != c->height || want_activate) { Bool want_fake_configure = False; if (req_x == c->x && req_y == c->y && req_w != c->width && req_h != c->height) { switch (c->gravity) { case NorthEastGravity: req_x = c->x -= (req_w - c->width); break; case EastGravity: req_x = c->x -= (req_w - c->width); break; case SouthWestGravity: req_y = c->y -= (req_h - c->height); break; case SouthGravity: req_y = c->y -= (req_h - c->height); break; case SouthEastGravity: req_x = c->x -= (req_w - c->width); req_y = c->y -= (req_h - c->height); break; case CenterGravity: /* FIXME */ case NorthWestGravity: case NorthGravity: case WestGravity: case StaticGravity: default: break; } } dialog_constrain_geometry(c, &req_x, &req_y, &req_w, &req_h); #ifdef USE_ALT_INPUT_WIN /* Alternate Input windows use the dialog type to * fit in with stacking etc but they cant change width, x nor y */ if (c->flags & (CLIENT_TB_ALT_TRANS_FOR_DIALOG |CLIENT_TB_ALT_TRANS_FOR_APP)) { if (c->height != req_h) { Client *trans_client = c->trans; int diff = c->height - req_h; c->height = req_h; c->y += diff; toolbar_client_move_resize(c); if (trans_client) { if (trans_client->type == MBCLIENT_TYPE_DIALOG) { /* do not grow over their initial size because of IM resizing smaller */ if (trans_client->height + diff >= trans_client->init_height) { trans_client->height = trans_client->init_height; } else if (diff < 0) { /* Input window has grown larger so push it * up but keep it on screen. */ int x, y, w, h; dialog_client_get_coverage(trans_client, &x, &y, &w, &h); if (c->y < y+h) { int amount = (y+h) - c->y; /* move upwards */ trans_client->y -= amount; /* but not over screen area */ if (y-amount < 0) { trans_client->height -= amount-y; trans_client->y += amount-y; } } } else { /* * Input window increased in height, but not * 'enough' for initial size */ trans_client->height += diff; } } else /* Application window */ if (trans_client->type != MBCLIENT_TYPE_DESKTOP) trans_client->height += diff; trans_client->move_resize(trans_client); trans_client->redraw(trans_client, False); } } return; } #endif if (c->width == req_w && c->height == req_h) want_fake_configure = True; /* make sure buttons get repositioned */ if (c->width != req_w) client_buttons_delete_all(c); xwc.width = c->width = req_w; xwc.height = c->height = req_h; xwc.x = c->x = req_x; xwc.y = c->y = req_y; /* ICCCM says if window only moved - not size change, * then we send a fake one too. */ if (want_fake_configure) client_deliver_config(c); /* Client wants to be raised to top of stack */ if (want_activate) { dbg("%s(): calling activate client\n", __func__); wm_activate_client(c); } dialog_client_move_resize(c); dialog_client_redraw(c, False); /* make sure composite does any needed updates */ comp_engine_client_configure(w, c); comp_engine_client_show(w, c); return; } } /* Nothing has changed but ICCCM still send synthetic config * Code should fall back to this. */ client_deliver_config(c); } void wm_handle_map_request(Wm *w, XMapRequestEvent *e) { Client *c = wm_find_client(w, e->window, WINDOW); if (!c) { wm_make_new_client(w, e->window); } else { dbg("%s() Honoring map request for %s\n", __func__, c->name); wm_activate_client(c); } } void wm_handle_unmap_event(Wm *w, XUnmapEvent *e) { Client *c = wm_find_client(w, e->window, WINDOW); if (!c) return; dbg("%s() for client %s\n", __func__, c->name); if (c->ignore_unmap) { c->ignore_unmap--; dbg("%s() ignoring .. \n", __func__ ); } else { if (!c->mapped) return; /* TODO: Check this */ wm_remove_client(w, c); } } void wm_handle_expose_event(Wm *w, XExposeEvent *e) { Client *c = wm_find_client(w, e->window, FRAME); if (c) { XEvent ev; /* Compress expose events */ while (XCheckTypedWindowEvent(w->dpy, e->window, Expose, &ev)); dbg("%s() for %s\n", __func__, c->name); /* redraw title from cache - prolly a no-op * * All image paints happen via win backgrounds (server handles exposes) * We probably dont even need func at all. */ c->redraw(c, True); } } void wm_handle_destroy_event(Wm *w, XDestroyWindowEvent *e) { Client *c = wm_find_client(w, e->window, WINDOW); if (!c) return; dbg("%s for %s\n", __func__, c->name); wm_remove_client(w, c); } void wm_handle_client_message(Wm *w, XClientMessageEvent *e) { Client *c = wm_find_client(w, e->window, WINDOW); dbg("%s() messgae type is %li\n", __func__, e->message_type); /* Handle messages from mbcontrol */ if (e->message_type == w->atoms[MB_COMMAND]) { dbg("%s() mb command requested %li\n", __func__, e->data.l[0] ); switch (e->data.l[0]) { #ifndef STANDALONE case MB_CMD_SET_THEME : { Atom realType; unsigned long n; unsigned long extra; int format; int status; char *value = NULL; dbg("%s() atempting to switch theme\n", __func__ ); status = XGetWindowProperty(w->dpy, w->root, w->atoms[_MB_THEME], 0L, 512L, False, AnyPropertyType, &realType, &format, &n, &extra, (unsigned char **) &value); if (status == Success && value != NULL) { dbg("%s() switching theme to %s\n", __func__, value); mbtheme_switch(w, value); } if (value) XFree(value); return; } #endif case MB_CMD_EXIT : exit(0); case MB_CMD_NEXT : wm_activate_client(stack_cycle_backward(w, MBCLIENT_TYPE_APP)); break; case MB_CMD_PREV : wm_activate_client(stack_cycle_forward(w, MBCLIENT_TYPE_APP)); break; case MB_CMD_DESKTOP : wm_toggle_desktop(w); break; case MB_CMD_MISC: /* This is used for random testing stuff */ /* comp_engine_deinit(w); */ #ifdef DEBUG /* comp_engine_time(w); Not used atm XXX DO_TIMINGS */ dbg("*** Toggling composite visual debugging ***\n"); w->flags ^= DEBUG_COMPOSITE_VISIBLE_FLAG; #endif break; #ifndef NO_KBD case MB_CMB_KEYS_RELOAD: keys_reinit(w); break; #endif #ifdef USE_COMPOSITE case MB_CMD_COMPOSITE: if (w->comp_engine_disabled) comp_engine_reinit(w); else comp_engine_deinit(w); break; #endif } return; } if (e->message_type == w->atoms[WM_CHANGE_STATE]) { dbg("%s() messagae type is change state\n", __func__ ); if (c && e->format == 32 && e->data.l[0] == IconicState) { c->iconize(c); } return; } /* Also handle any EWMH messages */ ewmh_handle_root_message(w, e); } void wm_handle_property_change(Wm *w, XPropertyEvent *e) { Bool update_titlebar = False; Client *c = wm_find_client(w, e->window, WINDOW); if (!c) return; if (c->type == MBCLIENT_TYPE_OVERRIDE) return; #ifdef DEBUG { char *atomname = XGetAtomName(w->dpy, e->atom); dbg("%s() on %s, atom is %li ( %s )\n", __func__, c->name, e->atom, atomname ); if (atomname) free(atomname); } #endif /* Window Name changes */ if (e->atom == XA_WM_NAME && !c->name_is_utf8) { if (c->name) XFree(c->name); misc_trap_xerrors(); XFetchName(w->dpy, c->window, (char **)&c->name); if (!misc_untrap_xerrors()) { base_client_process_name(c); dbg("%s() XA_WM_NAME change, name is %s\n", __func__, c->name); update_titlebar = True; } } else if (e->atom == w->atoms[WM_TRANSIENT_FOR]) { Client *new_trans_client; Window trans_win = 0; int success = 0; dbg("%s() got a tranciency change\n", __func__); misc_trap_xerrors(); success = XGetTransientForHint(w->dpy, c->window, &trans_win); if (!misc_untrap_xerrors() && success) if ((new_trans_client = wm_find_client(w, trans_win, WINDOW)) != NULL) { Client *p = new_trans_client; dbg("%s() <%s> changing trans", __func__, new_trans_client->name); /* Dont let clients be change transiency to themselves * either directly or recursively. */ while (p != NULL) { if (p == c) { dbg("%s() CLIENT WARNING: %s ( %li ) transient for self\n", __func__, c->name, c->window); c->trans = NULL; return; } p = p->trans; } c->trans = new_trans_client; return; } c->trans = NULL; } else if (e->atom == w->atoms[_NET_WM_NAME]) { if (c->name) { XFree(c->name); c->name = NULL; } misc_trap_xerrors(); /* avoid possible X Errors */ c->name = (char*)ewmh_get_utf8_prop(w, c->window, w->atoms[_NET_WM_NAME]); misc_untrap_xerrors(); if (c->name) c->name_is_utf8 = True; else { c->name_is_utf8 = False; XFetchName(w->dpy, c->window, (char **)&c->name); } base_client_process_name(c); dbg("%s() NET_WM_NAME change, name is %s\n", __func__, c->name); update_titlebar = True; } else if (e->atom == w->atoms[WM_PROTOCOLS]) { int orig_flags = c->flags; dbg("%s() WM_PROTOCOLS changed, flags %i\n", __func__, orig_flags); client_get_wm_protocols(c); dbg("%s() WM_PROTOCOLS changed, flags now %li\n", __func__, c->flags); /* If flags have changed, likely means a WM_CONTEXT_HELP|etc has changed * and thus titlebar needs a repaint. */ if (c->flags != orig_flags) { dbg("%s() WM_PROTOCOLS changed flags, repainting\n", __func__); /* Buttons will get recreated on demand via repaint */ client_buttons_delete_all(c); update_titlebar = True; } } else if (e->atom == w->atoms[WM_CHANGE_STATE]) { dbg("%s() state change, name is %s\n", __func__, c->name); if(client_get_state(c) == WithdrawnState) { wm_remove_client(w, c); } } else if (e->atom == w->atoms[CM_TRANSLUCENCY]) { comp_engine_client_get_trans_prop(w, c); comp_engine_client_repair(w, c); } if (update_titlebar) c->redraw(c, False); } /* If configured force a app window be treated as a dialog */ Bool wm_win_force_dialog(Wm *w, Window win) { char *win_title = NULL; Bool result = False; if (!w->config->force_dialogs) return result; if (XFetchName(w->dpy, win, (char **)&win_title)) if (strstr(w->config->force_dialogs, win_title)) /* TODO: Improve search */ result = True; if (win_title) XFree(win_title); return result; } Client* wm_make_new_client(Wm *w, Window win) { Window trans_win; Atom realType, *value = NULL; unsigned long n, extra; int format, status; Client *c = NULL, *t = NULL; XWMHints *wmhints = NULL; int mwm_flags = 0; XGrabServer(w->dpy); dbg("%s() initiated\n", __func__); if (wm_win_force_dialog(w, win)) { /* Hackiness to allow app wins to be forced into dialogs * ( see -froce_dialogs switch ). * Much better to fix the app people! */ c = dialog_client_new(w, win, NULL); if (c == NULL) goto end; } else { /* Use EWMH Window Type Hint to figure out window type */ misc_trap_xerrors(); status = XGetWindowProperty(w->dpy, win, w->atoms[WINDOW_TYPE], 0L, 1000000L, 0, XA_ATOM, &realType, &format, &n, &extra, (unsigned char **) &value); if (misc_untrap_xerrors()) /* An X error occured - win deleted ? */ goto end; if (status == Success) { if (realType == XA_ATOM && format == 32) { dbg("%s() got type atom\n", __func__); if (value[0] == w->atoms[WINDOW_TYPE_DOCK]) { dbg("%s() got dock atom\n", __func__ ); c = dockbar_client_new(w, win); if (c == NULL) goto end; } else if (value[0] == w->atoms[WINDOW_TYPE_TOOLBAR] || value[0] == w->atoms[WINDOW_TYPE_INPUT]) { dbg("%s() got toolbar atom\n", __func__ ); c = toolbar_client_new(w, win); if (c == NULL) goto end; #ifdef USE_ALT_INPUT_WIN c->flags &= ~CLIENT_IS_MINIMIZED; #endif } else if (value[0] == w->atoms[WINDOW_TYPE_DESKTOP]) { dbg("%s() got desktop atom\n", __func__ ); c = desktop_client_new(w, win); if (c == NULL) goto end; } else if (value[0] == w->atoms[WINDOW_TYPE_SPLASH]) { dbg("%s() got splash atom\n", __func__ ); c = dialog_client_new(w, win, NULL); if (c == NULL) goto end; c->flags |= (CLIENT_TITLE_HIDDEN_FLAG|CLIENT_IS_SPLASH_WIN); } else if (value[0] == w->atoms[WINDOW_TYPE_DIALOG]) { dbg("%s() got type dialog atom\n", __func__ ); c = dialog_client_new(w, win, NULL); if (c == NULL) goto end; } else if (value[0] == w->atoms[WINDOW_TYPE_MENU] || value[0] == w->atoms[_NET_WM_WINDOW_TYPE_POPUP_MENU] || value[0] == w->atoms[_NET_WM_WINDOW_TYPE_DROPDOWN_MENU]) { dbg("%s() got type menu atom\n", __func__ ); c = dialog_client_new(w, win, NULL); if (c == NULL) goto end; c->flags |= CLIENT_IS_MENU_DIALOG; } else if (value[0] == w->atoms[WINDOW_TYPE_MESSAGE] /* Above to depricate for below */ || value[0] == w->atoms[_NET_WM_WINDOW_TYPE_NOTIFICATION]) { c = dialog_client_new(w, win, NULL); if (c == NULL) goto end; /* Fremantle: no urgency flag */ /* c->flags |= CLIENT_HAS_URGENCY_FLAG | CLIENT_TITLE_HIDDEN_FLAG; */ c->flags |= CLIENT_TITLE_HIDDEN_FLAG; } else if (value[0] == w->atoms[WINDOW_TYPE_NORMAL]) { c = main_client_new(w, win); if (c == NULL) goto end; c->flags ^= mwm_flags; } } } if (value) XFree(value); } if ((mwm_flags = mwm_get_decoration_flags(w, win))) { /* for now, treat just like a splash */ if (c == NULL) c = dialog_client_new(w, win, NULL); if (c) c->flags ^= mwm_flags; dbg("%s() got MWM flags: %li\n", __func__, c->flags ); } /* check for transient - ie detect if its a dialog */ XGetTransientForHint(w->dpy, win, &trans_win); if (trans_win && (trans_win != win)) { dbg("%s() Transient hint set\n", __func__); t = wm_find_client(w, trans_win, WINDOW); if (t == NULL) { /* Its transient for something, but not managed by us .. * We check for win groups in last act of desperation. */ Client *p = NULL; dbg("%s() transient window not managed\n", __func__); if ((wmhints = XGetWMHints(w->dpy, win)) != NULL) { if (wmhints->window_group && !stack_empty(w)) { stack_enumerate(w, p) if (wmhints->window_group == p->window) { t = p; break; } } if (wmhints) XFree(wmhints); } } dbg("%s() Transient ( %s) looks good, creating dialog\n", __func__, t ? t->name : "none" ); if (c == NULL) { /* if t is is NULL (from above), dialog will always be visible */ c = dialog_client_new(w, win, t); } else if (c->type == MBCLIENT_TYPE_DIALOG) /* already exists, update */ c->trans = t; /* TODO: what about other types being transient for things ?*/ /* Make sure above state is inherited if parent has it */ if (c->trans != NULL && c->trans->type == MBCLIENT_TYPE_DIALOG && c->trans->flags & CLIENT_HAS_ABOVE_STATE) c->flags |= CLIENT_HAS_ABOVE_STATE; } if (c == NULL) /* Noting else found, default to a main client */ { c = main_client_new(w, win); if (c == NULL) /* Something has gone wrong - prolly win dissapeared */ { dbg("%s() client dissapeared\n", __func__); goto end; } } /* We do this now as really needs to know window type */ base_client_process_name(c); dbg("%s() calling configure method for new client\n", __func__); c->configure(c); /* Size up the client */ comp_engine_client_init(w, c); dbg("%s() reparenting new client\n", __func__ ); c->reparent(c); /* reparent it to frames and decor */ dbg("%s() move/resizing new client\n", __func__); c->move_resize(c); /* set pos + size */ /* send new configuration to client - needed */ client_deliver_config(c); /* TODO: * * Its likely the size we given the new client, is not what it requested. * We've by now told the app its new size, but we need to give it a * chance to repaint itself at the new size or other wise we get horrible * flicker on mapping ( as remenants of old size are seen ). * * A possible solutions could be to implement the new _NET_WM_SYNC_REQUEST * stuff, as this is for resizes and we are resizing after all. * * XUngrabServer(w->dpy); * XSync(w->dpy, False); * XGrabServer(w->dpy); * * Note, this seems worst on GTK apps. */ XGrabButton(c->wm->dpy, Button1, 0, c->window, True, ButtonPressMask, GrabModeSync, GrabModeSync, None, None); /* Handle an application started iconized */ if (c->flags & CLIENT_IS_MINIMIZED && c->type == MBCLIENT_TYPE_APP) { /* Clear the flag now to be safe */ c->flags &= ~CLIENT_IS_MINIMIZED; c->redraw(c, False); /* draw the decorations ready */ c->iconize (c); ewmh_update_lists(w); XUngrabServer(w->dpy); XFlush(w->dpy); goto end; } dbg("%s() showing new client\n", __func__); c->redraw(c, False); /* draw the decorations ready */ wm_activate_client(c); /* Map it into stack, ( will call show()) */ /* Let window know were all done */ ewmh_state_set(c); /* XXX This is likely not needed */ client_set_state(c, NormalState); end: XUngrabServer(w->dpy); XFlush(w->dpy); return c; } void wm_remove_client(Wm *w, Client *c) { dbg("%s() called for %s\n", __func__, c->name); XGrabServer(w->dpy); misc_trap_xerrors(); /* below very likely to genrate X errors */ /* Set win state to withdrawn and reparent to root. * If below is not done - suttle bugs appear with toolkits ( GTK ) */ client_set_state(c, WithdrawnState); /* Below is likely not needed ( window will have already unmapped ) * and likely to fire an X error, but we do it anyway to be extra safe. * * In gtk quickly hiding/showing window repeatadly it can seem gtk does't * always call the unmap and a wierd ghost window is left. */ XUnmapWindow(w->dpy, c->window); /* Reparent now unmanaged win to root */ XReparentWindow(w->dpy, c->window, w->root, c->x, c->y); XRemoveFromSaveSet(w->dpy, c->window); /* sync here so any (likely) lingering X errors are trapped */ XSync(w->dpy, False); misc_untrap_xerrors(); c->destroy(c); /* If no clients left, force update of active props accordingly */ if (stack_empty(w) || w->stack_top_app == NULL) { ewmh_set_current_app_window(w); ewmh_set_active(w); } XUngrabServer(w->dpy); } /* wm_update_layout() is called in the presence of a panel/toolbar * changing its size / appearing. It re-layouts all windows for it * to fit. */ void wm_update_layout(Wm *w, Client *client_changed, signed int change_amount) /* XXX Change to relayout */ { Client *p = NULL; XGrabServer(w->dpy); stack_enumerate(w,p) { if (p == client_changed) continue; dbg("%s() restacking, comparing %i is less than %i for %s\n", __func__, p->y, client_changed->y, p->name); if (client_changed->type == MBCLIENT_TYPE_PANEL && client_changed->flags & CLIENT_DOCK_WEST) { if (p->x >= client_changed->x) { switch (p->type) { case MBCLIENT_TYPE_APP : if (p->flags & CLIENT_FULLSCREEN_FLAG) break; p->width += change_amount; p->x -= change_amount; p->move_resize(p); theme_img_cache_clear( w->mbtheme, FRAME_MAIN ); client_deliver_config(p); client_buttons_delete_all(p); theme_pixmap_cache_clear_all(w->mbtheme); main_client_redraw(p, False); /* force title redraw */ break; case MBCLIENT_TYPE_TOOLBAR : case MBCLIENT_TYPE_PANEL : if (p->flags & CLIENT_DOCK_EAST) break; if (p->flags & CLIENT_DOCK_TITLEBAR) { /* See notes below on this */ if (change_amount > 0) { XRectangle rect; mbtheme_get_titlebar_panel_rect(p->wm->mbtheme, &rect, client_changed); p->x = rect.x + wm_get_offsets_size(p->wm, WEST, client_changed, True); p->width = rect.width ; } else p->configure(p); } else { p->width += change_amount; p->x -= change_amount; } p->move_resize(p); client_deliver_config(p); default: break; } } } else if (client_changed->type == MBCLIENT_TYPE_PANEL && client_changed->flags & CLIENT_DOCK_EAST) { if (p->x <= client_changed->x) { switch (p->type) { case MBCLIENT_TYPE_APP : if (p->flags & CLIENT_FULLSCREEN_FLAG) break; p->width += change_amount; p->move_resize(p); client_deliver_config(p); theme_img_cache_clear( w->mbtheme, FRAME_MAIN ); theme_pixmap_cache_clear_all(w->mbtheme); client_buttons_delete_all(p); main_client_redraw(p, False); /* force title redraw */ break; case MBCLIENT_TYPE_TOOLBAR : case MBCLIENT_TYPE_PANEL : if (p->flags & CLIENT_DOCK_WEST) break; if (p->flags & CLIENT_DOCK_TITLEBAR) { /* The usual configure call takes into account the just removed dock ( +ive change amount ), so we have to basically do own configure() call ignoring this. */ if (change_amount > 0) { XRectangle rect; mbtheme_get_titlebar_panel_rect(p->wm->mbtheme, &rect, client_changed); p->x = rect.x + wm_get_offsets_size(p->wm, WEST, client_changed, True); p->width = rect.width ; } else p->configure(p); } else { p->width += change_amount; } p->move_resize(p); client_deliver_config(p); default: break; } } } else if (client_changed->type == MBCLIENT_TYPE_PANEL && client_changed->flags & CLIENT_DOCK_NORTH) { if (p->y >= client_changed->y) { switch (p->type) { case MBCLIENT_TYPE_APP : if (p->flags & CLIENT_FULLSCREEN_FLAG) break; p->height += change_amount; p->y -= change_amount; p->move_resize(p); /* XXX shouldn't be any need to redraw here as * width won't have changed so no need to repaint * entire toolbar. * * It *could* break on if the side decoration themes * are somehow a function of height. No themes I know * of do this and we avoid quite a lot of cpu avoiding * this. * * theme_img_cache_clear( w->mbtheme, FRAME_MAIN ); * theme_pixmap_cache_clear_all(w->mbtheme); * main_client_redraw(p, False); */ client_deliver_config(p); break; case MBCLIENT_TYPE_PANEL : if (p->flags & CLIENT_DOCK_NORTH || p->flags & CLIENT_DOCK_TITLEBAR) { p->y -= change_amount; p->move_resize(p); client_deliver_config(p); } break; default: break; } } } else { /* toolbar changes here */ dbg("%s(): restack NORMAL comparing %i <= %i for %s\n", __func__, p->y, client_changed->y, p->name); if ( (p->y <= client_changed->y) || (client_changed->type == MBCLIENT_TYPE_PANEL && p->type == MBCLIENT_TYPE_TOOLBAR)) { dbg("%s() restacking ( NORMAL )%s", __func__, p->name); switch (p->type) { case MBCLIENT_TYPE_APP : if (p->flags & CLIENT_FULLSCREEN_FLAG && client_changed->type == MBCLIENT_TYPE_PANEL) break; p->height += change_amount; p->move_resize(p); /* * See above as to why this is commented out. * * theme_img_cache_clear( w->mbtheme, FRAME_MAIN ); * theme_pixmap_cache_clear_all(w->mbtheme); * main_client_redraw(p, False); */ client_deliver_config(p); break; case MBCLIENT_TYPE_TOOLBAR : p->y += change_amount; p->move_resize(p); client_deliver_config(p); break; case MBCLIENT_TYPE_PANEL : if (p->flags & CLIENT_DOCK_SOUTH) { p->y += change_amount; p->move_resize(p); client_deliver_config(p); } break; case MBCLIENT_TYPE_DIALOG : default: break; } } } } /* Handle dialog centering etc */ stack_enumerate(w, p) { if (p->type == MBCLIENT_TYPE_DIALOG) { Bool force_height = False; int req_x = p->x, req_y = p->y, req_w = p->width, req_h = p->height; #ifdef USE_ALT_INPUT_WIN /* Alternate Input windows use the dialog type to * fit in with stacking etc. below is a bit of a hack * to avoid getting repositioned like a dialog. */ if (p->flags & (CLIENT_TB_ALT_TRANS_FOR_DIALOG |CLIENT_TB_ALT_TRANS_FOR_APP)) { p->configure(p); p->move_resize(p); client_deliver_config(p); continue; } #else /* Always try and back to intially requested height, a * panel or input win may have dissapeared giving more * space. * NOTE: we avoid doing this for ALT_INPUT_WINS (maemo) */ if (p->init_height && p->init_height > req_h) { req_h = p->init_height; force_height = True; } #endif if (!dialog_constrain_geometry(p, &req_x, &req_y, &req_w, &req_h) || force_height) { p->x = req_x; p->y = req_y; p->width = req_w; p->height = req_h; p->move_resize(p); client_deliver_config(p); } } } ewmh_update_rects(w); XSync(w->dpy, False); XUngrabServer(w->dpy); } static void wm_stack_dialogs_for_transient(Wm *w, Client *trans) { /* Correctly stack dialogs in respect to a transient ( app/desktop ) * parent. Utility call for activate_client() */ if (trans == NULL) return; /* Move transient dialogs to top */ stack_move_transients_to_top(w, trans, 0); /* Above dialogs go above transient for root */ stack_move_transients_to_top(w, trans, CLIENT_HAS_ABOVE_STATE /* CLIENT_HAS_URGENCY_FLAG */); /* Move transient for root dialogs to very top */ stack_move_transients_to_top(w, NULL, 0); /* Move transient for root with state above to top */ stack_move_transients_to_top(w, NULL, CLIENT_HAS_ABOVE_STATE ); /* Now move transient for root messages to top */ stack_move_transients_to_top(w, NULL, CLIENT_HAS_URGENCY_FLAG); } /* wm_activate_client() is called to 'activate', eg raise or show * a client stack wise. */ void wm_activate_client(Client *c) { Wm *w; Client *client_to_focus = c; Bool set_desktop_show_hint = False, set_current_app_active_hint = False; #ifndef NO_PING Client *prev_app_client = NULL; #endif if (c == NULL) return; /* its possible for this to happen :( */ w = c->wm; dbg("%s() called for %s\n", __func__, c->name); #ifndef NO_PING if (w->config->ping_aggressive) { prev_app_client = wm_get_visible_main_client(w); } #endif XGrabServer(w->dpy); c->show(c); /* Set 'relative' pos in stack, map windows if needed etc */ dbg("%s() DESKTOP_RAISED_FLAG is %i\n", __func__, (w->flags & DESKTOP_RAISED_FLAG)); if (c->type == MBCLIENT_TYPE_APP || c->type == MBCLIENT_TYPE_DESKTOP) { /* As matchbox works around 'main' windows ( apps/main and desktop wins). We need to sync extra stuff up when displaying a new one. */ Bool switching_from_to_fullscreen = False; /* save focus state for transient dialogs of prev showing main win */ if (w->stack_top_app && w->stack_top_app != c) { if ( (w->stack_top_app->flags & CLIENT_FULLSCREEN_FLAG && !(c->flags & CLIENT_FULLSCREEN_FLAG)) || ( !(w->stack_top_app->flags & CLIENT_FULLSCREEN_FLAG) && c->flags & CLIENT_FULLSCREEN_FLAG ) ) switching_from_to_fullscreen = True; w->stack_top_app->hide(w->stack_top_app); } /* If this client has a saved dialog focus state, load it */ if (c->next_focused_client && c->next_focused_client->type == MBCLIENT_TYPE_DIALOG) client_to_focus = c->next_focused_client; /* If transient for root dialog currently has focus then keep it that way. */ if (w->focused_client && w->focused_client->type == MBCLIENT_TYPE_DIALOG) { Client *lowest_dialog = w->focused_client; /* Get lowest transient dialog, and check its trans for root */ while (lowest_dialog->trans != NULL && lowest_dialog->type == MBCLIENT_TYPE_DIALOG) lowest_dialog = lowest_dialog->trans; if (lowest_dialog->trans == NULL && lowest_dialog->type == MBCLIENT_TYPE_DIALOG) { dbg("%s() keeping focus to root dialog\n", __func__); client_to_focus = w->focused_client; } } /* Raise panel + toolbars just above app but below app dialogs */ if (!(c->flags & CLIENT_FULLSCREEN_FLAG)) { dbg("%s() moving panels above %s\n", __func__, c->name); stack_move_type_above_client(w, MBCLIENT_TYPE_PANEL, c); stack_dump(w); } stack_move_type_above_client(w, MBCLIENT_TYPE_TOOLBAR, c); dbg("%s() c is trans for <%s>\n", __func__, c->trans ? c->trans->name : "nothing"); wm_stack_dialogs_for_transient(w, c); /* Deal with desktop flag etc */ if (c->type != MBCLIENT_TYPE_DESKTOP && !(c->flags & CLIENT_IS_DESKTOP_FLAG) ) /* ^^^^^^^^^ hack for decorated desktop */ { dbg("%s() clearing desktop flag\n", __func__); w->flags &= ~DESKTOP_RAISED_FLAG; w->stack_top_app = c; set_desktop_show_hint = True; } else { /* Desktop being activated */ dbg("%s() setting desktop raised flag\n", __func__); w->flags |= DESKTOP_RAISED_FLAG; /* Make sure embedded titlebar panels arn't visible for desktop */ if (w->have_titlebar_panel && mbtheme_has_titlebar_panel(w->mbtheme) && !(w->have_titlebar_panel->flags & CLIENT_DOCK_TITLEBAR_SHOW_ON_DESKTOP)) { stack_move_above_client(w->have_titlebar_panel, NULL); } set_desktop_show_hint = True; } /* Set active main client, set focus handles active win hint */ set_current_app_active_hint = True; #ifdef USE_ALT_INPUT_WIN /* If switching from/to fullscreen, then there could be an * input window transient for a transient for root dialog and * it therefore needs to be resized ( the IM ). */ if (switching_from_to_fullscreen && c->type == MBCLIENT_TYPE_APP) main_client_manage_toolbars_for_fullscreen(c, False); #endif } else if (c->type == MBCLIENT_TYPE_DIALOG) { /* A Little insurance - on mapping, a dialog can end up below * panels and toolbars. May be a cleaner way than this. */ Client *top_main_client = NULL; if (!(w->flags & DESKTOP_RAISED_FLAG)) { if ((top_main_client = wm_get_visible_main_client(w)) != NULL) { stack_dump(w); dbg("%s() now raising panels+toolbar above dialog\n", __func__); if (!(top_main_client->flags & CLIENT_FULLSCREEN_FLAG)) /* Move just above main app win, therefore *below* dialogs */ stack_move_type_above_client(w, MBCLIENT_TYPE_TOOLBAR |MBCLIENT_TYPE_PANEL, top_main_client); } else /* move type above nothing - eg to bottom */ stack_move_type_above_client(w, MBCLIENT_TYPE_TOOLBAR |MBCLIENT_TYPE_PANEL, NULL); } else { /* Desktop is raised. dialogs ( trans for desktop ) can end up * below panels for some reason on initial map so we take * below sledgehammer approach which seems to fix things. */ wm_stack_dialogs_for_transient(w, wm_get_visible_main_client(w)); } /* Check if this is transient for an app/desktop thats * not currently at the top of the stack. In which case * dont try and focus it. */ if (c->trans != NULL && wm_get_visible_main_client(w)) { Client *dialog_parent = c->trans; top_main_client = wm_get_visible_main_client(w); while (dialog_parent->trans != NULL) dialog_parent = dialog_parent->trans; if ( (dialog_parent->type == MBCLIENT_TYPE_APP || dialog_parent->type == MBCLIENT_TYPE_DESKTOP) && top_main_client != dialog_parent && top_main_client->win_group != c->win_group) client_to_focus = NULL; } } /* Always make sure embedded titlebar panels arn't visible for desktop */ if (c == w->have_titlebar_panel && w->flags & DESKTOP_RAISED_FLAG && mbtheme_has_titlebar_panel(w->mbtheme) && !(w->have_titlebar_panel->flags & CLIENT_DOCK_TITLEBAR_SHOW_ON_DESKTOP)) { /* TODO: Change to stack move bottom ? * * eg use stack_move_above_client(c, NULL) */ stack_move_above_client(c, NULL); } ewmh_update_lists(w); if (set_desktop_show_hint) ewmh_update_desktop_hint(w); dbg("%s() now syncing above window stack\n", __func__); stack_sync_to_display(w); if (c->flags & CLIENT_DELAY_MAPPING) /* See dialog show() source */ { c->flags &= ~CLIENT_DELAY_MAPPING; XMapSubwindows(w->dpy, c->frame); XMapWindow(w->dpy, c->frame); } client_set_focus(client_to_focus); /* set focus if needed and ewmh active */ stack_dump(w); if (set_current_app_active_hint) ewmh_set_current_app_window(w); comp_engine_client_show(w, c); #ifndef NO_PING if (w->config->ping_aggressive) { Client *new_app_client; new_app_client = wm_get_visible_main_client(w); if (prev_app_client != new_app_client) { /* Only stop pings here now, activates via NET_ACTIVE * * if (new_app_client * && new_app_client->type != MBCLIENT_TYPE_DESKTOP) * { * ewmh_ping_client_start (new_app_client); * } */ if (prev_app_client) { ewmh_ping_client_stop (prev_app_client); } } } #endif XSync(w->dpy, False); XUngrabServer(w->dpy); } /* Returns either desktop or main app client */ Client* wm_get_visible_main_client(Wm *w) { if (w->flags & DESKTOP_RAISED_FLAG) { dbg("%s() returning desktop - %p\n", __func__, wm_get_desktop(w)); return wm_get_desktop(w); } if (w->stack_top_app) { dbg("%s() returning stack top : %p\n", __func__, w->stack_top_app); return w->stack_top_app; } dbg("%s() returning NULL\n", __func__); return NULL; } /* Get area taken up on an edge by panels, toolbars */ int wm_get_offsets_size(Wm* w, int wanted_direction, Client* ignore_client, Bool include_toolbars ) { Client *p; int x, y, width, height, result = 0; if (stack_empty(w)) return 0; dbg("%s() called\n", __func__); stack_enumerate(w, p) { if ((ignore_client && p == ignore_client) || p->mapped == False) continue; switch(wanted_direction) { case NORTH: if (p->type == MBCLIENT_TYPE_PANEL && p->flags & CLIENT_DOCK_NORTH) { p->get_coverage(p, &x, &y, &width, &height); result += height; } break; case SOUTH: if ((p->type == MBCLIENT_TYPE_PANEL && p->flags & CLIENT_DOCK_SOUTH) || (p->type == MBCLIENT_TYPE_TOOLBAR && include_toolbars) ) { p->get_coverage(p, &x, &y, &width, &height); result += height; } break; case EAST: if (p->type == MBCLIENT_TYPE_PANEL && p->flags & CLIENT_DOCK_EAST) { p->get_coverage(p, &x, &y, &width, &height); result += width; } break; case WEST: if (p->type == MBCLIENT_TYPE_PANEL && p->flags & CLIENT_DOCK_WEST) { p->get_coverage(p, &x, &y, &width, &height); result += width; } break; } } return result; } void wm_toggle_desktop(Wm *w) { dbg("%s() called desktop flag is : %i \n", __func__, (w->flags & DESKTOP_RAISED_FLAG)); if (!wm_get_desktop(w)) { dbg("%s() couldn't find desktop \n", __func__ ); return; } if (w->flags & DESKTOP_RAISED_FLAG) { dbg("%s() hiding desktop\n", __func__); wm_activate_client(w->stack_top_app); } else { dbg("%s() showing desktop\n", __func__); wm_activate_client(wm_get_desktop(w)); } } void wm_set_cursor_visibility(Wm *w, Bool visible) { #if 0 int major = 0, minor = 0, ev_base, err_base; if (XFixesQueryExtension (w->dpy, &ev_base, &err_base)) XFixesQueryVersion (w->dpy, &major, &minor); dbg("Checking Xfixes, got %i.%i , ev (%i), err (%i)", major, minor, ev_base, err_base); if (major >= 4) { w->curs = XCreateFontCursor(w->dpy, XC_left_ptr); XDefineCursor(w->dpy, w->root, w->curs); if (visible) { printf ("%s: visible using XFixes\n", __func__); w->config->no_cursor = False; misc_trap_xerrors(); /* Appears to fire X error if not already hidden * but no way to query that ? */ XFixesShowCursor (w->dpy, w->root); XSync(w->dpy, False); misc_untrap_xerrors(); } else { printf ("%s: hidden using XFixes\n", __func__); XFixesHideCursor (w->dpy, w->root); } } else #endif { /* FIXME: do we need to free the cursors ? */ if (visible) { printf ("%s: visible using XCreateFontCursor\n", __func__); w->config->no_cursor = False; w->curs = XCreateFontCursor(w->dpy, XC_left_ptr); } else { printf ("%s: hidden using XCreatePixmapCursor\n", __func__); Pixmap pix = XCreatePixmap (w->dpy, w->root, 1, 1, 1); XColor col; memset (&col, 0, sizeof (col)); w->blank_curs = XCreatePixmapCursor (w->dpy, pix, pix, &col, &col, 1, 1); w->curs = w->blank_curs; XFreePixmap (w->dpy, pix); w->config->no_cursor = True; } XDefineCursor(w->dpy, w->root, w->curs); } } Client * wm_get_desktop(Wm *w) { return w->client_desktop; } #ifdef USE_XSETTINGS #define XSET_UNKNOWN 0 #define XSET_THEME 1 #define XSET_CURSOR 2 #define XSET_LOWLIGHT 3 #define XSET_TITLEBARS 4 #define XSET_COMPOSITE 5 #define XSET_CURSOR_THEME_NAME 6 #define XSET_CURSOR_THEME_SIZE 7 static void wm_xsettings_notify_cb (const char *name, XSettingsAction action, XSettingsSetting *setting, void *data) { Wm *w = (Wm *)data; int i = 0; int key = XSET_UNKNOWN; struct _mb_xsettings { char *name; int value; } mb_xsettings[] = { { "Net/ThemeName", XSET_THEME }, { "MATCHBOX/THEME", XSET_THEME }, { "MATCHBOX/CURSOR", XSET_CURSOR }, { "MATCHBOX/TITLEBARS", XSET_TITLEBARS }, /* XXX Not implemeted */ { "MATCHBOX/COMPOSITE", XSET_COMPOSITE }, { "Gtk/CursorThemeName", XSET_CURSOR_THEME_NAME }, { "Gtk/CursorThemeSize", XSET_CURSOR_THEME_SIZE }, { NULL, -1 } }; while( mb_xsettings[i].name != NULL ) { if (!strcmp(name, mb_xsettings[i].name) && setting != NULL) /* Set to NULL when action deleted */ { key = mb_xsettings[i].value; break; } i++; } if (key == XSET_UNKNOWN) return; if (setting->type == XSETTINGS_TYPE_STRING) { switch (action) { case XSETTINGS_ACTION_NEW: case XSETTINGS_ACTION_CHANGED: switch (key) { case XSET_COMPOSITE: if (!strcasecmp("off", setting->data.v_string) || !strcasecmp("false", setting->data.v_string)) { comp_engine_deinit(w); } else { comp_engine_reinit(w); } break; case XSET_THEME: if (w->flags & STARTUP_FLAG) w->config->theme = strdup(setting->data.v_string); else mbtheme_switch(w, setting->data.v_string); break; case XSET_CURSOR: if (!strcasecmp("true", setting->data.v_string)) wm_set_cursor_visibility(w, True); else wm_set_cursor_visibility(w, False); break; case XSET_TITLEBARS: /* XXX todo */ break; case XSET_CURSOR_THEME_NAME: #ifdef HAVE_XCURSOR XcursorSetTheme (w->dpy, setting->data.v_string); #endif break; default: break; } case XSETTINGS_ACTION_DELETED: /* Do nothing for now */ break; } } else if (setting->type == XSETTINGS_TYPE_INT) { #ifdef HAVE_XCURSOR if ( (action == XSETTINGS_ACTION_NEW || action == XSETTINGS_ACTION_CHANGED) && key == XSET_CURSOR_THEME_NAME) { if (setting->data.v_int) XcursorSetDefaultSize (w->dpy, setting->data.v_int); } #endif } } #endif #ifdef USE_LIBSN /* Various stuff for startup notification libs. * Mb uses it for both busy startup cursor and single instancing apps. * Seems alot of code for just that .... */ static void wm_sn_exec(Wm *w, char* name, char* bin_name, char *desc) { SnLauncherContext *context = NULL; pid_t child_pid = 0; context = sn_launcher_context_new (w->sn_display, DefaultScreen (w->dpy)); if (name) sn_launcher_context_set_name (context, name); if (desc) sn_launcher_context_set_description (context, desc); if (bin_name) sn_launcher_context_set_binary_name (context, bin_name); sn_launcher_context_initiate (context, "Matchbox-kb-shortcut", bin_name, CurrentTime); switch ((child_pid = fork ())) { case -1: fprintf (stderr, "Fork failed\n" ); break; case 0: sn_launcher_context_setup_child_process (context); execlp(bin_name, bin_name, (char *)NULL); fprintf (stderr, "Failed to exec %s \n", bin_name); _exit (1); break; } sn_launcher_context_unref (context); } static void wm_sn_timeout_check (Wm *w) { time_t now ; dbg("%s() called\n", __func__); if (!w->sn_busy_cnt) return; now = time(NULL); if ((now - w->sn_init_time) > MB_SN_APP_TIMEOUT) { w->sn_busy_cnt--; w->sn_init_time = time(NULL); } if (w->sn_busy_cnt) XDefineCursor(w->dpy, w->root, w->curs_busy); else { XDefineCursor(w->dpy, w->root, w->curs); XDeleteProperty(w->dpy, w->root, w->atoms[MB_CLIENT_STARTUP_LIST]); } } static void wm_sn_cycle_update_root_prop(Wm *w) { SnCycle *current_cycle = w->sn_cycles; char *prop_str = NULL; int prop_str_len = 0; ewmh_update_lists(w); if (current_cycle == NULL) { XDeleteProperty(w->dpy, w->root, w->atoms[MB_CLIENT_STARTUP_LIST]); XFlush(w->dpy); return; } XGrabServer(w->dpy); while(current_cycle != NULL) { dbg("%s() looping on %s, %li\n", __func__, current_cycle->bin_name, current_cycle->xid ); if (current_cycle->xid == None) { dbg("%s() adding %s, %li\n", __func__, current_cycle->bin_name, current_cycle->xid ); prop_str_len += (strlen(current_cycle->bin_name) + 1); } current_cycle = current_cycle->next; } if (prop_str_len > 1) { prop_str = malloc(sizeof(char)*(prop_str_len+1)); memset(prop_str, 0, prop_str_len+1); current_cycle = w->sn_cycles; while(current_cycle != NULL) { if (current_cycle->xid == None) { strcat(prop_str, current_cycle->bin_name); strcat(prop_str, "|"); } current_cycle = current_cycle->next; } dbg("%s() Setting MB_CLIENT_STARTUP_LIST to %s\n", __func__, prop_str); if (prop_str) { XChangeProperty(w->dpy, w->root, w->atoms[MB_CLIENT_STARTUP_LIST] , XA_STRING, 8, PropModeReplace, (unsigned char *)prop_str, strlen(prop_str) ); free(prop_str); } } else { dbg("%s() Deleting MB_CLIENT_STARTUP_LIST \n", __func__ ); XDeleteProperty(w->dpy, w->root, w->atoms[MB_CLIENT_STARTUP_LIST]); } XFlush(w->dpy); XUngrabServer(w->dpy); } static SnCycle * wm_sn_cycle_new(Wm *w, const char *bin_name) { SnCycle *new_cycle = malloc(sizeof(SnCycle)); memset(new_cycle, 0, sizeof(SnCycle)); new_cycle->bin_name = strdup(bin_name); new_cycle->xid = None; new_cycle->next = NULL; return new_cycle; } static void wm_sn_cycle_add(Wm *w, const char *bin_name) { SnCycle *current_cycle; dbg("%s() called with %s\n", __func__, bin_name); if (w->sn_cycles == NULL) { w->sn_cycles = wm_sn_cycle_new(w, bin_name); } else { current_cycle = w->sn_cycles; if (!strcmp(current_cycle->bin_name, bin_name) && current_cycle->xid == None) { dbg("%s() already have %s\n", __func__, bin_name); return; /* already have it */ } while (current_cycle->next != NULL) { if (!strcmp(current_cycle->bin_name, bin_name) && current_cycle->xid == None ) { dbg("%s() already have %s\n", __func__, bin_name); return; /* already have it */ } current_cycle = current_cycle->next; } current_cycle->next = wm_sn_cycle_new(w, bin_name); } wm_sn_cycle_update_root_prop(w); } void wm_sn_cycle_remove(Wm *w, Window xid) { SnCycle *current_cycle = w->sn_cycles, *prev_cycle = NULL; while(current_cycle != NULL) { if (current_cycle->xid == xid) { if (current_cycle == w->sn_cycles) { w->sn_cycles = current_cycle->next; dbg("%s(): removed, w->sn_cycles is now %p\n", __func__, w->sn_cycles); } else { prev_cycle->next = current_cycle->next; } free(current_cycle->bin_name); free(current_cycle); wm_sn_cycle_update_root_prop(w); return; } prev_cycle = current_cycle; current_cycle = current_cycle->next; } wm_sn_cycle_update_root_prop(w); } static void wm_sn_cycle_update_xid(Wm *w, const char *bin_name, Window xid) { /* find first where xid is None, and update */ /* in above check, check another dont exist _without_ xid */ /* destroy must call sn_cycle remove ? - unless theme switch flag is on */ SnCycle *current_cycle = w->sn_cycles; dbg("%s() called with %s, %li\n", __func__, bin_name, xid); while(current_cycle != NULL) { if (!strcmp(current_cycle->bin_name, bin_name) && current_cycle->xid == None) { dbg("%s() got match for %s, setting xid = %li\n", __func__, bin_name, xid); current_cycle->xid = xid; wm_sn_cycle_update_root_prop(w); return; } current_cycle = current_cycle->next; } dbg("%s() match failed\n", __func__); wm_sn_cycle_update_root_prop(w); } static void wm_sn_monitor_event_func (SnMonitorEvent *event, void *user_data) { SnStartupSequence *sequence; Wm *w = (Wm *)user_data; const char *seq_id = NULL, *bin_name = NULL; Client *p; dbg("%s() called\n", __func__); sequence = sn_monitor_event_get_startup_sequence (event); if (sequence == NULL) { dbg("%s() failed, context / sequence is NULL\n", __func__); return; } seq_id = sn_startup_sequence_get_id (sequence); bin_name = sn_startup_sequence_get_binary_name (sequence); if (seq_id == NULL || bin_name == NULL) { dbg("%s() failed, seq_id or bin_name NULL \n", __func__ ); return; } switch (sn_monitor_event_get_type (event)) { case SN_MONITOR_EVENT_INITIATED: dbg("%s() SN_MONITOR_EVENT_INITIATED\n", __func__); w->sn_busy_cnt++; w->sn_init_time = time(NULL); wm_sn_cycle_add(w, bin_name); break; case SN_MONITOR_EVENT_CHANGED: dbg("%s() SN_MONITOR_EVENT_CHANGED\n", __func__); break; case SN_MONITOR_EVENT_COMPLETED: dbg("%s() SN_MONITOR_EVENT_COMPLETED\n", __func__ ); if (!stack_empty(w)) { stack_enumerate(w, p) { if (p->startup_id && !strcmp(p->startup_id, seq_id)) { dbg("%s() found startup_id match ( %s ) for %s \n", __func__, seq_id, p->name ); wm_sn_cycle_update_xid(w, bin_name, p->window); wm_sn_cycle_update_root_prop(w); w->sn_busy_cnt--; break; } } } else w->sn_busy_cnt--; break; case SN_MONITOR_EVENT_CANCELED: /* wm_sn_cycle_remove(w, bin_name); */ w->sn_busy_cnt--; break; } if (w->sn_busy_cnt) XDefineCursor(w->dpy, w->root, w->curs_busy); else XDefineCursor(w->dpy, w->root, w->curs); } #endif /* Hacky way of dimming windows when no composite - not recommended */ #ifndef USE_COMPOSITE void wm_lowlight(Wm *w, Client *c) { #ifndef STANDALONE MBPixbufImage *img; int x, y; Pixmap pxm_tmp; XSetWindowAttributes attr; attr.override_redirect = True; attr.event_mask = ChildMask|ButtonPressMask|ExposureMask; c->frame = XCreateWindow(w->dpy, w->root, 0, 0, w->dpy_width, w->dpy_height, 0, CopyFromParent, CopyFromParent, CopyFromParent, CWOverrideRedirect|CWEventMask, &attr); pxm_tmp = XCreatePixmap(c->wm->dpy, c->window, w->dpy_width, w->dpy_height , w->pb->depth); img = mb_pixbuf_img_new_from_x_drawable(c->wm->pb, w->root, None, 0, 0, w->dpy_width, w->dpy_height, True); XMapWindow(w->dpy, c->frame); for (x = 0; x < w->dpy_width; x++) for (y = 0; y < w->dpy_height; y++) mb_pixbuf_img_plot_pixel_with_alpha(c->wm->pb, img, x, y, w->config->lowlight_params[0], w->config->lowlight_params[1], w->config->lowlight_params[2], w->config->lowlight_params[3] ); /* Striped pattern diabled. if ( (y % 6) > 2 ) { mb_pixbuf_img_composite_pixel(img, x, y, 0, 0, 0, 150); } else { mb_pixbuf_img_composite_pixel(img, x, y, 0, 0, 0, 100); } */ mb_pixbuf_img_render_to_drawable(w->pb, img, pxm_tmp, 0, 0); XSetWindowBackgroundPixmap(w->dpy, c->frame, pxm_tmp); XClearWindow(w->dpy, c->frame); mb_pixbuf_img_free(w->pb, img); XFreePixmap(w->dpy, pxm_tmp); #endif } #endif #ifdef USE_GCONF void gconf_key_changed_callback (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer user_data) { Wm *w = (Wm *)user_data; GConfValue *value = NULL; char *key = NULL; dbg("%s() called\n", __func__ ); value = gconf_entry_get_value(entry); key = (char *)gconf_entry_get_key(entry); if (value && key) { dbg("%s() key is %s\n", __func__, key ); switch (value->type) { case GCONF_VALUE_STRING: dbg("%s() value is string : %s\n", __func__, gconf_value_get_string(value) ); /* On a keychange, we just reload the whole config :/ */ if (strstr(key, "keybindings")) { dbg("%s() calling keys_reinit\n", __func__ ); keys_reinit(w); } else if (!strcmp(key, "/apps/matchbox/general/theme")) { #ifndef USE_XSETTINGS char *theme = gconf_client_get_string(w->gconf_client, "/apps/matchbox/general/theme", NULL); if (w->flags & STARTUP_FLAG) w->config->theme = strdup(theme); else mbtheme_switch(w, theme); #else if (w->xsettings_client == NULL) { char *theme = gconf_client_get_string(w->gconf_client, "/apps/matchbox/general/theme", NULL); if (w->flags & STARTUP_FLAG) w->config->theme = strdup(theme); else mbtheme_switch(w, theme); } #endif } break; case GCONF_VALUE_BOOL: dbg("%s() value is boolean : %s\n", __func__, (gconf_value_get_bool(value)) ? "True" : "False" ); break; case GCONF_VALUE_INT: dbg("%s() value is int : %i\n", __func__, gconf_value_get_int(value)); break; default : dbg("%s() value is useless to me...\n", __func__ ); } } } #endif matchbox-window-manager-1.2/matchbox-window-manager/src/toolbar_client_alt.c0000664000211500234210000002140411307441355026262 0ustar bifh1bifhs/* * Matchbox Window Manager - A lightweight window manager not for the * desktop. * * Authored By Matthew Allum * * Copyright (c) 2002, 2004 OpenedHand Ltd - http://o-hand.com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ /* Toolbar windows are small collapsable 'panel' like windows at bottom * of display. They are mainly to hold input methods like software keyboards * stroke recognisers etc. */ #include "toolbar_client.h" #ifdef USE_ALT_INPUT_WIN static int dialog_init_height; static void toolbar_client_set_input_area(Wm *w, Client *c) { CARD32 val[4]; if(!c) { XDeleteProperty(w->dpy, w->root, w->atoms[_NET_INPUT_AREAS]); return; } val[0] = c->x; val[1] = c->y; val[2] = c->width; val[3] = c->height; XChangeProperty(w->dpy, w->root, w->atoms[_NET_INPUT_AREAS], XA_CARDINAL, 32, PropModeReplace, (unsigned char *)val, 4); } Client* toolbar_client_new(Wm *w, Window win) { Window trans_win; Client *c = NULL, *trans_client = NULL; c = base_client_new(w, win); if (!c) return NULL; c->type = MBCLIENT_TYPE_DIALOG; c->configure = &toolbar_client_configure; c->reparent = &toolbar_client_reparent; c->hide = &toolbar_client_hide; c->iconize = &toolbar_client_hide; c->show = &toolbar_client_show; c->move_resize = &toolbar_client_move_resize; c->destroy = &toolbar_client_destroy; dialog_init_height = -1; XGetTransientForHint(w->dpy, win, &trans_win); dbg("%s() checking trans hint\n", __func__); if (trans_win && (trans_win != win)) { dbg("%s() got trans hint\n", __func__); trans_client = wm_find_client(w, trans_win, WINDOW); if (trans_client) { if (trans_client->type == MBCLIENT_TYPE_DIALOG) { c->flags |= CLIENT_TB_ALT_TRANS_FOR_DIALOG; dbg("%s() is trans for dialog\n", __func__); } else if (trans_client->type & (MBCLIENT_TYPE_APP|MBCLIENT_TYPE_DESKTOP)) { dbg("%s() is trans for app\n", __func__); c->flags |= CLIENT_TB_ALT_TRANS_FOR_APP; } else trans_client = NULL; } if (trans_client == NULL) { fprintf(stderr, "matchbox: Alternate toolbar window lacks valid transient parent\n"); return NULL; /* SledgeHammer for now */ } } return c; } int toolbar_win_offset(Client *c) { return 0; } void toolbar_client_configure(Client *c) { Wm *w = c->wm; Client *main_client = NULL; dbg("%s() called\n", __func__); if (c->flags & CLIENT_IS_MINIMIZED) return; dbg("%s() client is not minimised\n", __func__); if (c->flags & CLIENT_TB_ALT_TRANS_FOR_APP) { /* resize the main client were transient for */ Client *app_client = c->trans; if (app_client && (app_client->flags & CLIENT_FULLSCREEN_FLAG)) { c->x = 0; c->y = w->dpy_height - c->height; c->width = w->dpy_width; return; } } c->y = w->dpy_height - wm_get_offsets_size(w, SOUTH, c, True) - c->height; c->x = wm_get_offsets_size(w, WEST, NULL, False); c->width = w->dpy_width - wm_get_offsets_size(w, WEST, NULL, False) - wm_get_offsets_size(w, EAST, NULL, False); /* * Though not transient for app, there could be a fullscreened * app win below us, in which case the input win needs to cover * any vertical panels. */ if ((main_client = wm_get_visible_main_client(w)) != NULL) { if (main_client->flags & CLIENT_FULLSCREEN_FLAG) { c->x = 0; c->y = w->dpy_height - c->height; c->width = w->dpy_width; } } if (c->flags & CLIENT_TB_ALT_TRANS_FOR_DIALOG) { Client *dialog_client = c->trans; dbg("%s() client trans for dialog\n", __func__); if (dialog_client) { /* * Move transient dialog out of the way of toolbar. */ Bool tmp_mapped = c->mapped; int req_x = dialog_client->x, req_y = dialog_client->y, req_w = dialog_client->width, req_h = dialog_client->height; if (dialog_init_height < 0) dialog_init_height = dialog_client->height; c->mapped = True; /* Hack Hack */ c->type = MBCLIENT_TYPE_TOOLBAR; dbg("%s() checking for available geom\n", __func__); if (!dialog_constrain_geometry(dialog_client, &req_x, &req_y, &req_w, &req_h)) { dbg("%s() constraining to %ix%i +%i+%i\n", __func__, req_w, req_h, req_x, req_y); dialog_client->x = req_x; dialog_client->y = req_y; dialog_client->width = req_w; dialog_client->height = req_h; dialog_client->move_resize(dialog_client); /* Force a redraw to be safe */ dialog_client->redraw(dialog_client, False); client_deliver_config(dialog_client); } c->type = MBCLIENT_TYPE_DIALOG; c->mapped = tmp_mapped; } } } void toolbar_client_move_resize(Client *c) { Wm *w = c->wm; base_client_move_resize(c); dbg("%s() called setting size +%i+%i,%ix%i\n", __func__, c->x, c->y, c->width, c->height); XResizeWindow(w->dpy, c->window, c->width, c->height); XMoveResizeWindow(w->dpy, c->frame, c->x, c->y, c->width, c->height ); } void toolbar_client_reparent(Client *c) { Wm *w = c->wm; XSetWindowAttributes attr; attr.override_redirect = True; attr.background_pixel = w->grey_col.pixel; attr.event_mask = ChildMask|ButtonPressMask|ExposureMask; c->frame = XCreateWindow(w->dpy, w->root, 0, c->y, w->dpy_width, c->height, 0, CopyFromParent, CopyFromParent, CopyFromParent, CWOverrideRedirect|CWEventMask|CWBackPixel, &attr); attr.background_pixel = w->grey_col.pixel; XSetWindowBorderWidth(w->dpy, c->window, 0); XAddToSaveSet(w->dpy, c->window); XSelectInput(w->dpy, c->window, ButtonPressMask|ColormapChangeMask|PropertyChangeMask); dbg("%s() reparenting\n", __func__ ); XReparentWindow(w->dpy, c->window, c->frame, 0, 0); } void toolbar_client_show(Client *c) { Wm *w = c->wm; if (!c->mapped) { XMapSubwindows(w->dpy, c->frame); XMapWindow(w->dpy, c->frame); if (c->flags & CLIENT_TB_ALT_TRANS_FOR_APP) { /* resize the main client were transient for */ Client *app_client = c->trans; /* Call this so, map of toolbar hopefully happens before * resize preventing potential flash of desktop win. */ XSync(w->dpy, False); if (app_client && app_client->type != MBCLIENT_TYPE_DESKTOP) { app_client->height -= c->height; app_client->move_resize(app_client); app_client->redraw(app_client, False); } } } dialog_client_show(c); toolbar_client_set_input_area(w, c); c->mapped = True; } void toolbar_client_hide(Client *c) { Wm *w = c->wm; client_set_state(c, WithdrawnState); XReparentWindow(w->dpy, c->window, w->root, c->x, c->y); XUnmapWindow(w->dpy, c->window); c->destroy(c); } void toolbar_client_destroy(Client *c) { Wm *w = c->wm; dbg("%s() called\n", __func__); c->mapped = False; /* Setting mapped to false will allow the dialog resizing/repositioning via restack to ignore use */ /* resize the main client were transient for */ if (c->flags & CLIENT_TB_ALT_TRANS_FOR_APP) { Client *app_client = c->trans; if (app_client && app_client->type != MBCLIENT_TYPE_DESKTOP) { /* app_client could have likely dissapeared with the toolbar * but we havn't been told yet - therefore trap. * XXX - there maybe a better way of handling this ? */ misc_trap_xerrors(); app_client->height += c->height; app_client->move_resize(app_client); app_client->redraw(app_client, False); misc_untrap_xerrors(); } } else if (c->flags & CLIENT_TB_ALT_TRANS_FOR_DIALOG) { Client *dialog_client = c->trans; /* Reset dialog to old size - *no* repositioning currently */ if (dialog_client && (dialog_init_height != dialog_client->height)) { dialog_client->height = dialog_init_height; dialog_client->move_resize(dialog_client); dialog_client->redraw(dialog_client, False); client_deliver_config(dialog_client); } } if (w->focused_client == c) w->focused_client = NULL; base_client_destroy(c); toolbar_client_set_input_area(w, NULL); } void toolbar_client_redraw(Client *c, Bool use_cache) { ; } #endif /* USE_ALT_INPUT_WIN */ matchbox-window-manager-1.2/matchbox-window-manager/src/select_client.c0000664000211500234210000002070611307441355025243 0ustar bifh1bifhs/* * Matchbox Window Manager - A lightweight window manager not for the * desktop. * * Authored By Matthew Allum * * Copyright (c) 2002, 2004 OpenedHand Ltd - http://o-hand.com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ /* * A 'select client' is the small titilebar task menu dropdown. */ #include "select_client.h" Client* select_client_new(Wm *w) { Window win; XSetWindowAttributes attr; int button_x = 0; int width, height; Client *c; dbg("%s() called\n", __func__); if (w->flags & SINGLE_FLAG && !wm_get_desktop(w)) return NULL; /* Make sure select menu is not shown on un decored desktop */ if (!(w->flags & DESKTOP_DECOR_FLAG) && w->flags & DESKTOP_RAISED_FLAG) return NULL; if (!theme_frame_menu_get_dimentions(w->mbtheme, &width, &height)) return NULL; if (width == 0 || height == 0) return NULL; dbg("%s() got valid size\n", __func__); button_x = theme_frame_button_get_x_pos(w->mbtheme, FRAME_MAIN, BUTTON_ACTION_MENU, w->stack_top_app->width); #ifndef STANDALONE { /* * A uglyish hack to center the drop down menu on centered labels * which are menu's. Should probably figure out how to get this * into mbtheme.c ( into theme_frame_button_get_x_pos()! ) */ MBThemeFrame *frame; MBThemeFrame *frame_menu; MBThemeButton *button; MBThemeLayer *layer; frame = (MBThemeFrame*)list_find_by_id(w->mbtheme->frames, FRAME_MAIN ); frame_menu = (MBThemeFrame*)list_find_by_id(w->mbtheme->frames, FRAME_MENU ); if (frame) { button = (MBThemeButton *)list_find_by_id(frame->buttons, BUTTON_ACTION_MENU ); layer = (MBThemeLayer*)list_find_by_id(frame->layers, LAYER_LABEL); /* Also handle fixed X positions */ if (frame_menu && frame_menu->fixed_x != -1) { button_x = frame_menu->fixed_x; } else if (button && layer && layer->label && layer->label->justify == ALIGN_CENTER && button->x->unit == textx && button->w->unit == textw) { button_x = button_x + (( frame->label_w + ( MENU_ENTRY_PADDING + w->config->use_icons ) - width )/2 ); } /* FIXME: should also do for ALIGN_RIGHT */ } } #endif if (XGrabPointer(w->dpy, w->root, True, (ButtonPressMask|ButtonReleaseMask), GrabModeAsync, GrabModeAsync, None, w->curs, CurrentTime) != GrabSuccess) return NULL; XGrabKeyboard(w->dpy, w->root, True, GrabModeAsync, GrabModeAsync, CurrentTime); attr.override_redirect = True; attr.background_pixel = BlackPixel(w->dpy, w->screen); attr.event_mask = ButtonPressMask|ExposureMask| EnterWindowMask|LeaveWindowMask|PointerMotionMask; win = XCreateWindow(w->dpy, w->root, button_x + wm_get_offsets_size(w, WEST, NULL, True), wm_get_offsets_size(w, NORTH, NULL, True) + main_client_title_height(w->stack_top_app), width, height, 0, CopyFromParent, CopyFromParent, CopyFromParent, CWOverrideRedirect|CWBackPixel|CWEventMask, &attr); c = base_client_new(w, win); c->type = MBCLIENT_TYPE_TASK_MENU; client_title_frame(c) = c->frame = c->window; comp_engine_client_init(w, c); c->destroy = &select_client_destroy; c->button_press = &select_client_button_press; c->redraw = &select_client_redraw; w->flags ^= MENU_FLAG; c->redraw(c, False); c->mapped = True; client_set_state(c, NormalState); c->height = height; c->width = width; c->name = strdup(""); stack_move_top(c); XMapWindow(c->wm->dpy, c->frame); comp_engine_client_show(w, c); return c; } void select_client_event_loop( Client *c, struct list_item *button_item_cur ) { Client *p; XEvent ev; Bool in_window = True; MBClientButton *button; struct list_item *button_item_new = NULL; KeySym key; if (button_item_cur == NULL) { button_item_cur = c->buttons; in_window = False; } button = (MBClientButton *)button_item_cur->data; theme_frame_menu_highlight_entry( c, button, ACTIVE); for (;;) { XMaskEvent(c->wm->dpy, EnterWindowMask|LeaveWindowMask|KeyReleaseMask|KeyPressMask |ExposureMask|ButtonReleaseMask|PointerMotionMask, &ev); switch (ev.type) { case KeyRelease: switch (key = XKeycodeToKeysym (c->wm->dpy, ev.xkey.keycode, 0)) { case XK_Up: button_item_new = c->buttons; if (button_item_cur == c->buttons) { while(button_item_new->next != NULL) button_item_new = button_item_new->next; } else { while(button_item_new->next != button_item_cur) button_item_new = button_item_new->next; } if (button_item_cur) theme_frame_menu_highlight_entry( c, button, INACTIVE); button_item_cur = button_item_new; button = (MBClientButton *)button_item_cur->data; theme_frame_menu_highlight_entry( c, button, ACTIVE); break; case XK_Down: button_item_new = button_item_cur->next; if (button_item_new == NULL) button_item_new = c->buttons; if (button_item_cur) theme_frame_menu_highlight_entry( c, button, INACTIVE); button_item_cur = button_item_new; button = (MBClientButton *)button_item_cur->data; theme_frame_menu_highlight_entry( c, button, ACTIVE); break; case XK_Return: case XK_KP_Enter: p = (Client *)button->data; theme_frame_menu_highlight_entry( c, button, INACTIVE); if (p->type == MBCLIENT_TYPE_DESKTOP) wm_toggle_desktop(c->wm); else { wm_activate_client(p); } dbg("%s() returning ....\n", __func__); return; } break; case ButtonRelease: if (button && in_window) { p = (Client *)button->data; theme_frame_menu_highlight_entry( c, button, INACTIVE); if (p->type == MBCLIENT_TYPE_DESKTOP) wm_toggle_desktop(c->wm); else { wm_activate_client(p); } } return; case EnterNotify: in_window = True; break; case MotionNotify: /* XXX get list_item back, then can get next / prev for keys */ button_item_new = client_get_button_list_item_from_event(c, &ev.xbutton); if (button_item_new != NULL && in_window) { if (button_item_new != button_item_cur) { dbg("%s() got a button again\n", __func__ ); if (button_item_cur) theme_frame_menu_highlight_entry( c, button, INACTIVE); button_item_cur = button_item_new; button = (MBClientButton *)button_item_cur->data; theme_frame_menu_highlight_entry( c, button, ACTIVE); } } break; case LeaveNotify: in_window = False; button_item_cur = NULL; /* Clear button highlight */ theme_frame_menu_highlight_entry( c, button, INACTIVE); break; } } } void select_client_button_press( Client *c, XButtonEvent *e) { struct list_item *button_item = NULL; if ((button_item = client_get_button_list_item_from_event(c, e)) == NULL) { dbg("%s() failed to get a button\n", __func__ ); select_client_destroy(c); return; } select_client_event_loop( c, button_item ); dbg("%s() calling destroy\n", __func__); select_client_destroy(c); } void select_client_redraw(Client *c, Bool use_cache) { MBTheme *theme = c->wm->mbtheme; Bool is_shaped = False; dbg("%s() called\n", __func__); if (use_cache) return; is_shaped = theme_frame_wants_shaped_window( theme, FRAME_MENU); if (is_shaped) client_init_backing_mask(c, c->width, 0, c->height, 0, 0, 0 ); theme_frame_menu_paint( theme, c); if (is_shaped) XShapeCombineMask( c->wm->dpy, c->frame, ShapeBounding, 0, 0, c->backing_masks[MSK_NORTH], ShapeSet); XClearWindow(c->wm->dpy, c->frame); } void select_client_destroy(Client *c) { dbg("%s() called\n", __func__); XUngrabPointer(c->wm->dpy, CurrentTime); XUngrabKeyboard(c->wm->dpy, CurrentTime); c->wm->flags ^= MENU_FLAG; XUnmapWindow(c->wm->dpy, c->frame); base_client_destroy(c); } matchbox-window-manager-1.2/matchbox-window-manager/src/misc.h0000664000211500234210000000240511307441355023362 0ustar bifh1bifhs/* * Matchbox Window Manager - A lightweight window manager not for the * desktop. * * Authored By Matthew Allum * * Copyright (c) 2002, 2004 OpenedHand Ltd - http://o-hand.com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #ifndef _MISC_H_ #define _MISC_H_ #include "structs.h" #include "wm.h" #include "main_client.h" #include "config.h" void err(const char *fmt, ...); #ifndef HAVE_STRSEP char *strsep(char **stringp, char *delim); #endif void fork_exec(char *cmd); void sig_handler(int signal); int handle_xerror(Display *dpy, XErrorEvent *e); int ignore_xerror(Display *dpy, XErrorEvent *e); void misc_trap_xerrors(void); int misc_untrap_xerrors(void); int mwm_get_decoration_flags(Wm *w, Window win); void misc_scale_wm_app_icon(Wm *w); #endif matchbox-window-manager-1.2/matchbox-window-manager/src/main_client.c0000664000211500234210000006756411307441355024725 0ustar bifh1bifhs/* * Matchbox Window Manager - A lightweight window manager not for the * desktop. * * Authored By Matthew Allum * * Copyright (c) 2002, 2004 OpenedHand Ltd - http://o-hand.com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #include "main_client.h" #include Client* main_client_new(Wm *w, Window win) { Client *c = base_client_new(w, win); if (!c) return NULL; c->type = MBCLIENT_TYPE_APP; c->reparent = &main_client_reparent; c->redraw = &main_client_redraw; c->button_press = &main_client_button_press; c->move_resize = &main_client_move_resize; c->get_coverage = &main_client_get_coverage; c->hide = &main_client_hide; c->show = &main_client_show; c->configure = &main_client_configure; c->destroy = &main_client_destroy; c->iconize = &main_client_iconize; main_client_check_for_state_hints(c); main_client_check_for_single(c); return c; } void main_client_check_for_state_hints(Client *c) { dbg("%s() checking for fullscreen hint\n", __func__); if (ewmh_state_check(c, c->wm->atoms[WINDOW_STATE_FULLSCREEN])) { c->flags ^= CLIENT_FULLSCREEN_FLAG; dbg("%s() client is fullscreen\n", __func__); } } void main_client_check_for_single(Client *c) { Wm *w = c->wm; if (w->flags & SINGLE_FLAG) { /* There was only main client till this came along */ w->flags ^= SINGLE_FLAG; /* turn off single flag */ if (w->stack_top_app) main_client_redraw(w->stack_top_app, False); /* update menu button */ } else if (!w->stack_top_app) /* This must be the only client*/ c->wm->flags |= SINGLE_FLAG; /* so turn on single flag */ } /* Handle the case for showing input methods ( toolbars ) * for fullscreen */ int main_client_manage_toolbars_for_fullscreen(Client *c, Bool main_client_showing) { #ifdef USE_ALT_INPUT_WIN Wm *w = c->wm; Client *p = NULL; dbg("%s() called\n", __func__); stack_enumerate(w, p) { if (p->type == MBCLIENT_TYPE_DIALOG) { if (p->flags & CLIENT_TB_ALT_TRANS_FOR_APP && p->trans == c) { toolbar_client_configure(p); toolbar_client_move_resize(p); return p->height; } else if (p->flags & CLIENT_TB_ALT_TRANS_FOR_DIALOG) { dbg("%s() IM trans for dialog found resizing..\n", __func__); toolbar_client_configure(p); toolbar_client_move_resize(p); return 0; } } } return 0; #else Wm *w = c->wm; Client *p = NULL; int south_panel_size = 0, south_total_size = 0; if (main_client_showing && (c->flags & CLIENT_TOOLBARS_MOVED_FOR_FULLSCREEN)) return 0; if (!main_client_showing && !(c->flags & CLIENT_TOOLBARS_MOVED_FOR_FULLSCREEN)) return 0; south_panel_size = wm_get_offsets_size(w, SOUTH, NULL, False); south_total_size = wm_get_offsets_size(w, SOUTH, NULL, True); c->flags ^= CLIENT_TOOLBARS_MOVED_FOR_FULLSCREEN; if (south_total_size > south_panel_size) /* there are toolbars */ { stack_enumerate(w, p) { /* move toolbar wins up/down over panels */ if (p->type == MBCLIENT_TYPE_TOOLBAR && p->mapped) { if (main_client_showing) { p->y += south_panel_size; /* cover vertical panels */ p->x = toolbar_win_offset(p); p->width = w->dpy_width - toolbar_win_offset(p); } else { /* uncover any vertical panels */ p->x = toolbar_win_offset(p) + wm_get_offsets_size(w, WEST, NULL, False); p->width = w->dpy_width - toolbar_win_offset(p) - wm_get_offsets_size(w, WEST, NULL, False) - wm_get_offsets_size(w, EAST, NULL, False); p->y -= south_panel_size; } p->move_resize(p); XMapRaised(w->dpy, p->frame); } else if (p->type == MBCLIENT_TYPE_PANEL && main_client_showing) { XLowerWindow(w->dpy, p->frame); } } return (south_total_size - south_panel_size); } return 0; #endif } void main_client_configure(Client *c) { Wm *w = c->wm; int frm_size = main_client_title_height(c); int offset_south = theme_frame_defined_height_get(c->wm->mbtheme, FRAME_MAIN_SOUTH); int offset_east = theme_frame_defined_width_get(c->wm->mbtheme, FRAME_MAIN_EAST ); int offset_west = theme_frame_defined_width_get(c->wm->mbtheme, FRAME_MAIN_WEST ); int h = wm_get_offsets_size(w, SOUTH, NULL, True); if (c->flags & CLIENT_TITLE_HIDDEN_FLAG) /* Decorations */ frm_size = offset_south = offset_east = offset_west = 0; if ( c->flags & CLIENT_FULLSCREEN_FLAG ) { c->y = 0; c->x = 0; c->width = w->dpy_width; c->height = w->dpy_height - main_client_manage_toolbars_for_fullscreen(c, True); } else { c->y = wm_get_offsets_size(c->wm, NORTH, NULL, False) + frm_size; c->x = wm_get_offsets_size(c->wm, WEST, NULL, False) + offset_west; c->width = c->wm->dpy_width - ( offset_east + offset_west ) - wm_get_offsets_size(c->wm, EAST, NULL, False) - wm_get_offsets_size(c->wm, WEST, NULL, False); #ifdef USE_ALT_INPUT_WIN c->height = c->wm->dpy_height - c->y - h - offset_south - main_client_manage_toolbars_for_fullscreen(c, False); #else c->height = c->wm->dpy_height - c->y - h - offset_south; main_client_manage_toolbars_for_fullscreen(c, False); #endif } dbg("%s() configured as %i*%i+%i+%i, frame size is %i\n", __func__, c->width, c->height, c->x, c->y, frm_size); } int main_client_title_height(Client *c) { if (c == NULL || c->type != MBCLIENT_TYPE_APP) return 0; if ( (!c->wm->config->use_title) || c->flags & CLIENT_FULLSCREEN_FLAG || c->flags & CLIENT_TITLE_HIDDEN_FLAG) return 0; if ((c->wm->flags & TITLE_HIDDEN_FLAG) && c->type == MBCLIENT_TYPE_APP) return TITLE_HIDDEN_SZ; return theme_frame_defined_height_get(c->wm->mbtheme, FRAME_MAIN); } void main_client_get_coverage(Client *c, int *x, int *y, int *w, int *h) { int offset_south = theme_frame_defined_height_get(c->wm->mbtheme, FRAME_MAIN_SOUTH); int offset_east = theme_frame_defined_width_get(c->wm->mbtheme, FRAME_MAIN_EAST ); int offset_west = theme_frame_defined_width_get(c->wm->mbtheme, FRAME_MAIN_WEST ); if (c->flags & CLIENT_TITLE_HIDDEN_FLAG) offset_south = offset_east = offset_west = 0; *x = c->x - offset_west; *y = c->y - main_client_title_height(c); *w = c->width + offset_east + offset_west; *h = c->height + main_client_title_height(c) + offset_south; dbg("%s() +%i+%i, %ix%i\n", __func__, *x, *y, *w, *h); } void main_client_reparent(Client *c) { Wm *w = c->wm; XSetWindowAttributes attr; int frame_north_height; int offset_north = main_client_title_height(c); int offset_south = theme_frame_defined_height_get(w->mbtheme, FRAME_MAIN_SOUTH); int offset_east = theme_frame_defined_width_get(w->mbtheme, FRAME_MAIN_EAST ); int offset_west = theme_frame_defined_width_get(w->mbtheme, FRAME_MAIN_WEST ); attr.override_redirect = True; attr.background_pixel = w->grey_col.pixel; /* BlackPixel(w->dpy, w->screen); */ attr.event_mask = ChildMask|ButtonMask|ExposureMask; if (c->flags & CLIENT_TITLE_HIDDEN_FLAG) offset_south = offset_east = offset_west = 0; c->frame = XCreateWindow(w->dpy, w->root, c->x - offset_west, c->y - offset_north, c->width + offset_east + offset_west, c->height + offset_north + offset_south, 0, CopyFromParent, CopyFromParent, CopyFromParent, CWOverrideRedirect|CWEventMask|CWBackPixel, &attr); dbg("%s frame created : %i*%i+%i+%i\n", __func__, c->width, c->height + offset_north, c->x, c->y); frame_north_height = offset_north; if (!c->wm->config->use_title && c->flags & CLIENT_FULLSCREEN_FLAG) { /* make sure the top frame is not 0 pixels high if fullscreen * else toggling will break. */ frame_north_height = theme_frame_defined_height_get(c->wm->mbtheme, FRAME_MAIN); } if (!(c->flags & CLIENT_TITLE_HIDDEN_FLAG)) client_decor_frames_init(c, offset_west, offset_east, ( c->flags & CLIENT_FULLSCREEN_FLAG) ? : offset_north, offset_south); XClearWindow(w->dpy, c->frame); XSetWindowBorderWidth(w->dpy, c->window, 0); XAddToSaveSet(w->dpy, c->window); XSelectInput(w->dpy, c->window, ColormapChangeMask|PropertyChangeMask); XReparentWindow(w->dpy, c->window, c->frame, offset_west, offset_north); } void main_client_move_resize(Client *c) { Wm *w = c->wm; int offset_south = theme_frame_defined_height_get(w->mbtheme, FRAME_MAIN_SOUTH); int offset_east = theme_frame_defined_width_get(w->mbtheme, FRAME_MAIN_EAST ); int offset_west = theme_frame_defined_width_get(w->mbtheme, FRAME_MAIN_WEST ); if (c->flags & CLIENT_TITLE_HIDDEN_FLAG) offset_south = offset_east = offset_west = 0; base_client_move_resize(c); XMoveResizeWindow(w->dpy, c->window, offset_west, main_client_title_height(c), c->width, c->height); XMoveResizeWindow(w->dpy, c->frame, c->x - offset_west, c->y - main_client_title_height(c), c->width + ( offset_east + offset_west), c->height + main_client_title_height(c) + offset_south); client_decor_frames_move_resize(c, offset_west, offset_east, main_client_title_height(c), offset_south); /* * Disabled _NET_WM_SYNC code ( Alternate to above XMove*'s ) * Is unfinished and initial testing did not seem to improve things. * Maybe re-try again at a later date. * * if (!c->ewmh_sync_is_waiting) * { * XMoveResizeWindow(w->dpy, c->window, * offset_west, main_client_title_height(c), * c->width, c->height); * } * * if (ewmh_sync_client_move_resize(c)) * { * dbg("%s() not resizing frame yet\n", __func__); * return; * } * * XMoveWindow(w->dpy, c->window, offset_west, main_client_title_height(c)); * * XResizeWindow(w->dpy, c->title_frame, * c->width + (offset_east + offset_west), * c->height + main_client_title_height(c) + offset_south); * * XMoveResizeWindow(w->dpy, c->frame, * c->x - offset_west, * c->y - main_client_title_height(c), * c->width + ( offset_east + offset_west), * c->height + main_client_title_height(c) + offset_south); * * dbg("%s() resizing frame\n", __func__); * * c->ewmh_sync_is_waiting = False; */ } void main_client_toggle_fullscreen(Client *c) { c->flags ^= CLIENT_FULLSCREEN_FLAG; ewmh_state_set(c); /* Let win know it fullscreen state has changed, it could be waiting on this to adjust ui */ main_client_configure(c); main_client_move_resize(c); if (!(c->flags & CLIENT_FULLSCREEN_FLAG)) { /* Client was fullscreen - to be safe we redraw decoration buttons */ client_buttons_delete_all(c); c->redraw(c, False); } wm_activate_client(c); /* Reactivate, stacking order slightly different */ /* No need to ping here anymore * if (c->wm->config->ping_aggressive) * ewmh_ping_client_start (c); */ } /* redraws the frame */ void main_client_redraw(Client *c, Bool use_cache) { Wm *w = c->wm; Bool is_shaped = False; int width = 0, height = 0; int offset_south, offset_east, offset_west; dbg("%s() called on %s\n", __func__, c->name); if (!w->config->use_title || c->flags & CLIENT_TITLE_HIDDEN_FLAG) return; if (w->flags & TITLE_HIDDEN_FLAG) { XUnmapWindow(w->dpy, client_title_frame(c)); return; } if (use_cache && c->have_set_bg) return ; offset_south = theme_frame_defined_height_get(w->mbtheme, FRAME_MAIN_SOUTH); offset_east = theme_frame_defined_width_get(w->mbtheme, FRAME_MAIN_EAST ); offset_west = theme_frame_defined_width_get(w->mbtheme, FRAME_MAIN_WEST ); width = c->width + offset_east + offset_west; height = theme_frame_defined_height_get(w->mbtheme, FRAME_MAIN); is_shaped = theme_frame_wants_shaped_window( w->mbtheme, FRAME_MAIN); dbg("%s() cache failed, actual redraw on %s\n", __func__, c->name); if (is_shaped) client_init_backing_mask(c, c->width + offset_east + offset_west, c->height, height , offset_south, width - offset_east, offset_west); dbg("%s() calling theme_frame_paint()\n", __func__); theme_frame_paint(w->mbtheme, c, FRAME_MAIN, width, height); theme_frame_paint(w->mbtheme, c, FRAME_MAIN_WEST, offset_west, c->height); theme_frame_paint(w->mbtheme, c, FRAME_MAIN_EAST, offset_east, c->height); theme_frame_paint(w->mbtheme, c, FRAME_MAIN_SOUTH, c->width + offset_east + offset_west, offset_south); if (!(c->flags & CLIENT_IS_DESKTOP_FLAG)) theme_frame_button_paint(w->mbtheme, c, BUTTON_ACTION_CLOSE, INACTIVE, FRAME_MAIN, width, height); theme_frame_button_paint(w->mbtheme, c, BUTTON_ACTION_HIDE, INACTIVE, FRAME_MAIN, width, height); theme_frame_button_paint(w->mbtheme, c, BUTTON_ACTION_MIN, INACTIVE, FRAME_MAIN, width, height); if (!(w->flags & SINGLE_FLAG)) { dbg("%s() painting next / prev buttons\n", __func__); theme_frame_button_paint(w->mbtheme, c, BUTTON_ACTION_MENU, INACTIVE, FRAME_MAIN, width, height); theme_frame_button_paint(w->mbtheme, c, BUTTON_ACTION_NEXT, INACTIVE, FRAME_MAIN, width, height); theme_frame_button_paint(w->mbtheme, c, BUTTON_ACTION_PREV, INACTIVE, FRAME_MAIN, width, height); } else { client_button_remove(c, BUTTON_ACTION_NEXT); client_button_remove(c, BUTTON_ACTION_PREV); if (!(w->flags & DESKTOP_DECOR_FLAG) && wm_get_desktop(c->wm)) /* Paint the dropdown for the desktop */ { dbg("%s() have desktop\n", __func__); theme_frame_button_paint(w->mbtheme, c, BUTTON_ACTION_MENU, INACTIVE, FRAME_MAIN, width, height); theme_frame_button_paint(w->mbtheme, c, BUTTON_ACTION_DESKTOP, INACTIVE, FRAME_MAIN, width, height); } else { dbg("%s() removing menu button\n", __func__ ); client_button_remove(c, BUTTON_ACTION_MENU); } } if (c->flags & CLIENT_ACCEPT_BUTTON_FLAG) theme_frame_button_paint(w->mbtheme, c, BUTTON_ACTION_ACCEPT, INACTIVE, FRAME_MAIN, width, height); if (c->flags & CLIENT_HELP_BUTTON_FLAG) { dbg("%s() painting help button\n", __func__); theme_frame_button_paint(w->mbtheme, c, BUTTON_ACTION_HELP, INACTIVE, FRAME_MAIN, width, height); } if (c->flags & CLIENT_CUSTOM_BUTTON_FLAG) { dbg("%s() painting help button\n", __func__); theme_frame_button_paint(w->mbtheme, c, BUTTON_ACTION_CUSTOM, INACTIVE, FRAME_MAIN, width, height); } if (is_shaped) /* XXX do we really need titleframe here ? */ { XRectangle rects[1]; rects[0].x = 0; rects[0].y = height; rects[0].width = width; rects[0].height = c->height; XShapeCombineRectangles ( w->dpy, c->frame, ShapeBounding, 0, 0, rects, 1, ShapeSet, 0 ); XShapeCombineMask( c->wm->dpy, c->frames_decor[NORTH], ShapeBounding, 0, 0, c->backing_masks[MSK_NORTH], ShapeSet); XShapeCombineMask( c->wm->dpy, c->frames_decor[SOUTH], ShapeBounding, 0, 0, c->backing_masks[MSK_SOUTH], ShapeSet); XShapeCombineShape ( c->wm->dpy, c->frame, ShapeBounding, 0, 0, c->frames_decor[NORTH], ShapeBounding, ShapeUnion); XShapeCombineShape ( c->wm->dpy, c->frame, ShapeBounding, 0, c->height + height, c->frames_decor[SOUTH], ShapeBounding, ShapeUnion); } #if 0 #ifdef STANDALONE XSetWindowBackgroundPixmap(w->dpy, c->title_frame, c->backing); #else XSetWindowBackgroundPixmap(w->dpy, c->title_frame, mb_drawable_pixmap(c->backing)); #endif XClearWindow(w->dpy, c->title_frame); #ifdef STANDALONE XFreePixmap(w->dpy, c->backing); c->backing = None; #else mb_drawable_unref(c->backing); c->backing = NULL; #endif #endif /* if 0 */ c->have_set_bg = True; } #ifdef USE_FRAME_ANIMATION Bool video_overlay_in_use (Client *c) { Wm *w = c->wm; unsigned long n; unsigned long extra; int format, status; Atom overlay_atom; Atom realType, *value = NULL; overlay_atom = XInternAtom (w->dpy, "_OMAP_VIDEO_OVERLAY", False); status = XGetWindowProperty(w->dpy, c->window, overlay_atom, 0L, 1000000L, 0, XA_ATOM, &realType, &format, &n, &extra, (unsigned char **) &value); if (status == Success) { if (!value) { return 0; } if (value) XFree(value); return 1; } if (value) XFree(value); return 0; } #endif void main_client_button_press(Client *c, XButtonEvent *e) { Wm *w = c->wm; int ch = 0, offset_east = 0, offset_west = 0, total_w = 0; Client *p = NULL; if (!w->config->use_title) return; if (w->flags & TITLE_HIDDEN_FLAG) { main_client_toggle_title_bar(c); /* XXX What is this doing ? XMapWindow(w->dpy, c->title_frame); XMapSubwindows(w->dpy, c->title_frame); */ return; } if (w->config->super_modal) { stack_enumerate(w, p) { if (p->trans == c && (p->flags & CLIENT_IS_MODAL_FLAG)) { MBList *button_item = client_get_button_list_item_from_event(c, e); /* In the precense of a modal transient dialog ignore * certain buttons. * */ if ((button_item && button_item->id == BUTTON_ACTION_CUSTOM) || (button_item && button_item->id == BUTTON_ACTION_MIN) || (button_item && button_item->id == BUTTON_ACTION_CLOSE)) { if (button_item->id == BUTTON_ACTION_CLOSE) { /* initiate pinging the app anyway for close button */ if (c->has_ping_protocol && c->pings_pending == -1) { c->pings_pending = 0; w->n_active_ping_clients++; } } return; } } } } offset_east = theme_frame_defined_width_get(w->mbtheme, FRAME_MAIN_EAST ); offset_west = theme_frame_defined_width_get(w->mbtheme, FRAME_MAIN_WEST ); ch = theme_frame_defined_height_get(w->mbtheme, FRAME_MAIN); total_w = c->width + offset_east + offset_west; switch (client_button_do_ops(c, e, FRAME_MAIN, total_w, ch)) { case BUTTON_ACTION_DESKTOP: wm_toggle_desktop(w); break; case BUTTON_ACTION_CLOSE: #ifdef USE_FRAME_ANIMATION if (w->config->use_frame_animation && !video_overlay_in_use(c)) { if (XGrabPointer(w->dpy, w->root, False, (ButtonPressMask|ButtonReleaseMask|PointerMotionMask), GrabModeAsync, GrabModeAsync, None, w->curs_drag, CurrentTime) == GrabSuccess) { mb_util_frame_animation(w->dpy, &w->config->animations[MB_FRAME_ANIMATION_CLOSE].src, &w->config->animations[MB_FRAME_ANIMATION_CLOSE].dst); XUngrabPointer(w->dpy, CurrentTime); } } #endif client_deliver_delete(c); break; case BUTTON_ACTION_NEXT: wm_activate_client(stack_cycle_backward(w, MBCLIENT_TYPE_APP)); break; case BUTTON_ACTION_PREV: wm_activate_client(stack_cycle_forward(w, MBCLIENT_TYPE_APP)); break; case BUTTON_ACTION_MENU: select_client_new(w); break; case BUTTON_ACTION_HIDE: main_client_toggle_title_bar(c); break; case BUTTON_ACTION_MIN: main_client_iconize(c); break; case BUTTON_ACTION_HELP: client_deliver_wm_protocol(c, w->atoms[_NET_WM_CONTEXT_HELP]); break; case BUTTON_ACTION_ACCEPT: client_deliver_wm_protocol(c, w->atoms[_NET_WM_CONTEXT_ACCEPT]); break; case BUTTON_ACTION_CUSTOM: client_deliver_wm_protocol(c, w->atoms[_NET_WM_CONTEXT_CUSTOM]); break; case -1: /* Cancelled */ break; case 0: /* Not on button */ break; } } void main_client_toggle_title_bar(Client *c) { Wm *w = c->wm; Client *p = NULL; int prev_height = main_client_title_height(c); int y_offset = wm_get_offsets_size(c->wm, NORTH, NULL, False); if (c->flags & CLIENT_TITLE_HIDDEN_FLAG) return; w->flags ^= TITLE_HIDDEN_FLAG; dbg("%s() called\n", __func__); XGrabServer(w->dpy); theme_img_cache_clear( w->mbtheme, FRAME_MAIN ); stack_enumerate(c->wm, p) if (p->type == MBCLIENT_TYPE_APP) { if (w->flags & TITLE_HIDDEN_FLAG) { /* hide */ p->height += (prev_height - TITLE_HIDDEN_SZ ); p->y = y_offset + TITLE_HIDDEN_SZ; if (w->have_titlebar_panel && mbtheme_has_titlebar_panel(w->mbtheme)) { w->have_titlebar_panel->ignore_unmap++; XUnmapWindow(w->dpy, w->have_titlebar_panel->frame); } } else { /* show */ p->y = main_client_title_height(p) + y_offset; p->height -= ( main_client_title_height(p) - TITLE_HIDDEN_SZ ); XMapWindow(w->dpy, client_title_frame(p)); /* prev will have unmapped */ if (w->have_titlebar_panel && mbtheme_has_titlebar_panel(w->mbtheme)) XMapRaised(w->dpy, w->have_titlebar_panel->frame); } p->move_resize(p); p->redraw(p, False); } XUngrabServer(w->dpy); } /* This is called when a main client is not visible anymore - i.e. another one is activated */ void main_client_hide(Client *c) { Wm *w = c->wm; /* If we dont have focus atm, and one of our dialogs likely does, then remember it for next time we come active */ if (w->focused_client != c && w->focused_client && w->focused_client->type == MBCLIENT_TYPE_DIALOG && w->focused_client->trans != NULL) { c->next_focused_client = w->focused_client; } else { c->next_focused_client = NULL; /* If were focused, unset focus for something better to be found */ if (w->focused_client == c) w->focused_client = NULL; } } void main_client_iconize(Client *c) { Wm *w = c->wm; Client *p = NULL; dbg("%s() called on %s\n", __func__, c->name); client_set_state(c, IconicState); c->flags |= CLIENT_IS_MINIMIZED; /* Make sure any transients get iconized too */ stack_enumerate(w, p) if (p->trans == c) p->iconize(p); /* do not unmap before animation, underlying expose might take a long time ... */ #ifdef USE_FRAME_ANIMATION if (w->config->use_frame_animation && !video_overlay_in_use(c)) { int *geometry = ewmh_get_icon_geometry(c->wm, c->window); XRectangle icon_geometry; XRectangle *dst; dst = &w->config->animations[MB_FRAME_ANIMATION_MINIMIZE].dst; if (geometry) { icon_geometry.x = geometry[0]; icon_geometry.y = geometry[1]; icon_geometry.width = geometry[2]; icon_geometry.height = geometry[3]; dst = &icon_geometry; free (geometry); } if (XGrabPointer(w->dpy, w->root, False, (ButtonPressMask|ButtonReleaseMask|PointerMotionMask), GrabModeAsync, GrabModeAsync, None, w->curs_drag, CurrentTime) == GrabSuccess) { mb_util_frame_animation(w->dpy, &w->config->animations[MB_FRAME_ANIMATION_MINIMIZE].src, dst); XUngrabPointer(w->dpy, CurrentTime); } } #endif main_client_unmap(c); } void main_client_show(Client *c) { Wm *w = c->wm; Client *visible_app_client = NULL; dbg("%s() called on %s\n", __func__, c->name); if (c->flags & CLIENT_NO_FOCUS_ON_MAP) visible_app_client = wm_get_visible_main_client(w); if (w->flags & DESKTOP_RAISED_FLAG) { c->flags |= CLIENT_NEW_FOR_DESKTOP; } else { /* Only reset this flag if were not the main client. * - ie we've paged to another app and come back. * Avoid problem of open app *and* the dialog from desktop, close * app then does not go back to desktop. */ if (wm_get_visible_main_client(w) != c) c->flags &= ~CLIENT_NEW_FOR_DESKTOP; } /* Move this client and any transients to the very top of the stack. wm_activate_client() ( call it sync_display ? ) will then take care of painels etc as it can use active client as a 'watermark' */ stack_move_top(c); stack_dump(w); if (!c->mapped) { if (c->flags & CLIENT_IS_MINIMIZED) { Client *p = NULL; #ifdef USE_FRAME_ANIMATION if (w->config->use_frame_animation && !video_overlay_in_use(c)) { int *geometry = ewmh_get_icon_geometry(c->wm, c->window); XRectangle icon_geometry; XRectangle *src; src = &w->config->animations[MB_FRAME_ANIMATION_MAXIMIZE].src; if (geometry) { icon_geometry.x = geometry[0]; icon_geometry.y = geometry[1]; icon_geometry.width = geometry[2]; icon_geometry.height = geometry[3]; src = &icon_geometry; free (geometry); } mb_util_frame_animation(c->wm->dpy, src, &w->config->animations[MB_FRAME_ANIMATION_MAXIMIZE].dst); } #endif /* Reset state from Iconized */ client_set_state(c, NormalState); c->flags &= ~CLIENT_IS_MINIMIZED; /* Make sure any dialogs are shown too */ stack_enumerate(w, p) if (p->trans == c) { p->show(p); /* To handle delay mapping.. */ XMapSubwindows(w->dpy, p->frame); XMapWindow(w->dpy, p->frame); } } if (c->flags & CLIENT_NO_FOCUS_ON_MAP) { if (visible_app_client) { stack_move_above_client (c, visible_app_client->below); c->flags |= CLIENT_DELAY_MAPPING; } c->flags &= ~CLIENT_NO_FOCUS_ON_MAP; } if (!(c->flags & CLIENT_DELAY_MAPPING)) { XMapSubwindows(w->dpy, c->frame); XMapWindow(w->dpy, c->frame); } } c->mapped = True; } void main_client_unmap(Client *c) { Wm *w = c->wm; Client *next_client = NULL; dbg("%s called for %s\n", __func__, c->name); if ( c->flags & CLIENT_FULLSCREEN_FLAG ) main_client_manage_toolbars_for_fullscreen(c, False); /* Are we at the top of the stack ? */ if (c == w->stack_top_app) { next_client = stack_get_below(c, MBCLIENT_TYPE_APP); dbg("%s() at stack top\n", __func__ ); /* Is this the only main client left? */ if(next_client == c) { dbg("%s() only client left\n", __func__ ); if (w->flags & SINGLE_FLAG) w->flags ^= SINGLE_FLAG; /* single flag off ( for menu button ) */ /* is there a desktop ? */ next_client = wm_get_desktop(w); } else { /* There are more main clients left, but we may have been * opened from the desktop and it therefor makes sense to * go back there. */ if (c->flags & CLIENT_NEW_FOR_DESKTOP) { /* Make sure we set stack_top_app so desktop * toggling still works. */ w->stack_top_app = next_client; next_client = wm_get_desktop(w); } } /* if we havn't set stack_top_app to something else let * wm_activate_client(next_client) below update this */ if (c == w->stack_top_app) w->stack_top_app = NULL; } c->mapped = False; if (next_client /* only 1 main_client left ? */ && next_client->type == MBCLIENT_TYPE_APP && (next_client == stack_get_below(next_client, MBCLIENT_TYPE_APP))) { dbg("%s() turning on single flag\n", __func__); w->flags |= SINGLE_FLAG; /* turn on single flag for menu button */ main_client_redraw(next_client, False); } XUnmapWindow(w->dpy, c->frame); if (c == w->focused_client) w->focused_client = NULL; if (next_client) wm_activate_client(next_client); } void main_client_destroy(Client *c) { dbg("%s called for %s\n", __func__, c->name); main_client_unmap(c); base_client_destroy(c); } matchbox-window-manager-1.2/matchbox-window-manager/src/composite-engine.h0000664000211500234210000000436111307441355025677 0ustar bifh1bifhs/* * Matchbox Window Manager - A lightweight window manager not for the * desktop. * * Authored By Matthew Allum * * Copyright (c) 2002, 2004 OpenedHand Ltd - http://o-hand.com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #ifndef _COMPOSITE_ENGINE_H_ #define _COMPOSITE_ENGINE_H_ #include "structs.h" #include "wm.h" #ifdef USE_COMPOSITE Bool comp_engine_init (Wm *w); void comp_engine_set_defualts(Wm *w); void comp_engine_theme_init(Wm *w); void comp_engine_deinit(Wm *w); void comp_engine_reinit(Wm *w); void comp_engine_client_init(Wm *w, Client *client); int comp_engine_client_get_trans_prop(Wm *w, Client *client); void comp_engine_client_show(Wm *w, Client *client); void comp_engine_client_hide(Wm *w, Client *client); void comp_engine_client_destroy(Wm *w, Client *client); void comp_engine_client_repair (Wm *w, Client *client); void comp_engine_client_configure(Wm *w, Client *client); void comp_engine_handle_events(Wm *w, XEvent *ev); void comp_engine_destroy_root_buffer(Wm *w); void comp_engine_render(Wm *w, XserverRegion region); #else /* All no ops */ #define comp_engine_init(w) ; #define comp_engine_reinit(w) ; #define comp_engine_deinit(w) ; #define comp_engine_theme_init(w); #define comp_engine_set_defualts(w); #define comp_engine_client_init(w, c) ; #define comp_engine_client_get_trans_prop(w, c); #define comp_engine_client_show(w, c) ; #define comp_engine_client_hide(w, c) ; #define comp_engine_client_destroy(w, c) ; #define comp_engine_client_repair(w, c) ; #define comp_engine_client_configure(w, c) ; #define comp_engine_handle_events(w, c) ; #define comp_engine_destroy_root_buffer(w) ; #define comp_engine_render(w, r) ; #define comp_engine_get_argb32_visual(w) ; #endif void comp_engine_time(Wm *w); #endif matchbox-window-manager-1.2/matchbox-window-manager/src/dockbar_client.h0000664000211500234210000000237611307441355025401 0ustar bifh1bifhs/* * Matchbox Window Manager - A lightweight window manager not for the * desktop. * * Authored By Matthew Allum * * Copyright (c) 2002, 2004 OpenedHand Ltd - http://o-hand.com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #ifndef _DOCKBAR_CLIENT_H_ #define _DOCKBAR_CLIENT_H_ #include "structs.h" #include "base_client.h" #include "client_common.h" #include "toolbar_client.h" #include "wm.h" #include "misc.h" Client* dockbar_client_new (Wm *w, Window win); void dockbar_client_show(Client *c); void dockbar_client_hide(Client *c); void dockbar_client_configure(Client *c); void dockbar_client_get_coverage(Client *c, int *x, int *y, int *w, int *h); void dockbar_client_move_resize(Client *c); void dockbar_client_destroy(Client *c); #endif matchbox-window-manager-1.2/matchbox-window-manager/src/list.h0000664000211500234210000000255311307441355023406 0ustar bifh1bifhs/* * Matchbox Window Manager - A lightweight window manager not for the * desktop. * * Authored By Matthew Allum * * Copyright (c) 2002, 2004 OpenedHand Ltd - http://o-hand.com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #ifndef _MBLIST_H_ #define _MBLIST_H_ #include "structs.h" struct list_item { char* name; int id; void* data; struct list_item* next; }; #define list_enumerate(l,i) for((i)=(l);(i);(i)=(i)->next) #define list_get_tail(l) while ((l)->next != NULL) (l)=(l)->next; struct list_item* list_new(int id, char *name, void *data); void* list_add(struct list_item** head, char *name, int id, void *data); void* list_find_by_id(struct list_item* head, int needed_id); void* list_find_by_name(struct list_item* head, char *name); void list_remove(struct list_item** head, void *data); void list_destroy(struct list_item** head); #endif matchbox-window-manager-1.2/matchbox-window-manager/src/xml.c0000664000211500234210000002663611307441355023236 0ustar bifh1bifhs/* * Matchbox Window Manager - A lightweight window manager not for the * desktop. * * Authored By Matthew Allum * * Copyright (c) 2002, 2004 OpenedHand Ltd - http://o-hand.com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ /* * xml.c provides a very simple DOM for an xml file. * It can use expat or slightly limited ( no cdata, utf8 ) * internal parser. * * This isn't used by a standalone matchbox. */ #define _GNU_SOURCE #include "xml.h" #ifdef USE_EXPAT static void node_start_cb(void *data, const char *tag, const char **expat_attr); #else static void node_start_cb( XMLParser *parser, const char *tag, Params *attr); #endif #ifdef USE_EXPAT static void node_end_cb(void *data, const char *tag); #else static void node_end_cb( XMLParser *parser, const char *tag ); static char *parse(XMLParser *parser, char *doc); static void node_cdata_cb( XMLParser *parser, char *cdata); #endif static char* load_file(const char* filename); static void _params_free(Params *params); static Params *_params_clone(Params *params); static void _xml_parser_free(XMLNode *node); static Nlist *list_add_node(XMLNode *dest, XMLNode *new); #ifndef DEBUG static jmp_buf Jbuf; #endif Params* attr_to_params(const char **attr) { Params *p = NULL, *q = NULL; if (attr != NULL && attr[0] != NULL) { int i = 0; p = q = xml_params_new(); while(attr[i] && attr[i+1]) { q->key = strdup(attr[i]); q->value = strdup(attr[i+1]); if (attr[i+2]) { q->next = xml_params_new(); q = q->next; } i += 2; } return p; } else { return NULL; } } Nlist *list_add_node(XMLNode *dest, XMLNode *new) { Nlist *tmp; if (dest->kids == NULL) { dest->kids = (Nlist *)malloc(sizeof(Nlist)); tmp = dest->kids; } else { for(tmp = dest->kids; tmp->next != NULL; tmp = tmp->next); tmp->next = (Nlist *)malloc(sizeof(Nlist)); tmp = tmp->next; } tmp->next = NULL; tmp->data = new; return tmp; } XMLNode *xml_node_new(const char *name, Params *attr) { XMLNode *n = (XMLNode *)malloc(sizeof(XMLNode)); memset(n, 0, sizeof(XMLNode)); n->tag = strdup(name); n->attr = _params_clone(attr); return n; } #ifdef USE_EXPAT static void node_start_cb(void *data, const char *tag, const char **expat_attr) { XMLParser *parser = (XMLParser *)data; Params *attr = attr_to_params(expat_attr); #else static void node_start_cb( XMLParser *parser, const char *tag, Params *attr) { #endif if (parser->root_node == NULL) { parser->root_node = xml_node_new(tag, attr); parser->_current_node = parser->root_node; } else { Nlist *tmp; tmp = list_add_node(parser->_current_node, xml_node_new(tag, attr)); tmp->data->parent = parser->_current_node; parser->_current_node = tmp->data; } _params_free(attr); /* xml_node_new rather confusingly make a copy */ } #ifdef USE_EXPAT static void node_end_cb(void *data, const char *tag) { XMLParser *parser = (XMLParser *)data; #else static void node_end_cb( XMLParser *parser, const char *tag ) { #endif parser->_current_node = parser->_current_node->parent; } #ifndef USE_EXPAT static void node_cdata_cb( XMLParser *parser, char *cdata) { if (cdata == NULL) return; if (parser->_current_node->cdata == NULL) parser->_current_node->cdata = strdup(cdata); else { parser->_current_node->cdata = (char *)realloc(parser->_current_node->cdata, sizeof(char)*(strlen(parser->_current_node->cdata)) + sizeof(char)*(strlen(cdata)+1)); strcat(parser->_current_node->cdata, cdata); } } #endif #ifdef DEBUG void xml_dump(XMLNode *node, int depth) { Nlist *tmp; Params *p; char crap[] = "-------"; char more_crap[] = " "; printf("+%s %s\n", &crap[5-depth], node->tag); for(p = node->attr; p != NULL; p = p->next) { printf(" %s %s = %s\n", &more_crap[5-depth], p->key, p->value); } if (node->cdata) printf(" %s%s\n", &more_crap[5-depth], node->cdata); for(tmp = node->kids; tmp != NULL; tmp = tmp->next) { xml_dump(tmp->data, depth+2); } } #endif static Params * _params_clone(Params *params) { Params *params_clone = NULL, *params_cur = NULL;; if (params == NULL) return NULL; params_cur = params_clone = xml_params_new(); while(params != NULL) { if (params->key) params_cur->key = strdup(params->key); if (params->value) params_cur->value = strdup(params->value); if (params->next) { params_cur->next = xml_params_new(); params_cur = params_cur->next; } params = params->next; } return params_clone; } static void _params_free(Params *params) { Params *params_cpy = NULL; while(params != NULL) { params_cpy = params; params = params_cpy->next; if (params_cpy->key) free(params_cpy->key); if (params_cpy->value) free(params_cpy->value); free (params_cpy); } } static void _xml_parser_free(XMLNode *node) { Nlist *tmp, *old_tmp = NULL; _params_free(node->attr); if (node->cdata) free(node->cdata); if (node->tag) free(node->tag); tmp = node->kids; while (tmp != NULL) { old_tmp = tmp->next; _xml_parser_free(tmp->data); free(tmp); tmp = old_tmp; } free(node); } Params *xml_params_new(void) { Params *p = (Params *)malloc(sizeof(Params)); p->next = NULL; return p; } #ifndef USE_EXPAT #define CHECK_EOF(p) \ if ((*p) == '\0') { printf("end of file?\n"); return NULL; } #define SHD(c) ((*c) != '\0') static char *parse(XMLParser *parser, char *doc) { char *p = doc; /* Temporary data */ char *oe_data = NULL; char *e_data = NULL; char *ce_data = NULL; char *key_data = NULL; char *val_data = NULL; Params *attr_params = NULL, *start_params = NULL; int skip_spaces = 0, in_value = 0; int in_comment = 0, done = 0; do { if (*p == '<') { if (*(p+1) == '!') in_comment++; else if (*(p+1) == '?') while(SHD(p) && *p != '>') p++; else if (!in_comment) done = 1; } if (in_comment && *p == '-' && SHD(p+1) && *(p+1) == '-' && SHD(p+2) && *(p+2) == '>' ) { p += 3; in_comment--; } if (!done) p++; } while( SHD(p) && !done ); CHECK_EOF(p); *p = '\0'; oe_data = ++p; /* Pointer to open tag name */ while (SHD(p) && *p != '>') /* advance to end of first tag */ { if (isspace(*p) && !skip_spaces) /* possible attribute key */ { *p = '\0'; if (SHD(p+1) && !isspace(*(p+1)) && *(p+1) != '>' && *(p+1) != '/') { if (attr_params == NULL) { attr_params = xml_params_new(); start_params = attr_params; } else { attr_params->next = xml_params_new(); attr_params = attr_params->next; } key_data = p+1; //attr_params->key = p+1; } p++; } else if (*p == '=' && !in_value) /* beginning of attribute value */ { *p = '\0'; attr_params->key = strdup(key_data); p += 2; /* skipp first " */ val_data = p; //attr_params->value = p; skip_spaces = 1; /* ignore spaces in value */ in_value = 1; key_data = NULL; } else if (*p == '"') /* end of attribute value */ { *p = '\0'; attr_params->value = strdup(val_data); val_data = NULL; skip_spaces = 0; in_value=0; p++; } else { p++; } } *p = '\0'; /* end possible dangling value pointer */ /* fire all callback */ parser->start_element_cb(parser, oe_data, start_params); if (*(p-1) == '/') { /* catch */ *(p-1) = '\0'; parser->data_cb(parser, NULL); parser->end_element_cb(parser, oe_data); return p +1; /* TODO: catch possible segfualt */ } do { if (*p != '<') p++; /* TODO: fixme ... maybe */ e_data = p; /* grab cdata */ while (SHD(p) && *p != '<') p++; *p = '\0'; parser->data_cb(parser, e_data); /* ? */ if (*(p+1) == '!') { *p = '\0'; p++; while (!(SHD(p) && *p == '-' && SHD(p+1) && *(p+1) == '-' && SHD(p+2) && *(p+2) == '>')) p++; } else { //if (!*p) return NULL; /* catch possible segfualt */ if (*(p+1) == '/') /* close tag */ { //*p = '\0'; // parser->data_cb(parser, e_data); /* cdata callback */ p+=2; /* skip /> */ ce_data = p; while (SHD(p) && *p != '>') p++; *p = '\0'; parser->end_element_cb(parser, ce_data); return p+1; /* TODO catch possible segfualt */ } else { //*p = '\0'; // parser->data_cb(parser, e_data); *p = '<'; p = parse(parser, p); /* recurse into inner tags */ } } } while (SHD(p)); return p; } #endif static char* load_file(const char* filename) { struct stat st; FILE* fp; char* str; int len; if (stat(filename, &st)) return NULL; if (!(fp = fopen(filename, "rb"))) return NULL; str = (char *)malloc(sizeof(char)*(st.st_size + 1)); len = fread(str, 1, st.st_size, fp); if (len >= 0) str[len] = '\0'; fclose(fp); return str; } #ifndef DEBUG static void catch_sigsegv(int sig) { signal(SIGSEGV, SIG_DFL); longjmp(Jbuf, 1); } #endif XMLParser *xml_parser_new(void) { XMLParser *parser; parser = (XMLParser *)malloc(sizeof(XMLParser)); parser->start_element_cb = NULL; parser->end_element_cb = NULL; parser->data_cb = NULL; parser->root_node = NULL; parser->_current_node = NULL; return parser; } void xml_parser_free(XMLParser *parser, XMLNode *root) { if (root) _xml_parser_free(root); free(parser); } XMLNode* xml_parse_data_dom(XMLParser *parser, char *data) { #ifdef USE_EXPAT XML_Parser p = XML_ParserCreate(NULL); if (! p) { fprintf(stderr, "Matchbox: Couldn't allocate memory for XML parser\n"); exit(-1); } XML_SetElementHandler(p, node_start_cb, node_end_cb); /* XML_SetCharacterDataHandler(p, chars); */ XML_SetUserData(p, (void *)parser); if (! XML_Parse(p, data, strlen(data), 1)) { fprintf(stderr, "Matchbox: XML Parse error at line %d:\n%s\n", XML_GetCurrentLineNumber(p), XML_ErrorString(XML_GetErrorCode(p))); return NULL; } return parser->root_node; #else int success = 1; parser->start_element_cb = &node_start_cb; parser->end_element_cb = &node_end_cb; parser->data_cb = &node_cdata_cb; #ifndef DEBUG signal(SIGSEGV, catch_sigsegv); if (setjmp(Jbuf)) success = 0; #endif if (parse(parser, data) == NULL) success = 0; #ifndef DEBUG signal(SIGSEGV, NULL); #endif if (success) return parser->root_node; return NULL; #endif } XMLNode* xml_parse_file_dom(XMLParser *parser, char *filename) { XMLNode *root; char *data = load_file(filename); if (data != NULL) { if ((root = xml_parse_data_dom(parser, data)) != NULL) { free(data); return root; } } return NULL; } matchbox-window-manager-1.2/matchbox-window-manager/src/stack.h0000664000211500234210000000531011307441355023532 0ustar bifh1bifhs/* * Matchbox Window Manager - A lightweight window manager not for the * desktop. * * Authored By Matthew Allum * * Copyright (c) 2002, 2004 OpenedHand Ltd - http://o-hand.com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #ifndef _HAVE_STACK_H_ #define _HAVE_STACK_H_ #include "structs.h" #include "wm.h" #include "config.h" #define stack_enumerate(w,c) \ if ((w)->stack_bottom) \ for ((c)=(w)->stack_bottom; (c) != NULL; (c)=(c)->above) #define stack_enumerate_reverse(w,c) \ if ((w)->stack_top) \ for ((c)=(w)->stack_top; (c) != NULL; (c)=(c)->below) #define stack_enumerate_transients(w,c,t) \ if ((w)->stack_bottom) \ for ((c)=(w)->stack_bottom; (c) != NULL; (c)=(c)->above) \ if ((c)->trans == (t)) #define stack_move_top(c) \ stack_move_above_client((c), (c)->wm->stack_top) #define stack_add_bottom(c) \ stack_move_below_client((c), (c)->wm->stack_bottom) #define stack_empty(w) \ ((w)->stack_bottom == NULL) #define n_stack_items(w) \ (w)->stack_n_items void stack_add_above_client(Client *client, Client *client_below); void stack_append_top(Client *client); void stack_prepend_bottom(Client *client); void stack_remove(Client *client); void stack_move_transients_to_top(Wm *w, Client *client_trans_for, int flags); void stack_move_client_above_type(Client *client, int type_below); void stack_move_type_above_client(Wm *w, MBClientTypeEnum wanted_type, Client *client); void stack_move_above_client(Client *client, Client *client_below); Client* stack_get_above(Client* client_below, MBClientTypeEnum wanted_type); Client* stack_get_below(Client* client_above, MBClientTypeEnum wanted_type); Client* stack_cycle_forward(Wm *w, MBClientTypeEnum type_to_cycle); Client* stack_cycle_backward(Wm *w, MBClientTypeEnum type_to_cycle); Client* stack_get_highest(Wm *w, MBClientTypeEnum wanted_type); Client* stack_get_lowest(Wm *w, MBClientTypeEnum wanted_type); Window* stack_get_window_list(Wm *w); void stack_sync_to_display(Wm *w); void stack_dump(Wm *w); #endif matchbox-window-manager-1.2/matchbox-window-manager/src/dockbar_client.c0000664000211500234210000001343011307441355025365 0ustar bifh1bifhs/* * Matchbox Window Manager - A lightweight window manager not for the * desktop. * * Authored By Matthew Allum * * Copyright (c) 2002, 2004 OpenedHand Ltd - http://o-hand.com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ /* * a Dockbar is a *Panel*. */ #include "dockbar_client.h" static int dockbar_client_orientation_calc(Client *c); Client* dockbar_client_new(Wm *w, Window win) { Client *c = base_client_new(w, win); if (!c) return NULL; c->type = MBCLIENT_TYPE_PANEL; c->configure = &dockbar_client_configure; c->show = &dockbar_client_show; c->hide = &dockbar_client_hide; c->move_resize = &dockbar_client_move_resize; c->destroy = &dockbar_client_destroy; c->flags = dockbar_client_orientation_calc(c); c->frame = c->window; return c; } static int dockbar_client_orientation_calc(Client *c) { Wm *w = c->wm; dbg("%s() called, x:%i, y:%i, w:%i h:%i\n", __func__, c->x, c->y, c->width, c->height); /* - Can only have one titlebar panel * - if theme does not have title bar it wont get mapped. */ if (!w->have_titlebar_panel) /* && mbtheme_has_titlebar_panel(w->mbtheme)) */ { if (ewmh_state_check(c, c->wm->atoms[MB_WM_STATE_DOCK_TITLEBAR])) { w->have_titlebar_panel = c; /* Does the panel still want to be shown when we map the desktop ? */ if (ewmh_state_check(c, c->wm->atoms[MB_DOCK_TITLEBAR_SHOW_ON_DESKTOP])) return CLIENT_DOCK_TITLEBAR|CLIENT_DOCK_TITLEBAR_SHOW_ON_DESKTOP; return CLIENT_DOCK_TITLEBAR; } } if (c->width > c->height) /* Assume Horizonal north/south Dock */ { if (c->y < (w->dpy_height/2)) return CLIENT_DOCK_NORTH; else return CLIENT_DOCK_SOUTH; } else { if (c->x < (w->dpy_width/2)) return CLIENT_DOCK_WEST; else return CLIENT_DOCK_EAST; } } void dockbar_client_configure(Client *c) { Wm *w = c->wm; int n_offset = wm_get_offsets_size(c->wm, NORTH, c, False); int s_offset = wm_get_offsets_size(c->wm, SOUTH, c, False); int e_offset = wm_get_offsets_size(c->wm, EAST, c, True); int w_offset = wm_get_offsets_size(c->wm, WEST, c, True); /* XXX - we should check for overlapping and if this happens change em to normal clients. */ if (c->flags & CLIENT_DOCK_NORTH) { c->y = n_offset; c->x = w_offset; c->width = w->dpy_width - e_offset - w_offset; } else if (c->flags & CLIENT_DOCK_SOUTH) { c->y = w->dpy_height - s_offset - c->height; c->x = w_offset; c->width = w->dpy_width - e_offset - w_offset; } else if (c->flags & CLIENT_DOCK_WEST) { c->y = 0; c->x = w_offset; c->height = w->dpy_height; } else if (c->flags & CLIENT_DOCK_EAST) { c->y = 0; c->x = w->dpy_width - e_offset - c->width; c->height = w->dpy_height; } else if (c->flags & CLIENT_DOCK_TITLEBAR) { XRectangle rect; mbtheme_get_titlebar_panel_rect(w->mbtheme, &rect, NULL); c->x = rect.x + w_offset; c->y = rect.y + n_offset; c->width = rect.width; c->height = rect.height; } else { dbg("%s() : EEEK no dock type flag set !\n", __func__ ); } dbg("%s() sizing as %i %i %i %i", __func__, c->x, c->y, c->width, c->height); XSetWindowBorderWidth(w->dpy, c->window, 0); XSetWindowBorder(w->dpy, c->window, 0); } void dockbar_client_move_resize(Client *c) { Wm *w = c->wm; base_client_move_resize(c); dbg("%s() to %s x: %i , y: %i w: %i h: %i \n", __func__, c->name, c->x, c->y, c->width, c->height); XResizeWindow(w->dpy, c->window, c->width, c->height); XMoveWindow(w->dpy, c->window, c->x, c->y); } void dockbar_client_show(Client *c) /*TODO: show and hide share common static func*/ { Wm *w = c->wm; if (client_get_state(c) == NormalState) return; dbg("%s() called\n", __func__); XGrabServer(w->dpy); c->mapped = True; if (c->flags & CLIENT_DOCK_EAST || c->flags & CLIENT_DOCK_WEST) wm_update_layout(c->wm, c, - c->width); else if ( c->flags & CLIENT_DOCK_NORTH ) { wm_update_layout(c->wm, c, - c->height); } else if ( c->flags & CLIENT_DOCK_SOUTH ) wm_update_layout(c->wm, c, - c->height); client_set_state(c, NormalState); XMapWindow(w->dpy, c->window); stack_move_client_above_type(c, MBCLIENT_TYPE_APP|MBCLIENT_TYPE_DESKTOP); XUngrabServer(w->dpy); } void dockbar_client_hide(Client *c) { Wm *w = c->wm; if (client_get_state(c) == IconicState) return; XGrabServer(w->dpy); client_set_state(c, IconicState); c->mapped = False; /* Same reasoning as toolbar_destroy */ if (c->flags & CLIENT_DOCK_EAST || c->flags & CLIENT_DOCK_WEST) wm_update_layout(c->wm, c, c->width); else if (!(c->flags & CLIENT_DOCK_TITLEBAR)) wm_update_layout(c->wm, c, c->height); base_client_hide(c); XUngrabServer(w->dpy); } void dockbar_client_destroy(Client *c) { Wm *w = c->wm; if (c == w->have_titlebar_panel) w->have_titlebar_panel = NULL; c->mapped = False; if (c->flags & CLIENT_DOCK_EAST || c->flags & CLIENT_DOCK_WEST) wm_update_layout(c->wm, c, c->width ); else if (!(c->flags & CLIENT_DOCK_TITLEBAR)) wm_update_layout(c->wm, c, c->height); base_client_destroy(c); } matchbox-window-manager-1.2/matchbox-window-manager/src/composite-engine.c0000664000211500234210000011125011307441355025666 0ustar bifh1bifhs/* * Matchbox Window Manager - A lightweight window manager not for the * desktop. * * Authored By Matthew Allum * * Copyright (c) 2002, 2004 OpenedHand Ltd - http://o-hand.com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #include "composite-engine.h" #define DO_TIMINGS 0 /* enable this for lowlight timings */ #if DO_TIMINGS #include #include #endif #ifdef USE_COMPOSITE #include static void comp_engine_add_damage (Wm *w, XserverRegion damage); typedef struct _conv { int size; double *data; } conv; typedef struct StackItem { Client *client; struct StackItem *next; } StackItem; /* XXX Ideally get rid of these globals */ static conv *gussianMap; static StackItem *comp_stack; /* List for stack rendering of dialogs etc */ /* Shadow Generation */ static double gaussian (double r, double x, double y) { return ((1 / (sqrt (2 * M_PI * r))) * exp ((- (x * x + y * y)) / (2 * r * r))); } static conv * make_gaussian_map (double r) { conv *c; int size = ((int) ceil ((r * 3)) + 1) & ~1; int center = size / 2; int x, y; double t = 0.0; double g; c = malloc (sizeof (conv) + size * size * sizeof (double)); c->size = size; dbg("%s() map size is %i\n", __func__, size); c->data = (double *) (c + 1); for (y = 0; y < size; y++) for (x = 0; x < size; x++) { g = gaussian (r, (double) (x - center), (double) (y - center)); t += g; c->data[y * size + x] = g; } for (y = 0; y < size; y++) for (x = 0; x < size; x++) c->data[y*size + x] /= t; return c; } static unsigned char sum_gaussian (conv *map, double opacity, int x, int y, int width, int height) { int fx, fy; double *g_data; double *g_line = map->data; int g_size = map->size; int center = g_size / 2; int fx_start, fx_end; int fy_start, fy_end; double v; /* * Compute set of filter values which are "in range", * that's the set with: * 0 <= x + (fx-center) && x + (fx-center) < width && * 0 <= y + (fy-center) && y + (fy-center) < height * * 0 <= x + (fx - center) x + fx - center < width * center - x <= fx fx < width + center - x */ fx_start = center - x; if (fx_start < 0) fx_start = 0; fx_end = width + center - x; if (fx_end > g_size) fx_end = g_size; fy_start = center - y; if (fy_start < 0) fy_start = 0; fy_end = height + center - y; if (fy_end > g_size) fy_end = g_size; g_line = g_line + fy_start * g_size + fx_start; v = 0; for (fy = fy_start; fy < fy_end; fy++) { g_data = g_line; g_line += g_size; for (fx = fx_start; fx < fx_end; fx++) v += *g_data++; } if (v > 1) v = 1; return ((unsigned int) (v * opacity * 255.0)); } #define MAX_TILE_SZ 16 /* make sure size/2 < MAX_TILE_SZ */ #define WIDTH 320 #define HEIGHT 320 static void shadow_setup_part (Wm *w, XImage **ximage, Picture *pic, Pixmap *pxm, int width, int height) { *ximage = XCreateImage (w->dpy, DefaultVisual(w->dpy,DefaultScreen(w->dpy)), 8, ZPixmap, 0, 0, width, height, 8, width * sizeof (unsigned char)); (*ximage)->data = malloc (width * height * sizeof (unsigned char)); *pxm = XCreatePixmap (w->dpy, w->root, width, height, 8); *pic = XRenderCreatePicture (w->dpy, *pxm, XRenderFindStandardFormat (w->dpy, PictStandardA8), 0, 0); } static void shadow_finalise_part (Wm *w, XImage *ximage, Picture pic, Pixmap pxm, int width, int height) { GC gc = XCreateGC (w->dpy, pxm, 0, 0); XPutImage (w->dpy, pxm, gc, ximage, 0, 0, 0, 0, width, height); XDestroyImage (ximage); XFreeGC (w->dpy, gc); XFreePixmap (w->dpy, pxm); } static void shadow_setup (Wm *w) { XImage *ximage; Pixmap pxm; unsigned char *data; int size; int center; int x, y; unsigned char d; int pwidth, pheight; double opacity = SHADOW_OPACITY; if (w->config->shadow_style == SHADOW_STYLE_NONE) return; if (w->config->shadow_style == SHADOW_STYLE_SIMPLE) { w->config->shadow_padding_width = 0; w->config->shadow_padding_height = 0; return; } /* SHADOW_STYLE_GAUSSIAN */ gussianMap = make_gaussian_map (SHADOW_RADIUS); /* XXX must free */ w->config->shadow_padding_width = gussianMap->size; w->config->shadow_padding_height = gussianMap->size; size = gussianMap->size; center = size / 2; dbg("%s() gussian size is %i\n", __func__, size); /* Top & bottom */ pwidth = MAX_TILE_SZ; pheight = size/2; shadow_setup_part(w, &ximage, &w->shadow_n_pic, &pxm, pwidth, pheight); data = (unsigned char*)ximage->data; for (y = 0; y < pheight; y++) { d = sum_gaussian (gussianMap, opacity, center, y - center, WIDTH, HEIGHT); for (x = 0; x < pwidth; x++) data[y * pwidth + x] = d; } shadow_finalise_part (w, ximage, w->shadow_n_pic, pxm, pwidth, pheight); pwidth = MAX_TILE_SZ; pheight = MAX_TILE_SZ; shadow_setup_part(w, &ximage, &w->shadow_s_pic, &pxm, pwidth, pheight); data = (unsigned char*)ximage->data; for (y = 0; y < pheight; y++) { d = sum_gaussian (gussianMap, opacity, center, y - center, WIDTH, HEIGHT); for (x = 0; x < pwidth; x++) data[(pheight - y - 1) * pwidth + x] = d; } shadow_finalise_part (w, ximage, w->shadow_s_pic, pxm, pwidth, pheight); /* Sides */ pwidth = MAX_TILE_SZ; pheight = MAX_TILE_SZ; shadow_setup_part(w, &ximage, &w->shadow_w_pic, &pxm, pwidth, pheight); data = (unsigned char*)ximage->data; for (x = 0; x < pwidth; x++) { d = sum_gaussian (gussianMap, opacity, x - center, center, WIDTH, HEIGHT); for (y = 0; y < pheight; y++) data[y * pwidth + (pwidth - x - 1)] = d; } shadow_finalise_part (w, ximage, w->shadow_w_pic, pxm, pwidth, pheight); shadow_setup_part(w, &ximage, &w->shadow_e_pic, &pxm, pwidth, pheight); data = (unsigned char*)ximage->data; for (x = 0; x < pwidth; x++) { d = sum_gaussian (gussianMap, opacity, x - center, center, WIDTH, HEIGHT); for (y = 0; y < pheight; y++) data[y * pwidth + x] = d; } shadow_finalise_part (w, ximage, w->shadow_e_pic, pxm, pwidth, pheight); /* Corners */ pwidth = MAX_TILE_SZ; pheight = MAX_TILE_SZ; shadow_setup_part(w, &ximage, &w->shadow_nw_pic, &pxm, pwidth, pheight); data = (unsigned char*)ximage->data; for (x = 0; x < pwidth; x++) for (y = 0; y < pheight; y++) { d = sum_gaussian (gussianMap, opacity, x - center, y - center, WIDTH, HEIGHT); data[y * pwidth + x] = d; } shadow_finalise_part (w, ximage, w->shadow_nw_pic, pxm, pwidth, pheight); shadow_setup_part(w, &ximage, &w->shadow_sw_pic, &pxm, pwidth, pheight); data = (unsigned char*)ximage->data; for (x = 0; x < pwidth; x++) for (y = 0; y < pheight; y++) { d = sum_gaussian (gussianMap, opacity, x - center, y - center, WIDTH, HEIGHT); data[(pheight - y - 1) * pwidth + x] = d; } shadow_finalise_part (w, ximage, w->shadow_sw_pic, pxm, pwidth, pheight); shadow_setup_part(w, &ximage, &w->shadow_se_pic, &pxm, pwidth, pheight); data = (unsigned char*)ximage->data; for (x = 0; x < pwidth; x++) for (y = 0; y < pheight; y++) { d = sum_gaussian (gussianMap, opacity, x - center, y - center, WIDTH, HEIGHT); data[(pheight - y - 1) * pwidth + (pwidth - x -1)] = d; } shadow_finalise_part (w, ximage, w->shadow_se_pic, pxm, pwidth, pheight); shadow_setup_part(w, &ximage, &w->shadow_ne_pic, &pxm, pwidth, pheight); data = (unsigned char*)ximage->data; for (x = 0; x < pwidth; x++) for (y = 0; y < pheight; y++) { d = sum_gaussian (gussianMap, opacity, x - center, y - center, WIDTH, HEIGHT); data[y * pwidth + (pwidth - x -1)] = d; } shadow_finalise_part (w, ximage, w->shadow_ne_pic, pxm, pwidth, pheight); /* Finally center */ pwidth = MAX_TILE_SZ; pheight = MAX_TILE_SZ; shadow_setup_part(w, &ximage, &w->shadow_pic, &pxm, pwidth, pheight); data = (unsigned char*)ximage->data; d = sum_gaussian (gussianMap, opacity, center, center, WIDTH, HEIGHT); for (x = 0; x < pwidth; x++) for (y = 0; y < pheight; y++) data[y * pwidth + x] = d; shadow_finalise_part (w, ximage, w->shadow_pic, pxm, pwidth, pheight); } static Picture shadow_gaussian_make_picture (Wm *w, int width, int height) { Picture pic; Pixmap pxm; int pwidth, pheight, x, y, dw, dh; pxm = XCreatePixmap (w->dpy, w->root, width, height, 8); pic = XRenderCreatePicture (w->dpy, pxm, XRenderFindStandardFormat (w->dpy, PictStandardA8), 0,0); pwidth = MAX_TILE_SZ; pheight = MAX_TILE_SZ; for (x=0; x < width; x += pwidth) for (y=0; y < height; y += pheight) { if ( (y + pheight) > height ) dh = pheight - ((y + pheight)-height); else dh = pheight; if ( (x + pwidth) > width ) dw = pwidth - ((x + pwidth)-width); else dw = pwidth; XRenderComposite (w->dpy, PictOpSrc, w->shadow_pic, None, pic, 0, 0, 0, 0, x, y, dw, dh); } /* Top & bottom */ if ( width > (MAX_TILE_SZ*2) ) { pwidth = MAX_TILE_SZ; pheight = MAX_TILE_SZ; for (x=0; x < width; x += pwidth ) { if ( (x + pwidth) > width ) dw = pwidth - ((x + pwidth)-width); else dw = pwidth; XRenderComposite (w->dpy, PictOpSrc, w->shadow_n_pic, None, pic, 0, 0, 0, 0, x, 0, dw, pheight); XRenderComposite (w->dpy, PictOpSrc, w->shadow_s_pic, None, pic, 0, 0, 0, 0, x, height - pheight, dw, pheight); } } /* Sides */ if ( height > (MAX_TILE_SZ*2) ) { pwidth = MAX_TILE_SZ; pheight = MAX_TILE_SZ; for (y=0; y < height; y += pheight) { if ( (y + pheight) > height ) dh = pheight - ((y + pheight)-height); else dh = pheight; XRenderComposite (w->dpy, PictOpSrc /* PictOpIn */, w->shadow_e_pic, None, pic, 0, 0, 0, 0, 0, y, pwidth, dh); XRenderComposite (w->dpy, PictOpSrc /* PictOpIn */, w->shadow_w_pic, None, pic, 0, 0, 0, 0, width - pwidth, y, pwidth, dh); } } /* Corners */ pwidth = MAX_TILE_SZ; pheight = MAX_TILE_SZ; XRenderComposite (w->dpy, PictOpSrc, w->shadow_nw_pic, None, pic, 0, 0, 0, 0, 0, 0, pwidth, pheight); XRenderComposite (w->dpy, PictOpSrc, w->shadow_ne_pic, None, pic, 0, 0, 0, 0, width - pwidth, 0, pwidth, pheight); XRenderComposite (w->dpy, PictOpSrc, w->shadow_sw_pic, None, pic, 0, 0, 0, 0, 0, height - pheight, pwidth, pheight); XRenderComposite (w->dpy, PictOpSrc, w->shadow_se_pic, None, pic, 0, 0, 0, 0, width - pwidth, height - pheight, pwidth, pheight); XFreePixmap (w->dpy, pxm); return pic; } static XserverRegion client_win_extents (Wm *w, Client *client) { int x, y, width, height; XRectangle r; /* XXX make coverage much fast as its now getting called all the time */ client->get_coverage(client, &x, &y, &width, &height); r.x = x; r.y = y; r.width = width; r.height = height; if (w->config->shadow_style) { if (client->type == MBCLIENT_TYPE_DIALOG || client->type == MBCLIENT_TYPE_TASK_MENU || client->type == MBCLIENT_TYPE_OVERRIDE) { if (w->config->shadow_style == SHADOW_STYLE_SIMPLE) { r.width += w->config->shadow_dx; r.height += w->config->shadow_dy; } else { r.x += w->config->shadow_dx; r.y += w->config->shadow_dy; r.width += w->config->shadow_padding_width; r.height += w->config->shadow_padding_height; } } } dbg("comp %s() +%i+%i , %ix%i\n", __func__, x, y, width, height); return XFixesCreateRegion (w->dpy, &r, 1); } static XserverRegion client_border_size (Wm *w, Client *c, int x, int y) { XserverRegion border; border = XFixesCreateRegionFromWindow (w->dpy, c->frame, WindowRegionBounding ); /* translate this */ XFixesTranslateRegion (w->dpy, border, x, y); return border; } static Visual* comp_engine_get_argb32_visual(Wm *w) { XVisualInfo *xvi; XVisualInfo template; int nvi; int i; XRenderPictFormat *format; Visual *visual = NULL; template.screen = w->screen; template.depth = 32; template.class = TrueColor; if ((xvi = XGetVisualInfo (w->dpy, VisualScreenMask | VisualDepthMask | VisualClassMask, &template, &nvi)) == NULL) return NULL; for (i = 0; i < nvi; i++) { format = XRenderFindVisualFormat (w->dpy, xvi[i].visual); if (format->type == PictTypeDirect && format->direct.alphaMask) { visual = xvi[i].visual; break; } } XFree (xvi); return visual; } void comp_engine_set_defualts(Wm *w) { w->config->shadow_style = SHADOW_STYLE_GAUSSIAN; w->config->shadow_color[0] = 0; w->config->shadow_color[1] = 0; w->config->shadow_color[2] = 0; w->config->shadow_color[3] = 0xff; w->config->shadow_dx = SHADOW_OFFSET_X; w->config->shadow_dy = SHADOW_OFFSET_Y; /* Not really used yet */ w->config->shadow_padding_width = 0; w->config->shadow_padding_height = 0; } void comp_engine_theme_init(Wm *w) { Pixmap transPixmap, blackPixmap, lowlightPixmap, redPixmap; XRenderPictureAttributes pa; XRenderColor c; int i; Picture pics_to_free[] = { w->trans_picture, w->black_picture, w->lowlight_picture, w->shadow_n_pic, w->shadow_e_pic, w->shadow_s_pic, w->shadow_w_pic, w->shadow_ne_pic, w->shadow_nw_pic, w->shadow_se_pic, w->shadow_sw_pic, w->shadow_pic }; if (!w->have_comp_engine) return; for (i=0; i < (sizeof(pics_to_free)/sizeof(Picture)); i++) if (pics_to_free[i] != None) XRenderFreePicture (w->dpy, pics_to_free[i]); if (w->config->shadow_style == SHADOW_STYLE_NONE) return; if (w->config->shadow_style == SHADOW_STYLE_GAUSSIAN) shadow_setup (w); pa.subwindow_mode = IncludeInferiors; pa.repeat = True; transPixmap = XCreatePixmap (w->dpy, w->root, 1, 1, 8); w->trans_picture = XRenderCreatePicture (w->dpy, transPixmap, XRenderFindStandardFormat (w->dpy, PictStandardA8), CPRepeat, &pa); c.red = c.green = c.blue = 0; c.alpha = 0xb0b0; XRenderFillRectangle (w->dpy, PictOpSrc, w->trans_picture, &c, 0, 0, 1, 1); /* black pixmap used for shadows */ blackPixmap = XCreatePixmap (w->dpy, w->root, 1, 1, 32); w->black_picture = XRenderCreatePicture (w->dpy, blackPixmap, XRenderFindStandardFormat (w->dpy, PictStandardARGB32), CPRepeat, &pa); c.red = w->config->shadow_color[0] << 8; c.green = w->config->shadow_color[1] << 8; c.blue = w->config->shadow_color[2] << 8; if (w->config->shadow_style == SHADOW_STYLE_GAUSSIAN) c.alpha = 0xffff; else c.alpha = w->config->shadow_color[3] << 8; dbg("%s() shadow alpha is %i\n", __func__, c.alpha); XRenderFillRectangle (w->dpy, PictOpSrc, w->black_picture, &c, 0, 0, 1, 1); #if DEBUG /* for visual composite debugging */ redPixmap = XCreatePixmap (w->dpy, w->root, 1, 1, 32); w->red_picture = XRenderCreatePicture (w->dpy, redPixmap, XRenderFindStandardFormat (w->dpy, PictStandardARGB32), CPRepeat, &pa); c.red = 0xffff; c.green = 0; c.blue = 0; c.alpha = 0xffff; XRenderFillRectangle (w->dpy, PictOpSrc, w->red_picture, &c, 0, 0, 1, 1); #endif /* Used for lowlights */ lowlightPixmap = XCreatePixmap (w->dpy, w->root, 1, 1, 32); w->lowlight_picture = XRenderCreatePicture (w->dpy, lowlightPixmap, XRenderFindStandardFormat (w->dpy, PictStandardARGB32), CPRepeat, &pa); if (w->config->dialog_shade) { c.red = w->config->lowlight_params[0] << 8; c.green = w->config->lowlight_params[1] << 8; c.blue = w->config->lowlight_params[2] << 8; c.alpha = w->config->lowlight_params[3] << 8; } else { c.red = 0; c.green = 0; c.blue = 0; c.alpha = 0x8d8d; } XRenderFillRectangle (w->dpy, PictOpSrc, w->lowlight_picture, &c, 0, 0, 1, 1); } /* Shuts the compositing down */ void comp_engine_deinit(Wm *w) { Client *c = NULL; if (!w->have_comp_engine) { w->comp_engine_disabled = True; return; } if (w->comp_engine_disabled) return; /* * really shut down the composite engine. * */ XCompositeUnredirectSubwindows (w->dpy, w->root, CompositeRedirectManual); if (w->root_picture) XRenderFreePicture (w->dpy, w->root_picture); if (w->root_buffer) XRenderFreePicture (w->dpy, w->root_buffer); w->root_buffer = None; w->root_picture = None; if (w->all_damage) XDamageDestroy (w->dpy, w->all_damage); /* Free up any client composite resources */ stack_enumerate(w, c) comp_engine_client_destroy(w, c); /* XXX should free up any client picture data ? */ w->comp_engine_disabled = True; w->have_comp_engine = False; /* bad ? */ } void comp_engine_reinit(Wm *w) { Client *c = NULL; w->comp_engine_disabled = False; comp_engine_init (w); XSync(w->dpy, False); if (!stack_empty(w)) { stack_enumerate(w, c) { dbg("%s() calling init for '%s'\n", __func__, c->name); comp_engine_client_init(w, c); comp_engine_client_show(w, c); } comp_engine_render(w, None); } } Bool comp_engine_init (Wm *w) { int event_base, error_base; int damage_error; int xfixes_event, xfixes_error; int render_event, render_error; XRenderPictureAttributes pa; Pixmap tmp_pxm; dbg("%s() called\n", __func__); if (w->comp_engine_disabled) return False; if (w->have_comp_engine) return False; /* already running */ w->comp_engine_disabled = True; if (!XRenderQueryExtension (w->dpy, &render_event, &render_error)) { fprintf (stderr, "matchbox: No render extension\n"); w->have_comp_engine = False; return False; } if (!XCompositeQueryExtension (w->dpy, &event_base, &error_base)) { fprintf (stderr, "matchbox: No composite extension\n"); w->have_comp_engine = False; return False; } if (!XDamageQueryExtension (w->dpy, &w->damage_event, &damage_error)) { fprintf (stderr, "matchbox: No damage extension\n"); w->have_comp_engine = False; return False; } if (!XFixesQueryExtension (w->dpy, &xfixes_event, &xfixes_error)) { fprintf (stderr, "matchbox: No XFixes extension\n"); w->have_comp_engine = False; return False; } w->have_comp_engine = True; w->comp_engine_disabled = False; comp_stack = NULL; /* Make the shadow tiles */ pa.subwindow_mode = IncludeInferiors; w->root_picture = XRenderCreatePicture (w->dpy, w->root, XRenderFindVisualFormat (w->dpy, DefaultVisual (w->dpy, w->screen)), CPSubwindowMode, &pa); w->all_damage = None; XCompositeRedirectSubwindows (w->dpy, w->root, CompositeRedirectManual); dbg("%s() success \n", __func__); /* Setup an mbpixbuf reference for 32bit argb rendering */ w->argb_pb = mb_pixbuf_new_extended(w->dpy, w->screen, comp_engine_get_argb32_visual(w), 32); /* A little hack to get the GC right */ tmp_pxm = XCreatePixmap(w->dpy, w->root, 16, 16, 32); w->argb_pb->gc = XCreateGC(w->dpy, tmp_pxm, 0, NULL); XFreePixmap(w->dpy, tmp_pxm); return True; } void comp_engine_client_init(Wm *w, Client *client) { XRenderPictFormat *format; if (!w->have_comp_engine) return; client->damaged = 0; client->damage = None; client->picture = None; client->shadow = None; client->borderSize = None; client->extents = None; client->transparency = -1; client->is_argb32 = False; /* Check visual */ format = XRenderFindVisualFormat (w->dpy, client->visual); if (format && format->type == PictTypeDirect && format->direct.alphaMask) { dbg("%s() client is ARGB32\n", __func__); client->is_argb32 = True; } comp_engine_client_get_trans_prop(w, client); } int comp_engine_client_get_trans_prop(Wm *w, Client *client) { Atom actual; int format; unsigned long n, left; char *data; XGetWindowProperty(w->dpy, client->window, w->atoms[CM_TRANSLUCENCY], 0L, 1L, False, XA_INTEGER, &actual, &format, &n, &left, (unsigned char **) &data); if (data != None) { client->transparency = (int) *data; XFree( (void *) data); return client->transparency; } return -1; } void comp_engine_client_show(Wm *w, Client *client) { XserverRegion region; XRenderPictureAttributes pa; if (!w->have_comp_engine) return; dbg("%s() called\n", __func__); /* * Destroying / Recreating the client pictures should hopefully save * some memory in the server. */ if (client->picture == None) { pa.subwindow_mode = IncludeInferiors; client->picture = XRenderCreatePicture (w->dpy, client->frame, XRenderFindVisualFormat (w->dpy, client->visual), CPSubwindowMode, &pa); } if (client->damage != None) XDamageDestroy (w->dpy, client->damage); client->damage = XDamageCreate (w->dpy, client->frame, XDamageReportNonEmpty); region = client_win_extents (w, client); comp_engine_add_damage (w, region); } void comp_engine_client_hide(Wm *w, Client *client) { Client *t = NULL; if (!w->have_comp_engine) return; dbg("%s() called\n", __func__); if (client->flags & CLIENT_IS_MODAL_FLAG && ((t = wm_get_visible_main_client(w)) != NULL)) { /* We need to make sure the any lowlighting on a 'parent' * modal for app gets cleared. This is kind of a sledgehammer * approach to it, but more suttle attempts oddly fail at times. * * FIXME: keep an eye on this for future revisions of composite * - there may be a better way. */ comp_engine_client_repair (w, t); comp_engine_add_damage (w, t->extents); } if (client->damage != None) { XDamageDestroy (w->dpy, client->damage); client->damage = None; } if (client->extents != None) { comp_engine_add_damage (w, client->extents); client->extents = None; } if (client->picture) { XRenderFreePicture (w->dpy, client->picture); client->picture = None; } } void comp_engine_client_destroy(Wm *w, Client *client) { if (!w->have_comp_engine) return; dbg("%s() called\n", __func__); comp_engine_client_hide(w, client); if (client->picture) XRenderFreePicture (w->dpy, client->picture); if (client->border_clip != None) XFixesDestroyRegion (w->dpy, client->border_clip); } static void comp_engine_add_damage (Wm *w, XserverRegion damage) { if (!w->have_comp_engine) return; dbg("%s() called\n", __func__); if (w->all_damage) { XFixesUnionRegion (w->dpy, w->all_damage, w->all_damage, damage); XFixesDestroyRegion (w->dpy, damage); } else w->all_damage = damage; } void comp_engine_client_repair (Wm *w, Client *client) { XserverRegion parts; int x, y, width, height; if (!w->have_comp_engine) return; dbg("%s() called for client '%s'\n", __func__, client->name); parts = XFixesCreateRegion (w->dpy, 0, 0); /* translate region */ dbg("%s() client damage is %li\n", __func__, client->damage); XDamageSubtract (w->dpy, client->damage, None, parts); client->get_coverage(client, &x, &y, &width, &height); XFixesTranslateRegion (w->dpy, parts, x, y); comp_engine_add_damage (w, parts); } void comp_engine_client_configure(Wm *w, Client *client) { XserverRegion damage = None; XserverRegion extents = client_win_extents(w, client); if (client->picture != None) { XRenderFreePicture (w->dpy, client->picture); client->picture = None; } damage = XFixesCreateRegion (w->dpy, 0, 0); if (client->extents != None) XFixesCopyRegion (w->dpy, damage, client->extents); XFixesUnionRegion (w->dpy, damage, damage, extents); XFixesDestroyRegion (w->dpy, extents); comp_engine_add_damage (w, damage); } void comp_engine_handle_events(Wm *w, XEvent *ev) { if (!w->have_comp_engine) return; if (ev->type == w->damage_event + XDamageNotify) { XDamageNotifyEvent *de; Client *c; dbg("%s() called have damage event \n", __func__); de = (XDamageNotifyEvent *)ev; c = wm_find_client(w, de->drawable, FRAME); if (c) comp_engine_client_repair(w, c); else { dbg("%s() failed to find damaged window \n", __func__); } } } static void _render_a_client(Wm *w, Client *client, XserverRegion region, int lowlight_type) /* 0 - none, 1 app, 2 full */ { int x,y,width,height; XserverRegion winborder; if (client->picture == None) { dbg("%s() no pixture for %s\n", __func__, client->name); return; } if (client->extents) XFixesDestroyRegion (w->dpy, client->extents); client->extents = client_win_extents (w, client); client->get_coverage(client, &x, &y, &width, &height); winborder = client_border_size (w, client, x, y); /* Transparency only done for dialogs and overides */ if ( (client->transparency == -1 || client->type == MBCLIENT_TYPE_APP || client->type == MBCLIENT_TYPE_DESKTOP || client->type == MBCLIENT_TYPE_TOOLBAR || client->type == MBCLIENT_TYPE_PANEL) && !client->is_argb32) { XFixesSetPictureClipRegion (w->dpy, w->root_buffer, 0, 0, region); XFixesSubtractRegion (w->dpy, region, region, winborder); XRenderComposite (w->dpy, PictOpSrc, client->picture, None, w->root_buffer, 0, 0, 0, 0, x, y, width, height); } /* Render lowlight dialog modal for app */ if (lowlight_type == 1 && (client->type & (MBCLIENT_TYPE_APP|MBCLIENT_TYPE_DESKTOP))) { int title_offset = 0; dbg("%s() rendering lowlight\n", __func__); if (client->type == MBCLIENT_TYPE_APP) title_offset = main_client_title_height(client); XRenderComposite (w->dpy, PictOpOver, w->lowlight_picture, None, w->root_buffer, 0, 0, 0, 0, x, y + title_offset, width, height - title_offset); } /* Render lowlight dialog modal for root - e.g lowlight everything */ if (lowlight_type == 2 && client->win_modal_blocker == None) XRenderComposite (w->dpy, PictOpOver, w->lowlight_picture, None, w->root_buffer, 0, 0, 0, 0, x, y, width, height); if (client->border_clip != None) { XFixesDestroyRegion (w->dpy, client->border_clip); client->border_clip = None; } client->border_clip = XFixesCreateRegion (w->dpy, 0, 0); XFixesCopyRegion (w->dpy, client->border_clip, region); XFixesDestroyRegion (w->dpy, winborder); /* XXX the leak plugged ? */ } void comp_engine_destroy_root_buffer(Wm *w) { if (w->root_buffer) { XRenderFreePicture (w->dpy, w->root_buffer); w->root_buffer = None; } } void comp_engine_render(Wm *w, XserverRegion region) { Client *client_top_app = NULL, *t = NULL; int x,y,width,height; int lowlight = 0; if (!w->have_comp_engine || stack_empty(w)) return; dbg("%s() called\n", __func__); if (!region) { XRectangle r; r.x = 0; r.y = 0; r.width = w->dpy_width; r.height = w->dpy_height; region = XFixesCreateRegion (w->dpy, &r, 1); } client_top_app = wm_get_visible_main_client(w); if (!w->root_buffer) { Pixmap rootPixmap = XCreatePixmap (w->dpy, w->root, w->dpy_width, w->dpy_height, DefaultDepth (w->dpy, w->screen)); w->root_buffer = XRenderCreatePicture (w->dpy, rootPixmap, XRenderFindVisualFormat (w->dpy, DefaultVisual (w->dpy, w->screen)), 0, 0); XRenderComposite (w->dpy, PictOpSrc, w->black_picture, None, w->root_buffer, 0, 0, 0, 0, 0, 0, w->dpy_width, w->dpy_height); XFreePixmap (w->dpy, rootPixmap); } XFixesSetPictureClipRegion (w->dpy, w->root_picture, 0, 0, region); XFixesSetPictureClipRegion (w->dpy, w->root_buffer, 0, 0, region); #if DEBUG if (w->flags & DEBUG_COMPOSITE_VISIBLE_FLAG) { XRenderComposite (w->dpy, PictOpSrc, w->red_picture, None, w->root_picture, 0, 0, 0, 0, 0, 0, w->dpy_width, w->dpy_height); XSync(w->dpy, False); /* return; */ } #endif /* Check initially to see what kind of lowlight todo ( if any ) */ stack_enumerate_reverse(w, t) { if (t->type == MBCLIENT_TYPE_DIALOG && t->flags & CLIENT_IS_MODAL_FLAG) { lowlight = ((t->win_modal_blocker) ? 2 : 1); } if (t == client_top_app) break; } /* Render top -> bottom */ stack_enumerate_reverse(w, t) { dbg("%s() rendering %s\n", __func__, t->name); _render_a_client(w, t, region, lowlight); if (t == client_top_app) break; } if (client_top_app == NULL) { /* Render block of boring black in case of no top app or desktop */ XFixesSetPictureClipRegion (w->dpy, w->root_buffer, 0, 0, region); XRenderComposite (w->dpy, PictOpSrc, w->black_picture, None, w->root_buffer, 0, 0, 0, 0, 0, 0, w->dpy_width, w->dpy_height); XFixesSetPictureClipRegion (w->dpy, w->root_buffer, 0, 0, None); client_top_app = w->stack_bottom; } XFixesSetPictureClipRegion (w->dpy, w->root_buffer, 0, 0, None); /* Now render shadows but bottom -> top this time */ for ((t)=client_top_app; (t) != NULL; (t)=(t)->above) { dbg("%s() rendering shadow for %s\n", __func__, t->name); if ((t->type == MBCLIENT_TYPE_DIALOG && t->mapped) || t->type == MBCLIENT_TYPE_TASK_MENU || t->type == MBCLIENT_TYPE_OVERRIDE) { dbg("%s() rendering shadow for %s\n", __func__, t->name); if (!t->picture) { dbg("%s() no pixture for %s\n", __func__, t->name); continue; } if (w->config->shadow_style) { Picture shadow_pic; t->get_coverage(t, &x, &y, &width, &height); if (w->config->shadow_style == SHADOW_STYLE_SIMPLE) { XserverRegion shadow_region; /* Grab 'shape' region of window */ shadow_region = client_border_size (w, t, x, y); /* Offset it. */ XFixesTranslateRegion (w->dpy, shadow_region, w->config->shadow_dx, w->config->shadow_dy); /* Intersect it, so only border remains */ XFixesIntersectRegion (w->dpy, shadow_region, t->border_clip, shadow_region ); XFixesSetPictureClipRegion (w->dpy, w->root_buffer, 0, 0, shadow_region); /* now paint them */ if (t->is_argb32 ) { XRenderComposite (w->dpy, PictOpOver, w->black_picture, t->picture, w->root_buffer, 0, 0, 0, 0, x + w->config->shadow_dx, y + w->config->shadow_dy, width + w->config->shadow_padding_width, height + w->config->shadow_padding_height); } else { XRenderComposite (w->dpy, PictOpOver, w->black_picture, None, w->root_buffer, 0, 0, 0, 0, x + w->config->shadow_dx, y + w->config->shadow_dy, width + w->config->shadow_padding_width, height + w->config->shadow_padding_height); } /* Paint any transparent window contents */ if (t->transparency != -1 || t->is_argb32 ) { XFixesDestroyRegion (w->dpy, shadow_region); shadow_region = client_border_size (w, t, x, y); XFixesIntersectRegion (w->dpy, shadow_region, t->border_clip, shadow_region ); XFixesSetPictureClipRegion (w->dpy, w->root_buffer, 0, 0, shadow_region); if (t->is_argb32) XRenderComposite (w->dpy, PictOpOver, t->picture, None, w->root_buffer, 0, 0, 0, 0, x, y, width, height); else XRenderComposite (w->dpy, PictOpOver, t->picture, w->trans_picture, w->root_buffer, 0, 0, 0, 0, x, y, width, height); } XFixesDestroyRegion (w->dpy, shadow_region); } else /* GAUSSIAN */ { XFixesSetPictureClipRegion (w->dpy, w->root_buffer, 0, 0, t->border_clip); if (t->transparency != -1 || t->is_argb32 ) { /* No shadows currently for transparent windows */ XRenderComposite (w->dpy, PictOpOver, t->picture, w->trans_picture, w->root_buffer, 0, 0, 0, 0, x, y, width, height); } else { /* Combine pregenerated shadow tiles */ shadow_pic = shadow_gaussian_make_picture (w, width + w->config->shadow_padding_width, height + w->config->shadow_padding_height); XRenderComposite (w->dpy, PictOpOver, w->black_picture, shadow_pic, w->root_buffer, 0, 0, 0, 0, x + w->config->shadow_dx, y + w->config->shadow_dy, width + w->config->shadow_padding_width, height + w->config->shadow_padding_height); XRenderFreePicture (w->dpy, shadow_pic); } } } } } XFixesSetPictureClipRegion (w->dpy, w->root_buffer, 0, 0, None); XRenderComposite (w->dpy, PictOpSrc, w->root_buffer, None, w->root_picture, 0, 0, 0, 0, 0, 0, w->dpy_width, w->dpy_height); XSync(w->dpy, False); } #endif void comp_engine_time(Wm *w) { #ifdef STANDALONE /* No timings for standalone */ return; #endif /* STANDALONE */ #if DO_TIMINGS struct timeval tv_start, tv_end; struct timezone tz; long diff; #ifdef USE_COMPOSITE XSync(w->dpy, False); gettimeofday(&tv_start, &tz); XFixesSetPictureClipRegion (w->dpy, w->root_buffer, 0, 0, None); XFixesSetPictureClipRegion (w->dpy, w->root_picture, 0, 0, None); XRenderComposite (w->dpy, PictOpOver, w->lowlight_picture, None, w->root_buffer, 0, 0, 0, 0, 0, 0, w->dpy_width, w->dpy_height); XRenderComposite (w->dpy, PictOpSrc, w->root_buffer, None, w->root_picture, 0, 0, 0, 0, 0, 0, w->dpy_width, w->dpy_height); XSync(w->dpy, False); gettimeofday(&tv_end, &tz); diff = ((tv_end.tv_sec * 1000000) + tv_end.tv_usec) - ((tv_start.tv_sec * 1000000) + tv_start.tv_usec); fprintf(stderr, "COMPOSITE LOWLIGHT TIMING: %li us\n", diff); sleep(1); comp_engine_render(w, None); #else #ifndef STANDALONE MBPixbufImage *img; int x, y; Pixmap pxm_tmp; Window win; XSetWindowAttributes attr; attr.override_redirect = True; attr.event_mask = ChildMask|ButtonPressMask|ExposureMask; XSync(w->dpy, False); gettimeofday(&tv_start, &tz); win = XCreateWindow(w->dpy, w->root, 0, 0, w->dpy_width, w->dpy_height, 0, CopyFromParent, CopyFromParent, CopyFromParent, CWOverrideRedirect|CWEventMask, &attr); pxm_tmp = XCreatePixmap(w->dpy, win, w->dpy_width, w->dpy_height , w->pb->depth); img = mb_pixbuf_img_new_from_x_drawable(w->pb, w->root, None, 0, 0, w->dpy_width, w->dpy_height, True); if (!img) { fprintf(stderr, "%s(): failed to grab root image\n", __func__); return; } for (x = 0; x < w->dpy_width; x++) for (y = 0; y < w->dpy_height; y++) mb_pixbuf_img_plot_pixel_with_alpha(w->pb, img, x, y, w->config->lowlight_params[0], w->config->lowlight_params[1], w->config->lowlight_params[2], w->config->lowlight_params[3] ); mb_pixbuf_img_render_to_drawable(w->pb, img, pxm_tmp, 0, 0); XSetWindowBackgroundPixmap(w->dpy, win, pxm_tmp); XClearWindow(w->dpy, win); XMapRaised(w->dpy, win); XSync(w->dpy, False); gettimeofday(&tv_end, &tz); diff = ((tv_end.tv_sec * 1000000) + tv_end.tv_usec) - ((tv_start.tv_sec * 1000000) + tv_start.tv_usec); fprintf(stderr, "XIMAGE LOWLIGHT TIMING: %li us\n", diff); mb_pixbuf_img_free(w->pb, img); XFreePixmap(w->dpy, pxm_tmp); XSync(w->dpy, False); sleep(1); XDestroyWindow(w->dpy, win); #endif /* STANDALONE */ #endif /* USE_COMPOSITE */ #else fprintf(stderr, "matchbox-window-manager: timing functionality disabled\n"); #endif /* DO TIMINGS */ } matchbox-window-manager-1.2/matchbox-window-manager/src/keys.c0000664000211500234210000003300211307441355023372 0ustar bifh1bifhs/* * Matchbox Window Manager - A lightweight window manager not for the * desktop. * * Authored By Matthew Allum * * Copyright (c) 2002, 2004 OpenedHand Ltd - http://o-hand.com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #include "structs.h" #include "keys.h" #ifndef NO_KBD static Bool keys_keysym_needs_shift(Wm *w, KeySym keysym) { int col; /* XXX double check this is correct / easiest way */ int keycode; KeySym k; int min_kc, max_kc; XDisplayKeycodes(w->dpy, &min_kc, &max_kc); for (keycode = min_kc; keycode <= max_kc; keycode++) { for (col = 0; (k = XKeycodeToKeysym (w->dpy, keycode, col)) != NoSymbol; col++) if (k == keysym && col == 1) { return True; } } return False; } static KeySym keys_keysym_get_shifted (Wm *w, KeySym keysym) { int min_kc, max_kc, keycode; KeySym k; XDisplayKeycodes (w->dpy, &min_kc, &max_kc); for (keycode = min_kc; keycode <= max_kc; keycode++) if ((k = XKeycodeToKeysym (w->dpy, keycode, 0)) == keysym) return XKeycodeToKeysym (w->dpy, keycode, 1); return NoSymbol; } Bool keys_add_entry(Wm *w, char *keystr, int action, int idata, char *sdata) { char *p = keystr; char *q; int i = 0, mask = 0, index = 0; char *keydef = NULL; Bool want_shift = False; KeySym ks; MBConfigKbdEntry *entry; MBConfigKbd *kb = w->config->kb; struct { char *def; int mask; } lookup[] = { { "ctrl", ControlMask }, { "alt", kb->AltMask }, { "meta", kb->MetaMask }, { "super", kb->SuperMask }, { "hyper", kb->HyperMask }, { "mod1", Mod1Mask }, { "mod2", Mod2Mask }, { "mod3", Mod3Mask }, { "mod4", Mod4Mask }, { "mod5", Mod5Mask }, { NULL, 0 } }; dbg("%s() called, keystr: %s action: %i sdata %s\n", __func__, keystr, action, sdata); while (*p != '\0') { Bool found = False; if (*p == '<') /* XXX check for esacped < */ { q = ++p; while (*q != '\0' && *q != '>') q++; if (*q == '\0') return False; /* Parse error */ i = 0; while (lookup[i].def != NULL && !found) { if (!strncasecmp(p, lookup[i].def, q-p)) { if (lookup[i].mask) { mask |= lookup[i].mask; found = True; } else { fprintf(stderr, "matchbox: keyboard does not appear to have a <%s> key.\n", lookup[i].def); } } i++; } if (found) { p = q; } else { if (!strncasecmp(p, "shift", 5)) { want_shift = True; p = q; } else return False; } } else if (!isspace(*p)) { keydef = p; break; } p++; } if (!keydef) return False; if ((ks = XStringToKeysym(keydef)) == (KeySym)NULL) { if (islower(keydef[0])) /* Try again, changing case */ keydef[0] = toupper(keydef[0]); else keydef[0] = tolower(keydef[0]); if ((ks = XStringToKeysym(keydef)) == (KeySym)NULL) { fprintf(stderr, "matchbox: Cant find keysym for %s\n", keydef); dbg("%s() can find keysym %s\n", __func__, keydef); return False; } } if (keys_keysym_needs_shift(w, ks)) { mask |= ShiftMask; index = 1; } else if (want_shift) { KeySym shifted; /* Change the keysym for case of 'lowerchar' where we * actually want to grab the shifted version of the keysym. */ if ((shifted = keys_keysym_get_shifted (w, ks)) != NoSymbol) { ks = shifted; index = 1; } /* Set the mask even if no shifted version - up key for * example. */ mask |= ShiftMask; } dbg("%s() keydefinition is %s, want_shift is %i\n", __func__, keydef, mask & ShiftMask); /* If we grab keycode 0, we end up grabbing the entire keyboard :\ */ if (XKeysymToKeycode(w->dpy, ks) == 0 && mask == 0) { fprintf(stderr, "matchbox: Cant find a keycode for keysym %li\n", ks); return False; } if (w->config->kb->entrys == NULL) { w->config->kb->entrys = malloc(sizeof(MBConfigKbdEntry)); entry = w->config->kb->entrys; } else { entry = w->config->kb->entrys; while (entry->next_entry != NULL) entry = entry->next_entry; entry->next_entry = malloc(sizeof(MBConfigKbdEntry)); entry = entry->next_entry; } entry->next_entry = NULL; entry->action = action; entry->ModifierMask = mask; entry->index = index; entry->key = ks; entry->idata = idata; entry->sdata = (( sdata == NULL ) ? NULL : strdup(sdata)); dbg("added new key entry mask: %i\n", entry->ModifierMask); return True; } Bool keys_load_config(Wm *w) { #ifdef USE_GCONF int i = 0; char *key_def_str = NULL; char gconf_key_cmd_keys[256] = { 0 }; char gconf_key_cmd[256] = { 0 }; #define KEY_CMD_ENTRYS_N 12 struct { char *key; int action; } lookup[] = { { "/apps/matchbox/global_keybindings/cycle_windows", KEY_ACTN_NEXT_CLIENT }, { "/apps/matchbox/global_keybindings/cycle_windows_backward", KEY_ACTN_PREV_CLIENT }, { "/apps/matchbox/window_keybindings/close", KEY_ACTN_CLOSE_CLIENT }, { "/apps/matchbox/global_keybindings/show_desktop", KEY_ACTN_TOGGLE_DESKTOP }, { "/apps/matchbox/window_keybindings/activate_window_menu", KEY_ACTN_TASK_MENU_ACTIVATE }, { "/apps/matchbox/window_keybindings/toggle_fullscreen", KEY_ACTN_FULLSCREEN }, { "/apps/matchbox/window_keybindings/toggle_titlebar", KEY_ACTN_HIDE_TITLEBAR }, { NULL, 0 } }; while (lookup[i].key != NULL) { key_def_str = gconf_client_get_string(w->gconf_client, lookup[i].key, NULL); if (key_def_str && strcasecmp(key_def_str, "disabled")) keys_add_entry(w, key_def_str, lookup[i].action, 0, NULL); i++; } /* Add any command entrys */ for (i=0; igconf_client, gconf_key_cmd, NULL); cmd_keys = gconf_client_get_string(w->gconf_client, gconf_key_cmd_keys, NULL); if (cmd_value && cmd_keys && strcasecmp(cmd_value, "disabled") && strcasecmp(cmd_keys, "disabled") ) { #ifdef USE_LIBSN if (*cmd_value == '!') { action = KEY_ACTN_EXEC_SN; cmd_value++; } else if (*cmd_value == '$') { action = KEY_ACTN_EXEC_SINGLE; cmd_value++; } else #else if ((*(cmd_value+1) == '!') || (*(cmd_value+1) == '$')) cmd_value++; #endif action = KEY_ACTN_EXEC; keys_add_entry(w, cmd_keys, action, 0, cmd_value); } } #else /* No Gconf, Load the shortcuts from a file */ FILE *fp; char data[256]; char *key = NULL, *val = NULL, *str = NULL; int i = 0; struct stat stat_info; char *conf_path = NULL; struct { char *str; int act; } lookup[] = { { "next", KEY_ACTN_NEXT_CLIENT }, { "prev", KEY_ACTN_PREV_CLIENT }, { "close", KEY_ACTN_CLOSE_CLIENT }, { "desktop", KEY_ACTN_TOGGLE_DESKTOP }, { "taskmenu", KEY_ACTN_TASK_MENU_ACTIVATE }, { "fullscreen", KEY_ACTN_FULLSCREEN }, { "hidetitle", KEY_ACTN_HIDE_TITLEBAR }, { NULL, 0 } }; if (w->config->kbd_conf_file != NULL) conf_path = w->config->kbd_conf_file; if (conf_path == NULL && getenv("HOME")) { conf_path = malloc(sizeof(char)*(strlen(getenv("HOME"))+25)); sprintf(conf_path, "%s/.matchbox/kbdconfig", getenv("HOME")); if (stat(conf_path, &stat_info) == -1) { free(conf_path); conf_path = NULL; } } if (conf_path == NULL) conf_path = strdup(CONFDIR "/kbdconfig"); if (!(fp = fopen(conf_path, "r"))) { free(conf_path); return False; } dbg("%s() parsing keyboard config: %s\n", __func__, conf_path); free(conf_path); while(fgets(data,256,fp) != NULL) { if (data[0] == '#') continue; str = strdup(data); if ( (val = strchr(str, '=')) != NULL) { *val++ = '\0'; key = str; if (*val != '\0') { int action = 0; if (val[strlen(val)-1] == '\n') val[strlen(val)-1] = '\0'; if (*val == '!') { /* It some kind of exec */ val++; #ifdef USE_LIBSN if (*val == '!') { action = KEY_ACTN_EXEC_SN; val++; } else if (*val == '$') { action = KEY_ACTN_EXEC_SINGLE; val++; } else #else if ((*(val+1) == '!') || (*(val+1) == '$')) val++; #endif action = KEY_ACTN_EXEC; } else { i = 0; while (lookup[i].str != NULL) { if (!strncasecmp(lookup[i].str, val, strlen(lookup[i].str))) { action = lookup[i].act; break; } i++; } } if (!(action && keys_add_entry(w, key, action, 0, val))) fprintf(stderr, "matchbox: ignoring key shortcut %s\n", data); } } free(str); } fclose(fp); #endif return 1; } void keys_get_modifiers(Wm *w) { int mod_idx, mod_key, col, kpm; XModifierKeymap *mod_map = XGetModifierMapping(w->dpy); MBConfigKbd *kbd = w->config->kb; kbd->MetaMask = 0; kbd->HyperMask = 0; kbd->SuperMask = 0; kbd->AltMask = 0; kbd->ModeMask = 0; kbd->NumLockMask = 0; kbd->ScrollLockMask = 0; kpm = mod_map->max_keypermod; for (mod_idx = 0; mod_idx < 8; mod_idx++) for (mod_key = 0; mod_key < kpm; mod_key++) { KeySym last_sym = 0; for (col = 0; col < 4; col += 2) { KeyCode code = mod_map->modifiermap[mod_idx * kpm + mod_key]; KeySym sym = (code ? XKeycodeToKeysym(w->dpy, code, col) : 0); if (sym == last_sym) continue; last_sym = sym; switch (sym) { case XK_Mode_switch: /* XXX store_modifier("Mode_switch", mode_bit); */ break; case XK_Meta_L: case XK_Meta_R: kbd->MetaMask |= (1 << mod_idx); break; case XK_Super_L: case XK_Super_R: kbd->SuperMask |= (1 << mod_idx); break; case XK_Hyper_L: case XK_Hyper_R: kbd->HyperMask |= (1 << mod_idx); break; case XK_Alt_L: case XK_Alt_R: kbd->AltMask |= (1 << mod_idx); break; case XK_Num_Lock: kbd->NumLockMask |= (1 << mod_idx); break; case XK_Scroll_Lock: kbd->ScrollLockMask |= (1 << mod_idx); break; } } } /* XXX check this. assume alt <=> meta if only either set */ if (!kbd->AltMask) kbd->AltMask = kbd->MetaMask; if (!kbd->MetaMask) kbd->MetaMask = kbd->AltMask; kbd->lock_mask = kbd->ScrollLockMask | kbd->NumLockMask | LockMask; if (mod_map) XFreeModifiermap(mod_map); } void keys_grab(Wm *w, Bool ungrab) { MBConfigKbdEntry *entry = w->config->kb->entrys; while (entry != NULL) { int ignored_mask = 0; /* Needed to grab all ignored combo's too */ while (ignored_mask < (int) w->config->kb->lock_mask) { if (ignored_mask & ~(w->config->kb->lock_mask)) { ++ignored_mask; continue; } if (ungrab) { dbg("keys, ungrabbing %i , %i\n", XKeysymToKeycode(w->dpy, entry->key), entry->ModifierMask); XUngrabKey(w->dpy, XKeysymToKeycode(w->dpy, entry->key), entry->ModifierMask | ignored_mask, w->root); } else { int result; misc_trap_xerrors(); dbg("keys, grabbing keycode: %i , mask: %i\n", XKeysymToKeycode(w->dpy, entry->key), entry->ModifierMask | ignored_mask); XGrabKey(w->dpy, XKeysymToKeycode(w->dpy, entry->key), entry->ModifierMask | ignored_mask, w->root, True, GrabModeAsync, GrabModeAsync); result = misc_untrap_xerrors(); if (result != Success) { if (result == BadAccess) fprintf(stderr, "matchbox: Some other program is already using the key %s with modifiers %x as a binding\n", (XKeysymToString(entry->key)) ? XKeysymToString (entry->key) : "unknown", entry->ModifierMask | ignored_mask ); else fprintf(stderr, "matchbox: Unable to grab the key %s with modifiers %x as a binding\n", (XKeysymToString(entry->key)) ? XKeysymToString (entry->key) : "unknown", entry->ModifierMask | ignored_mask ); } } ++ignored_mask; } entry = entry->next_entry; } } static void keys_entries_free(Wm *w) { MBConfigKbdEntry *cur = w->config->kb->entrys, *entry = NULL; while (cur != NULL) { entry = cur; if (entry->sdata) free(entry->sdata); cur = entry->next_entry; free(entry); } w->config->kb->entrys = NULL; } static void keys_load_and_grab(Wm *w) { keys_get_modifiers(w); if (!keys_load_config(w)) { return; } keys_grab(w, False); } void keys_reinit(Wm *w) { keys_grab(w, True); keys_entries_free(w); keys_load_and_grab(w); } void keys_init(Wm *w) { w->config->kb = malloc(sizeof(MBConfigKbd)); w->config->kb->entrys = NULL; keys_load_and_grab(w); } #endif matchbox-window-manager-1.2/matchbox-window-manager/src/select_client.h0000664000211500234210000000261411307441355025246 0ustar bifh1bifhs/* * Matchbox Window Manager - A lightweight window manager not for the * desktop. * * Authored By Matthew Allum * * Copyright (c) 2002, 2004 OpenedHand Ltd - http://o-hand.com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #ifndef _SELECT_CLIENT_H_ #define _SELECT_CLIENT_H_ #include "structs.h" #include "base_client.h" #include "client_common.h" #include "main_client.h" #include "select_client.h" #include "dockbar_client.h" #include "wm.h" #include "misc.h" Client* select_client_new (Wm *w); void select_client_destroy (Client *c); void select_client_calc_dim (Wm *w, int *width, int *height); void select_client_button_press (Client *c, XButtonEvent *e); void select_client_init (Client *c); void select_client_reparent (Client *c); void select_client_redraw (Client *c, Bool use_cache); void select_client_event_loop (Client *c, struct list_item *button_item_cur ); #endif matchbox-window-manager-1.2/matchbox-window-manager/src/main_client.h0000664000211500234210000000354011307441355024712 0ustar bifh1bifhs/* * Matchbox Window Manager - A lightweight window manager not for the * desktop. * * Authored By Matthew Allum * * Copyright (c) 2002, 2004 OpenedHand Ltd - http://o-hand.com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #ifndef _MAIN_CLIENT_H_ #define _MAIN_CLIENT_H_ #include "structs.h" #include "base_client.h" #include "wm.h" #include "main_client.h" #include "misc.h" #include "select_client.h" #define TITLE_HIDDEN_SZ 4 Client* main_client_new (struct _wm *w, Window win); void main_client_check_for_state_hints(Client *c); void main_client_check_for_single(Client *c); void main_client_init(Client *c); void main_client_configure(Client *c); int main_client_manage_toolbars_for_fullscreen(Client *c, Bool main_client_showing); void main_client_reparent(Client *c); void main_client_redraw(Client *c, Bool use_cache); void main_client_button_press(Client *c, XButtonEvent *e); void main_client_move_resize(Client *c); void main_client_destroy(Client *c); void main_client_iconize(Client *c); int main_client_title_height(Client *c); void main_client_get_coverage(Client *c, int *x, int *y, int *w, int *h); void main_client_unmap(Client *c); void main_client_hide(Client *c); void main_client_show(Client *c); void main_client_toggle_title_bar(Client *c); void main_client_toggle_fullscreen(Client *c); #endif matchbox-window-manager-1.2/matchbox-window-manager/src/xml.h0000664000211500234210000000410011307441355023221 0ustar bifh1bifhs/* * Matchbox Window Manager - A lightweight window manager not for the * desktop. * * Authored By Matthew Allum * * Copyright (c) 2002, 2004 OpenedHand Ltd - http://o-hand.com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #include #include #include #include #include #include #include #include #include "config.h" #ifdef USE_EXPAT #include #endif typedef struct _params { char *key; char *value; struct _params *next; } Params; typedef struct _nlist { struct _xml_node *data; struct _nlist *next; } Nlist; typedef struct _xml_node { char *tag; Params *attr; char *cdata; struct _xml_node *parent; Nlist *kids; } XMLNode; typedef struct _xmlparser { void (* start_element_cb)( struct _xmlparser *parser, const char *tag, Params *attr); void (* end_element_cb)( struct _xmlparser *parser, const char *tag ); void (* data_cb)( struct _xmlparser *parser, char *data ); XMLNode *root_node; XMLNode *_current_node; } XMLParser; XMLNode *xml_node_new(const char *name, Params *attr); #ifdef DEBUG void xml_dump(XMLNode *node, int depth); #endif /* --------------------------------------------------------------- */ Params *xml_params_new(void); XMLParser *xml_parser_new(void); XMLNode *xml_parse_data_dom(XMLParser *parser, char *data); XMLNode *xml_parse_file_dom(XMLParser *parser, char *filename); void xml_parser_free(XMLParser *parser, XMLNode *root); matchbox-window-manager-1.2/matchbox-window-manager/src/mbtheme.h0000664000211500234210000001441311307441355024052 0ustar bifh1bifhs/* * Matchbox Window Manager - A lightweight window manager not for the * desktop. * * Authored By Matthew Allum * * Copyright (c) 2002, 2004 OpenedHand Ltd - http://o-hand.com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #ifndef _MBTHEME_H_ #define _MBTHEME_H_ #include "structs.h" #include "xml.h" #include "wm.h" #include "list.h" #define ERROR_MISSING_PARAMS -1 #define ERROR_INCORRECT_PARAMS -2 #define ERROR_LOADING_RESOURCE -3 typedef struct _mb_theme_param { enum { pixel, percentage, object, textx, textw, MBParamLabelEnd, MBParamTotalLabelWidth, } unit; signed int value; signed int offset; } MBThemeParam; enum { LAYER_GRADIENT_HORIZ = 1, LAYER_GRADIENT_VERT, LAYER_LABEL, LAYER_PLAIN, LAYER_PIXMAP, LAYER_PIXMAP_TILED, LAYER_PICTURE, LAYER_PICTURE_TILED, LAYER_ICON, LAYER_SUB_LABEL, } MBThemeLayerType; typedef struct _mb_theme_label { Alignment justify; MBColor *col; MBColor *bgcol; MBFont *font; MBThemeParam *sublabel_label_clip_w; } MBThemeLabel; typedef struct _mb_theme_button { int action; Bool inputonly; Bool press_activates; Bool wants_dbl_click; MBThemeParam *x; MBThemeParam *y; MBThemeParam *w; MBThemeParam *h; MBPixbufImage *img_active; MBPixbufImage *img_inactive; int img_active_blend; int img_inactive_blend; } MBThemeButton; typedef struct _mb_theme_layer { MBThemeParam *x; MBThemeParam *y; MBThemeParam *w; MBThemeParam *h; MBColor *color; MBPixbufImage *img; MBThemeLabel *label; MBColor *color_end; /* for gradients */ } MBThemeLayer; typedef struct _mb_theme_frame { int type; struct list_item *layers; struct list_item *buttons; int set_height; int set_width; char *options; Bool wants_shape; /* FIXME: * Can save some bytes by do some C style OO casting magic on * MBThemeFrame instances to save wastage of bytes below on * frames that dont need this infomation. */ /* Only for frames display text */ int label_w; int label_h; int label_x; int sublabel_x; int sublabel_w; MBFont *font; MBColor *color; MBColor *hl_color; /* Only for menu frame */ int border_n; int border_e; int border_s; int border_w; int fixed_width; int fixed_x; } MBThemeFrame; typedef struct _mbtheme { struct list_item* frames; struct list_item* images; struct list_item* pictures; struct list_item* colors; struct list_item* fonts; GC gc, mask_gc, band_gc; /* for drag window */ MBPixbufImage* img_caches[N_FRAME_TYPES]; /* For toolbar in panel */ Bool have_toolbar_panel; MBThemeParam *toolbar_panel_x; MBThemeParam *toolbar_panel_y; MBThemeParam *toolbar_panel_w; MBThemeParam *toolbar_panel_h; /* For image substitution */ char subst_char; MBPixbufImage *subst_img; /* App side decoration pixmap cache */ Pixmap app_win_pxm_cache[3]; /* disable cacheing, not recommened */ Bool disable_pixbuf_cache; struct _wm *wm; } MBTheme; void theme_paint_rgba_icon (MBTheme *t, Client *c, Drawable drw, int x, int y, int *data); void theme_frame_icon_paint (MBTheme *t, Client *c, MBPixbufImage *img_dest, int x, int y); Bool theme_frame_wants_shaped_window (MBTheme *theme, int frame_type); Bool theme_frame_supports_button_type (MBTheme *theme, int frame_type, int button_type); Bool theme_has_frame_type_defined (MBTheme *theme, int frame_type); int theme_frame_defined_width_get (MBTheme *theme, int frame_type ); int theme_frame_defined_height_get (MBTheme *theme, int frame_ref ); Bool theme_has_message_decor( MBTheme *theme ); Bool theme_has_borders_only_decor( MBTheme *theme ); void theme_img_cache_clear (MBTheme *theme, int frame_ref ); void theme_img_cache_clear_all (MBTheme *theme ); void theme_pixmap_cache_clear_all( MBTheme *theme ); void theme_frame_button_paint (MBTheme *theme, Client *c, int action, int state, int frame_type, int dest_w, int dest_h ); Bool theme_frame_paint (MBTheme *theme, Client *c, int frame_ref, int dw, int dh ); void theme_frame_menu_highlight_entry(Client *c, MBClientButton *button, int mode); void theme_frame_menu_paint (MBTheme *theme, Client *c); Bool theme_frame_menu_get_dimentions (MBTheme *theme, int *w, int *h); MBTheme* mbtheme_new (Wm *w); void mbtheme_switch (Wm *w, char *new_theme_conf); void mbtheme_init (Wm *w, char *theme_conf); int theme_frame_button_get_x_pos (MBTheme *theme, int frame_type, int button_type, int width); Bool mbtheme_get_titlebar_panel_rect(MBTheme *theme, XRectangle *rect, Client *ignore_client); Bool mbtheme_has_titlebar_panel(MBTheme *theme); Bool mbtheme_button_press_activates(MBThemeButton* button); #endif matchbox-window-manager-1.2/matchbox-window-manager/src/desktop_client.h0000664000211500234210000000237211307441355025441 0ustar bifh1bifhs/* * Matchbox Window Manager - A lightweight window manager not for the * desktop. * * Authored By Matthew Allum * * Copyright (c) 2002, 2004 OpenedHand Ltd - http://o-hand.com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #ifndef _DESKTOP_CLIENT_H_ #define _DESKTOP_CLIENT_H_ #include "structs.h" #include "base_client.h" #include "wm.h" #include "main_client.h" #include "misc.h" #include "select_client.h" Client* desktop_client_new(Wm *w, Window win); void desktop_client_reparent(Client *c); void desktop_client_move_resize(Client *c); void desktop_client_get_coverage(Client *c, int *x, int *y, int *w, int *h); void desktop_client_configure(Client *c); void desktop_client_show(Client *c); void desktop_client_destroy(Client *c); #endif matchbox-window-manager-1.2/matchbox-window-manager/src/misc.c0000664000211500234210000001166111307441355023361 0ustar bifh1bifhs/* * Matchbox Window Manager - A lightweight window manager not for the * desktop. * * Authored By Matthew Allum * * Copyright (c) 2002, 2004 OpenedHand Ltd - http://o-hand.com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #include "misc.h" static int trapped_error_code = 0; static int (*old_error_handler) (Display *d, XErrorEvent *e); #ifndef HAVE_STRSEP char * strsep(char **stringp, char *delim) { char *start = *stringp; char *cp; char ch; if (start == NULL) return NULL; for (cp = start; ch = *cp; cp++) { if (strchr(delim, ch)) { *cp++ = 0; *stringp = cp; return start; } } *stringp = NULL; return start; } #endif void fork_exec(char *cmd) { switch (fork()) { case 0: execlp ("/bin/sh", "sh", "-c", cmd, (char *)NULL); fprintf (stderr, "Exec failed.\n"); exit (0); break; case -1: fprintf (stderr, "Fork failed.\n"); break; } } void sig_handler(int signal) { switch (signal) { case SIGINT: case SIGTERM: case SIGHUP: exit(1); break; case SIGCHLD: wait(NULL); break; } } int handle_xerror(Display *dpy, XErrorEvent *e) { if (e->error_code == BadAccess && e->resourceid == RootWindow(dpy, DefaultScreen(dpy)) ) { fprintf(stderr, "root window unavailible (maybe another wm is running?)\n"); exit(1); } else { char msg[255]; XGetErrorText(dpy, e->error_code, msg, sizeof msg); fprintf(stderr, "matchbox-wm: X error warning (%#lx): %s (opcode: %i)\n", e->resourceid, msg, e->request_code); } return 0; } int ignore_xerror(Display *dpy, XErrorEvent *e) { return 0; } static int trapped_xerror_handler(Display *display, XErrorEvent *error) { trapped_error_code = error->error_code; return 0; } void misc_trap_xerrors(void) { trapped_error_code = 0; dbg("**** %s() *****\n", __func__); old_error_handler = XSetErrorHandler(trapped_xerror_handler); } int misc_untrap_xerrors(void) { dbg("**** %s() *****\n", __func__); XSetErrorHandler(old_error_handler); return trapped_error_code; } /* check for ageing mwm hints, it probably shouldn't be in misc.c .. */ int mwm_get_decoration_flags(Wm *w, Window win) { #define PROP_MOTIF_WM_HINTS_ELEMENTS 5 #define MWM_HINTS_DECORATIONS (1L << 1) #define MWM_DECOR_BORDER (1L << 1) #define MWM_DECOR_RESIZEH (1L << 2) #define MWM_DECOR_TITLE (1L << 3) #define MWM_DECOR_MENU (1L << 4) #define MWM_DECOR_MINIMIZE (1L << 5) #define MWM_DECOR_MAXIMIZE (1L << 6) typedef struct { unsigned long flags; unsigned long functions; unsigned long decorations; long inputMode; unsigned long status; } PropMotifWmHints; Atom type; int format; PropMotifWmHints *hints = NULL; unsigned long n_items, bytes_after; if (XGetWindowProperty (w->dpy, win, w->atoms[_MOTIF_WM_HINTS], 0, PROP_MOTIF_WM_HINTS_ELEMENTS, False, AnyPropertyType, &type, &format, &n_items, &bytes_after, (unsigned char **)&hints) != Success || type == None) { dbg("MWM xgetwinprop failed\n"); if (hints) XFree(hints); return 0; } if (type == None || n_items != PROP_MOTIF_WM_HINTS_ELEMENTS) { dbg("MWM xgetwinprop failed - %li items != 5\n", n_items); if (hints) XFree(hints); return 0; } dbg("MWM xgetwinprop success \n"); if (hints->flags & MWM_HINTS_DECORATIONS) { if (hints->decorations == 0) { dbg("%s() MWM is no decor. \n", __func__); if (hints) XFree(hints); return CLIENT_TITLE_HIDDEN_FLAG; /* XXX should really change flag to NO_DECOR */ } if (hints->decorations == MWM_DECOR_BORDER) { dbg("%s() MWM is borders only. \n", __func__); if (hints) XFree(hints); return CLIENT_BORDERS_ONLY_FLAG; } } dbg("%s() MWM, nothing of interest here. \n", __func__); if (hints) XFree(hints); return 0; } void misc_scale_wm_app_icon(Wm *w) { #ifndef STANDALONE if (w->img_generic_icon->width != 16 || w->img_generic_icon->height != 16) { MBPixbufImage *img_tmp; img_tmp = mb_pixbuf_img_scale_down(w->pb, w->img_generic_icon, 16, 16); mb_pixbuf_img_free(w->pb, w->img_generic_icon); w->img_generic_icon = img_tmp; } #endif } matchbox-window-manager-1.2/matchbox-window-manager/src/main.c0000664000211500234210000000247111307441355023351 0ustar bifh1bifhs/* * Matchbox Window Manager - A lightweight window manager not for the * desktop. * * Authored By Matthew Allum * * Copyright (c) 2002, 2004 OpenedHand Ltd - http://o-hand.com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #include "structs.h" #include "wm.h" #include "misc.h" int main(int argc, char **argv) { Wm *w; struct sigaction act; memset(&act, 0, sizeof(struct sigaction)); act.sa_handler = sig_handler; act.sa_flags = 0; sigaction(SIGTERM, &act, NULL); sigaction(SIGINT, &act, NULL); sigaction(SIGHUP, &act, NULL); sigaction(SIGCHLD, &act, NULL); signal (SIGCHLD, SIG_IGN); /* as now we exec via keyboard */ w = wm_new(argc, argv); if (getenv("MB_SYNC")) XSynchronize (w->dpy, True); wm_init_existing(w); wm_event_loop(w); return 1; } matchbox-window-manager-1.2/matchbox-window-manager/src/mbtheme-standalone.h0000664000211500234210000001356511307441355026207 0ustar bifh1bifhs/* * Matchbox Window Manager - A lightweight window manager not for the * desktop. * * Authored By Matthew Allum * * Copyright (c) 2002, 2004 OpenedHand Ltd - http://o-hand.com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #ifndef _MBTHEME_H_ #define _MBTHEME_H_ #include "structs.h" #include "wm.h" #include "list.h" /*** Feel Free to experiment with below defines, to get a standalone 'theme' to suit your tastes. Also see _draw_button() and theme_frame_paint() for more extreme changes ***/ /* Various frame sizes in pixels. */ #define FRAME_MAIN_HEIGHT 20 #define FRAME_DIALOG_HEIGHT 20 #define FRAME_DIALOG_BORDER_SIZE 1 #define FRAME_TOOLBAR_MAX_SIZE 16 #define FRAME_TOOLBAR_MIN_SIZE 16 /* Line width for buttons */ #define THEME_LINE_WIDTH 2 /* Frame Colors */ #define THEME_FG_COLOR "#496179" #define THEME_FG_HIGHLIGHT_COLOR "#697d96" #define THEME_FG_LOWLIGHT_COLOR "#384961" /* Text / button color - white */ #define THEME_TEXT_COLOR "#ffffff" /* Fonts, notice you can list alternates seperated by a '|' */ #ifdef USE_XFT #define THEME_FONT_MAIN "sans serif-10:bold" #define THEME_FONT_TOOLBAR "sans serif-8:bold" #else #define THEME_FONT_MAIN "-*-helvetica-bold-*-normal-*-12-*-*-*-*-*-*-*|fixed" #define THEME_FONT_TOOLBAR "6x10|5x7|fixed" #endif /* Simple theme struct */ typedef struct _mbtheme { XColor col_fg; XColor col_fg_lowlight; XColor col_fg_highlight; XColor col_text; GC gc, mask_gc, band_gc; #ifdef USE_XFT XftFont *font; XftFont *font_toolbar; XftColor xftcol; #else XFontStruct *font; XFontStruct *font_toolbar; #endif struct _wm *wm; } MBTheme; /* font stuff */ #define font_height(font) (((font)->ascent) + ((font)->descent)) #define font_ascent(font) ((font)->ascent) #define font_ref(font) ((font)) #ifdef USE_XFT Bool font_load (Wm *w, char *spec, XftFont **font); #else Bool font_load (Wm *w, char *spec, XFontStruct **font); #endif #ifdef USE_XFT void font_paint (Wm *w, XftDraw *drawable, XftColor *color, XftFont *font, unsigned char *text, int text_len, Bool text_is_utf8, int x, int y); #else void font_paint (Wm *w, Drawable drawable, XColor *color, XFontStruct *font, GC gc, unsigned char *text, int text_len, int x, int y); #endif #ifdef USE_XFT int font_get_str_width (Wm *w, XftFont *font, unsigned char *text, int text_len, Bool text_is_utf8); #else int font_get_str_width (Wm *w, XFontStruct *font, unsigned char *text, int text_len, Bool text_is_utf8); #endif /* funcs, some are just stubs */ void theme_paint_rgba_icon (MBTheme *t, Client *c, Drawable drw, int x, int y, int *data); Bool theme_frame_wants_shaped_window (MBTheme *theme, int frame_type); Bool theme_frame_supports_button_type (MBTheme *theme, int frame_type, int button_type); int theme_frame_defined_width_get (MBTheme *theme, int frame_type ); int theme_frame_defined_height_get (MBTheme *theme, int frame_ref ); Bool theme_has_frame_type_defined (MBTheme *theme, int frame_type); void theme_img_cache_clear (MBTheme *theme, int frame_ref ); void theme_img_cache_clear_all (MBTheme *theme ); void theme_frame_button_paint (MBTheme *theme, Client *c, int action, int state, int frame_type, int dest_w, int dest_h ); Bool theme_frame_paint (MBTheme *theme, Client *c, int frame_ref, int dw, int dh ); void theme_frame_menu_paint (MBTheme *theme, Client *c); Bool theme_frame_menu_get_dimentions (MBTheme *theme, int *w, int *h); void theme_frame_menu_highlight_entry(Client *c, MBClientButton *button, int mode); Bool theme_has_message_decor( MBTheme *theme ); Bool theme_has_borders_only_decor( MBTheme *theme ); MBTheme* mbtheme_new (Wm *w); void mbtheme_switch (Wm *w, char *new_theme_conf); void mbtheme_init (Wm *w, char *theme_conf); int theme_frame_button_get_x_pos (MBTheme *theme, int frame_type, int button_type, int width); Bool mbtheme_get_titlebar_panel_rect(MBTheme *theme, XRectangle *rect, Client *ignore_client); Bool mbtheme_has_titlebar_panel(MBTheme *theme); void theme_pixmap_cache_clear_all( MBTheme *theme ); #endif matchbox-window-manager-1.2/matchbox-window-manager/src/base_client.h0000664000211500234210000000371211307441355024701 0ustar bifh1bifhs/* * Matchbox Window Manager - A lightweight window manager not for the * desktop. * * Authored By Matthew Allum * * Copyright (c) 2002, 2004 OpenedHand Ltd - http://o-hand.com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #define _GNU_SOURCE #ifndef _BASE_CLIENT_H_ #define _BASE_CLIENT_H_ #include #include #include #include #include #include "structs.h" #include "wm.h" Client* base_client_new (Wm *w, Window win); void base_client_process_name (Client *c); /* This will set the window attributes to what _we_ want */ void base_client_configure (Client *c); /* sets inital 'object methods' */ void base_client_set_funcs (Client *c); /* Frame the window if needed */ void base_client_reparent (Client *c); /* redraw the clients frame */ void base_client_redraw (Client *c, Bool use_cache); /* Hide any transients */ void base_client_hide_transients (Client *c); /* button press on frame */ void base_client_button_press (Client *c, XButtonEvent *e); /* move and resize the window */ void base_client_move_resize (Client *c); /* iconize client */ void base_client_iconize (Client *c); /* return the 'area' covered by the window. Including the frame Would return 0 for an unmapped window */ void base_client_get_coverage (Client *c, int *x, int *y, int *w, int *h); void base_client_hide (Client *c); void base_client_show (Client *c); void base_client_destroy (Client *c); #endif matchbox-window-manager-1.2/matchbox-window-manager/src/toolbar_client.h0000664000211500234210000000263711307441355025436 0ustar bifh1bifhs/* * Matchbox Window Manager - A lightweight window manager not for the * desktop. * * Authored By Matthew Allum * * Copyright (c) 2002, 2004 OpenedHand Ltd - http://o-hand.com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #ifndef _TOOLBAR_CLIENT_H_ #define _TOOLBAR_CLIENT_H_ #include "structs.h" #include "client_common.h" #include "base_client.h" #include "main_client.h" Client* toolbar_client_new(Wm *w, Window win); void toolbar_client_configure(Client *c); void toolbar_client_button_press(Client *c, XButtonEvent *e); void toolbar_client_show(Client *c); void toolbar_client_hide(Client *c); void toolbar_client_move_resize(Client *c); void toolbar_client_get_coverage(Client *c, int *x, int *y, int *w, int *h); void toolbar_client_destroy(Client *c); void toolbar_client_reparent(Client *c); void toolbar_client_redraw(Client *c, Bool use_cache); int toolbar_win_offset(Client *c); #endif matchbox-window-manager-1.2/matchbox-window-manager/src/list.c0000664000211500234210000000502411307441355023375 0ustar bifh1bifhs/* * Matchbox Window Manager - A lightweight window manager not for the * desktop. * * Authored By Matthew Allum * * Copyright (c) 2002, 2004 OpenedHand Ltd - http://o-hand.com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #include "list.h" struct list_item* list_new(int id, char *name, void *data) { struct list_item* list; list = malloc(sizeof(struct list_item)); memset(list, 0, sizeof(struct list_item)); if (name) list->name = strdup(name); if (id) list->id = id; list->data = data; list->next = NULL; return list; } void* list_add(struct list_item** head, char *name, int id, void *data) { struct list_item* tmp = *head; if (tmp == NULL) { *head = list_new(id, name, data); return NULL; } while (tmp->next != NULL) tmp = tmp->next; tmp->next = list_new(id, name, data); return tmp->next->data; } void* list_find_by_id(struct list_item* head, int needed_id) { struct list_item* tmp = head; while (tmp != NULL) { if (tmp->id && tmp->id == needed_id) return tmp->data; tmp = tmp->next; } return NULL; } void* list_find_by_name(struct list_item* head, char *name) { struct list_item* tmp = head; while (tmp != NULL) { if (tmp->name && name && !strcmp(tmp->name, name)) return tmp->data; tmp = tmp->next; } return NULL; } void list_remove(struct list_item** head, void *data) { struct list_item* cur = *head, *prev = NULL; if (cur && cur->next == NULL && cur->data == data) { list_destroy(head); return; } while (cur != NULL) { if (cur->data == data) { if (prev) prev->next = cur->next; else *head = cur->next; if (cur->name) free (cur->name); free(cur); return; } prev = cur; cur = cur->next; } } void list_destroy(struct list_item** head) { struct list_item* next = NULL, *cur = *head; while (cur != NULL) { next = cur->next; if (cur->name) free (cur->name); free(cur); cur = next; } *head = NULL; } matchbox-window-manager-1.2/matchbox-window-manager/install-sh0000775000211500234210000002244111307441355023475 0ustar bifh1bifhs#!/bin/sh # install - install a program, script, or datafile scriptversion=2004-04-01.17 # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" transformbasename= transform_arg= instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd= chgrpcmd= stripcmd= rmcmd="$rmprog -f" mvcmd="$mvprog" src= dst= dir_arg= usage="Usage: $0 [OPTION]... SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 -d DIRECTORIES... In the first form, install SRCFILE to DSTFILE, removing SRCFILE by default. In the second, create the directory path DIR. Options: -b=TRANSFORMBASENAME -c copy source (using $cpprog) instead of moving (using $mvprog). -d create directories instead of installing files. -g GROUP $chgrp installed files to GROUP. -m MODE $chmod installed files to MODE. -o USER $chown installed files to USER. -s strip installed files (using $stripprog). -t=TRANSFORM --help display this help and exit. --version display version info and exit. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test -n "$1"; do case $1 in -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; -c) instcmd=$cpprog shift continue;; -d) dir_arg=true shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; --help) echo "$usage"; exit 0;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -s) stripcmd=$stripprog shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; --version) echo "$0 $scriptversion"; exit 0;; *) # When -d is used, all remaining arguments are directories to create. test -n "$dir_arg" && break # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dstarg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dstarg" shift # fnord fi shift # arg dstarg=$arg done break;; esac done if test -z "$1"; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi for src do # Protect names starting with `-'. case $src in -*) src=./$src ;; esac if test -n "$dir_arg"; then dst=$src src= if test -d "$dst"; then instcmd=: chmodcmd= else instcmd=$mkdirprog fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dstarg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dstarg # Protect names starting with `-'. case $dst in -*) dst=./$dst ;; esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then dst=$dst/`basename "$src"` fi fi # This sed command emulates the dirname command. dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # Skip lots of stat calls in the usual case. if test ! -d "$dstdir"; then defaultIFS=' ' IFS="${IFS-$defaultIFS}" oIFS=$IFS # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` IFS=$oIFS pathcomp= while test $# -ne 0 ; do pathcomp=$pathcomp$1 shift if test ! -d "$pathcomp"; then $mkdirprog "$pathcomp" || lasterr=$? # mkdir can fail with a `File exist' error in case several # install-sh are creating the directory concurrently. This # is OK. test ! -d "$pathcomp" && { (exit ${lasterr-1}); exit; } fi pathcomp=$pathcomp/ done fi if test -n "$dir_arg"; then $doit $instcmd "$dst" \ && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \ && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \ && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; } else # If we're going to rename the final executable, determine the name now. if test -z "$transformarg"; then dstfile=`basename "$dst"` else dstfile=`basename "$dst" $transformbasename \ | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename. test -z "$dstfile" && dstfile=`basename "$dst"` # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0 trap '(exit $?); exit' 1 2 13 15 # Move or copy the file name to the temp name $doit $instcmd "$src" "$dsttmp" && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $instcmd $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } && # Now rename the file to the real destination. { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \ || { # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { if test -f "$dstdir/$dstfile"; then $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \ || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \ || { echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 (exit 1); exit } else : fi } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" } } fi || { (exit 1); exit; } done # The final little trick to "correctly" pass the exit status to the exit trap. { (exit 0); exit } # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: matchbox-window-manager-1.2/matchbox-window-manager/INSTALL0000664000211500234210000002203011307441354022513 0ustar bifh1bifhsCopyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is free documentation; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. Basic Installation ================== These are generic installation instructions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). It can also use an optional file (typically called `config.cache' and enabled with `--cache-file=config.cache' or simply `-C') that saves the results of its tests to speed up reconfiguring. (Caching is disabled by default to prevent problems with accidental use of stale cache files.) If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If you are using the cache, and at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.ac' (or `configure.in') is used to create `configure' by a program called `autoconf'. You only need `configure.ac' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. If you're using `csh' on an old version of System V, you might need to type `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself. Running `configure' takes awhile. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package. 4. Type `make install' to install the programs and any data files and documentation. 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. Run `./configure --help' for details on some of the pertinent environment variables. You can give `configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you must use a version of `make' that supports the `VPATH' variable, such as GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. If you have to use a `make' that does not support the `VPATH' variable, you have to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. Installation Names ================== By default, `make install' will install the package's files in `/usr/local/bin', `/usr/local/man', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PATH'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you give `configure' the option `--exec-prefix=PATH', the package will use PATH as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=PATH' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Specifying the System Type ========================== There may be some features `configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, `configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the `--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the `--target=TYPE' option to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with `--host=TYPE'. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to `configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the `configure' command line, using `VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc will cause the specified gcc to be used as the C compiler (unless it is overridden in the site shell script). `configure' Invocation ====================== `configure' recognizes the following options to control how it operates. `--help' `-h' Print a summary of the options to `configure', and exit. `--version' `-V' Print the version of Autoconf used to generate the `configure' script, and exit. `--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally `config.cache'. FILE defaults to `/dev/null' to disable caching. `--config-cache' `-C' Alias for `--cache-file=config.cache'. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. matchbox-window-manager-1.2/matchbox-window-manager/COMPLIANCE0000664000211500234210000000210111307441354023014 0ustar bifh1bifhs# # EWMH hints # [ ] : not implemented [*] : partially implemented [+] : supported [-] : unsupported/unused/ignored Root Window Properties (and Related Messages) [+] _NET_SUPPORTED [+] _NET_CLIENT_LIST [*] _NET_NUMBER_OF_DESKTOPS [+] _NET_DESKTOP_GEOMETRY [-] _NET_DESKTOP_VIEWPORT [*] _NET_CURRENT_DESKTOP [-] _NET_DESKTOP_NAMES [+] _NET_ACTIVE_WINDOW [+] _NET_WORKAREA [+] _NET_SUPPORTING_WM_CHECK [-] _NET_VIRTUAL_ROOTS [+] _NET_DESKTOP_LAYOUT [+] _NET_SHOWING_DESKTOP Other Root Window Messages [+] _NET_CLOSE_WINDOW [-] _NET_MOVERESIZE_WINDOW [-] _NET_WM_MOVERESIZE Application Window Properties [+] _NET_WM_NAME [-] _NET_WM_VISIBLE_NAME [-] _NET_WM_ICON_NAME [-] _NET_WM_VISIBLE_ICON_NAME [+] _NET_WM_DESKTOP [+] _NET_WM_WINDOW_TYPE [*] _NET_WM_STATE Support exists for; _NET_WM_STATE_MODAL, _NET_WM_STATE_FULLSCREEN, _NET_WM_STATE_ABOVE [*] _NET_WM_ALLOWED_ACTIONS [-] _NET_WM_STRUT [-] _NET_WM_STRUT_PARTIAL [-] _NET_WM_ICON_GEOMETRY [+] _NET_WM_ICON [+] _NET_WM_PID [-] _NET_WM_HANDLED_ICONS [-] _NET_WM_USER_TIME Window Manager Protocols [+] _NET_WM_PINGmatchbox-window-manager-1.2/matchbox-window-manager/autogen.sh0000775000211500234210000000012711307441354023466 0ustar bifh1bifhs#! /bin/sh autoreconf -v --install || exit 1 ./configure --enable-maintainer-mode "$@" matchbox-window-manager-1.2/debian/0000775000211500234210000000000011307441354016165 5ustar bifh1bifhsmatchbox-window-manager-1.2/debian/matchbox-window-manager.manpages0000664000211500234210000000007211307441354024423 0ustar bifh1bifhsdebian/matchbox-window-manager.1 debian/matchbox-remote.1 matchbox-window-manager-1.2/debian/copyright0000664000211500234210000000207311307441354020122 0ustar bifh1bifhsThis package was debianised by Moray Allan on Mon, 12 Jul 2004 20:39:00 +0100. It was downloaded from http://matchbox.handhelds.org/sources/ Upstream author: Matthew Allum Copyright: Copyright (C) 2004 Matthew Allum This package is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 dated June, 1991. This package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this package; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. On Debian GNU/Linux systems, the complete text of the GNU General Public License can be found in '/usr/share/common-licenses/GPL-2'. matchbox-window-manager-1.2/debian/matchbox-remote.10000664000211500234210000000265711307441354021357 0ustar bifh1bifhs.\" matchbox-remote.1 .\" Copyright 2004 Moray Allan .TH matchbox-remote 1 "Jul 16 2004" "" .SH NAME matchbox-remote \- communicate with matchbox-window-manager process .SH SYNOPSIS .B matchbox-remote [options] .SH OPTIONS .TP \fB\-t\fR switch matchbox theme .TP \fB\-r\fR Print current matchbox theme to stdout .TP \fB\-exit\fR Request matchbox to exit .TP \fB\-next\fR Page to next window .TP \fB\-prev\fR Page to previous window .HP \fB\-desktop\fR Toggle desktop visibility .TP \fB\-mbmenu\fR Toggle mbmenu .TP \fB\-panel\-id\fR .HP \fB\-panel\-toggle\fR .TP \fB\-h\fR help .TP \fB\-t\fR switch matchbox theme .TP \fB\-r\fR Print current matchbox theme to stdout .TP \fB\-exit\fR Request matchbox to exit .TP \fB\-next\fR Page to next window .TP \fB\-prev\fR Page to previous window .HP \fB\-desktop\fR Toggle desktop visibility .TP \fB\-mbmenu\fR Toggle mbmenu .TP \fB\-panel\-id\fR .HP \fB\-panel\-toggle\fR .SH DESCRIPTION .B matchbox-remote connects to a running .B matchbox-window-manager process to get information about its state or send it instructions. .B matchbox-window-manager is a window manager for the X Window System running on non-desktop embedded platforms such as handhelds, set-top boxes, kiosks and anything else for which screen space, input mechanisms or system resources are limited. .SH AUTHOR .B matchbox-remote was written by Matthew Allum . matchbox-window-manager-1.2/debian/rules0000775000211500234210000000520111307441354017243 0ustar bifh1bifhs#!/usr/bin/make -f # -*- makefile -*- # Sample debian/rules that uses debhelper. # GNU copyright 1997 to 1999 by Joey Hess. # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 SOURCE_DIR=matchbox-window-manager # These are used for cross-compiling and for saving the configure script # from having to guess our platform (since we know it already) DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) EXTRA_FLAGS = --enable-alt-input-wins --disable-xrm --enable-xsync --enable-frameanimation CFLAGS = -Wall -g ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) CFLAGS += -O0 else CFLAGS += -O2 endif ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) INSTALL_PROGRAM += -s endif config.status: $(SOURCE_DIR)/configure dh_testdir # Add here commands to configure the package. cd $(SOURCE_DIR) && CFLAGS="$(CFLAGS)" ./configure $(EXTRA_FLAGS) --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info $(SOURCE_DIR)/configure: # tar -jxf snapshot/matchbox-window-manager*.tar.bz2 cd $(SOURCE_DIR) && aclocal && autoconf && autoheader && automake --add-missing --foreign build: build-stamp build-stamp: config.status dh_testdir # Add here commands to compile the package. cd $(SOURCE_DIR) && $(MAKE) touch build-stamp clean: dh_testdir dh_testroot rm -f build-stamp # rm -fr $(SOURCE_DIR) # Add here commands to clean up after the build process. -$(MAKE) distclean ifneq "$(wildcard /usr/share/misc/config.sub)" "" cp -f /usr/share/misc/config.sub config.sub endif ifneq "$(wildcard /usr/share/misc/config.guess)" "" cp -f /usr/share/misc/config.guess config.guess endif dh_clean install: build dh_testdir dh_testroot dh_clean -k dh_installdirs # Add here commands to install the package into debian/tmp cd $(SOURCE_DIR) && $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp # Build architecture-independent files here. binary-indep: build install # We have nothing to do by default. # Empty docs on armel ifneq (,$(findstring arm,$(DEB_BUILD_GNU_TYPE))) p := -p matchbox-window-manager-dbg endif # Build architecture-dependent files here. binary-arch: build install dh_testdir dh_testroot dh_installchangelogs $(p) $(SOURCE_DIR)/ChangeLog dh_installdocs $(p) dh_installexamples $(p) dh_install --sourcedir=debian/tmp -v dh_installman $(p) dh_link dh_strip dh_compress dh_fixperms dh_makeshlibs dh_installdeb dh_shlibdeps dh_gencontrol dh_md5sums dh_builddeb binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install matchbox-window-manager-1.2/debian/compat0000664000211500234210000000000211307441354017363 0ustar bifh1bifhs4 matchbox-window-manager-1.2/debian/changelog0000664000211500234210000004720311307441405020042 0ustar bifh1bifhsmatchbox-window-manager (3:1.2-osso21+0m5) unstable; urgency=low * This entry has been added by BIFH queue processor Suffix +0m5 added to package revision -- Kojo Aapo Tue, 08 Dec 2009 14:13:57 +0200 matchbox-window-manager (3:1.2-osso21) unstable; urgency=low * Fixes: NB#149139 - Remove doc files from matchbox deb * rm -rf matchbox-window-manager/debian -- Adam Endrodi Fri, 04 Dec 2009 17:13:57 +0200 matchbox-window-manager (3:1.2-osso20) unstable; urgency=low Thomas & Kimmo: * Fixes: NB#103733 - all notifications have no titlebar. * Fixes: NB#106529 - Hildon Toch Confirmation note is not displayed properly when initiating the device * Fixes: NB#103387 - Make matchbox1 not hide dialogs when their title bar is tapped -- Kimmo Hämäläinen Mon, 18 May 2009 08:37:25 +0300 matchbox-window-manager (3:1.2-osso19) unstable; urgency=low * Updated the maintainer. * Fixes: NB#108320 - Pointer is visible during startup -- Kimmo Hämäläinen Wed, 22 Apr 2009 13:39:18 +0300 matchbox-window-manager (2:1.2-osso18) unstable; urgency=low * wm.c: make sure to resize dialogs on ALT_INPUT_WIN resize correctly * Fixes: NB#71258 -- Tapani Palli Fri, 12 Oct 2007 13:42:05 +0300 matchbox-window-manager (2:1.2-osso17) unstable; urgency=low * wm.c: do not resize MBCLIENT_TYPE_DESKTOP windows on ALT_INPUT_WIN resize * Fixes: NB#70390 -- Tapani Pälli Fri, 21 Sep 2007 09:53:01 +0300 matchbox-window-manager (2:1.2-osso16) unstable; urgency=low * mbtheme.c: make sure painting coordinates are ok * Fixes: NB#68579 -- Tapani Pälli Wed, 12 Sep 2007 14:58:09 +0300 matchbox-window-manager (2:1.2-osso15) unstable; urgency=low * wm.c: do not touch a client if it's creation failed * Fixes: NB#68773 -- Tapani Pälli Mon, 10 Sep 2007 11:33:43 +0300 matchbox-window-manager (2:1.2-osso14) unstable; urgency=low * toolbar_client_alt.c: _really_ check for TYPE_DESKTOP hint -- Tapani Pälli Wed, 5 Sep 2007 15:03:30 +0300 matchbox-window-manager (2:1.2-osso13) unstable; urgency=low * toolbar_client_alt.c: do not resize MBCLIENT_TYPE_DESKTOP windows on show/hide * wm.c: cleanup with previous c->flags patch * Fixes: NB#61397 -- Tapani Pälli Tue, 4 Sep 2007 11:36:03 +0300 matchbox-window-manager (2:1.2-osso12) unstable; urgency=low * wm.c: c->flags &= ~CLIENT_IS_MINIMIZED for WINDOW_TYPE_INPUT * Fixes: NB#66177 -- Tapani Pälli Tue, 28 Aug 2007 11:18:18 +0300 matchbox-window-manager (2:1.2-osso11) unstable; urgency=low * main_client.c : check value of atom, not just return value of function -- Tapani Palli Thu, 16 Aug 2007 14:11:53 +0300 matchbox-window-manager (2:1.2-osso10) unstable; urgency=low * wm.c, keys.c : remove un-needed fprintf noise * main_client.c : check for _OMAP_VIDEO_OVERLAY before animation * dialog_client.c : no not add toolbar_client_alt height for dialog mapping size negotations ... * wm.c : always send configurenotify on new clients (maemo bugzilla #1633) * Fixes: NB#64062, NB#62798 -- Tapani Palli Tue, 14 Aug 2007 15:41:33 +0300 matchbox-window-manager (2:1.2-osso9) unstable; urgency=low * client_common.c: send e->time, not CurrentTime in grabtransfer ... -- Tapani Palli Mon, 13 Aug 2007 12:34:46 +0300 matchbox-window-manager (2:1.2-osso8) unstable; urgency=low * use "_MB_NUM_SYSTEM_MODAL_WINDOWS_PRESENT" hint for system modal dialogs + upstream fixes * main_client.c: grabpointer before animation * Fixes: NB#56489 -- Tapani Palli Thu, 19 Jul 2007 11:51:23 +0300 matchbox-window-manager (2:1.2-osso7) unstable; urgency=low * main_client.c: attempt to determine position for close animation dst dynamically since desktop layout (panels) may change -- Tapani Palli Tue, 19 Jun 2007 14:18:57 +0300 matchbox-window-manager (2:1.2-osso6) unstable; urgency=low * structs.h, ewmh.c: add new atom _NET_WM_ICON_GEOMETRY + query func * main_client.c: use ICON_GEOMETRY values for animation if such found, otherwise use values specified in theme * Fixes: NB#55865 -- Tapani Palli Tue, 19 Jun 2007 12:19:53 +0300 matchbox-window-manager (2:1.2-osso5) unstable; urgency=low * wm.c: resize and move dialog correctly when IM resizes (bug #369 in o-hand bugzilla) -- Tapani Palli Fri, 15 Jun 2007 13:02:38 +0300 matchbox-window-manager (2:1.2-osso4) unstable; urgency=low * structs.h, mbtheme.c : read frame-animation properties from theme * configure.ac : put frame-animation behind configure switch * main_client.c : use animations from wm->config * structs.h, ewmh.c, toolbar_client_alt.c : implement _NET_INPUT_AREAS (bug #333 in o-hand bugzilla) * client_common.c : pass time and button in _MB_GRAB_TRANSFER message, (bug #1465 in maemo bugzilla) -- Tapani Palli Thu, 10 May 2007 13:21:03 +0300 matchbox-window-manager (2:1.2-osso3) unstable; urgency=low * debian/rules : run autogen.sh before build -- Tapani Palli Thu, 26 Apr 2007 14:06:57 +0300 matchbox-window-manager (2:1.2-osso2) unstable; urgency=low * src/ewmh.c : n_modals_present -> n_modal_blocker_wins * Fixes: NB#54921 -- Tapani Palli Wed, 25 Apr 2007 15:58:17 +0300 matchbox-window-manager (2:1.2-osso1) unstable; urgency=low * wm.c : inheritance of aboveness * Fixes: NB#53539, NB#53355 * main_client.c : window frame animation * Implemented: NR#167772, NR#167597, NR#167225 -- Tapani Palli Tue, 24 Apr 2007 09:44:12 +0300 matchbox-window-manager (2:1.1-osso18) unstable; urgency=low * support for more specific menu hints DROPDOWN and POPUP (used by gtk) * sync with upstream changes * fixes maemo.org bugzilla bug #1141 -- Tapani Palli Mon, 19 Mar 2007 15:28:13 +0200 matchbox-window-manager (2:1.1-osso17) unstable; urgency=low * configure.ac : check for xfixes 4.0 -- Tapani Palli Tue, 6 Mar 2007 08:32:06 +0200 matchbox-window-manager (2:1.1-osso16) unstable; urgency=low * debian package changes -- Tapani Palli Thu, 25 Jan 2007 10:58:18 +0200 matchbox-window-manager (2:1.1-osso15) unstable; urgency=low * IM resize fix * Fixes: NB#49087 -- Tapani Palli Fri, 19 Jan 2007 14:23:14 +0200 matchbox-window-manager (2:1.1-osso14) unstable; urgency=low * release button grab, additional focus movement restrictions/rules * Fixes: NB#30183, NB#34446, NB#45473, NB#49379 -- Tapani Palli Fri, 15 Dec 2006 09:17:43 +0200 matchbox-window-manager (2:1.1-osso13) unstable; urgency=low * added libgconf2-dev dependecy for gconf related aclocal macros -- Tapani Palli Thu, 9 Nov 2006 12:51:14 +0200 matchbox-window-manager (2:1.1-osso12) unstable; urgency=low * rolled back the patch, reopens NB#40684 -- Tapani Palli Fri, 27 Oct 2006 14:45:15 +0300 matchbox-window-manager (2:1.1-osso11) unstable; urgency=low * applied patch for window grouping and dialogs considering stacking * Fixes: NB#40684 -- Tapani Palli Tue, 24 Oct 2006 14:31:15 +0300 matchbox-window-manager (2:1.1-osso10) unstable; urgency=low * rollback 'Set modal indicator desktop hint for all modal dialogs' change * applied patch for wm.c:wm_handle_button_event * Fixes: NB#43743 -- Tapani Palli Tue, 24 Oct 2006 14:17:31 +0300 matchbox-window-manager (2:1.1-osso9) unstable; urgency=low * merge a change to 'modal indicator desktop hint' from upstream, helps with NB#37594 ... -- Tapani Palli Wed, 11 Oct 2006 16:02:27 +0300 matchbox-window-manager (2:1.1-osso8) unstable; urgency=low * reverted part of patch to NB#35001 (dialog_client.c:dialog_get_available_area) * Fixes: NB#42203, NB#42576 -- Tapani Palli Wed, 11 Oct 2006 10:07:50 +0300 matchbox-window-manager (2:1.1-osso7) unstable; urgency=low * Fixes: NB#40724 -- Tapani Palli Thu, 5 Oct 2006 10:03:43 +0300 matchbox-window-manager (2:1.1-osso6) unstable; urgency=low * Fixes: NB#40455, NB#40723 -- Tapani Palli Tue, 3 Oct 2006 11:31:40 +0300 matchbox-window-manager (2:1.1-osso5) unstable; urgency=low * added debug symbol package, reversing partly one patch for positioning windows, (see http://svn.o-hand.com/view/matchbox?rev=1405&view=rev) * Fixes : NB#40261, NB#35001 -- Tapani Palli Fri, 15 Sep 2006 12:48:24 +0300 matchbox-window-manager (2:1.1-osso4) unstable; urgency=low * Fixes: NB#35508, NB#38782 -- Tapani Palli Fri, 8 Sep 2006 15:16:35 +0300 matchbox-window-manager (2:1.1-osso3) unstable; urgency=low * Dont let panels changing size on fullscreen windows, fixes NB#37200 -- Tapani Palli Fri, 25 Aug 2006 10:50:22 +0300 matchbox-window-manager (2:1.1-osso2) unstable; urgency=low * Grouped dialog stacking fixes, fixes NB#36977, * use Pango instead of Xft, fixes NB#38416 -- Tapani Palli Wed, 23 Aug 2006 16:04:24 +0300 matchbox-window-manager (2:1.1-osso1) unstable; urgency=low * patch to keep input-focus on system modal dialog (or child of one) if application opened on background, fix to NB#35151. * upstream patches (decorationless application windows), bump version to 1.1 -- Tapani Palli Wed, 9 Aug 2006 14:17:15 +0300 matchbox-window-manager (2:1.0-osso1) unstable; urgency=low * follow debian policy with version numbering -- Tapani Palli Mon, 24 Jul 2006 15:27:06 +0300 matchbox-window-manager (1:1.0.20060619-9) unstable; urgency=low * pumped up PING values, timeout now ~12secs, fix to NB#32916 -- Tapani Palli Mon, 19 Jun 2006 09:41:55 +0300 matchbox-window-manager (1:1.0.20060606-9) unstable; urgency=low * fix to NB#31762 -- Tapani Palli Tue, 6 Jun 2006 16:46:18 +0300 matchbox-window-manager (1:1.0.20060605-9) unstable; urgency=low * configure fix, fixes NB#26863 -- Tapani Palli Mon, 5 Jun 2006 14:53:07 +0300 matchbox-window-manager (1:1.0.20060523-8) unstable; urgency=low * fix to NB#30343 (gray corners when resize of shaped dialog) -- Tapani Palli Tue, 23 May 2006 15:26:06 +0300 matchbox-window-manager (1:1.0.20060517-8) unstable; urgency=low * fix to NB#29965 (resize dialog fix) -- Tapani Palli Wed, 17 May 2006 15:38:32 +0300 matchbox-window-manager (1:1.0.20060512-8) unstable; urgency=low * apply Default theme as a fallback, NB#26863 -- Tapani Palli Fri, 12 May 2006 13:28:36 +0300 matchbox-window-manager (1:1.0.20060511-7) unstable; urgency=low * patch to fix NB#28840, changes ping feature behaviour -- Tapani Palli Thu, 11 May 2006 13:48:34 +0300 matchbox-window-manager (1:1.0.20060508-7) unstable; urgency=low * return original size for dialogs resized by IM + fix to N#25281 -- Tapani Palli Mon, 8 May 2006 10:58:18 +0300 matchbox-window-manager (1:1.0.20060426-7) unstable; urgency=low * fix to window gravity support, N#2766 -- Tapani Palli Wed, 26 Apr 2006 11:12:34 +0300 matchbox-window-manager (1:1.0.20060424-7) unstable; urgency=low * patching away window numbering, bug N#25430 -- Tapani Palli Mon, 24 Apr 2006 10:38:32 +0300 matchbox-window-manager (1:1.0.20060411-7) unstable; urgency=low * window gravity support -- Tapani Palli Wed, 22 Mar 2006 11:11:41 +0200 matchbox-window-manager (1:1.0.20060315-7) unstable; urgency=low * patched away bug #24219 -- Tapani Palli Wed, 15 Mar 2006 14:26:41 +0200 matchbox-window-manager (1:1.0.20060313-7) unstable; urgency=low * upgrade to mbox 1.0, fixes bug #24003 -- Tapani Palli Mon, 13 Mar 2006 14:09:40 +0200 matchbox-window-manager (1:0.9.6.20060302-7) unstable; urgency=low * delivering upstream fix to window grouping, bug #11666 -- Tapani Palli Thu, 2 Mar 2006 10:47:08 +0200 matchbox-window-manager (1:0.9.6.20060222-7) unstable; urgency=low * delivering extended _NET_PING handling feature -- Tapani Palli Wed, 22 Feb 2006 11:01:48 +0200 matchbox-window-manager (1:0.9.6.20060220-7) unstable; urgency=low * Extended theming for titlebarless dialogs + additional bugfix to memory bug #20437 -- Tapani Palli Tue, 21 Mar 2006 02:33:55 +0200 matchbox-window-manager (1:0.9.6.20060131-7) unstable; urgency=low * patched away part of window grouping support, fixes bug #22523. waiting for better patch for grouping later on. -- Tapani Palli Tue, 31 Jan 2006 15:00:07 +0200 matchbox-window-manager (1:0.9.6.20060120-7) unstable; urgency=low * upstream sync for, basic window grouping support -- Tapani Palli Fri, 20 Jan 2006 13:22:40 +0200 matchbox-window-manager (1:0.9.6.20060118-7) unstable; urgency=low * fix for #20437 (memory bug in theme switching) -- Tapani Palli Wed, 18 Jan 2006 10:58:05 +0200 matchbox-window-manager (1:0.9.6.20051216-7) unstable; urgency=low * enabled ping protocol support, adjusted pending pings to 5 (frequency still 2), better workaround for #18557 -- Tapani Palli Fri, 16 Dec 2005 12:45:15 +0200 matchbox-window-manager (1:0.9.6.20051213-6) unstable; urgency=low * Updated latest fixes from o-hand svn (fixes #21933), disabled ping protocol support in build (workaround for #18557) -- Tapani Palli Tue, 13 Dec 2005 09:59:14 +0200 matchbox-window-manager (1:0.9.6.20051128-6) unstable; urgency=low * fix for N#21659 from o-hand -- Tapani Palli Mon, 28 Nov 2005 16:09:37 +0200 matchbox-window-manager (1:0.9.6.20051125-6) unstable; urgency=low * fix for N#20758, N#18717 from o-hand -- Tapani Palli Fri, 25 Nov 2005 16:18:34 +0200 matchbox-window-manager (1:0.9.6.20051115-6) unstable; urgency=low * fix for N#21264 from o-hand -- Tapani Palli Tue, 15 Nov 2005 16:31:34 +0200 matchbox-window-manager (1:0.9.6.20051101-6) unstable; urgency=low * updated fixes from o-hand svn, fixes #20283, #20422, #20937, #20532 -- Tapani Palli Tue, 1 Nov 2005 16:44:37 +0200 matchbox-window-manager (1:0.9.6.20051018-5) unstable; urgency=low * Updated fix for #20283 from o-hand svn. -- Tapani Palli Mon, 17 Oct 2005 16:21:00 +0300 matchbox-window-manager (1:0.9.6.20050929-5) unstable; urgency=low * Updated latest fixes from o-hand svn. (fixes wm-part of bug #18558) -- Tapani Palli Thu, 29 Sep 2005 16:07:37 +0300 matchbox-window-manager (1:0.9.5.20050809-5) unstable; urgency=low * Added custom button enable/disable fix from o-hand svn. -- Tapani Palli Tue, 20 Sep 2005 13:08:00 +0300 matchbox-window-manager (1:0.9.5.20050809-4) unstable; urgency=low * Remove circular dependency -- Alexander Kanevskiy Mon, 12 Sep 2005 13:05:26 +0300 matchbox-window-manager (1:0.9.5.20050809-3) unstable; urgency=low * Updating latest changes from o-hand svn. -- Tapani Palli Thu, 8 Sep 2005 11:51:37 +0300 matchbox-window-manager (1:0.9.5.20050809-2) unstable; urgency=low * Code cleanup -- Tapani Palli Tue, 6 Sep 2005 09:55:35 +0300 matchbox-window-manager (1:0.9.5.20050809-1) unstable; urgency=low * Packaged a new snapshot from the Matchbox SVN repository * Fixes the positioning of withdrawn windows so that they are no longer moved to 0,0 -- Tapani Palli Tue, 9 Aug 2005 13:21:08 +0300 matchbox-window-manager (1:0.9.5-1.20050621.1) unstable; urgency=low * Minor build fixes, removed SVN repository remains -- Tapani Palli Tue, 21 Jun 2005 13:54:11 +0300 matchbox-window-manager (1:0.9.5-1.20050621) unstable; urgency=low * Another packaged SVN snapshot containing various fixes * Fixes #14553 (Destroying a HildonNote too quickly causes a BadWindow error) * Fixes #14657 (Stripping out non-required themes from matchbox package) -- Tapani Palli Tue, 21 Jun 2005 11:40:06 +0300 matchbox-window-manager (1:0.9.5-1.20050615) unstable; urgency=low * A packaged SVN snapshot containing various fixes * Removed various patches as they should now be present in the Matchbox source itself * Fixed #11656 (Withdrawn windows staying around) -- Tapani Palli Fri, 17 Jun 2005 09:28:46 +0300 matchbox-window-manager (1:0.9.4-1osso3) unstable; urgency=low * Applied attachment #3648 from bug #13276. -- Tapani Palli Mon, 6 Jun 2005 14:27:09 +0300 matchbox-window-manager (1:0.9.4-1osso2) unstable; urgency=low * control: Addition of libxrender-dev dependency as a build workaround at least until a real culprit is fixed. No code changes. -- Tapani Palli Thu, 12 May 2005 10:48:13 +0300 matchbox-window-manager (1:0.9.4-1osso1) unstable; urgency=low * Applied _NET_ACTIVE_WINDOW behavior patch from Matthew Allum * Focus behavior change patch from Matthew Allum was applied. -- Tapani Palli Tue, 10 May 2005 12:03:25 +0300 matchbox-window-manager (1:0.9.4-1) unstable; urgency=low * New upstream version has been packaged. * Now XFT compile option is set instead of Pango -- Tapani Palli Wed, 13 Apr 2005 11:23:27 +0300 matchbox-window-manager (1:0.9.3-2.20050301) unstable; urgency=low * Another packaged snapshot, fixes at least #6420 (Toolbars with fullscreen doesn't work together with input window) * Also bound the alt shift s to osso-screenshot-tool, as suggested in bug #6478. -- Tapani Palli Thu, 3 Mar 2005 15:12:04 +0200 matchbox-window-manager (1:0.9.3-2) unstable; urgency=low * Rebuilt with some additional compile options -- Tapani Palli Thu, 17 Feb 2005 12:33:50 +0200 matchbox-window-manager (1:0.9.3-1) unstable; urgency=low * New upstream version -- Moray Allan Thu, 10 Feb 2005 16:20:35 +0200 matchbox-window-manager (0.9-2) unstable; urgency=low * Update watch file. * Tighten libmatchbox-dev build-depends. -- Moray Allan Mon, 10 Jan 2005 02:24:47 +0000 matchbox-window-manager (0.9-1) unstable; urgency=medium * New upstream release. -- Moray Allan Fri, 7 Jan 2005 16:56:11 +0000 matchbox-window-manager (0.8.4-1) unstable; urgency=low * New upstream release -- Moray Allan Sat, 27 Nov 2004 19:15:45 +0000 matchbox-window-manager (0.8.2-1) unstable; urgency=low * Split out from monolithic matchbox package. * New upstream release. Closes: #221365, #234223. * New maintainer for Matchbox packages. -- Moray Allan Fri, 16 Jul 2004 02:14:53 +0100 matchbox-window-manager-1.2/debian/matchbox-window-manager.install0000664000211500234210000000011411307441354024273 0ustar bifh1bifhsusr/bin/matchbox-window-manager usr/bin/matchbox-remote usr/share/themes/* matchbox-window-manager-1.2/debian/control0000664000211500234210000000172411307441354017574 0ustar bifh1bifhsSource: matchbox-window-manager Section: embedded Priority: optional Maintainer: Kimmo Hämäläinen Build-Depends: cdbs (>= 0.4.21), debhelper (>= 4.1.0), pkg-config, libmatchbox-dev (>= 1.5-2), libxrender-dev, libxcursor-dev, libgconf2-dev Standards-Version: 3.6.1 Package: matchbox-window-manager Architecture: any Depends: ${shlibs:Depends} Replaces: matchbox (<< 1:0.8.2) Description: window manager for resource-limited systems Matchbox is a base environment for the X Window System running on non-desktop embedded platforms such as handhelds, set-top boxes, kiosks and anything else for which screen space, input mechanisms or system resources are limited. . This package contains the Matchbox window manager. Package: matchbox-window-manager-dbg Architecture: any Depends: matchbox-window-manager (= ${Source-Version}) Description: debug symbols matchbox-window-manager This package contains debug symbols for matchbox-window-manager. matchbox-window-manager-1.2/debian/matchbox-window-manager.10000664000211500234210000000153311307441354022773 0ustar bifh1bifhs.\" matchbox-window-manager.1 .\" Copyright 2004 Moray Allan .TH matchbox-window-manager 1 "Jul 16 2004" "" .SH NAME matchbox-window-manager \- window manager for resource-limited systems .SH SYNOPSIS .B matchbox-window-manager [options] .SH OPTIONS .TP \fB\-display\fR .TP \fB\-theme\fR .TP \fB\-use_titlebar\fR .TP \fB\-use_cursor\fR .TP \fB\-use_lowlight\fR .TP \fB\-use_dialog_mode\fR .HP \fB\-use_desktop_mode\fR .SH DESCRIPTION .B matchbox-window-manager is a window manager for the X Window System running on non-desktop embedded platforms such as handhelds, set-top boxes, kiosks and anything else for which screen space, input mechanisms or system resources are limited. .SH AUTHOR .B matchbox-window-manager was written by Matthew Allum . matchbox-window-manager-1.2/debian/dirs0000664000211500234210000000003611307441354017050 0ustar bifh1bifhsusr/bin usr/share/themes etc