X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Fpanel.c;h=9b52aae3768f3b4e8d848a6b3adc09b0fe3ae271;hb=b984f3f3b26d76ba6bf7488ac9737cd69413031c;hp=f5eaf9a16277bf299ba98dab0e05e2120544defc;hpb=2fe8ce00afa75977d3fd394481b19deaf3d102a5;p=chaz%2Ftint2 diff --git a/src/panel.c b/src/panel.c index f5eaf9a..9b52aae 100644 --- a/src/panel.c +++ b/src/panel.c @@ -1,7 +1,7 @@ /************************************************************************** * * Copyright (C) 2008 PÃ¥l Staurland (staura@gmail.com) -* Modified (C) 2008 thierry lorthiois (lorthiois@bbsoft.fr) +* Modified (C) 2008 thierry lorthiois (lorthiois@bbsoft.fr) from Omega distribution * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License version 2 @@ -169,9 +169,6 @@ void init_panel() p->area.resize = 1; p->area.size_mode = SIZE_BY_LAYOUT; p->area._resize = resize_panel; - p->g_taskbar.area.parent = p; - p->g_taskbar.area.panel = p; - p->g_task.area.panel = p; init_panel_size_and_position(p); // add childs according to panel_items for (k=0 ; k < strlen(panel_items_order) ; k++) { @@ -303,11 +300,11 @@ void init_panel_size_and_position(Panel *panel) int resize_panel(void *obj) -{ +{ resize_by_layout(obj, 0); //printf("resize_panel\n"); - if (panel_mode != MULTI_DESKTOP) { + if (panel_mode != MULTI_DESKTOP && taskbar_enabled) { // propagate width/height on hidden taskbar int i, width, height; Panel *panel = (Panel*)obj; @@ -530,12 +527,19 @@ void set_panel_background(Panel *p) set_redraw(a); } - // reset task 'state_pix' - int i; + // reset task/taskbar 'state_pix' + int i, k; Taskbar *tskbar; for (i=0 ; i < p->nb_desktop ; i++) { tskbar = &p->taskbar[i]; - for (l0 = tskbar->area.list; l0 ; l0 = l0->next) { + for (k=0; kstate_pix[k]) XFreePixmap(server.dsp, tskbar->state_pix[k]); + tskbar->state_pix[k] = 0; + } + tskbar->area.pix = 0; + l0 = tskbar->area.list; + if (taskbarname_enabled) l0 = l0->next; + for (; l0 ; l0 = l0->next) { set_task_redraw((Task *)l0->data); } } @@ -585,7 +589,9 @@ Task *click_task (Panel *panel, int x, int y) if ( (tskbar = click_taskbar(panel, x, y)) ) { if (panel_horizontal) { Task *tsk; - for (l0 = tskbar->area.list; l0 ; l0 = l0->next) { + l0 = tskbar->area.list; + if (taskbarname_enabled) l0 = l0->next; + for (; l0 ; l0 = l0->next) { tsk = l0->data; if (tsk->area.on_screen && x >= tsk->area.posx && x <= (tsk->area.posx + tsk->area.width)) { return tsk; @@ -594,7 +600,9 @@ Task *click_task (Panel *panel, int x, int y) } else { Task *tsk; - for (l0 = tskbar->area.list; l0 ; l0 = l0->next) { + l0 = tskbar->area.list; + if (taskbarname_enabled) l0 = l0->next; + for (; l0 ; l0 = l0->next) { tsk = l0->data; if (tsk->area.on_screen && y >= tsk->area.posy && y <= (tsk->area.posy + tsk->area.height)) { return tsk;