X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;ds=sidebyside;f=src%2Flauncher%2Flauncher.c;h=50d3829100636e665a6bcf1e833ab4dd4f9e8841;hb=7a03bbf353324d6803aa84ca8fd41e6c6f4d099c;hp=158e06c1ddac0a590253ed1b0b8709482b9c778a;hpb=7f435e3a3592613e718eac626917d9ae32e37bcf;p=chaz%2Ftint2 diff --git a/src/launcher/launcher.c b/src/launcher/launcher.c index 158e06c..50d3829 100644 --- a/src/launcher/launcher.c +++ b/src/launcher/launcher.c @@ -149,7 +149,7 @@ void cleanup_launcher() launcher_enabled = 0; } -void resize_launcher(void *obj) +int resize_launcher(void *obj) { Launcher *launcher = obj; Panel *panel = launcher->area.panel; @@ -223,7 +223,7 @@ void resize_launcher(void *obj) launcher->area.width = (2 * launcher->area.bg->border.width) + (2 * launcher->area.paddingxlr) + (icon_size * icons_per_row) + ((icons_per_row-1) * launcher->area.paddingx); } - launcher->area.posx = panel->area.bg->border.width + panel->area.paddingxlr; +// launcher->area.posx = panel->area.bg->border.width + panel->area.paddingxlr; launcher->area.posy = panel->area.bg->border.width; } else { @@ -238,7 +238,7 @@ void resize_launcher(void *obj) } launcher->area.posx = panel->area.bg->border.width; - launcher->area.posy = panel->area.height - panel->area.bg->border.width - panel->area.paddingxlr - launcher->area.height; +// launcher->area.posy = panel->area.height - panel->area.bg->border.width - panel->area.paddingxlr - launcher->area.height; } int i, posx, posy; @@ -274,9 +274,7 @@ void resize_launcher(void *obj) } } } - - // resize force the redraw - launcher->area.redraw = 1; + return 1; } @@ -372,7 +370,7 @@ void expand_exec(DesktopEntry *entry, const char *path) // %c -> Name // %k -> path if (entry->exec) { - char *exec2 = malloc(strlen(entry->exec) + strlen(entry->name) + strlen(entry->icon) + 100); + char *exec2 = malloc(strlen(entry->exec) + (entry->name ? strlen(entry->name) : 1) + (entry->icon ? strlen(entry->icon) : 1) + 100); char *p, *q; // p will never point to an escaped char for (p = entry->exec, q = exec2; *p; p++, q++) { @@ -711,6 +709,7 @@ void launcher_load_themes(Launcher *launcher) launcher->icon_themes = g_slist_append(launcher->icon_themes, theme); GSList* item = theme->list_inherits; + int pos = 0; while (item != NULL) { char *parent = item->data; @@ -724,7 +723,8 @@ void launcher_load_themes(Launcher *launcher) queued_item = g_slist_next(queued_item); } if (!duplicate) { - queue = g_slist_append(queue, strdup(parent)); + queue = g_slist_insert(queue, strdup(parent), pos); + pos++; queued = g_slist_append(queued, strdup(parent)); } item = g_slist_next(item);