- // switch desktop
- if (panel_mode == MULTI_DESKTOP && action != mouse_tilt_left && action != mouse_tilt_right) {
- if (tskbar->desktop != server.desktop && action != CLOSE)
- set_desktop (tskbar->desktop);
- }
-
- // action on task
- window_action( click_task(panel, e), action);
-
- // to keep window below
- XLowerWindow (server.dsp, panel->main_win);
-/*
- int x = e->xbutton.x;
- int y = e->xbutton.y;
- // search taskbar
- Taskbar *tskbar;
- GSList *l0;
- Clock clk = panel->clock;
- if (panel_horizontal) {
- if (clk.area.on_screen && x >= clk.area.posx && x <= (clk.area.posx + clk.area.width))
- clock_action(e->xbutton.button);
- else {
- for (l0 = panel->area.list; l0 ; l0 = l0->next) {
- tskbar = l0->data;
- if (!tskbar->area.on_screen) continue;
- if (x >= tskbar->area.posx && x <= (tskbar->area.posx + tskbar->area.width))
- goto suite;
- }
- }
- }
- else {
- if (clk.area.on_screen && y >= clk.area.posy && y <= (clk.area.posy + clk.area.height))
- clock_action(e->xbutton.button);
- else {
- for (l0 = panel->area.list; l0 ; l0 = l0->next) {
- tskbar = l0->data;
- if (!tskbar->area.on_screen) continue;
- if (y >= tskbar->area.posy && y <= (tskbar->area.posy + tskbar->area.height))
- goto suite;
- }
- }
- }
-
- // TODO: check better solution to keep window below
- XLowerWindow (server.dsp, panel->main_win);
- task_drag = 0;
- return;
-
-suite:
- // drag and drop task
- if (task_drag) {
- if (tskbar != task_drag->area.parent && action == TOGGLE_ICONIFY) {
- if (task_drag->desktop != ALLDESKTOP && panel_mode == MULTI_DESKTOP) {
- windows_set_desktop(task_drag->win, tskbar->desktop);
- if (tskbar->desktop == server.desktop)
- set_active(task_drag->win);
- task_drag = 0;
- }
- return;
- }
- else task_drag = 0;
- }
-