Date: Sunday, August 2, 2015 @ 16:58:24 Author: arodseth Revision: 137706
upgpkg: tint2 0.12.1-1 Deleted: tint2/trunk/add-power-now-support.patch tint2/trunk/clock.patch tint2/trunk/launcher_apps_dir-v2.patch tint2/trunk/src-task-align.patch -----------------------------+ add-power-now-support.patch | 19 ------ clock.patch | 78 ---------------------------- launcher_apps_dir-v2.patch | 100 ------------------------------------ src-task-align.patch | 115 ------------------------------------------ 4 files changed, 312 deletions(-) Deleted: add-power-now-support.patch =================================================================== --- add-power-now-support.patch 2015-08-02 14:57:42 UTC (rev 137705) +++ add-power-now-support.patch 2015-08-02 14:58:24 UTC (rev 137706) @@ -1,19 +0,0 @@ -diff -rup trunk/src/battery/battery.c ./src/battery/battery.c ---- trunk/src/battery/battery.c 2010-12-02 23:56:11.313403140 +0100 -+++ trunk/src/battery/battery.c 2010-12-02 23:57:22.266956142 +0100 -@@ -184,8 +184,14 @@ void init_battery() - } - g_free(path2); - } -- if (path_energy_now && path_energy_full) { -+ -+ path_current_now = g_build_filename(battery_dir, "power_now", NULL); -+ if (!g_file_test (path_current_now, G_FILE_TEST_EXISTS)) { -+ g_free(path_current_now); - path_current_now = g_build_filename(battery_dir, "current_now", NULL); -+ } -+ -+ if (path_energy_now && path_energy_full) { - path_status = g_build_filename(battery_dir, "status", NULL); - - // check file Deleted: clock.patch =================================================================== --- clock.patch 2015-08-02 14:57:42 UTC (rev 137705) +++ clock.patch 2015-08-02 14:58:24 UTC (rev 137706) @@ -1,78 +0,0 @@ -http://code.google.com/p/tint2/issues/detail?id=430 -Submitted By: David B. Cortarello (Nomius) <dcortarello at gmail dot com> -Date: 18-05-2013 -Initial Package Version: subversion trunk (revision 652) -Description: Implemented middle click mouse button in the clock to execute tasks. -* Implemented middle click mouse button over the clock by accepting the button 2 in the -clock_action. -* A new configuration parameter was created called clock_mclick_command, which works in -the same way -* clock_lclick_command and clock_rclick_command does. - -Index: trunk/src/clock/clock.c -=================================================================== ---- trunk/src/clock/clock.c (revision 652) -+++ trunk/src/clock/clock.c (working copy) -@@ -39,6 +41,7 @@ - char *time_tooltip_format; - char *time_tooltip_timezone; - char *clock_lclick_command; -+char *clock_mclick_command; - char *clock_rclick_command; - struct timeval time_clock; - PangoFontDescription *time1_font_desc; -@@ -61,6 +64,7 @@ - time_tooltip_format = 0; - time_tooltip_timezone = 0; - clock_lclick_command = 0; -+ clock_mclick_command = 0; - clock_rclick_command = 0; - time1_font_desc = 0; - time2_font_desc = 0; -@@ -77,6 +81,7 @@ - if (time2_timezone) g_free(time2_timezone); - if (time_tooltip_timezone) g_free(time_tooltip_timezone); - if (clock_lclick_command) g_free(clock_lclick_command); -+ if (clock_mclick_command) g_free(clock_mclick_command); - if (clock_rclick_command) g_free(clock_rclick_command); - if (clock_timeout) stop_timeout(clock_timeout); - } -@@ -254,6 +263,9 @@ - case 1: - command = clock_lclick_command; - break; -+ case 2: -+ command = clock_mclick_command; -+ break; - case 3: - command = clock_rclick_command; - break; -Index: trunk/src/clock/clock.h -=================================================================== ---- trunk/src/clock/clock.h (revision 652) -+++ trunk/src/clock/clock.h (working copy) -@@ -33,6 +33,7 @@ - extern PangoFontDescription *time1_font_desc; - extern PangoFontDescription *time2_font_desc; - extern char *clock_lclick_command; -+extern char *clock_mclick_command; - extern char *clock_rclick_command; - extern int clock_enabled; - -Index: trunk/src/config.c -=================================================================== ---- trunk/src/config.c (revision 652) -+++ trunk/src/config.c (working copy) -@@ -396,6 +396,10 @@ - if (strlen(value) > 0) - clock_lclick_command = strdup(value); - } -+ else if (strcmp(key, "clock_mclick_command") == 0) { -+ if (strlen(value) > 0) -+ clock_mclick_command = strdup(value); -+ } - else if (strcmp(key, "clock_rclick_command") == 0) { - if (strlen(value) > 0) - clock_rclick_command = strdup(value); - - Deleted: launcher_apps_dir-v2.patch =================================================================== --- launcher_apps_dir-v2.patch 2015-08-02 14:57:42 UTC (rev 137705) +++ launcher_apps_dir-v2.patch 2015-08-02 14:58:24 UTC (rev 137706) @@ -1,100 +0,0 @@ -Index: trunk/src/config.c -=================================================================== ---- trunk/src/config.c (revision 646) -+++ trunk/src/config.c (working copy) -@@ -583,6 +583,18 @@ - char *app = strdup(value); - panel_config.launcher.list_apps = g_slist_append(panel_config.launcher.list_apps, app); - } -+ else if (strcmp(key, "launcher_apps_dir") == 0) { -+ -+ GList *list = dir_scan_alpha(value, "*.desktop"); -+ -+ for (list = g_list_first(list); list; list = g_list_next(list)) { -+ fprintf(stderr, "Add launcher app: %s\n", (const char *)list->data); -+ panel_config.launcher.list_apps = g_slist_append(panel_config.launcher.list_apps, (char *)strdup((const char *)list->data)); -+ } -+ -+ // Cleanup -+ g_list_free_full(list, g_free); -+ } - else if (strcmp(key, "launcher_icon_theme") == 0) { - // if XSETTINGS manager running, tint2 use it. - if (!icon_theme_name) -Index: trunk/src/util/common.c -=================================================================== ---- trunk/src/util/common.c (revision 646) -+++ trunk/src/util/common.c (working copy) -@@ -22,10 +22,13 @@ - #include <X11/Xutil.h> - #include <X11/Xatom.h> - #include <X11/extensions/Xrender.h> -+#include <sys/types.h> -+#include <sys/stat.h> - #include <stdio.h> - #include <stdlib.h> - #include <string.h> - #include <unistd.h> -+#include <fnmatch.h> - - #include "common.h" - #include "../server.h" -@@ -342,3 +345,46 @@ - XRenderFreePicture(server.dsp, pict_image); - XRenderFreePicture(server.dsp, pict_drawable); - } -+ -+/** -+ * @brief -+ * Scan given directory for files which are meet the given mask and sort them alphabetically -+ * -+ * @param path - directory path -+ * @param mask - filename mask -+ * -+ * @return files list -+ */ -+GList *dir_scan_alpha(const char *path, const char *mask) -+{ -+ GError *err = NULL; -+ GList *list = NULL; -+ const char *n; -+ gchar *fn; -+ struct stat st; -+ -+ GDir *dir = g_dir_open(path, 0, &err); -+ -+ if (!dir) { -+ fprintf(stderr, "%s\n", err->message); -+ g_error_free(err); -+ } else { -+ // Enumerate files -+ while ((n = g_dir_read_name(dir))) { -+ if (!fnmatch(mask, n, FNM_PATHNAME)) { -+ fn = g_build_filename(path, n, NULL); -+ -+ if (stat((char *)fn, &st) < 0) -+ continue; -+ -+ // Only regular files -+ if (S_ISREG(st.st_mode)) -+ list = g_list_prepend(list, (gpointer)fn); -+ } -+ } -+ -+ list = g_list_sort (list, (GCompareFunc) &strcmp); -+ } -+ -+ return list; -+} -Index: trunk/src/util/common.h -=================================================================== ---- trunk/src/util/common.h (revision 646) -+++ trunk/src/util/common.h (working copy) -@@ -57,5 +57,7 @@ - void createHeuristicMask(DATA32* data, int w, int h); - - void render_image(Drawable d, int x, int y, int w, int h); -+ -+GList *dir_scan_alpha(const char *path, const char *mask); - #endif - Deleted: src-task-align.patch =================================================================== --- src-task-align.patch 2015-08-02 14:57:42 UTC (rev 137705) +++ src-task-align.patch 2015-08-02 14:58:24 UTC (rev 137706) @@ -1,115 +0,0 @@ -Index: trunk/src/panel.h -=================================================================== ---- trunk/src/panel.h (revision 639) -+++ trunk/src/panel.h (working copy) -@@ -61,6 +61,9 @@ - extern int panel_strut_policy; - extern char *panel_items_order; - -+// tasks alignment -+enum { ALIGN_LEFT, ALIGN_CENTER, ALIGN_RIGHT }; -+ - extern int max_tick_urgent; - - extern GArray* backgrounds; -Index: src/config.c -=================================================================== ---- trunk/src/config.c (revision 639) -+++ trunk/src/config.c (working copy) -@@ -484,6 +484,14 @@ - if (value2) panel_config.g_task.area.paddingy = atoi (value2); - if (value3) panel_config.g_task.area.paddingx = atoi (value3); - } -+ else if (strcmp (key, "task_align") == 0) { -+ extract_values(value, &value1, &value2, &value3); -+ printf("task_align: %s\n", value1); -+ if (strcmp (value1, "left") == 0) panel_config.g_task.align = ALIGN_LEFT; -+ else if (strcmp (value1, "center") == 0) panel_config.g_task.align = ALIGN_CENTER; -+ else if (strcmp (value1, "right") == 0) panel_config.g_task.align = ALIGN_RIGHT; -+ else fprintf(stderr, "Unknown value for task_align: %s\n", value1); -+ } - else if (strcmp (key, "task_font") == 0) { - panel_config.g_task.font_desc = pango_font_description_from_string (value); - } -Index: trunk/src/taskbar/task.h -=================================================================== ---- trunk/src/taskbar/task.h (revision 639) -+++ trunk/src/taskbar/task.h (working copy) -@@ -26,6 +26,7 @@ - int text; - int icon; - int centered; -+ int align; - - int icon_posy; - int icon_size1; -Index: trunk/src/util/area.c -=================================================================== ---- trunk/src/util/area.c (revision 639) -+++ trunk/src/util/area.c (working copy) -@@ -130,6 +130,54 @@ - } - - -+// calculate total size of all children including -+// parent's padding -+int children_size(Area *a, int horizontal) -+{ -+ int size = 0; -+ GSList *l; -+ -+ for (l = a->list; l; l = l->next) { -+ Area *child = ((Area*)l->data); -+ if (!child->on_screen) continue; -+ -+ if (horizontal) -+ size += child->width + a->paddingx; -+ else -+ size += child->height + a->paddingy; -+ } -+ -+ return size; -+} -+ -+ -+// calculate chilren's align offset depending on the align type -+int align_offset(Area *a, int align, int horizontal) -+{ -+ int size = 0; -+ int child_size = children_size(a, horizontal); -+ -+ if (horizontal) -+ size = a->width; -+ else -+ size = a->height; -+ -+ switch (align) { -+ case ALIGN_LEFT: -+ return 0; -+ -+ case ALIGN_CENTER: -+ return (size - child_size) / 2; -+ -+ case ALIGN_RIGHT: -+ return size - child_size; -+ -+ default: -+ return 0; -+ } -+} -+ -+ - void size_by_layout (Area *a, int pos, int level) - { - // don't resize hiden objects -@@ -179,7 +227,9 @@ - int k; - for (k=0 ; k < level ; k++) printf(" "); - printf("tree level %d, object %d, pos %d, %s\n", level, i, pos, (child->size_mode == SIZE_BY_LAYOUT) ? "SIZE_BY_LAYOUT" : "SIZE_BY_CONTENT");*/ -- size_by_layout(child, pos, level+1); -+ -+ int offset = align_offset(child, panel_config.g_task.align, panel_horizontal); -+ size_by_layout(child, pos + offset, level + 1); - - if (panel_horizontal) - pos += child->width + a->paddingx;