From: Thierry Lorthiois Date: Thu, 30 Oct 2008 15:39:24 +0000 (+0000) Subject: fixed issue and test svn X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Ftint2;a=commitdiff_plain;h=4612bf6efcd6337a0507e430194235d997a5c115 fixed issue and test svn --- diff --git a/AUTHORS b/AUTHORS index 2a12de2..23d6bf1 100644 --- a/AUTHORS +++ b/AUTHORS @@ -4,6 +4,10 @@ Developed by: Contributors: - Daniel Moerner , man page - - + Daniel Moerner : man page and debian package + Doug Barton : freebsd package + James Buren : Frugalware package + Pierre-Emmanuel Andre : openbsd port + Redroar : arch package + + diff --git a/ChangeLog b/ChangeLog index ffde567..4004d80 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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 diff --git a/README b/README index a250d34..018c197 100644 --- a/README +++ b/README @@ -16,3 +16,4 @@ check http://code.google.com/p/tint2/ for latest release, documentation and sample config file. + diff --git a/src/Makefile b/src/Makefile index 3eecbbb..4da3f66 100644 --- a/src/Makefile +++ b/src/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 @@ $(PROGNAME): $(FILES) $(SYSTRAYOBJ) 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 diff --git a/src/panel.c b/src/panel.c index 2e1c228..208922c 100644 --- a/src/panel.c +++ b/src/panel.c @@ -36,43 +36,6 @@ void visual_refresh () 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; diff --git a/src/server.c b/src/server.c index cdfa969..3f75f21 100644 --- a/src/server.c +++ b/src/server.c @@ -66,6 +66,7 @@ void server_init_atoms () 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,12 +134,49 @@ void *server_get_property (Window win, Atom at, Atom type, int *num_results) } +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) { root_pixmap = *((Drawable*) res); @@ -149,18 +187,9 @@ Pixmap get_root_pixmap () 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 () { diff --git a/src/server.h b/src/server.h index 6bb4060..c4225db 100644 --- a/src/server.h +++ b/src/server.h @@ -51,6 +51,7 @@ typedef struct Global_atom 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 diff --git a/src/tint.c b/src/tint.c index 42581ff..56cbc1c 100644 --- a/src/tint.c +++ b/src/tint.c @@ -75,7 +75,7 @@ void init () } 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 @@ load_config: break; case PropertyNotify: + //printf("PropertyNotify\n"); event_property_notify (e.xproperty.window, e.xproperty.atom); break; diff --git a/src/tint2 b/src/tint2 index 08a6116..47b576f 100755 Binary files a/src/tint2 and b/src/tint2 differ diff --git a/src/util/area.h b/src/util/area.h index 2ad26aa..1dc6f18 100644 --- a/src/util/area.h +++ b/src/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. +* +* Area manage the background and border drawing, size and padding. +* Area manage also the tree of visible objects +* panel -> taskbars -> tasks +* -> clock +* -> systray -> icons * -* 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 -* * un objet comprend les actions: * 1) redraw(obj) * force l'indicateur 'redraw' sur l'objet @@ -34,13 +32,8 @@ * 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 ! diff --git a/src/util/window.c b/src/util/window.c index ebbdce0..b265d6f 100644 --- a/src/util/window.c +++ b/src/util/window.c @@ -58,7 +58,7 @@ void set_close (Window win) 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); } @@ -261,4 +261,3 @@ void get_text_size(PangoFontDescription *font, int *height_ink, int *height, int } - diff --git a/tintrc03 b/tintrc03 index 914dfd1..0106f89 100644 --- a/tintrc03 +++ b/tintrc03 @@ -5,25 +5,29 @@ #--------------------------------------------- # BACKGROUND AND BORDER #--------------------------------------------- -rounded = 1 -border_width = 1 -background_color = #282828 100 -border_color = #000000 100 - -rounded = 1 +rounded = 5 border_width = 1 -background_color = #282828 100 -#background_color = #3b3b3b 100 -border_color = #cccccc 100 +background_color = #ffffff 40 +border_color = #ffffff 70 + +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 #--------------------------------------------- # 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 @@ panel_background_id = 1 # TASKBAR #--------------------------------------------- taskbar_mode = multi_desktop -taskbar_padding = 4 0 +taskbar_padding = 2 3 taskbar_background_id = 0 #--------------------------------------------- @@ -39,14 +43,14 @@ taskbar_background_id = 0 #--------------------------------------------- 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 @@ task_active_background_id = 2 #--------------------------------------------- # 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 #--------------------------------------------- diff --git a/tintrc04 b/tintrc04 index fd930d4..5c7378b 100644 --- a/tintrc04 +++ b/tintrc04 @@ -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 @@ task_active_background_id = 3 # 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