=== modified file 'src/awn-gconf.c' --- src/awn-gconf.c 2007-08-04 10:57:52 +0000 +++ src/awn-gconf.c 2007-08-06 11:56:03 +0000 @@ -92,6 +92,16 @@ AwnSettings* awn_gconf_new() { + GdkScreen *screen; + gint width = 1024; + gint height = 768; + + screen = gdk_screen_get_default(); + if (screen) { + width = gdk_screen_get_width(screen); + height = gdk_screen_get_height(screen); + } + if (settings) return settings; AwnSettings *s = NULL; @@ -104,8 +114,8 @@ /* general settings */ gconf_client_add_dir(client, AWN_PATH, GCONF_CLIENT_PRELOAD_NONE, NULL); awn_load_bool(client, AWN_FORCE_MONITOR, &s->force_monitor, FALSE); - awn_load_int(client, AWN_MONITOR_WIDTH, &s->monitor_width, 1024); - awn_load_int(client, AWN_MONITOR_HEIGHT, &s->monitor_height, 768); + awn_load_int(client, AWN_MONITOR_WIDTH, &s->monitor_width, width); + awn_load_int(client, AWN_MONITOR_HEIGHT, &s->monitor_height, height); awn_load_bool(client, AWN_PANEL_MODE, &s->panel_mode, FALSE); awn_load_bool(client, AWN_AUTO_HIDE, &s->auto_hide, FALSE); s->hidden = FALSE; @@ -158,7 +168,7 @@ awn_load_string(client, TITLE_FONT_FACE, &s->font_face, "Sans 11"); load_monitor (s); - s->task_width = 60; + s->task_width = settings->bar_height + 12; /* make the custom icons directory */ gchar *path = g_build_filename (g_get_home_dir (), === modified file 'src/awn-task-manager.c' --- src/awn-task-manager.c 2007-08-05 13:11:57 +0000 +++ src/awn-task-manager.c 2007-08-06 12:01:25 +0000 @@ -475,8 +475,6 @@ _reparent_windows(task_manager); _refresh_box(task_manager); - - _task_manager_check_width (task_manager); } static void @@ -754,34 +752,53 @@ { AwnTaskManagerPrivate *priv; AwnSettings *settings; - - priv = AWN_TASK_MANAGER_GET_PRIVATE (task_manager); - settings = priv->settings; - gint w, h; + gint width; + gint x; + gint num; + + priv = AWN_TASK_MANAGER_GET_PRIVATE (task_manager); + settings = priv->settings; + gtk_window_get_size (GTK_WINDOW (settings->window), &w, &h); - //gint width = settings->bar_height+10; - gint width = 60; - gint i = 0; - - //for (i =0; i < settings->bar_height+10; i+=2) { - for (i =0; i < 60; i+=2) { - gint res = (settings->monitor.width) / width; - if (res > (num_tasks+num_launchers)) { - break; + width = settings->task_width; + num = num_tasks + num_launchers; + + if (num == 0) { + awn_task_manager_update_separator_position (task_manager); + return; + } + + if (w + 20 > settings->monitor_width) { + x = w - num * width; + + do { + --width; + } while (x + num * width + 40 > settings->monitor_width); + } else if (width != settings->bar_height + 12 && w + 60 < settings->monitor_width) { + x = w - num * width; + + do { + ++width; + } while (x + num * width + 50 < settings->monitor_width); + } + + if (width < settings->task_width) { + settings->task_width = width; + g_list_foreach(priv->launchers, (GFunc)_task_resize, GINT_TO_POINTER (settings->task_width)); + g_list_foreach(priv->tasks, (GFunc)_task_resize, GINT_TO_POINTER (settings->task_width)); + } else if (width > settings->task_width) { + if (width > settings->bar_height + 12) { + settings->task_width = settings->bar_height + 12; + } else { + settings->task_width = width; } - width -=i; - } - - if (width != priv->settings->task_width) { - priv->settings->task_width = width; - g_list_foreach(priv->launchers, (GFunc)_task_resize, GINT_TO_POINTER (width)); - g_list_foreach(priv->tasks, (GFunc)_task_resize, GINT_TO_POINTER (width)); - g_print ("New width = %d", width); - } + g_list_foreach(priv->launchers, (GFunc)_task_resize, GINT_TO_POINTER (settings->task_width)); + g_list_foreach(priv->tasks, (GFunc)_task_resize, GINT_TO_POINTER (settings->task_width)); + } + awn_task_manager_update_separator_position (task_manager); - } static void === modified file 'src/awn-task.c' --- src/awn-task.c 2007-08-03 16:25:43 +0000 +++ src/awn-task.c 2007-08-06 12:13:13 +0000 @@ -1778,19 +1778,23 @@ g_return_if_fail (AWN_IS_TASK (task)); priv = AWN_TASK_GET_PRIVATE (task); + if (priv->is_closing) { + return; + } + old = priv->icon; old_reflect = priv->reflect; if (priv->is_launcher) { char * icon_name = gnome_desktop_item_get_icon (priv->item, priv->settings->icon_theme ); if (!icon_name) - priv->icon = awn_x_get_icon_for_window (priv->window, width-6, width-6); + priv->icon = awn_x_get_icon_for_window (priv->window, width-12, width-12); else - priv->icon = icon_loader_get_icon_spec(icon_name, width-6, width-6); + priv->icon = icon_loader_get_icon_spec(icon_name, width-12, width-12); g_free (icon_name); } else { if (WNCK_IS_WINDOW (priv->window)) - priv->icon = awn_x_get_icon_for_window (priv->window, width-6, width-6); + priv->icon = awn_x_get_icon_for_window (priv->window, width-12, width-12); priv->reflect = gdk_pixbuf_flip (priv->icon,FALSE); } @@ -1808,7 +1812,8 @@ gtk_widget_set_size_request (GTK_WIDGET (task), width, - (priv->settings->bar_height + 2) * 2); + (priv->settings->bar_height + 2) * 2); + } === modified file 'src/main.c' --- src/main.c 2007-07-30 23:21:37 +0000 +++ src/main.c 2007-08-06 18:43:42 +0000 @@ -109,6 +109,7 @@ GConfClient *client; GtkWidget *box = NULL; GtkWidget *applet_manager = NULL; + GdkScreen *screen; DBusGConnection *connection; DBusGProxy *proxy; @@ -170,6 +171,12 @@ GtkWidget *hot = awn_hotspot_new (settings); gtk_widget_show (hot); + screen = gdk_screen_get_default(); + if (screen && !settings->force_monitor) { + settings->monitor_width = gdk_screen_get_width(screen); + settings->monitor_height = gdk_screen_get_height(screen); + } + g_signal_connect (G_OBJECT(settings->window), "drag-motion", G_CALLBACK(drag_motion), (gpointer)settings->window); g_signal_connect (G_OBJECT(hot), "drag-motion",