]> Dogcows Code - chaz/tint2/blobdiff - src/panel.c
*fix* finish dnd problems and autohide
[chaz/tint2] / src / panel.c
index 0cf58187fc006507f33d775ad078d2d4ede68ff0..c8c945eea244d03a3f7d31a7a8a5b13222594512 100644 (file)
@@ -59,8 +59,6 @@ int panel_autohide_hide_timeout;
 int panel_autohide_height;
 int panel_strut_policy;
 
-Task *task_active;
-Task *task_drag;
 int  max_tick_urgent;
 
 // panel's initial config
@@ -73,18 +71,11 @@ GArray* backgrounds;
 
 Imlib_Image default_icon;
 
-
-void autohide_hide(void* p);
-void autohide_show(void* p);
-
-
 void default_panel()
 {
        panel1 = 0;
        nb_panel = 0;
        default_icon = NULL;
-       task_active = 0;
-       task_drag = 0;
        task_dragged = 0;
        panel_horizontal = 1;
        panel_position = CENTER;
@@ -92,7 +83,7 @@ void default_panel()
        panel_autohide_show_timeout = 0;
        panel_autohide_hide_timeout = 0;
        panel_autohide_height = 5;  // for vertical panels this is of course the width
-       panel_strut_policy = STRUT_MINIMUM;
+       panel_strut_policy = STRUT_FOLLOW_SIZE;
        panel_dock = 0;  // default not in the dock
        panel_layer = BOTTOM_LAYER;  // default is bottom layer
        wm_menu = 0;
@@ -125,7 +116,8 @@ void cleanup_panel()
        }
 
        if (panel1) free(panel1);
-       if (backgrounds) g_array_free(backgrounds, 1);
+       if (backgrounds)
+               g_array_free(backgrounds, 1);
        if (panel_config.g_task.font_desc) pango_font_description_free(panel_config.g_task.font_desc);
 }
 
@@ -287,16 +279,15 @@ void init_panel_size_and_position(Panel *panel)
                }
        }
 
-       if (panel_autohide) {
-               int diff = (panel_horizontal ? panel->area.height : panel->area.width) - panel_autohide_height;
-               if (panel_horizontal) {
-                       panel->hidden_width = panel->area.width;
-                       panel->hidden_height = panel->area.height - diff;
-               }
-               else {
-                       panel->hidden_width = panel->area.width - diff;
-                       panel->hidden_height = panel->area.height;
-               }
+       // autohide or strut_policy=minimum
+       int diff = (panel_horizontal ? panel->area.height : panel->area.width) - panel_autohide_height;
+       if (panel_horizontal) {
+               panel->hidden_width = panel->area.width;
+               panel->hidden_height = panel->area.height - diff;
+       }
+       else {
+               panel->hidden_width = panel->area.width - diff;
+               panel->hidden_height = panel->area.height;
        }
        // printf("panel : posx %d, posy %d, width %d, height %d\n", panel->posx, panel->posy, panel->area.width, panel->area.height);
 }
@@ -420,7 +411,7 @@ void update_strut(Panel* p)
        long   struts [12] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
        if (panel_horizontal) {
                int height = p->area.height + p->marginy;
-               if (panel_autohide && (panel_strut_policy == STRUT_MINIMUM || (panel_strut_policy == STRUT_FOLLOW_SIZE && p->is_hidden)) )
+               if (panel_strut_policy == STRUT_MINIMUM || (panel_strut_policy == STRUT_FOLLOW_SIZE && p->is_hidden))
                        height = p->hidden_height;
                if (panel_position & TOP) {
                        struts[2] = height + monitor.y;
@@ -437,7 +428,7 @@ void update_strut(Panel* p)
        }
        else {
                int width = p->area.width + p->marginx;
-               if (panel_autohide && (panel_strut_policy == STRUT_MINIMUM || (panel_strut_policy == STRUT_FOLLOW_SIZE && p->is_hidden)) )
+               if (panel_strut_policy == STRUT_MINIMUM || (panel_strut_policy == STRUT_FOLLOW_SIZE && p->is_hidden))
                        width = p->hidden_width;
                if (panel_position & LEFT) {
                        struts[0] = width + monitor.x;
This page took 0.023072 seconds and 4 git commands to generate.