]> Dogcows Code - chaz/tint2/blobdiff - src/panel.c
add comment
[chaz/tint2] / src / panel.c
index 5ca3afc764891222127a47ea33dae3f5fb9bc634..e51a69573db36998f77970fe4008975b3c4be346 100644 (file)
@@ -163,6 +163,7 @@ void init_panel()
                p->area.panel = p;
                p->area.on_screen = 1;
                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;
@@ -300,7 +301,7 @@ void init_panel_size_and_position(Panel *panel)
 }
 
 
-void resize_panel(void *obj)
+int resize_panel(void *obj)
 {
        Panel *panel = (Panel*)obj;
 //printf("resize_panel : taskbar\n");
@@ -384,6 +385,7 @@ void resize_panel(void *obj)
                                posy += panel->taskbar[i].area.height + panel->area.paddingx;
                }
        }
+       return 0;
 }
 
 
@@ -509,7 +511,7 @@ void set_panel_properties(Panel *p)
        XChangeProperty(server.dsp, p->main_win, server.atom._MOTIF_WM_HINTS, server.atom._MOTIF_WM_HINTS, 32, PropModeReplace, (unsigned char *) prop, 5);
 
        // XdndAware - Register for Xdnd events
-       long version=5;
+       Atom version=4;
        XChangeProperty(server.dsp, p->main_win, server.atom.XdndAware, XA_ATOM, 32, PropModeReplace, (unsigned char*)&version, 1);
 
        update_strut(p);
@@ -579,12 +581,14 @@ 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) {
                a = l0->data;
                set_redraw(a);
        }
+       
        // reset task 'state_pix'
        int i;
        Taskbar *tskbar;
@@ -687,8 +691,8 @@ LauncherIcon *click_launcher_icon (Panel *panel, int x, int y)
                LauncherIcon *icon;
                for (l0 = launcher->list_icons; l0 ; l0 = l0->next) {
                        icon = l0->data;
-                       if (x >= (launcher->area.posx + icon->x) && x <= (launcher->area.posx + icon->x + icon->width) &&
-                               y >= (launcher->area.posy + icon->y) && y <= (launcher->area.posy + icon->y + icon->height)) {
+                       if (x >= (launcher->area.posx + icon->x) && x <= (launcher->area.posx + icon->x + icon->icon_size) &&
+                               y >= (launcher->area.posy + icon->y) && y <= (launcher->area.posy + icon->y + icon->icon_size)) {
                                //printf("Hit rect x=%d y=%d xmax=%d ymax=%d\n", launcher->area.posx + icon->x, launcher->area.posy + icon->y, launcher->area.posx + icon->x + icon->width, launcher->area.posy + icon->y + icon->height);
                                return icon;
                        }
This page took 0.022429 seconds and 4 git commands to generate.