debian/0000755000000000000000000000000011733047260007171 5ustar debian/docs0000644000000000000000000000000711733047260010041 0ustar README debian/upstream.changelog0000644000000000000000000000266311733047260012711 0ustar 2009-12-19 downloaded from http://web.archive.org/web/20080413150757/http://www.chatjunkies.org/fspanel/ ChangeLog version 0.8beta1 * Switched to unified window manager spec. You now need a window manager that supports it. E.g. Sawfish, KWM. * Changed the desktop pager to 1 2 3 etc buttons. * Made it possible to compile with Xft for anti aliased text. * Removed the clock. If you need a clock, use 0.7. * Right-clicking a task makes it shade. version 0.7 * Windows that set their icons after mapping no longer get the generic icon. * A new generic icon (looks better, I think). * Fixed lockup when large amount of windows are open. * Desktop switching arrows look different. * Panel height and width are customizable at the top of fspanel.c. Made the default 24 (previously 22) and font 12. This seems to suite 1024x768 well, change to what suites you. * Now uses the unified window manager spec to find the list of windows. Falls back to gnome spec if unavailable. This might make fspanel work on KDE? Note: this is only partially supported and uses the unified spec only for a client list, everything else still uses the gnome window manager spec. * Optimized more code - i386-linux binary is now 9280 bytes! debian/pod2man.mk0000644000000000000000000000345311733047260011067 0ustar # pod2man.mk -- Makefile portion to convert *.pod files to manual pages # # Copyright information # # Copyright (C) 2008-2010 Jari Aalto # # License # # 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, see . # # Description # # Convert *.pod files to manual pages. Add this to Makefile: # # PACKAGE = package # # man: # make -f pod2man.mk PACKAGE=$(PACKAGE) makeman # # build: man ifneq (,) This makefile requires GNU Make. endif # This variable *must* be set when called PACKAGE ?= package # Optional variables to set MANSECT ?= 1 PODCENTER ?= User Commands PODDATE ?= $$(date "+%Y-%m-%d") # Directories MANSRC ?= MANDEST ?= $(MANSRC) MANPOD ?= $(MANSRC)$(PACKAGE).$(MANSECT).pod MANPAGE ?= $(MANDEST)$(PACKAGE).$(MANSECT) POD2MAN ?= pod2man POD2MAN_FLAGS ?= --utf8 makeman: $(MANPAGE) $(MANPAGE): $(MANPOD) # make target - create manual page from a *.pod page podchecker $(MANPOD) LC_ALL= LANG=C $(POD2MAN) $(POD2MAN_FLAGS) \ --center="$(PODCENTER)" \ --date="$(PODDATE)" \ --name="$(PACKAGE)" \ --section="$(MANSECT)" \ $(MANPOD) \ | sed 's,[Pp]erl v[0-9.]\+,$(PACKAGE),' \ > $(MANPAGE) && \ rm -f pod*.tmp # End of of Makefile part debian/clean0000644000000000000000000000001311733047260010170 0ustar debian/*.1 debian/source/0000755000000000000000000000000011733047260010471 5ustar debian/source/format0000644000000000000000000000001411733047260011677 0ustar 3.0 (quilt) debian/fspanel.1.pod0000644000000000000000000000234411733047260011467 0ustar # This is manual page in Perl POD format. Read more at # http://perldoc.perl.org/perlpod.html or run command: # # perldoc perlpod | less # # To check the syntax: # # podchecker *.pod # # Create manual page with command: # # pod2man PAGE.N.pod > PAGE.N =pod =head1 NAME fspanel - a minimalist panel for X =head1 SYNOPSIS fspanel =head1 OPTIONS None. =head1 DESCRIPTION This manual page documents briefly the fspanel command. fspanel is a minimalist panel for X. It works with any Gnome compliant window manager and displays a clock and the programs. It does not providevide menus, program launchers or applets. Click to the far right and left of the panel to make it hide and jump to the top of the screen. Click on the arrows on the left to switch desktops. =head1 ENVIRONMENT None. =head1 FILES None. =head1 SEE ALSO page(1) =head1 AUTHORS Program was written by . This manual page was written by David Starner , the Debian GNU system (but may be used by others). Updated by Jari Aalto . Released under license GNU GPL v2 or (at your option) any later version. For more information about license, visit . =cut debian/install0000644000000000000000000000002011733047260010552 0ustar fspanel usr/bin debian/upstream0000644000000000000000000000003211733047260010747 0ustar debian/upstream.changelog debian/changelog0000644000000000000000000001743411733047260011054 0ustar fspanel (0.7-13) unstable; urgency=low * debian/control - (Build-Depends): Rm dpkg-dev; not needed with debhelper 9. - (Standards-Version): Update to 3.9.3.1. * debian/copyright - Update to format 1.0. * debian/rules - (override_dh_installman): Delete target; not needed. - (override_dh-auto_build): New. - Enable all hardening flags. - Use DEB_*_MAINT_* variables (Closes: #665270). Patch thanks to Simon Ruderich . -- Jari Aalto Fri, 23 Mar 2012 06:21:19 -0400 fspanel (0.7-12) unstable; urgency=low * debian/patches: - (40): New. Fix failure to switch desktops and hidden by other windows (Closes: #660333). Massive patch that also corrects other things thanks to Ulrich Eckhardt . -- Jari Aalto Sun, 19 Feb 2012 11:05:49 -0500 fspanel (0.7-11) unstable; urgency=low * debian/compat - Update to 9 * debian/control - (Build-Depends): update to debhelper 9, dpkg-dev 1.16.1. * debian/copyright - (Format): Update URL. * debian/rules - Use hardened CFLAGS. http://wiki.debian.org/ReleaseGoals/SecurityHardeningBuildFlags -- Jari Aalto Sat, 11 Feb 2012 17:50:27 -0500 fspanel (0.7-10) unstable; urgency=low * debian/copyright - Update to DEP 5 layout. * debian/compat - Update to 8. * debian/control (Build-Depends): debhelper 8. (Standards-Version): Update to 3.9.2. * debian/install - New file. * debian/manpages - Renamed from fspanel.manpages. * debian/menu - (section): Update from Apps/Tools to Applications/System/Administration. * debian/rules - Rewrite to use dh(1) layout. * debian/patches - (30): Update makefile to place libs in the proper place. (Closes: #641494). Update thanks to Ubuntu Daniel T Chen (FTBFS; LP: #770750). -- Jari Aalto Wed, 14 Sep 2011 09:39:24 +0300 fspanel (0.7-9) unstable; urgency=low * Move to format: 3.0 (quilt). * debian/clean - Move content from debian/rules for dh(1). * debian/control - (Depends): Remove dpatch. - (Standards-Version): update to 3.8.4. * debian/copyright - Add archive.org URL * debian/debian-vars.mk - Update. * debian/fspanel.{install,manpages} - Move content from debian/rules for dh(1). * debian/fspanel.1.pod - Add copyright. * debian/patches - Convert to quilt. * debian/README.source" - Delete, obsoleted by format 3.0. * debian/rules - Remove dpatch. - Remove rules obsoleted by dh(1). * debian/source/format - New file. * upstream - New file. -- Jari Aalto Sun, 14 Feb 2010 02:17:47 +0200 fspanel (0.7-8) unstable; urgency=low * GENERAL INFORMATION - Package was moved fully to dpatch. * debian/control: - (Build-Depends): Add dpatch. Change obsolete x-dev to x11proto-core-dev (Closes: #515523). Update debhelper to 7. - (Description): Correct GNOME spelling. - (Standards-Version): update to 3.8.3. - (Vcs-*): New fields to document Alioth repository. * debian/compat: - Update to 7. * debian/copyright: - Change to Freshmeat URL and correct upstream email. - spell out GPL-2 (lintian). * debian/debian-vars.mk - Rewrite file. * debian/fspanel.1.pod - New. Manual page in POD format. * debian/patches: - 10-xgetgeometry-fix.dpatch: New. Fix XGetGeometry() call's third parameter which is supposed to be a pointer to a 'Window' and not to a 'Pixmap'. Thanks to Ulrich Eckhardt (Closes: #489010). - 20-fspanel-gc-patch.dpatch: New. Extracted from monolithic Debian patch. - 30-makefile.dpatch: New. Extracted from monolithic Debian patch. * debian/rules: - Add dpatch. - (clean): use dh_prep (lintian). * debian/watch: - Add missing newline. -- Jari Aalto Wed, 02 Dec 2009 10:19:29 +0000 fspanel (0.7-7) unstable; urgency=low * New maintainer. (O/ITA; Closes: #352430). * Makefile: changed 'cp' to 'install'. * debian/rules: Old rule file removed and used new dh_make template. * debian/dirs: Unneeded, removed (See Makefile changes). * debian/copyright: Updated to use latest template (added years) * debian/compat: raised to 5. * debian/watch: New file. * debian/control: (Maintainer:) Updated. (Build-Depends:) Added debhelper (>= 5). (Depends:) Added ${misc:Depends} (Description:) Added Homepage URL. -- Jari Aalto Mon, 13 Feb 2006 00:54:05 +0200 fspanel (0.7-6) unstable; urgency=low * Bah. I'd hoped to keep the same version in etch as in sarge. * Update build-deps to reflect the xlibs bitrot (closes: #346684) * May as well update to policy 3.6.2, since there's no changes needed * Squish a few compiler warnings while we're here, no substantive changes * ...and a couple of lintian ones * And translate the manpage into English -- Andrew Suffield Wed, 18 Jan 2006 18:42:05 +0000 fspanel (0.7-5) unstable; urgency=low * Adopted * Edit description a little * Migrate to debhelper 4 * Update to policy 3.6.1, include DEB_BUILD_OPTIONS support * Go with -Os rather than -O2; at least on i386, it seems to generate better code in this case. -- Andrew Suffield Tue, 27 Jan 2004 17:40:26 +0000 fspanel (0.7-4) unstable; urgency=low * Adopted fspanel. Closes: #109964 * Fixed description error regarding Sawmill->Sawfish Closes: #120974 -- Brandon L. Griffith Thu, 13 Dec 2001 18:24:00 -0500 fspanel (0.7-3) unstable; urgency=low * Fix minor spelling bug in the description * No, I'm not maintaining this. -- David Starner Fri, 23 Nov 2001 16:26:00 -0600 fspanel (0.7-2) unstable; urgency=low * Um . . . set the Maintainer to Debian-QA. * This release and the last were both done by me * At least it got fixed before the last version got into the archives -- David Starner Fri, 24 Aug 2001 21:00:00 -0500 fspanel (0.7-1) unstable; urgency=low * New upstream version partially supports the Unified Window Manager Specification improves icon support * Fspanel is orphaned with this release -- Debian QA Groups Fri, 24 Aug 2001 15:11:03 -0500 fspanel (0.6-3) unstable; urgency=low * Make it build on Alpha (it's be nice if you could use the BTS, guys.) -- David Starner Fri, 6 Jul 2001 16:56:03 -0500 fspanel (0.6-2) unstable; urgency=low * Recompile with a version of xlibs in the archive -- David Starner Sun, 29 Apr 2001 15:29:33 -0600 fspanel (0.6-1) unstable; urgency=low * New upstream version Faster clock updates. -- David Starner Sat, 28 Apr 2001 15:29:33 -0600 fspanel (0.5-1) unstable; urgency=low * New upstream version Fix refresh for XFree86 4. (upstream fix for 79862) Fix switching desktops (works in Sawfish now too). Make windows focus when raising. (Closes: #83965) -- David Starner Wed, 31 Jan 2001 18:30:01 -0600 fspanel (0.4-3) unstable; urgency=low * Corrected problems with X4. (Closes: #79862) -- David Starner Sat, 27 Jan 2001 21:48:18 -0600 fspanel (0.4-2) unstable; urgency=low * Corrected spelling in long description (tinny -> tiny) (Closes: #80919) * It should now compile on all architectures (Closes: #81696, #81194) -- David Starner Sun, 14 Jan 2001 01:50:11 -0600 fspanel (0.4-1) unstable; urgency=low * Initial Release (Closes: #79554) -- David Starner Wed, 13 Dec 2000 16:47:55 -0600 debian/copyright0000644000000000000000000000461111733047260011126 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0 X-Format: http://dep.debian.net/deps/dep5 Upstream-Name: fspanel Upstream-Contact: Peter Zelezny , Source: http://freshmeat.net/projects/fspanel X-Comment: Dead upstream. Homepage last seen 2008 at http://web.archive.org/web/20080413150757/http://www.chatjunkies.org/fspanel/ Files: * Copyright: 2000-2001 Peter Zelezny , License: BSD Files: debian/* Copyright: 2006-2012 Jari Aalto 2000 David Starner License: GPL-2+ License: BSD Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Soft- ware"), 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 condi- tions: . 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 MERCHANTABIL- ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. License: GPL-2+ 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; either version 2 of the License, or (at your option) any later version. . 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 program. If not, see . . On Debian systems, the complete text of the GNU General Public License can be found in "/usr/share/common-licenses/GPL-2". debian/debian-vars.mk0000644000000000000000000000476411733047260011730 0ustar #!/usr/bin/make -f # # debian-vars.mk -- Common variables # # Copyright # # Copyright (C) 2005-2010 Jari Aalto # # License # # 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, see . # # Description # # This is GNU makefile part that defines common variables and # macros to be used from debian/rules. To install, add following # to the beginning of debian/rules: # # PACKAGE = foo # include debian/debian-vars.mk ifneq (,) This makefile requires GNU Make. endif PACKAGE ?= foo PIXPACKAGE ?= $(PACKAGE) ICONPACKAGE ?= $(PACKAGE) TOPDIR := $(shell pwd) PKGDIR = $(shell pwd)/debian/$(PACKAGE) SHAREROOTDIR = $(PKGDIR)/usr/share SHAREDIR = $(SHAREROOTDIR)/$(PACKAGE) DOCROOTDIR = $(SHAREROOTDIR)/doc PKGDOCDIR = $(DOCROOTDIR)/$(PACKAGE) SITELISPDIR = $(SHAREROOTDIR)/emacs/site-lisp PKGLISPDIR = $(SITELISPDIR)/$(PACKAGE) DESKTOPDIR = $(SHAREROOTDIR)/applications XSESSIONDIR = $(SHAREROOTDIR)/xsessions LOCALEDIR = $(SHAREROOTDIR)/locale INFODIR = $(SHAREROOTDIR)/info PIXDIR = $(SHAREROOTDIR)/pixmaps PKGPIXDIR = $(PIXDIR)/$(PIXPACKAGE) ICONDIR = $(SHAREROOTDIR)/icons PKGICONDIR = $(ICONDIR)/$(ICONPACKAGE) MANROOTDIR = $(SHAREROOTDIR)/man MAN1DIR = $(MANROOTDIR)/man1 MAN5DIR = $(MANROOTDIR)/man5 MAN7DIR = $(MANROOTDIR)/man7 MAN8DIR = $(MANROOTDIR)/man8 LIBROOTDIR = $(PKGDIR)/usr/lib LIBDIR = $(LIBROOTDIR)/$(PACKAGE) LIBPERLDIR = $(LIBROOTDIR)/perl BINDIR = $(PKGDIR)/usr/bin ETCDIR = $(PKGDIR)/etc PKGETCDIR = $(PKGDIR)/etc/$(PACKAGE) SBINDIR = $(PKGDIR)/usr/sbin GAMEBINDIR = $(PKGDIR)/usr/games INSTALL ?= /usr/bin/install INSTALL_DIR = $(INSTALL) -m 755 -d INSTALL_DATA = $(INSTALL) -p -m 644 # The difference is that "BIN" may contain binary strip option INSTALL_SCRIPT = $(INSTALL) -p -m 755 INSTALL_BIN = $(INSTALL) -p -m 755 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) INSTALL_BIN += -s endif # End of Makefile part debian/compat0000644000000000000000000000000211733047260010367 0ustar 9 debian/menu0000644000000000000000000000017111733047260010057 0ustar ?package(fspanel):needs="X11" section="Applications/System/Administration"\ title="fspanel" command="/usr/bin/fspanel" debian/control0000644000000000000000000000130611733047260010574 0ustar Source: fspanel Section: x11 Priority: optional Maintainer: Jari Aalto Build-Depends: debhelper (>= 9), libx11-dev, libxpm-dev, x11proto-core-dev Standards-Version: 3.9.3.1 Vcs-Browser: http://git.debian.org Vcs-Git: git://git.debian.org/git/collab-maint/fspanel.git Homepage: http://freshmeat.net/projects/fspanel Package: fspanel Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: minimalist panel for X A panel for X that lists all your windows, while consuming minimal disk, memory, and screen space. It works under any GNOME compliant window manager (e.g. E, Sawfish, WindowMaker, IceWM, Oroborus) and supports KDE's mini icons (the KWM_WIN_ICON atom). debian/rules0000755000000000000000000000067211733047260010256 0ustar #!/usr/bin/make -f PACKAGE = fspanel export DEB_BUILD_MAINT_OPTIONS = hardening=+all export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed man: $(MAKE) -C debian -f pod2man.mk PACKAGE=$(PACKAGE) makeman override_dh_auto_install: man # Do nothing. See files debian/{install,manpages} override_dh_auto_build: $(MAKE) EXTRA_CFLAGS="$(CFLAGS) $(CPPFLAGS) $(LDFLAGS)" %: dh $@ # End of file debian/watch0000644000000000000000000000022411733047260010220 0ustar version=3 # Like http://www.chatjunkies.org/fspanel/fspanel-0.8beta1.tar.gz http://www.chatjunkies.org/fspanel/ .*fspanel-([\d.]+[a-z\d.]*).tar.gz debian/manpages0000644000000000000000000000001311733047260010701 0ustar debian/*.1 debian/patches/0000755000000000000000000000000011733047260010620 5ustar debian/patches/30-makefile.patch0000644000000000000000000000252111733047260013636 0ustar From a5d4d64b76c4e6992ac9ed52b154aa9a69406e1c Mon Sep 17 00:00:00 2001 From: Jari Aalto Date: Tue, 9 Dec 2008 15:06:58 +0200 Subject: [PATCH] Makefile: Adjust compile and install Signed-off-by: Jari Aalto --- Makefile | 15 +++++++++------ 1 files changed, 9 insertions(+), 6 deletions(-) Index: fspanel-0.7/Makefile =================================================================== --- fspanel-0.7.orig/Makefile 2011-09-13 17:43:22.000000000 -0400 +++ fspanel-0.7/Makefile 2011-09-13 17:44:57.000000000 -0400 @@ -1,14 +1,17 @@ CC = gcc -C_FLAGS = -DNOSTDLIB -DHAVE_XPM -Wall -I/usr/X11R6/include -m386 -malign-loops=2 -malign-jumps=2 -malign-functions=2 -L_FLAGS = -nostdlib -O1 -Xlinker -s -L/usr/X11R6/lib -lX11 -lXpm +C_FLAGS = -DHAVE_XPM -Wall -I/usr/X11R6/include +L_FLAGS = -L/usr/X11R6/lib -lX11 -lXpm +EXTRA_CFLAGS = -g -Os PROGNAME = fspanel $(PROGNAME): Makefile fspanel.c fspanel.h icon.xpm - $(CC) $(C_FLAGS) $(L_FLAGS) fspanel.c -o $(PROGNAME) - @ls -l $(PROGNAME) + $(CC) $(C_FLAGS) $(EXTRA_CFLAGS) fspanel.c -o $(PROGNAME) $(L_FLAGS) -clean: +clean: rm -f core *.o $(PROGNAME) nohup.out install: $(PROGNAME) - cp $(PROGNAME) /usr/local/bin + install -d -m 755 $(DESTDIR)/usr/bin + install -m 755 $(PROGNAME) $(DESTDIR)/usr/bin + install -d -m 755 $(DESTDIR)/usr/share/man/man1 + debian/patches/40-EWMH-compliance.patch0000644000000000000000000002573411733047260014745 0ustar From: Fix failure to switch desktops and hidden by other windows Subject: Ulrich Eckhardt X-Debian-Bug: 660333 Here's a patch against the Debian sources. The modifications go beyond bug #660333, I discovered a few others on the way. Changes: 1. Set WM_CLASS property. See #660461 for a reason why. 2. Fix some indention mistakes and typos. 3. Handle sticky windows (desktop=-1) as visible everywhere 4. EWMH compliance: a) test _NET_SUPPORTED to detect compliant WM b) use _NET_NUMBER_OF_DESKTOPS and _NET_CURRENT_DESKTOP for switching c) use _NET_WM_DESKTOP to locate client windows d) prefer _NET_WM_NAME, fallback to WM_NAME for client name e) use _NET_WM_STATE to position fspanel above all other windows f) use _NET_WM_WINDOW_TYPE to mark fspanel as dektop part g) use _NET_CLIENT_LIST instead of _WIN_CLIENT_LIST BTW: I found out that when clicking on a task in fspanel, the window is not raised to the top. Only if the window was previously minimized/iconified it is restored and raised. This might be a fluxbox quirk or configuration, but if you can reproduce this with any other window managers (..) As a workaround, clicking three times helps, the first focuses, the second minimizes and the third restores and raises the window. --- fspanel-0.7/fspanel.c 2012-02-19 13:32:54.000000000 +0100 +++ fspanel.c 2012-02-19 13:59:12.000000000 +0100 @@ -38,6 +38,14 @@ Display *dd; Window root_win; +/* WM supports EWMH +This flag is set if the window manager supports the EWMH protocol for e.g. +switching workspaces. The fallback if this is not supported is to use the +Gnome variant. This is determined by looking for the presence of the +_NET_SUPPORTED property of the root window. Note that this is only used +for communication with the WM, whether each client supports this protocol +is up to the individual client. */ +int wm_use_ewmh; Pixmap generic_icon; Pixmap generic_mask; GC fore_gc; @@ -72,7 +80,17 @@ char *atom_names[] = { "_WIN_CLIENT_LIST", "_WIN_WORKSPACE_COUNT", "_WIN_STATE", - "WM_STATE" + "WM_STATE", + "_NET_NUMBER_OF_DESKTOPS", + "_NET_CURRENT_DESKTOP", + "_NET_WM_STATE", + "_NET_WM_STATE_ABOVE", + "_NET_SUPPORTED", + "_NET_WM_WINDOW_TYPE", + "_NET_WM_WINDOW_TYPE_DESKTOP", + "_NET_WM_DESKTOP", + "_NET_WM_NAME", + "UTF8_STRING", }; #define ATOM_COUNT (sizeof (atom_names) / sizeof (atom_names[0])) @@ -89,6 +107,16 @@ Atom atoms[ATOM_COUNT]; #define atom__WIN_WORKSPACE_COUNT atoms[7] #define atom__WIN_STATE atoms[8] #define atom_WM_STATE atoms[9] +#define atom__NET_NUMBER_OF_DESKTOPS atoms[10] +#define atom__NET_CURRENT_DESKTOP atoms[11] +#define atom__NET_WM_STATE atoms[12] +#define atom__NET_WM_STATE_ABOVE atoms[13] +#define atom__NET_SUPPORTED atoms[14] +#define atom__NET_WM_WINDOW_TYPE atoms[15] +#define atom__NET_WM_WINDOW_TYPE_DESKTOP atoms[16] +#define atom__NET_WM_DESKTOP atoms[17] +#define atom__NET_WM_NAME atoms[18] +#define atom_UTF8_STRING atoms[19] void * @@ -132,8 +160,8 @@ fill_rect (taskbar *tb, int x, int y, in void scale_icon (task *tk) { - int xx, yy, x, y; - unsigned int w, h, d, bw; + int xx, yy, x, y; + unsigned int w, h, d, bw; Pixmap pix, mk = None; XGCValues gcv; GC mgc = None; @@ -223,13 +251,40 @@ get_task_kdeicon (task *tk) } } +/* returns whether the window is visible on the desktop */ int -find_desktop (Window win) +is_visible_on_desktop (Window win, int desk) +{ + int client_desk = -1; + unsigned long *data; + + if (wm_use_ewmh) + data = get_prop_data (win, atom__NET_WM_DESKTOP, XA_CARDINAL, 0); + else + data = get_prop_data (win, atom__WIN_WORKSPACE, XA_CARDINAL, 0); + + if (data) + { + client_desk = *data; + XFree (data); + } + + /* If the client_desk is -1, it is visible on all desktops */ + return (client_desk == -1) || (client_desk == desk); +} + +/* index of the currently displayed desktop */ +int +get_current_desktop () { int desk = 0; unsigned long *data; - data = get_prop_data (win, atom__WIN_WORKSPACE, XA_CARDINAL, 0); + if (wm_use_ewmh) + data = get_prop_data (root_win, atom__NET_CURRENT_DESKTOP, XA_CARDINAL, 0); + else + data = get_prop_data (root_win, atom__WIN_WORKSPACE, XA_CARDINAL, 0); + if (data) { desk = *data; @@ -271,19 +326,36 @@ is_iconified (Window win) return ret; } +/* window name +The returned pointer must be freed using XFree() after use. + +TODO: The encoding for WM_NAME can be STRING or COMPOUND_TEXT. In any case +this encoding should be normalized before returning from this function. */ +char* +get_window_name (Window win) +{ + char* res = NULL; + /* try EWMH's _NET_WM_NAME first */ + res = get_prop_data (win, atom__NET_WM_NAME, atom_UTF8_STRING, 0); + if (!res) + /* fallback to WM_NAME */ + res = get_prop_data (win, XA_WM_NAME, XA_STRING, 0); + return res; +} + void add_task (taskbar * tb, Window win, int focus) { task *tk, *list; - /* is this window on a different desktop? */ - if (tb->my_desktop != find_desktop (win) || is_hidden (win)) + /* is this window on a different desktop or hidden? */ + if (!is_visible_on_desktop (win, tb->my_desktop) || is_hidden (win)) return; tk = calloc (1, sizeof (task)); tk->win = win; tk->focused = focus; - tk->name = get_prop_data (win, XA_WM_NAME, XA_STRING, 0); + tk->name = get_window_name (win); tk->iconified = is_iconified (win); get_task_kdeicon (tk); @@ -331,6 +403,7 @@ gui_create_taskbar (void) { taskbar *tb; Window win; + XClassHint wm_class; MWMHints mwm; XSizeHints size_hints; XWMHints wmhints; @@ -353,11 +426,30 @@ gui_create_taskbar (void) /*value mask*/ CWBackPixel | CWEventMask, /* attribs */ &att); - /* don't let any windows cover fspanel */ - set_prop (win, atom__WIN_LAYER, 10); /* WIN_LAYER_ABOVE_DOCK */ + /* set name and class */ + wm_class.res_name = "fspanel"; + wm_class.res_class = "fspanel"; + XSetClassHint (dd, win, &wm_class); - set_prop (win, atom__WIN_STATE, WIN_STATE_STICKY | - WIN_STATE_FIXED_POSITION); + /* don't let any windows cover fspanel */ + if (wm_use_ewmh) + { + XChangeProperty (dd, win, + atom__NET_WM_STATE, XA_ATOM, 32, + PropModeReplace, + (unsigned char *) &atom__NET_WM_STATE_ABOVE, 1); + + XChangeProperty (dd, win, + atom__NET_WM_WINDOW_TYPE, XA_ATOM, 32, + PropModeReplace, + (unsigned char *) &atom__NET_WM_WINDOW_TYPE_DESKTOP, 1); + } + else + { + set_prop (win, atom__WIN_LAYER, 10); /* WIN_LAYER_ABOVE_DOCK */ + set_prop (win, atom__WIN_STATE, + WIN_STATE_STICKY | WIN_STATE_FIXED_POSITION); + } set_prop (win, atom__WIN_HINTS, WIN_HINTS_SKIP_FOCUS | WIN_HINTS_SKIP_WINLIST | @@ -370,7 +462,7 @@ gui_create_taskbar (void) atom__MOTIF_WM_HINTS, 32, PropModeReplace, (unsigned char *) &mwm, sizeof (MWMHints) / 4); - /* make sure the WM obays our window position */ + /* make sure the WM obeys our window position */ size_hints.flags = PPosition; /*XSetWMNormalHints (dd, win, &size_hints);*/ XChangeProperty (dd, win, XA_WM_NORMAL_HINTS, @@ -461,7 +553,7 @@ gui_draw_task (taskbar * tb, task * tk) gui_draw_vline (tb, x); -/*set_foreground (3); *//* it's already 3 from gui_draw_vline() */ + /*set_foreground (3); *//* it's already 3 from gui_draw_vline() */ draw_line (tb, x + 1, 0, x + taskw, 0); set_foreground (1); @@ -541,7 +633,7 @@ gui_draw_clock (taskbar * tb) gui_draw_vline (tb, x); x += TEXTPAD; -/*set_foreground (3); *//* white *//* it's already 3 from gui_draw_vline() */ + /*set_foreground (3); *//* white *//* it's already 3 from gui_draw_vline() */ draw_line (tb, x + 1, WINHEIGHT - 2, old_x + width - TEXTPAD, WINHEIGHT - 2); draw_line (tb, old_x + width - TEXTPAD, 2, old_x + width - TEXTPAD, @@ -701,7 +793,7 @@ taskbar_read_clientlist (taskbar * tb) int num, i, rev, desk, new_desk = 0; task *list, *next; - desk = find_desktop (root_win); + desk = get_current_desktop (); if (desk != tb->my_desktop) { new_desk = 1; @@ -720,7 +812,7 @@ taskbar_read_clientlist (taskbar * tb) return; } - /* remove windows that arn't in the _WIN_CLIENT_LIST anymore */ + /* remove windows that aren't in the _WIN_CLIENT_LIST anymore */ list = tb->task_list; while (list) { @@ -767,24 +859,31 @@ void switch_desk (taskbar * tb, int rel) { XClientMessageEvent xev; - unsigned long *data; + unsigned long *data, max_desks; int want = tb->my_desktop + rel; if (want < 0) return; - data = get_prop_data (root_win, atom__WIN_WORKSPACE_COUNT, XA_CARDINAL, 0); - if (data) - { - register unsigned long max_desks = *data; - XFree (data); - if (max_desks <= want) - return; - } + if (wm_use_ewmh) + data = get_prop_data (root_win, atom__NET_NUMBER_OF_DESKTOPS, XA_CARDINAL, 0); + else + data = get_prop_data (root_win, atom__WIN_WORKSPACE_COUNT, XA_CARDINAL, 0); + if (!data) + /* number of workspaces not available */ + return; + + max_desks = *data; + XFree (data); + if (max_desks <= want) + return; xev.type = ClientMessage; xev.window = root_win; - xev.message_type = atom__WIN_WORKSPACE; + if (wm_use_ewmh) + xev.message_type = atom__NET_CURRENT_DESKTOP; + else + xev.message_type = atom__WIN_WORKSPACE; xev.format = 32; xev.data.l[0] = want; XSendEvent (dd, root_win, False, SubstructureNotifyMask, (XEvent *) &xev); @@ -902,12 +1001,23 @@ handle_propertynotify (taskbar * tb, Win if (win == root_win) { - if (at == atom__NET_CLIENT_LIST || - at == atom__WIN_CLIENT_LIST || - at == atom__WIN_WORKSPACE) + if (wm_use_ewmh) + { + if (at == atom__NET_CLIENT_LIST || + at == atom__NET_CURRENT_DESKTOP) + { + taskbar_read_clientlist (tb); + gui_draw_taskbar (tb); + } + } + else { - taskbar_read_clientlist (tb); - gui_draw_taskbar (tb); + if (at == atom__WIN_CLIENT_LIST || + at == atom__WIN_WORKSPACE) + { + taskbar_read_clientlist (tb); + gui_draw_taskbar (tb); + } } return; } @@ -916,12 +1026,12 @@ handle_propertynotify (taskbar * tb, Win if (!tk) return; - if (at == XA_WM_NAME) + if (at == XA_WM_NAME || at == atom__NET_WM_NAME) { /* window's title changed */ if (tk->name) XFree (tk->name); - tk->name = get_prop_data (tk->win, XA_WM_NAME, XA_STRING, 0); + tk->name = get_window_name (tk->win); gui_draw_task (tb, tk); } else if (at == atom_WM_STATE) { @@ -961,6 +1071,7 @@ main (int argc, char *argv[]) int xfd; time_t now; struct tm *lt; + void *prop; dd = XOpenDisplay (NULL); if (!dd) @@ -978,6 +1089,17 @@ main (int argc, char *argv[]) XInternAtoms (dd, atom_names, ATOM_COUNT, False, atoms); + /* check if the WM supports EWMH + Note that this is not reliable. When switching to a EWMH-unaware WM, it + will not delete this property. Also, we can't react to changes in this + without a restart. */ + prop = get_prop_data (root_win, atom__NET_SUPPORTED, XA_ATOM, NULL); + if (prop) + { + wm_use_ewmh = 1; + XFree (prop); + } + gui_init (); tb = gui_create_taskbar (); xfd = ConnectionNumber (dd); @@ -1024,5 +1146,5 @@ main (int argc, char *argv[]) /*XCloseDisplay (dd); - return 0;*/ + return 0;*/ } debian/patches/10-XGetGeometry-fix=11-gc.patch0000644000000000000000000000143411733047260016056 0ustar From c35a1682204ab10410df6576ece4b7cd867013bc Mon Sep 17 00:00:00 2001 From: Jari Aalto Date: Sun, 20 Dec 2009 21:39:42 +0200 Subject: [PATCH] fspanel.c: Fix scale_icon() and GC mgc Signed-off-by: Jari Aalto --- fspanel.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/fspanel.c b/fspanel.c index 39708c0..09fde1f 100644 --- a/fspanel.c +++ b/fspanel.c @@ -132,10 +132,11 @@ fill_rect (taskbar *tb, int x, int y, int a, int b) void scale_icon (task *tk) { - int xx, yy, x, y, w, h, d, bw; + int xx, yy, x, y; + unsigned int w, h, d, bw; Pixmap pix, mk = None; XGCValues gcv; - GC mgc; + GC mgc = None; Window unused; XGetGeometry (dd, tk->icon, &unused, &x, &y, &w, &h, &bw, &d); -- 1.6.5 debian/patches/10-XGetGeometry-fix.patch0000644000000000000000000000137011733047260015227 0ustar From 4590aa7fbadb4b8a00ddf5b1a27b13f8caeff141 Mon Sep 17 00:00:00 2001 From: Jari Aalto Date: Tue, 9 Dec 2008 14:37:39 +0200 Subject: [PATCH] fspanel.c: (scale_icon): Fix XGetGeometry call Signed-off-by: Jari Aalto --- fspanel.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/fspanel.c b/fspanel.c index 1eaa5bb..39708c0 100644 --- a/fspanel.c +++ b/fspanel.c @@ -137,7 +137,8 @@ scale_icon (task *tk) XGCValues gcv; GC mgc; - XGetGeometry (dd, tk->icon, &pix, &x, &y, &w, &h, &bw, &d); + Window unused; + XGetGeometry (dd, tk->icon, &unused, &x, &y, &w, &h, &bw, &d); pix = XCreatePixmap (dd, tk->win, ICONWIDTH, ICONHEIGHT, scr_depth); if (tk->mask != None) -- 1.6.5 debian/patches/series0000644000000000000000000000014511733047260012035 0ustar 10-XGetGeometry-fix.patch 10-XGetGeometry-fix=11-gc.patch 30-makefile.patch 40-EWMH-compliance.patch