all repos — tint2 @ 5b4d782ca2b9d91e4ca16b2cd4f825c2191c42a4

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

fixed issue 13, removed Window magager s menu for stability reason

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

5b4d782ca2b9d91e4ca16b2cd4f825c2191c42a4

parent

1d88864c0c7f78f0ac7e20c0a34510f1c8f48b19

M ChangeLogChangeLog

@@ -1,5 +1,9 @@

-2009-01-30 -- fixed issue 13 (not sure but it look right) +2009-02-05 +- better fixed for Robert Escriva problem : set_panel_properties -> Reserved space +- fixed issue 13 with background detection +- fixed bug with disconnected monitor (in multi monitor mode) +- removed capability to show Window magager's menu + it's a feature I would like, but implementation was buggy 2009-01-29 - use panel_margin parameter even with full_width
M src/clock/clock.csrc/clock/clock.c

@@ -30,33 +30,39 @@ #include "clock.h"

#include "panel.h" +char *time1_format = 0; +char *time2_format = 0; +struct timeval time_clock; +int time_precision; + + void init_clock(Clock *clock, int panel_height) { char buf_time[40]; char buf_date[40]; int time_height, time_height_ink, date_height, date_height_ink; - if (!clock->time1_format) return; + if (!time1_format) return; - if (strchr(clock->time1_format, 'S') == NULL) clock->time_precision = 60; - else clock->time_precision = 1; + if (strchr(time1_format, 'S') == NULL) time_precision = 60; + else time_precision = 1; clock->area.posy = panel.area.pix.border.width + panel.area.paddingy; clock->area.height = panel.area.height - (2 * clock->area.posy); clock->area.width = 0; // force posx and width detection clock->area.redraw = 1; - gettimeofday(&clock->clock, 0); - clock->clock.tv_sec -= clock->clock.tv_sec % clock->time_precision; + gettimeofday(&time_clock, 0); + time_clock.tv_sec -= time_clock.tv_sec % time_precision; - strftime(buf_time, sizeof(buf_time), clock->time1_format, localtime(&clock->clock.tv_sec)); - if (clock->time2_format) - strftime(buf_date, sizeof(buf_date), clock->time2_format, localtime(&clock->clock.tv_sec)); + strftime(buf_time, sizeof(buf_time), time1_format, localtime(&time_clock.tv_sec)); + if (time2_format) + strftime(buf_date, sizeof(buf_date), time2_format, localtime(&time_clock.tv_sec)); get_text_size(clock->time1_font_desc, &time_height_ink, &time_height, panel_height, buf_time, strlen(buf_time)); clock->time1_posy = (clock->area.height - time_height) / 2; - if (clock->time2_format) { + if (time2_format) { get_text_size(clock->time2_font_desc, &date_height_ink, &date_height, panel_height, buf_date, strlen(buf_date)); clock->time1_posy -= ((date_height_ink + 2) / 2);

@@ -74,9 +80,9 @@ char buf_date[40];

int time_width, date_width, new_width; time_width = date_width = 0; - strftime(buf_time, sizeof(buf_time), clock->time1_format, localtime(&clock->clock.tv_sec)); - if (clock->time2_format) - strftime(buf_date, sizeof(buf_date), clock->time2_format, localtime(&clock->clock.tv_sec)); + strftime(buf_time, sizeof(buf_time), time1_format, localtime(&time_clock.tv_sec)); + if (time2_format) + strftime(buf_date, sizeof(buf_date), time2_format, localtime(&time_clock.tv_sec)); //printf(" draw_foreground_clock : %s\n", buf_time); redraw:

@@ -87,7 +93,7 @@ pango_layout_set_font_description (layout, clock->time1_font_desc);

pango_layout_set_indent(layout, 0); pango_layout_set_text (layout, buf_time, strlen(buf_time)); pango_layout_get_pixel_size (layout, &time_width, NULL); - if (clock->time2_format) { + if (time2_format) { pango_layout_set_font_description (layout, clock->time2_font_desc); pango_layout_set_indent(layout, 0); pango_layout_set_text (layout, buf_date, strlen(buf_date));

@@ -120,7 +126,7 @@ pango_cairo_update_layout (c, layout);

cairo_move_to (c, 0, clock->time1_posy); pango_cairo_show_layout (c, layout); - if (clock->time2_format) { + if (time2_format) { pango_layout_set_font_description (layout, clock->time2_font_desc); pango_layout_set_indent(layout, 0); pango_layout_set_text (layout, buf_date, strlen(buf_date));
M src/clock/clock.hsrc/clock/clock.h

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

/************************************************************************** * Copyright (C) 2008 thierry lorthiois (lorthiois@bbsoft.fr) * -* clock : -* - draw clock, adjust width -* +* Clock with fonctionnal data (timeval, precision) and drawing data (area, font, ...). +* Each panel use his own drawing data. +* **************************************************************************/ #ifndef CLOCK_H

@@ -23,12 +23,12 @@ PangoFontDescription *time1_font_desc;

PangoFontDescription *time2_font_desc; int time1_posy; int time2_posy; - char *time1_format; - char *time2_format; - - struct timeval clock; - int time_precision; } Clock; + +extern char *time1_format; +extern char *time2_format; +extern struct timeval time_clock; +extern int time_precision; // initialize clock : y position, precision, ...
M src/config.csrc/config.c

@@ -77,9 +77,10 @@ if (g_task.font_desc) pango_font_description_free(g_task.font_desc);

if (panel.clock.time1_font_desc) pango_font_description_free(panel.clock.time1_font_desc); if (panel.clock.time2_font_desc) pango_font_description_free(panel.clock.time2_font_desc); if (panel.taskbar) cleanup_taskbar(); - if (panel.clock.time1_format) g_free(panel.clock.time1_format); - if (panel.clock.time2_format) g_free(panel.clock.time2_format); + if (time1_format) g_free(time1_format); + if (time2_format) g_free(time2_format); if (server.monitor) free(server.monitor); + XFreeGC(server.dsp, server.gc); XCloseDisplay(server.dsp); }

@@ -288,14 +289,14 @@ }

/* Clock */ else if (strcmp (key, "time1_format") == 0) { - if (panel.clock.time1_format) g_free(panel.clock.time1_format); - if (strlen(value) > 0) panel.clock.time1_format = strdup (value); - else panel.clock.time1_format = 0; + if (time1_format) g_free(time1_format); + if (strlen(value) > 0) time1_format = strdup (value); + else time1_format = 0; } else if (strcmp (key, "time2_format") == 0) { - if (panel.clock.time2_format) g_free(panel.clock.time2_format); - if (strlen(value) > 0) panel.clock.time2_format = strdup (value); - else panel.clock.time2_format = 0; + if (time2_format) g_free(time2_format); + if (strlen(value) > 0) time2_format = strdup (value); + else time2_format = 0; } else if (strcmp (key, "time1_font") == 0) { if (panel.clock.time1_font_desc) pango_font_description_free(panel.clock.time1_font_desc);

@@ -522,7 +523,7 @@ // TODO: redefinir panel.area.list en fonction des objets visibles

panel.area.list = g_slist_append(panel.area.list, tskbar); } } - if (panel.clock.time1_format) + if (time1_format) panel.area.list = g_slist_append(panel.area.list, &panel.clock); //printf("taskbar (desktop x monitor) : (%d x %d)\n", panel.nb_desktop, panel.nb_monitor);

@@ -552,7 +553,8 @@ if (!server.monitor[panel.monitor].width || !server.monitor[panel.monitor].height)

fprintf(stderr, "tint2 error : invalid monitor size.\n"); } - if (!panel.area.width) panel.area.width = server.monitor[panel.monitor].width - 1 - panel.marginleft - panel.marginright; + // use panel.marginleft and panel.marginright even in full width mode + if (!panel.area.width) panel.area.width = server.monitor[panel.monitor].width - panel.marginleft - panel.marginright; // taskbar g_taskbar.posy = panel.area.pix.border.width + panel.area.paddingy;
M src/panel.csrc/panel.c

@@ -32,9 +32,6 @@

void visual_refresh () { - if (!panel.area.pix.pmap) - set_panel_background(); - if (server.pmap) XFreePixmap (server.dsp, server.pmap); server.pmap = XCreatePixmap (server.dsp, server.root_win, panel.area.width, panel.area.height, server.depth);

@@ -46,7 +43,10 @@ for (; l ; l = l->next)

refresh (l->data); // main_win doesn't include panel.area.paddingx, so we have WM capabilities on left and right. - XCopyArea (server.dsp, server.pmap, window.main_win, server.gc, panel.area.paddingxlr, 0, panel.area.width-(2*panel.area.paddingxlr), panel.area.height, 0, 0); + // this feature is disabled ! + //XCopyArea (server.dsp, server.pmap, window.main_win, server.gc, panel.area.paddingxlr, 0, panel.area.width-(2*panel.area.paddingxlr), panel.area.height, 0, 0); + + XCopyArea (server.dsp, server.pmap, window.main_win, server.gc, 0, 0, panel.area.width, panel.area.height, 0, 0); XFlush (server.dsp); panel.refresh = 0; }

@@ -73,12 +73,14 @@ long struts [12] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

if (panel.position & TOP) { struts[2] = panel.area.height + panel.marginy; struts[8] = server.posx; - struts[9] = server.posx + panel.area.width; + // panel.area.width - 1 allowed full screen on monitor 2 + struts[9] = server.posx + panel.area.width - 1; } else { struts[3] = panel.area.height + panel.marginy; struts[10] = server.posx; - struts[11] = server.posx + panel.area.width; + // panel.area.width - 1 allowed full screen on monitor 2 + struts[11] = server.posx + panel.area.width - 1; } // Old specification : fluxbox need _NET_WM_STRUT. XChangeProperty (server.dsp, win, server.atom._NET_WM_STRUT, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &struts, 4);

@@ -113,34 +115,40 @@

void window_draw_panel () { - Window win; - /* panel position determined here */ - if (panel.position & LEFT) server.posx = server.monitor[panel.monitor].x + panel.marginleft; + if (panel.position & LEFT) { + server.posx = server.monitor[panel.monitor].x + panel.marginleft; + } else { - if (panel.position & RIGHT) server.posx = server.monitor[panel.monitor].x + server.monitor[panel.monitor].width - panel.area.width - panel.marginright; - else server.posx = server.monitor[panel.monitor].x + ((server.monitor[panel.monitor].width - panel.area.width) / 2); + if (panel.position & RIGHT) { + //server.posx = server.monitor[panel.monitor].x + server.monitor[panel.monitor].width - panel.area.width - panel.marginright; + server.posx = server.monitor[panel.monitor].x + server.monitor[panel.monitor].width - panel.area.width; + } + else { + server.posx = server.monitor[panel.monitor].x + ((server.monitor[panel.monitor].width - panel.area.width) / 2); + } } - if (panel.position & TOP) server.posy = server.monitor[panel.monitor].y + panel.marginy; - else server.posy = server.monitor[panel.monitor].y + server.monitor[panel.monitor].height - panel.area.height - panel.marginy; + if (panel.position & TOP) { + server.posy = server.monitor[panel.monitor].y + panel.marginy; + } + else { + server.posy = server.monitor[panel.monitor].y + server.monitor[panel.monitor].height - panel.area.height - panel.marginy; + } - /* Catch some events */ + // Catch some events XSetWindowAttributes att = { ParentRelative, 0L, 0, 0L, 0, 0, Always, 0L, 0L, False, ExposureMask|ButtonPressMask|ButtonReleaseMask, NoEventMask, False, 0, 0 }; // XCreateWindow(display, parent, x, y, w, h, border, depth, class, visual, mask, attrib) // main_win doesn't include panel.area.paddingx, so we have WM capabilities on left and right. + Window win; if (window.main_win) XDestroyWindow(server.dsp, window.main_win); - win = XCreateWindow (server.dsp, server.root_win, server.posx+panel.area.paddingxlr, server.posy, panel.area.width-(2*panel.area.paddingxlr), panel.area.height, 0, server.depth, InputOutput, CopyFromParent, CWEventMask, &att); + //win = XCreateWindow (server.dsp, server.root_win, server.posx+panel.area.paddingxlr, server.posy, panel.area.width-(2*panel.area.paddingxlr), panel.area.height, 0, server.depth, InputOutput, CopyFromParent, CWEventMask, &att); + win = XCreateWindow (server.dsp, server.root_win, server.posx, server.posy, panel.area.width, panel.area.height, 0, server.depth, InputOutput, CopyFromParent, CWEventMask, &att); set_panel_properties (win); window.main_win = win; - // replaced : server.gc = DefaultGC (server.dsp, 0); - if (server.gc) XFree(server.gc); - XGCValues gcValues; - server.gc = XCreateGC(server.dsp, win, (unsigned long) 0, &gcValues); - if (server.gc_root) XFree(server.gc_root); - server.gc_root = XCreateGC(server.dsp, server.root_win, (unsigned long) 0, &gcValues); + set_panel_background(); XMapWindow (server.dsp, win); XFlush (server.dsp);

@@ -156,7 +164,7 @@ }

// list of visible objects // start with clock because draw(clock) can resize others object - if (panel.clock.time1_format) + if (time1_format) panel.area.list = g_slist_append(panel.area.list, &panel.clock); int i, j;

@@ -174,44 +182,52 @@ panel.refresh = 1;

} -Pixmap get_root_pixmap () +void get_root_pixmap() { - Pixmap ret; - Window root = RootWindow(server.dsp, server.screen); + Pixmap ret = None; + + unsigned long *res; + int c = 2; - ret = None; - int act_format, c = 2 ; - u_long nitems ; - u_long bytes_after ; - u_char *prop ; - Atom dummy_id; + do { + res = server_get_property (server.root_win, server.atom._XROOTPMAP_ID, XA_PIXMAP, 0); + if (res) { + ret = *((Pixmap*)res); + XFree(res); + break; + } + } while (--c > 0); + server.root_pmap = ret; - 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); + if (server.root_pmap != None) { + XGCValues gcv; + gcv.ts_x_origin = 0; + gcv.ts_y_origin = 0; + gcv.fill_style = FillTiled; + uint mask = GCTileStipXOrigin | GCTileStipYOrigin | GCFillStyle | GCTile; - if (ret == None) fprintf(stderr, "unknown background\n"); - return ret; + gcv.tile = server.root_pmap; + XChangeGC(server.dsp, server.gc, mask, &gcv); + //fprintf(stderr, "pixmap background detected\n"); + } + else + fprintf(stderr, "pixmap background detection failed\n"); } void set_panel_background() { - Pixmap wall = get_root_pixmap(); + get_root_pixmap(); if (panel.area.pix.pmap) XFreePixmap (server.dsp, panel.area.pix.pmap); panel.area.pix.pmap = XCreatePixmap (server.dsp, server.root_win, panel.area.width, panel.area.height, server.depth); - // add layer of root pixmap - XCopyArea(server.dsp, wall, panel.area.pix.pmap, server.gc, server.posx, server.posy, panel.area.width, panel.area.height, 0, 0); + // copy background (server.root_pmap) in panel + Window dummy; + int x, y ; + XTranslateCoordinates(server.dsp, window.main_win, server.root_win, 0, 0, &x, &y, &dummy); + XSetTSOrigin(server.dsp, server.gc, -x, -y) ; + XFillRectangle(server.dsp, panel.area.pix.pmap, server.gc, 0, 0, panel.area.width, panel.area.height); // draw background panel cairo_surface_t *cs;

@@ -224,10 +240,11 @@

cairo_destroy (c); cairo_surface_destroy (cs); + // redraw panel + set_redraw (&panel.area); + // copy background panel on desktop window - XCopyArea (server.dsp, panel.area.pix.pmap, server.root_win, server.gc_root, 0, 0, panel.area.width, panel.area.height, server.posx, server.posy); - - set_redraw (&panel.area); + //XCopyArea (server.dsp, panel.area.pix.pmap, server.root_win, server.gc_root, 0, 0, panel.area.width, panel.area.height, server.posx, server.posy); }
M src/panel.hsrc/panel.h

@@ -82,6 +82,11 @@ void visual_refresh ();

void set_panel_properties (Window win); void window_draw_panel (); void visible_object(); + +// draw background panel void set_panel_background(); + +// detect server.root_pmap +void get_root_pixmap(); #endif
M src/server.csrc/server.c

@@ -172,19 +172,36 @@ if (XineramaIsActive(server.dsp)) {

XineramaScreenInfo *info = XineramaQueryScreens(server.dsp, &nb_monitor); if (info) { - int i; + int i = 0, nb=0, j; - //printf("nb_monitors %d\n", nb_monitor); - server.nb_monitor = nb_monitor; server.monitor = calloc(nb_monitor, sizeof(Monitor)); - for (i = 0; i < server.nb_monitor; i++) { - server.monitor[i].x = info[i].x_org; - server.monitor[i].y = info[i].y_org; - server.monitor[i].width = info[i].width; - server.monitor[i].height = info[i].height; + while (i < nb_monitor) { + for (j = 0; j < i; j++) { + if (info[i].x_org >= info[j].x_org && info[i].y_org >= info[j].y_org && (info[i].x_org+info[i].width) <= (info[j].x_org+info[j].width) && (info[i].y_org+info[i].height) <= (info[j].y_org+info[j].height)) { + if (info[i].x_org == info[j].x_org && info[i].y_org == info[j].y_org && info[i].width == info[j].width && info[i].height == info[j].height && nb == 0) { + // add the first monitor + break; + } + else { + // doesn't count monitor 'i' because it's included into another one + //fprintf(stderr, "monitor %d included into another one\n", i); + goto next; + } + } + } + + //fprintf(stderr, "monitor %d added\n", i); + server.monitor[nb].x = info[i].x_org; + server.monitor[nb].y = info[i].y_org; + server.monitor[nb].width = info[i].width; + server.monitor[nb].height = info[i].height; + nb++; +next: + i++; } XFree(info); - + server.nb_monitor = nb; + // ordered monitor according to coordinate qsort(server.monitor, server.nb_monitor, sizeof(Monitor), compareMonitor); }
M src/server.hsrc/server.h

@@ -17,72 +17,74 @@

typedef struct Global_atom { - Atom _XROOTPMAP_ID; - Atom _NET_CURRENT_DESKTOP; - Atom _NET_NUMBER_OF_DESKTOPS; - Atom _NET_DESKTOP_GEOMETRY; - Atom _NET_DESKTOP_VIEWPORT; - Atom _NET_ACTIVE_WINDOW; - Atom _NET_WM_WINDOW_TYPE; - Atom _NET_WM_STATE_SKIP_PAGER; - Atom _NET_WM_STATE_SKIP_TASKBAR; - Atom _NET_WM_STATE_STICKY; - Atom _NET_WM_WINDOW_TYPE_DOCK; - Atom _NET_WM_WINDOW_TYPE_DESKTOP; - Atom _NET_WM_WINDOW_TYPE_TOOLBAR; - Atom _NET_WM_WINDOW_TYPE_MENU; - Atom _NET_WM_WINDOW_TYPE_SPLASH; - Atom _NET_WM_WINDOW_TYPE_DIALOG; - Atom _NET_WM_WINDOW_TYPE_NORMAL; - Atom _NET_WM_DESKTOP; - Atom WM_STATE; - Atom _NET_WM_STATE; - Atom _NET_WM_STATE_SHADED; - Atom _NET_WM_STATE_BELOW; - Atom _NET_WM_STATE_MODAL; - Atom _NET_CLIENT_LIST; - Atom _NET_WM_NAME; - Atom _NET_WM_VISIBLE_NAME; - Atom _NET_WM_STRUT; - Atom _NET_WM_ICON; - Atom _NET_CLOSE_WINDOW; - Atom UTF8_STRING; - Atom _NET_SUPPORTING_WM_CHECK; - Atom _WIN_LAYER; - Atom _NET_WM_STRUT_PARTIAL; - Atom WM_NAME; - Atom __SWM_VROOT; - Atom _MOTIF_WM_HINTS; + Atom _XROOTPMAP_ID; + Atom _NET_CURRENT_DESKTOP; + Atom _NET_NUMBER_OF_DESKTOPS; + Atom _NET_DESKTOP_GEOMETRY; + Atom _NET_DESKTOP_VIEWPORT; + Atom _NET_ACTIVE_WINDOW; + Atom _NET_WM_WINDOW_TYPE; + Atom _NET_WM_STATE_SKIP_PAGER; + Atom _NET_WM_STATE_SKIP_TASKBAR; + Atom _NET_WM_STATE_STICKY; + Atom _NET_WM_WINDOW_TYPE_DOCK; + Atom _NET_WM_WINDOW_TYPE_DESKTOP; + Atom _NET_WM_WINDOW_TYPE_TOOLBAR; + Atom _NET_WM_WINDOW_TYPE_MENU; + Atom _NET_WM_WINDOW_TYPE_SPLASH; + Atom _NET_WM_WINDOW_TYPE_DIALOG; + Atom _NET_WM_WINDOW_TYPE_NORMAL; + Atom _NET_WM_DESKTOP; + Atom WM_STATE; + Atom _NET_WM_STATE; + Atom _NET_WM_STATE_SHADED; + Atom _NET_WM_STATE_BELOW; + Atom _NET_WM_STATE_MODAL; + Atom _NET_CLIENT_LIST; + Atom _NET_WM_NAME; + Atom _NET_WM_VISIBLE_NAME; + Atom _NET_WM_STRUT; + Atom _NET_WM_ICON; + Atom _NET_CLOSE_WINDOW; + Atom UTF8_STRING; + Atom _NET_SUPPORTING_WM_CHECK; + Atom _WIN_LAYER; + Atom _NET_WM_STRUT_PARTIAL; + Atom WM_NAME; + Atom __SWM_VROOT; + Atom _MOTIF_WM_HINTS; } Global_atom; typedef struct Monitor { - int x; - int y; - int width; - int height; + int x; + int y; + int width; + int height; } Monitor; typedef struct { - Display *dsp; - Window root_win; - int desktop; - int screen; - int depth; - int nb_desktop; - Monitor *monitor; - int nb_monitor; - int got_root_win; - Visual *visual; - int posx, posy; - Pixmap pmap; - GC gc; - GC gc_root; - Global_atom atom; + Display *dsp; + Window root_win; + int desktop; + int screen; + int depth; + int nb_desktop; + // number of monitor (without monitor included into another one) + int nb_monitor; + Monitor *monitor; + int got_root_win; + Visual *visual; + int posx, posy; + Pixmap pmap; + // root background + Pixmap root_pmap; + GC gc; + Global_atom atom; } Server_global;

@@ -97,6 +99,9 @@ void server_refresh_root_pixmap ();

void server_refresh_main_pixmap (); void server_catch_error (Display *d, XErrorEvent *ev); void server_init_atoms (); + +// detect monitors +// doesn't count monitor included into another one void get_monitors();
M src/taskbar/taskbar.csrc/taskbar/taskbar.c

@@ -153,7 +153,7 @@ if (panel.mode == MULTI_DESKTOP) taskbar_on_screen = panel.nb_desktop;

else taskbar_on_screen = panel.nb_monitor; taskbar_width = panel.area.width - (2 * panel.area.paddingxlr) - (2 * panel.area.pix.border.width); - if (panel.clock.time1_format) + if (time1_format) taskbar_width -= (panel.clock.area.width + panel.area.paddingx); taskbar_width = (taskbar_width - ((taskbar_on_screen-1) * panel.area.paddingx)) / taskbar_on_screen;
M src/tint.csrc/tint.c

@@ -75,12 +75,14 @@ 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 (); + XGCValues gcv; + server.gc = XCreateGC (server.dsp, server.root_win, (unsigned long)0, &gcv) ; XSetErrorHandler ((XErrorHandler) server_catch_error); // init systray - display = server.dsp; - root = RootWindow(display, DefaultScreen(display)); + //display = server.dsp; + //root = RootWindow(display, DefaultScreen(display)); //create_main_window(); //kde_init(); //net_init();

@@ -296,8 +298,7 @@ panel.refresh = 1;

} /* Wallpaper changed */ else if (at == server.atom._XROOTPMAP_ID) { - XFreePixmap (server.dsp, panel.area.pix.pmap); - panel.area.pix.pmap = 0; + set_panel_background(); panel.refresh = 1; } }

@@ -395,15 +396,15 @@ void event_timer()

{ struct timeval stv; - if (!panel.clock.time1_format) return; + if (!time1_format) return; if (gettimeofday(&stv, 0)) return; - if (abs(stv.tv_sec - panel.clock.clock.tv_sec) < panel.clock.time_precision) return; + if (abs(stv.tv_sec - time_clock.tv_sec) < time_precision) return; // update clock - panel.clock.clock.tv_sec = stv.tv_sec; - panel.clock.clock.tv_sec -= panel.clock.clock.tv_sec % panel.clock.time_precision; + time_clock.tv_sec = stv.tv_sec; + time_clock.tv_sec -= time_clock.tv_sec % time_precision; panel.clock.area.redraw = 1; panel.refresh = 1; }

@@ -420,8 +421,6 @@ c = getopt (argc, argv, "c:");

init (); load_config: - if (panel.area.pix.pmap) XFreePixmap (server.dsp, panel.area.pix.pmap); - panel.area.pix.pmap = 0; // append full transparency background list_back = g_slist_append(0, calloc(1, sizeof(Area)));

@@ -470,8 +469,9 @@ event_button_release (e.xbutton.button, e.xbutton.x, e.xbutton.y);

break; case Expose: - XCopyArea (server.dsp, panel.area.pix.pmap, server.root_win, server.gc_root, 0, 0, panel.area.width, panel.area.height, server.posx, server.posy); - XCopyArea (server.dsp, server.pmap, window.main_win, server.gc, panel.area.paddingxlr, 0, panel.area.width-(2*panel.area.paddingxlr), panel.area.height, 0, 0); + //XCopyArea (server.dsp, panel.area.pix.pmap, server.root_win, server.gc_root, 0, 0, panel.area.width, panel.area.height, server.posx, server.posy); + //XCopyArea (server.dsp, server.pmap, window.main_win, server.gc, panel.area.paddingxlr, 0, panel.area.width-(2*panel.area.paddingxlr), panel.area.height, 0, 0); + XCopyArea (server.dsp, server.pmap, window.main_win, server.gc, 0, 0, panel.area.width, panel.area.height, 0, 0); break; case PropertyNotify:
M tintrc01tintrc01

@@ -26,7 +26,7 @@ #---------------------------------------------

panel_monitor = 1 panel_position = bottom center panel_size = 0 30 -panel_margin = 15 2 15 +panel_margin = 20 2 panel_padding = 9 0 font_shadow = 0 panel_background_id = 1
M tintrc02tintrc02

@@ -6,8 +6,8 @@ #---------------------------------------------

# BACKGROUND AND BORDER #--------------------------------------------- rounded = 1 -border_width = 0 -background_color = #282828 60 +border_width = 0 +background_color = #282828 40 border_color = #000000 0 rounded = 1

@@ -24,9 +24,9 @@ #---------------------------------------------

# PANEL #--------------------------------------------- panel_monitor = 1 -panel_position = top left +panel_position = top center panel_size = 0 27 -panel_margin = 0 0 +panel_margin = 5 0 panel_padding = 7 3 7 font_shadow = 0 panel_background_id = 1

@@ -61,8 +61,8 @@

#--------------------------------------------- # CLOCK #--------------------------------------------- -time1_format = %H:%M:%S -time1_font = sans 7 +time1_format = %H:%M +time1_font = sans 7 time2_format = %A %d %B time2_font = sans 7 clock_font_color = #ffffff 100