git-svn-id: http://tint2.googlecode.com/svn/trunk@174 121b4492-b84c-0410-8b4c-0d4edfb3f3cc
This commit is contained in:
lorthiois@bbsoft.fr
2009-09-10 21:00:50 +00:00
parent 3082da0f5c
commit 5b3edd6777
2 changed files with 12 additions and 9 deletions

View File

@@ -81,6 +81,8 @@ typedef struct {
// -------------------------------------------------- // --------------------------------------------------
// taskbar point to the first taskbar in panel.area.list. // taskbar point to the first taskbar in panel.area.list.
// number of tasbar == nb_desktop // number of tasbar == nb_desktop
// taskbar[i] is used to loop over taskbar,
// while panel->area.list is used to loop over all panel's objects
Taskbar *taskbar; Taskbar *taskbar;
int nb_desktop; int nb_desktop;

View File

@@ -134,26 +134,27 @@ void cleanup()
Taskbar *click_taskbar (Panel *panel, int x, int y) Taskbar *click_taskbar (Panel *panel, int x, int y)
{ {
GSList *l0; Taskbar *tskbar;
Taskbar *tskbar = NULL; int i;
if (panel_horizontal) { if (panel_horizontal) {
for (l0 = panel->area.list; l0 ; l0 = l0->next) { for (i=0; i < panel->nb_desktop ; i++) {
tskbar = l0->data; tskbar = &panel->taskbar[i];
if (!tskbar->area.on_screen) continue; if (!tskbar->area.on_screen) continue;
if (x >= tskbar->area.posx && x <= (tskbar->area.posx + tskbar->area.width)) if (x >= tskbar->area.posx && x <= (tskbar->area.posx + tskbar->area.width))
break; return tskbar;
} }
} }
else { else {
for (l0 = panel->area.list; l0 ; l0 = l0->next) { for (i=0; i < panel->nb_desktop ; i++) {
tskbar = l0->data; tskbar = &panel->taskbar[i];
if (!tskbar->area.on_screen) continue; if (!tskbar->area.on_screen) continue;
if (y >= tskbar->area.posy && y <= (tskbar->area.posy + tskbar->area.height)) if (y >= tskbar->area.posy && y <= (tskbar->area.posy + tskbar->area.height))
break;
}
}
return tskbar; return tskbar;
} }
}
return NULL;
}
Task *click_task (Panel *panel, int x, int y) Task *click_task (Panel *panel, int x, int y)