X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;ds=sidebyside;f=src%2Fpanel.c;h=fce1277ac286ae0da726363259acd4f5b1e2d368;hb=055e4228a91f9957771e44cbdc540f20b2c3aa17;hp=6a98a26191aaf43ad2efc13daa1b5f3d4b8c019a;hpb=63bbffa4af17926ba2d52728883988eae402b07a;p=chaz%2Ftint2 diff --git a/src/panel.c b/src/panel.c index 6a98a26..fce1277 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 @@ -168,7 +168,7 @@ void init_panel() p->area.on_screen = 1; p->area.resize = 1; p->area.size_mode = SIZE_BY_LAYOUT; - p->area._resize = resize_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; @@ -302,6 +302,27 @@ 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 && taskbar_enabled) { + // propagate width/height on hidden taskbar + int i, width, height; + Panel *panel = (Panel*)obj; + width = panel->taskbar[server.desktop].area.width; + height = panel->taskbar[server.desktop].area.height; + for (i=0 ; i < panel->nb_desktop ; i++) { + panel->taskbar[i].area.width = width; + panel->taskbar[i].area.height = height; + panel->taskbar[i].area.resize = 1; + } + } + return 0; +} + + void update_strut(Panel* p) { if (panel_strut_policy == STRUT_NONE) { @@ -502,7 +523,6 @@ void set_panel_background(Panel *p) } // redraw panel's object - //p->area.redraw = 1; GSList *l0; Area *a; for (l0 = p->area.list; l0 ; l0 = l0->next) { @@ -510,11 +530,16 @@ 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 (k=0; kstate_pix[k]) XFreePixmap(server.dsp, tskbar->state_pix[k]); + tskbar->state_pix[k] = 0; + } + tskbar->area.pix = 0; for (l0 = tskbar->area.list; l0 ; l0 = l0->next) { set_task_redraw((Task *)l0->data); }