all repos — tint2 @ c9dc16858750646a77530fc2198a632dcd25d622

fork of the tint2 desktop panel for my custom setup - only minimized windows across all desktops for the taskbar

fixed issue and test svn

git-svn-id: http://tint2.googlecode.com/svn/trunk@14 121b4492-b84c-0410-8b4c-0d4edfb3f3cc
lorthiois@bbsoft.fr lorthiois@bbsoft.fr@121b4492-b84c-0410-8b4c-0d4edfb3f3cc
commit

c9dc16858750646a77530fc2198a632dcd25d622

parent

420dd5d1e21d255cf20df36ecc911c976e628d1c

M AUTHORSAUTHORS

@@ -4,6 +4,10 @@ Pål Staurland <staura@gmail.com>, tint2 is based on ttm originally written by Pål Staurland

Contributors: - Daniel Moerner <dmoerner@gmail.com>, man page - - + Daniel Moerner <dmoerner@gmail.com> : man page and debian package + Doug Barton : freebsd package + James Buren <ryuo@frugalware.org> : Frugalware package + Pierre-Emmanuel Andre <pea@raveland.org> : openbsd port + Redroar : arch package + +
M ChangeLogChangeLog

@@ -1,9 +1,7 @@

- -2008-09-30 -- change tintrc format - background and border can use linear gradiant -- update documentation +2008-10-28 +- fixed issue : "untitled task", "task button did not update", "window don't shade", + "error if I don't do 'make install", "Makefile error" 2008-09-24 - change tintrc format
M READMEREADME

@@ -16,3 +16,4 @@ check http://code.google.com/p/tint2/

for latest release, documentation and sample config file. +
M src/Makefilesrc/Makefile

@@ -7,13 +7,16 @@ ifndef DESTDIR

ifndef PREFIX BINDIR=/usr/bin XDG_CONFIG_DIR=/etc/xdg + MAN_DIR=/usr/share/man else BINDIR=$(PREFIX)/bin XDG_CONFIG_DIR=/etc/xdg + MAN_DIR=/usr/share/man endif else BINDIR=$(DESTDIR)/usr/bin XDG_CONFIG_DIR=$(DESTDIR)/etc/xdg + MAN_DIR=$(DESTDIR)/usr/share/man endif

@@ -24,13 +27,17 @@

install: mkdir -p $(BINDIR) mkdir -p $(XDG_CONFIG_DIR)/tint2 + mkdir -p $(MANDIR) + mkdir -p $(MANDIR)/man1 install $(PROGNAME) $(BINDIR) cp -f ../tintrc06 $(XDG_CONFIG_DIR)/tint2/tint2rc - cp -f ../doc/man/tint2.1 /usr/man/man1 + cp -f ../doc/man/tint2.1 $(MAN_DIR)/man1 uninstall: rm -f $(BINDIR)/$(PROGNAME) + rm -f $(MAN_DIR)/man1/tint2.1 clean: rm -f $(PROGNAME) +.PHONY: clean uninstall install
M src/panel.csrc/panel.c

@@ -36,43 +36,6 @@

draw (&panel.area); refresh (&panel.area); -/* -pour version 0.7 -gestion du systray - positionnement et taille fixe du systray (objet systray) - détection des notifications (détection des icones, ajout a la liste) - ajouter la transparence des icones - gérer le redimentionnement des éléments - => voir si lon peut faire abstraction sur le positionnement des objets ? - sachant que certains objets (task, taskbar) on une taille définit par l'extérieur - et d'autres objets (clock, systray) on une taille définit par l'intérieur - -gestion du layout - voir le positionnement des taskbar, task et systray - définir panel_layout dans la configuration - comment gérer le multi panel avec des layouts différents - -vérifier le niveau d'abstraction du code - utiliser la fonction draw(obj) récurrente sur Taskbar, Task, Systray, Clock - est ce compatible avec l'affichage de la tache active et les changement de taille -> redessine le panel - -correction de bugs : - memory, segfault - background - remettre en place single_desktop avec nouveau layout - remettre en place multi_monitor avec nouveau layout - vérifier le changement de configuration - -pour version 0.8 -gestion du thème - voir la gestion du dégradé sur le bord et le fond (inkscape) - faut-il trois coordonnées de padding x, y, x inter-objects - -gestion du zoom - définir le zoom du panel - -*/ - if (panel.clock.time1_format) { if (panel.clock.area.redraw) panel.refresh = 1;
M src/server.csrc/server.c

@@ -66,6 +66,7 @@ server.atom._NET_SUPPORTING_WM_CHECK = XInternAtom (server.dsp, "_NET_WM_NAME", False);

server.atom._WIN_LAYER = XInternAtom (server.dsp, "_WIN_LAYER", False); server.atom._NET_WM_STRUT_PARTIAL = XInternAtom (server.dsp, "_NET_WM_STRUT_PARTIAL", False); server.atom.WM_NAME = XInternAtom(server.dsp, "WM_NAME", False); + server.atom.__SWM_VROOT = XInternAtom(server.dsp, "__SWM_VROOT", False); }

@@ -133,11 +134,48 @@ else return 0;

} +Pixmap server_create_pixmap (int width, int height) +{ + return XCreatePixmap (server.dsp, server.root_win, width, height, server.depth); +} + + +Pixmap get_root_pixmap () +{ + Pixmap ret; + Window root = RootWindow(server.dsp, server.screen); + + ret = None; + int act_format, c = 2 ; + u_long nitems ; + u_long bytes_after ; + u_char *prop ; + Atom dummy_id; + + do { + if (XGetWindowProperty(server.dsp, root, server.atom._XROOTPMAP_ID, 0, 1, + False, XA_PIXMAP, &dummy_id, &act_format, + &nitems, &bytes_after, &prop) == Success) { + if (prop) { + ret = *((Pixmap *)prop); + XFree(prop); + break; + } + } + } while (--c > 0); + + return ret; +} + + +/* Pixmap get_root_pixmap () { // conky capture correctement le fond d'écran en xlib !! Pixmap root_pixmap; unsigned long *res; + + server.root_win = window_get_root(); res = server_get_property (server.root_win, server.atom._XROOTPMAP_ID, XA_PIXMAP, 0); if (res) {

@@ -149,18 +187,9 @@ else {

printf("get_root_pixmap incorrect\n"); // try _XSETROOT_ID } - return 0; -} - - - - -Pixmap server_create_pixmap (int width, int height) -{ - return XCreatePixmap (server.dsp, server.root_win, width, height, server.depth); -} - +} +*/ void server_refresh_root_pixmap () {
M src/server.hsrc/server.h

@@ -51,6 +51,7 @@ Atom _NET_SUPPORTING_WM_CHECK;

Atom _WIN_LAYER; Atom _NET_WM_STRUT_PARTIAL; Atom WM_NAME; + Atom __SWM_VROOT; } Global_atom;

@@ -97,6 +98,7 @@ void server_catch_error (Display *d, XErrorEvent *ev);

void server_init_atoms (); Pixmap server_create_pixmap (int width, int height); void get_monitors(); +Pixmap get_root_pixmap(); #endif
M src/tint.csrc/tint.c

@@ -75,7 +75,7 @@ exit(0);

} server_init_atoms (); server.screen = DefaultScreen (server.dsp); - server.root_win = RootWindow (server.dsp, server.screen); + server.root_win = RootWindow(server.dsp, server.screen); server.depth = DefaultDepth (server.dsp, server.screen); server.visual = DefaultVisual (server.dsp, server.screen); server.desktop = server_get_current_desktop ();

@@ -407,6 +407,7 @@ XCopyArea (server.dsp, server.pmap, window.main_win, server.gc, 0, 0, panel.area.width, panel.area.height, 0, 0);

break; case PropertyNotify: + //printf("PropertyNotify\n"); event_property_notify (e.xproperty.window, e.xproperty.atom); break;
M src/util/area.hsrc/util/area.h

@@ -1,17 +1,15 @@

/************************************************************************** -* base class for all objects (panel, taskbar, task, systray, clock, ...). -* each object 'inherit' Area and implement draw_foreground if needed. +* Copyright (C) 2008 thierry lorthiois (lorthiois@bbsoft.fr) * -* Area is at the begining of each object so &object == &area. +* base class for all graphical objects (panel, taskbar, task, systray, clock, ...). +* Area is at the begining of each graphical object so &object == &area. * -* une zone comprend : -* - fond : couleur / opacité -* - contenu -* - largeur / hauteur -* - paddingx / paddingy -* - pixmap mémorisant l'affichage (évite de redessiner l'objet à chaque rafraichissement) -* - une liste de sous objets -* +* Area manage the background and border drawing, size and padding. +* Area manage also the tree of visible objects +* panel -> taskbars -> tasks +* -> clock +* -> systray -> icons +* * un objet comprend les actions: * 1) redraw(obj) * force l'indicateur 'redraw' sur l'objet

@@ -34,13 +32,8 @@ * - taille d'une taskbar calculée à partir de la taille du panel et des autres objets

* 6) voir refresh(obj) * * Implémentation : -* - tous les éléments du panel possèdent 1 objet en début de structure -* panel, taskbar, systray, task, ... * - l'objet est en fait une zone (area). * l'imbrication des sous objet doit permettre de gérer le layout. -* - on a une relation 1<->1 entre un objet et une zone graphique -* les taskbar affichent toutes les taches. -* donc on utilise la liste des objets pour gérer la liste des taches. * - les taches ont 2 objets : l'un pour la tache inactive et l'autre pour la tache active * draw(obj) est appellé sur le premier objet automatiquement * et draw_foreground(obj) lance l'affichage du 2 ieme objet

@@ -60,8 +53,6 @@ *

* 3. tester l'implémentation et évaluer les autres abstractions possibles ? * * 4. comment gérer le groupage des taches -* 5. la clock est le contenu du panel. mais elle ne tiens pas compte du padding vertical ? -* c'est ok pour la clock. voir l'impact sur paddingx ? * * voir resize_taskbar(), resize_clock() et resize_tasks() * voir les taches actives et inactives ?? une seule tache est active !
M src/util/window.csrc/util/window.c

@@ -58,7 +58,7 @@

void window_toggle_shade (Window win) { - send_event32 (win, server.atom._NET_WM_STATE, 2, 0); + send_event32 (win, server.atom._NET_WM_STATE, 2, server.atom._NET_WM_STATE_SHADED); }

@@ -259,6 +259,5 @@ cairo_destroy (c);

cairo_surface_destroy (cs); XFreePixmap (server.dsp, pmap); } -
M tintrc03tintrc03

@@ -5,25 +5,29 @@

#--------------------------------------------- # BACKGROUND AND BORDER #--------------------------------------------- -rounded = 1 -border_width = 1 -background_color = #282828 100 -border_color = #000000 100 +rounded = 5 +border_width = 1 +background_color = #ffffff 40 +border_color = #ffffff 70 + +rounded = 4 +border_width = 0 +background_color = #ffffff 0 +border_color = #d1d1d1 0 -rounded = 1 -border_width = 1 -background_color = #282828 100 -#background_color = #3b3b3b 100 -border_color = #cccccc 100 +rounded = 4 +border_width = 0 +background_color = #ffffff 30 +border_color = #d1d1d1 14 #--------------------------------------------- # PANEL #--------------------------------------------- panel_monitor = 1 -panel_position = bottom right -panel_size = 0 27 -panel_margin = 0 0 -panel_padding = 3 2 +panel_position = bottom center +panel_size = 1000 25 +panel_margin = 0 7 +panel_padding = 6 0 font_shadow = 0 panel_background_id = 1

@@ -31,7 +35,7 @@ #---------------------------------------------

# TASKBAR #--------------------------------------------- taskbar_mode = multi_desktop -taskbar_padding = 4 0 +taskbar_padding = 2 3 taskbar_background_id = 0 #---------------------------------------------

@@ -39,14 +43,14 @@ # TASKS

#--------------------------------------------- task_icon = 1 task_text = 1 -task_width = 200 +task_width = 150 task_centered = 1 -task_padding = 1 3 -task_font = sans 8 -task_font_color = #ffffff 40 -task_active_font_color = #ffffff 100 -task_background_id = 0 -task_active_background_id = 2 +task_padding = 3 2 +task_font = myriad pro 8 +task_font_color = #000000 70 +task_active_font_color = #000000 100 +task_background_id = 2 +task_active_background_id = 3 #--------------------------------------------- # SYSTRAY

@@ -57,12 +61,12 @@

#--------------------------------------------- # CLOCK #--------------------------------------------- -time1_format = %H:%M:%S -time1_font = sans 7 -time2_format = %A %d %B -time2_font = sans 7 -clock_font_color = #ffffff 100 -clock_padding = 0 0 +time1_format = %H:%M +time1_font = sans bold 12 +#time2_format = %A %d %B +#time2_font = sans bold 10 +clock_font_color = #000000 70 +clock_padding = 6 0 clock_background_id = 0 #---------------------------------------------
M tintrc04tintrc04

@@ -5,52 +5,47 @@

#--------------------------------------------- # BACKGROUND AND BORDER #--------------------------------------------- -rounded = 5 +rounded = 3 border_width = 1 -background_color = #ffffff 40 -border_color = #ffffff 70 +background_color = #3c3020 90 +border_color = #3c3020 90 -rounded = 4 -border_width = 0 -background_color = #ffffff 0 -border_color = #d1d1d1 0 - -rounded = 4 -border_width = 0 -background_color = #ffffff 30 -border_color = #d1d1d1 14 +rounded = 3 +border_width = 1 +background_color = #3c3020 90 +border_color = #ffffff 30 #--------------------------------------------- # PANEL #--------------------------------------------- panel_monitor = 1 panel_position = bottom center -panel_size = 1000 25 +panel_size = 900 30 panel_margin = 0 0 -panel_padding = 6 0 +panel_padding = 10 2 font_shadow = 0 -panel_background_id = 1 +panel_background_id = 0 #--------------------------------------------- # TASKBAR #--------------------------------------------- -taskbar_mode = multi_desktop -taskbar_padding = 2 3 +taskbar_mode = single_desktop +taskbar_padding = 9 0 taskbar_background_id = 0 #--------------------------------------------- # TASKS #--------------------------------------------- -task_icon = 1 +task_icon = 0 task_text = 1 -task_width = 150 +task_width = 190 task_centered = 1 -task_padding = 3 2 -task_font = myriad pro 8 -task_font_color = #000000 70 -task_active_font_color = #000000 100 -task_background_id = 2 -task_active_background_id = 3 +task_padding = 2 0 +task_font = sans 8.4 +task_font_color = #ececec 50 +task_active_font_color = #ffffff 90 +task_background_id = 1 +task_active_background_id = 2 #--------------------------------------------- # SYSTRAY

@@ -62,12 +57,12 @@ #---------------------------------------------

# CLOCK #--------------------------------------------- time1_format = %H:%M -time1_font = sans bold 12 -#time2_format = %A %d %B -#time2_font = sans bold 10 -clock_font_color = #000000 70 -clock_padding = 6 0 -clock_background_id = 0 +time1_font = sans bold 8 +time2_format = %A %d %B +time2_font = sans 7 +clock_font_color = #ececec 50 +clock_padding = 4 0 +clock_background_id = 1 #--------------------------------------------- # MOUSE ACTION ON TASK