fixed decorated window with compiz

git-svn-id: http://tint2.googlecode.com/svn/trunk@22 121b4492-b84c-0410-8b4c-0d4edfb3f3cc
This commit is contained in:
lorthiois@bbsoft.fr
2009-01-05 21:01:05 +00:00
parent 89bcccb468
commit e0a80ef5a2
20 changed files with 166 additions and 155 deletions

View File

@@ -80,7 +80,7 @@ void add_task (Window win)
tskbar->area.list = g_slist_append(tskbar->area.list, new_tsk);
if (resize_tasks (tskbar))
redraw (&tskbar->area);
set_redraw (&tskbar->area);
}
@@ -92,7 +92,7 @@ void remove_task (Task *tsk)
tskbar = (Taskbar*)tsk->area.parent;
tskbar->area.list = g_slist_remove(tskbar->area.list, tsk);
resize_tasks (tskbar);
redraw (&tskbar->area);
set_redraw (&tskbar->area);
//printf("remove_task %d %s\n", index(tskbar->desktop, tskbar->monitor), tsk->title);
if (tsk->title) {
@@ -148,18 +148,30 @@ void get_icon (Task *tsk)
int num;
data = server_get_property (tsk->win, server.atom._NET_WM_ICON, XA_CARDINAL, &num);
if (!data) return;
if (data) {
printf("get_icon plein\n");
// ARGB
int w, h;
long *tmp_data;
tmp_data = get_best_icon (data, get_icon_count (data, num), num, &w, &h, g_task.icon_size1);
int w, h;
long *tmp_data;
tmp_data = get_best_icon (data, get_icon_count (data, num), num, &w, &h, g_task.icon_size1);
tsk->icon_width = w;
tsk->icon_height = h;
tsk->icon_data = malloc (w * h * sizeof (long));
memcpy (tsk->icon_data, tmp_data, w * h * sizeof (long));
XFree (data);
tsk->icon_width = w;
tsk->icon_height = h;
tsk->icon_data = malloc (w * h * sizeof (long));
memcpy (tsk->icon_data, tmp_data, w * h * sizeof (long));
XFree (data);
}
else {
//XWMHints *hints;
//hints = XGetWMHints(server.dsp, tkwin);
//if (hints != NULL) {
// XFree(hints);
//}
printf("get_icon vide\n");
// XChangeProperty (display, windowH, XInternAtom (display, "_NET_WM_ICON", False), XA_CARDINAL, 32, PropModeReplace, (unsigned char*) data, dataSize);
return;
}
}
@@ -272,7 +284,16 @@ void draw_task_title (cairo_t *c, Task *tsk, int active)
}
int draw_foreground_task (void *obj, cairo_t *c)
void draw_background_task (void *obj, cairo_t *c)
{
Task *tsk = obj;
draw_background (&tsk->area_active, c);
draw_background (&tsk->area_inactive, c);
}
void draw_foreground_task (void *obj, cairo_t *c)
{
Task *tsk = obj;
cairo_surface_t *cs;
@@ -292,11 +313,9 @@ int draw_foreground_task (void *obj, cairo_t *c)
ca = cairo_create (cs);
// redraw task
draw_background (&tsk->area_active, ca);
draw_task_title (ca, tsk, 1);
cairo_destroy (ca);
cairo_surface_destroy (cs);
return 0;
}

View File

@@ -59,7 +59,7 @@ Global_task g_task;
void add_task (Window win);
void remove_task (Task *tsk);
int draw_foreground_task (void *obj, cairo_t *c);
void draw_foreground_task (void *obj, cairo_t *c);
void get_icon (Task *tsk);
void get_title(Task *tsk);

View File

@@ -117,7 +117,7 @@ int resize_tasks (Taskbar *taskbar)
taskbar->task_modulo = modulo_width;
taskbar->text_width = pixel_width - g_task.text_posx - g_task.area.border.width - g_task.area.paddingx;
}
// change pos_x and width for all tasks
x = taskbar->area.posx + taskbar->area.border.width + taskbar->area.paddingx;
for (l = taskbar->area.list; l ; l = l->next) {