diff -Nru jgmenu-4.4.0/contrib/gtktheme/jgmenu-gtktheme.py jgmenu-4.4.1/contrib/gtktheme/jgmenu-gtktheme.py --- jgmenu-4.4.0/contrib/gtktheme/jgmenu-gtktheme.py 2021-09-16 17:36:13.000000000 +0000 +++ jgmenu-4.4.1/contrib/gtktheme/jgmenu-gtktheme.py 2022-10-30 13:42:32.000000000 +0000 @@ -56,9 +56,11 @@ setconfig("color_title_border", rgb2hex(line)) def cache(themename): - """ save the theme-name to ~/.cache/jgmenu/.last-gtktheme """ + """ save the theme-name to XDG_CACHE_HOME/jgmenu/.last-gtktheme or + ~/.cache/jgmenu/.last-gtktheme if it doesn't exist """ print("themename={}".format(themename)) - directory = os.environ["HOME"] + "/.cache/jgmenu" + home = os.environ["HOME"] + directory = os.getenv("XDG_CACHE_HOME", home + "/.cache") + "/jgmenu" if not os.path.exists(directory): os.mkdir(directory) f = open(directory + "/.last-gtktheme", "w") diff -Nru jgmenu-4.4.0/data/jgmenu.svg jgmenu-4.4.1/data/jgmenu.svg --- jgmenu-4.4.0/data/jgmenu.svg 2021-09-16 17:36:13.000000000 +0000 +++ jgmenu-4.4.1/data/jgmenu.svg 2022-10-30 13:42:32.000000000 +0000 @@ -8,6 +8,8 @@ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" viewBox="0 0 512 512" + width="512" + height="512" version="1.1" id="svg4" sodipodi:docname="jgmenu.svg" diff -Nru jgmenu-4.4.0/debian/changelog jgmenu-4.4.1/debian/changelog --- jgmenu-4.4.0/debian/changelog 2021-10-13 15:27:44.000000000 +0000 +++ jgmenu-4.4.1/debian/changelog 2022-11-14 21:34:28.000000000 +0000 @@ -1,3 +1,10 @@ +jgmenu (4.4.1-1) unstable; urgency=medium + + * New upstream release. + * Bump Standards Version to 4.6.1. + + -- Mateusz Łukasik Mon, 14 Nov 2022 22:34:28 +0100 + jgmenu (4.4.0-1) unstable; urgency=medium * New upstream release. diff -Nru jgmenu-4.4.0/debian/control jgmenu-4.4.1/debian/control --- jgmenu-4.4.0/debian/control 2021-10-13 15:27:09.000000000 +0000 +++ jgmenu-4.4.1/debian/control 2022-10-30 20:41:51.000000000 +0000 @@ -2,7 +2,7 @@ Maintainer: Mateusz Łukasik Section: x11 Priority: optional -Standards-Version: 4.6.0 +Standards-Version: 4.6.1 Homepage: https://jgmenu.github.io/ Build-Depends: debhelper-compat (= 13), libx11-dev, libxrandr-dev, libcairo2-dev, libpango1.0-dev, librsvg2-dev, libxml2-dev, libglib2.0-dev, libmenu-cache-dev, diff -Nru jgmenu-4.4.0/debian/upstream/metadata jgmenu-4.4.1/debian/upstream/metadata --- jgmenu-4.4.0/debian/upstream/metadata 1970-01-01 00:00:00.000000000 +0000 +++ jgmenu-4.4.1/debian/upstream/metadata 2021-10-19 07:33:10.000000000 +0000 @@ -0,0 +1,5 @@ +--- +Bug-Database: https://github.com/johanmalm/jgmenu/issues +Bug-Submit: https://github.com/johanmalm/jgmenu/issues/new +Repository: https://github.com/johanmalm/jgmenu.git +Repository-Browse: https://github.com/johanmalm/jgmenu diff -Nru jgmenu-4.4.0/docs/notes_on_icons jgmenu-4.4.1/docs/notes_on_icons --- jgmenu-4.4.0/docs/notes_on_icons 2021-09-16 17:36:13.000000000 +0000 +++ jgmenu-4.4.1/docs/notes_on_icons 2022-10-30 13:42:32.000000000 +0000 @@ -7,7 +7,9 @@ This allows the root-menu to be displayed quickly whilst the rest is loaded in the background. -When jgmenu if first run, icon 'cache' is created at '~/.cache/jgmenu/icons/'. +When jgmenu if first run, icon 'cache' is created in the path specified in the +XDG_CACHE_HOME environment variable. If this variable is unset, it default back +on '~/.cache/jgmenu/icons/'. The cache consists of symlinks pointing to icons which match the name, size and theme. For example: folder -> /usr/share/icons/Adwaita/22x22/places/folder.png diff -Nru jgmenu-4.4.0/docs/relnotes/4.4.1.txt jgmenu-4.4.1/docs/relnotes/4.4.1.txt --- jgmenu-4.4.0/docs/relnotes/4.4.1.txt 1970-01-01 00:00:00.000000000 +0000 +++ jgmenu-4.4.1/docs/relnotes/4.4.1.txt 2022-10-30 13:42:32.000000000 +0000 @@ -0,0 +1,31 @@ +jgmenu v4.4.1 release notes +=========================== + +Updates since v4.4.0 +-------------------- + + * Chase librsvg2 API changes + + - Use rsvg_handle_render_document() to render icons instead of + deprecated rsvg_handle_get_dimensions() and + rsvg_handle_render_cairo() + This requres librsvg2 >= 2.46 + + - jgmenu.svg: specify width and height to enable some applications + using imlib2 >= v1.8 (such as feh and tint2) to render the + jgmenu.svg icon correctly. This is an indirect result of the + librsvg2 API deprecation of rsvg_handle_get_dimensions() and + rsvg_handle_render_cairo() + + * jgmenu-apps: correctly sort desktop entries in languages other than + English. Issue #166 + + * Handle symlinked icon directories in order to support Papirus-Dark. + Issue #122. With thanks to @rafern @VectorKappa @M4he + + * Use cache directory ${XDG_CACHE_HOME:-$HOME/.cache} rather than just + defaulting to ~/.cache. Issue #175. Written-by: @tupo2 + + * Fix widgets cursor-motion bug caused by background @rect and @text + widgets blocking action widgets which should handle mouse-over. + Issue #167 diff -Nru jgmenu-4.4.0/Makefile jgmenu-4.4.1/Makefile --- jgmenu-4.4.0/Makefile 2021-09-16 17:36:13.000000000 +0000 +++ jgmenu-4.4.1/Makefile 2022-10-30 13:42:32.000000000 +0000 @@ -16,12 +16,14 @@ jgmenu-ob: CFLAGS += `xml2-config --cflags` jgmenu-obtheme: CFLAGS += `xml2-config --cflags` jgmenu-config: CFLAGS += `pkg-config --cflags glib-2.0` +jgmenu-apps: CFLAGS += `pkg-config --cflags glib-2.0` jgmenu: LIBS += `pkg-config x11 xrandr cairo pango pangocairo librsvg-2.0 --libs` jgmenu: LIBS += -pthread -lpng jgmenu-ob: LIBS += `xml2-config --libs` jgmenu-obtheme: LIBS += `xml2-config --libs` jgmenu-config: LIBS += `pkg-config --libs glib-2.0` +jgmenu-apps: LIBS += `pkg-config --libs glib-2.0` LDFLAGS += $(LIBS) diff -Nru jgmenu-4.4.0/NEWS.md jgmenu-4.4.1/NEWS.md --- jgmenu-4.4.0/NEWS.md 2021-09-16 17:36:13.000000000 +0000 +++ jgmenu-4.4.1/NEWS.md 2022-10-30 13:42:32.000000000 +0000 @@ -8,6 +8,7 @@ | Date | Release Notes | |------------|-----------------------------------| +| 2022-10-30 | [v4.4.1](docs/relnotes/4.4.1.txt) | | 2021-09-16 | [v4.4.0](docs/relnotes/4.4.0.txt) | | 2021-01-02 | [v4.3.0](docs/relnotes/4.3.0.txt) | | 2020-05-19 | [v4.2.1](docs/relnotes/4.2.1.txt) | diff -Nru jgmenu-4.4.0/README.md jgmenu-4.4.1/README.md --- jgmenu-4.4.0/README.md 2021-09-16 17:36:13.000000000 +0000 +++ jgmenu-4.4.1/README.md 2022-10-30 13:42:32.000000000 +0000 @@ -3,7 +3,6 @@


@@ -13,9 +12,7 @@ href="https://jgmenu.github.io/">Website] [Screenshots] -jgmenu - -A simple, independent and contemporary-looking X11 menu, designed for scripting, ricing and tweaking. +`jgmenu` is simple, independent and contemporary-looking X11 menu, designed for scripting, ricing and tweaking. It is hackable and has a simple code base. It does not depend on any toolkits such as GTK and Qt, but uses cairo and pango to render the menu. @@ -30,6 +27,10 @@ It has UTF-8 search support. +Video (13:43) showing advanced jgmenu usage on Mabox + +jgmenu + # Versioning We use [semver 2.0.0](http://www.semver.org) diff -Nru jgmenu-4.4.0/scripts/version-gen.sh jgmenu-4.4.1/scripts/version-gen.sh --- jgmenu-4.4.0/scripts/version-gen.sh 2021-09-16 17:36:13.000000000 +0000 +++ jgmenu-4.4.1/scripts/version-gen.sh 2022-10-30 13:42:32.000000000 +0000 @@ -8,7 +8,7 @@ # Change "default_version" before doing a `git tag -a ...` # -default_version="4.4.0" +default_version="4.4.1" v=$(git describe --dirty --abbrev=1 2>/dev/null) diff -Nru jgmenu-4.4.0/src/cache.c jgmenu-4.4.1/src/cache.c --- jgmenu-4.4.0/src/cache.c 2021-09-16 17:36:13.000000000 +0000 +++ jgmenu-4.4.1/src/cache.c 2022-10-30 13:42:32.000000000 +0000 @@ -10,7 +10,7 @@ #include "util.h" #include "banned.h" -#define CACHE_LOCATION "~/.cache/jgmenu/icons" +#define DEFAULT_CACHE_LOCATION "~/.cache" static struct sbuf *cache_location; static struct sbuf icon_theme; @@ -110,6 +110,23 @@ return ret; } +static void cache_get_dir(void) +{ + const char *xdg_cache_home = getenv("XDG_CACHE_HOME"); + + if (xdg_cache_home && *xdg_cache_home) + sbuf_addstr(cache_location, xdg_cache_home); + else + sbuf_addstr(cache_location, DEFAULT_CACHE_LOCATION); + sbuf_addstr(cache_location, "/jgmenu/icons"); + sbuf_expand_tilde(cache_location); +} + +char *cache_icon_get_dir(void) +{ + return cache_location->buf; +} + static void cache_delete(void) { char cmd[512]; @@ -136,11 +153,10 @@ die("cache.c: icon_{theme,size} needs to be set"); cache_location = xmalloc(sizeof(struct sbuf)); sbuf_init(cache_location); - sbuf_cpy(cache_location, CACHE_LOCATION); - sbuf_expand_tilde(cache_location); + cache_get_dir(); if (cache_check_index_theme(icon_theme.buf, icon_size) < 0) { cache_delete(); - mkdir_p(CACHE_LOCATION); + mkdir_p(cache_location->buf); cache_create_index_theme(icon_theme.buf, icon_size); } first_run = 0; diff -Nru jgmenu-4.4.0/src/cache.h jgmenu-4.4.1/src/cache.h --- jgmenu-4.4.0/src/cache.h 2021-09-16 17:36:13.000000000 +0000 +++ jgmenu-4.4.1/src/cache.h 2022-10-30 13:42:32.000000000 +0000 @@ -5,6 +5,7 @@ void cache_set_icon_theme(const char *theme); void cache_set_icon_size(int size); +char *cache_icon_get_dir(void); int cache_touch(const char *name); int cache_strdup_path(const char *name, struct sbuf *path); int cache_create_symlink(char *path, char *name); diff -Nru jgmenu-4.4.0/src/desktop.c jgmenu-4.4.1/src/desktop.c --- jgmenu-4.4.0/src/desktop.c 2021-09-16 17:36:13.000000000 +0000 +++ jgmenu-4.4.1/src/desktop.c 2022-10-30 13:42:32.000000000 +0000 @@ -9,6 +9,7 @@ #include #include #include +#include #include "desktop.h" #include "xdgdirs.h" @@ -87,8 +88,6 @@ if (!filename) return false; for (i = 0; i < nr_apps; i++) { - if (!apps[i].filename) - continue; if (!strcmp(apps[i].filename, filename)) return true; } @@ -99,7 +98,7 @@ { size_t len = strlen(p); - memmove(p, p + 1, len + 1); + memmove(p, p + 1, len); *(p + len) = '\0'; } @@ -228,9 +227,18 @@ { const struct app *aa = (struct app *)a; const struct app *bb = (struct app *)b; + const char *aa_name, *bb_name; + int ret; BUG_ON(!aa->name || !bb->name); - return strcasecmp(aa->name, bb->name); + aa_name = aa->name_localized[0] != '\0' ? aa->name_localized : aa->name; + bb_name = bb->name_localized[0] != '\0' ? bb->name_localized : bb->name; + aa_name = g_utf8_casefold(aa_name, -1); + bb_name = g_utf8_casefold(bb_name, -1); + ret = strcmp(aa_name, bb_name); + xfree(aa_name); + xfree(bb_name); + return ret; } struct app *desktop_read_files(void) diff -Nru jgmenu-4.4.0/src/icon.c jgmenu-4.4.1/src/icon.c --- jgmenu-4.4.0/src/icon.c 2021-09-16 17:36:13.000000000 +0000 +++ jgmenu-4.4.1/src/icon.c 2022-10-30 13:42:32.000000000 +0000 @@ -23,7 +23,6 @@ #include "xpm-loader.h" #include "cache.h" #include "config.h" -#include "icon.h" #include "banned.h" #define DEBUG_THEMES 0 @@ -101,38 +100,32 @@ cairo_surface_t *surface; cairo_t *cr; RsvgHandle *svg; - RsvgDimensionData dimensions; GError *err = NULL; - double scale, ratio; + RsvgRectangle viewport = { + .x = 0, + .y = 0, + .width = size, + .height = size, + }; svg = rsvg_handle_new_from_file(filename, &err); if (err) { - fprintf(stderr, "warning: problem loading svg %s-%s\n", filename, err->message); + fprintf(stderr, "warning: problem loading svg %s-%s\n", + filename, err->message); g_error_free(err); return NULL; } - rsvg_handle_get_dimensions(svg, &dimensions); - if (dimensions.width == dimensions.height) { - surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, - size, size); - cr = cairo_create(surface); - cairo_scale(cr, (double)size / dimensions.width, - (double)size / dimensions.height); - } else if (dimensions.width > dimensions.height) { - ratio = (double)dimensions.width / dimensions.height; - scale = (double)size / dimensions.width; - surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, size, size / ratio); - cr = cairo_create(surface); - cairo_scale(cr, scale, scale); - } else { - ratio = (double)dimensions.width / dimensions.height; - scale = (double)size / dimensions.height; - surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, size * ratio, size); - cr = cairo_create(surface); - cairo_scale(cr, scale, scale); + surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, size, size); + cr = cairo_create(surface); + + rsvg_handle_render_document(svg, cr, &viewport, &err); + if (err) { + fprintf(stderr, "warning: problem rendering svg %s-%s\n", + filename, err->message); + g_error_free(err); + return NULL; } - rsvg_handle_render_cairo(svg, cr); cairo_destroy(cr); g_object_unref(svg); @@ -225,7 +218,7 @@ } } if (nr_symlinks) - fprintf(stderr, "info: created %d symlinks in ~/.cache/jgmenu/icons/\n", nr_symlinks); + fprintf(stderr, "info: created %d symlinks in %s\n", nr_symlinks, cache_icon_get_dir()); list_for_each_entry_safe(path, tmp_path, &icon_paths, list) { free(path->name.buf); free(path->path.buf); diff -Nru jgmenu-4.4.0/src/icon-find.c jgmenu-4.4.1/src/icon-find.c --- jgmenu-4.4.0/src/icon-find.c 2021-09-16 17:36:13.000000000 +0000 +++ jgmenu-4.4.1/src/icon-find.c 2022-10-30 13:42:32.000000000 +0000 @@ -6,6 +6,7 @@ #include #include +#include #include "icon-find.h" #include "xdgdirs.h" @@ -243,6 +244,22 @@ return strncmp(prefix, str, strlen(prefix)) == 0; } +static bool isdir(struct dirent *entry, const char *pathname) +{ + struct stat sb; + + if (entry->d_type == DT_DIR) + return true; + else if (entry->d_type != DT_LNK) + return false; + + /* It's a symlink, so let's deal with it */ + if (stat(pathname, &sb) != 0) { + return false; + } + return S_ISDIR(sb.st_mode); +} + static void search_dir_for_files(const char *path, struct list_head *files, int depth_limit) { struct dirent *entry; @@ -266,7 +283,7 @@ sbuf_cpy(&s, path); sbuf_addch(&s, '/'); sbuf_addstr(&s, entry->d_name); - if (entry->d_type == DT_DIR) { + if (isdir(entry, s.buf)) { if (entry->d_name[0] != '.') search_dir_for_files(s.buf, files, depth_limit > 0 ? depth_limit - 1 : depth_limit); } else if (entry->d_type == DT_REG || entry->d_type == DT_LNK) { diff -Nru jgmenu-4.4.0/src/jgmenu-init.sh jgmenu-4.4.1/src/jgmenu-init.sh --- jgmenu-4.4.0/src/jgmenu-init.sh 2021-09-16 17:36:13.000000000 +0000 +++ jgmenu-4.4.1/src/jgmenu-init.sh 2022-10-30 13:42:32.000000000 +0000 @@ -285,8 +285,14 @@ } icon_theme_last_used_by_jgmenu () { - icon_theme=$(grep -i 'Inherits' ~/.cache/jgmenu/icons/index.theme) - icon_size=$(grep -i 'Size' ~/.cache/jgmenu/icons/index.theme) + if [ -d "$XDG_CACHE_HOME" ] + then + icon_theme=$(grep -i 'Inherits' $XDG_CACHE_HOME/jgmenu/icons/index.theme) + icon_size=$(grep -i 'Size' $XDG_CACHE_HOME/jgmenu/icons/index.theme) + else + icon_theme=$(grep -i 'Inherits' ~/.cache/jgmenu/icons/index.theme) + icon_size=$(grep -i 'Size' ~/.cache/jgmenu/icons/index.theme) + fi printf 'last time, icon-theme %s-%s was used\n' "${icon_theme#Inherits=}" \ "${icon_size#Size=}" } diff -Nru jgmenu-4.4.0/src/widgets.c jgmenu-4.4.1/src/widgets.c --- jgmenu-4.4.0/src/widgets.c 2021-09-16 17:36:13.000000000 +0000 +++ jgmenu-4.4.1/src/widgets.c 2022-10-30 13:42:32.000000000 +0000 @@ -191,7 +191,9 @@ mouseover = 0; pointer.x = x; pointer.y = y; - list_for_each_entry(w, &widgets, list) { + list_for_each_entry_reverse(w, &widgets, list) { + if (!w->action || w->action[0] == '\0') + continue; widget_area.x = w->x; widget_area.y = w->y; widget_area.w = w->w; diff -Nru jgmenu-4.4.0/tests/t1201-lx.t jgmenu-4.4.1/tests/t1201-lx.t --- jgmenu-4.4.0/tests/t1201-lx.t 2021-09-16 17:36:13.000000000 +0000 +++ jgmenu-4.4.1/tests/t1201-lx.t 2022-10-30 13:42:32.000000000 +0000 @@ -62,7 +62,12 @@ printf "%b\n" "XDG_DATA_DIRS=$XDG_DATA_DIRS" export XDG_MENU_PREFIX="${1}-" - rm -rf ~/.cache/menus && + if [ -d "$XDG_CACHE_HOME" ] + then + rm -rf $XDG_CACHE_HOME/menus + else + rm -rf ~/.cache/menus + fi cp "../t1201/${1}.expect" expect && LANG=C LC_ALL=C ../../contrib/lx/jgmenu-lx >actual && cp "../t1201/${1}.expect" expect && diff -Nru jgmenu-4.4.0/.travis.yml jgmenu-4.4.1/.travis.yml --- jgmenu-4.4.0/.travis.yml 2021-09-16 17:36:13.000000000 +0000 +++ jgmenu-4.4.1/.travis.yml 2022-10-30 13:42:32.000000000 +0000 @@ -1,6 +1,6 @@ language: c -dist: xenial +dist: jammy os: linux @@ -25,19 +25,3 @@ - make test - sudo checkinstall --install=no -y -env: - global: - - CODECOV_TOKEN="786edde0-bf90-4e6b-9299-cc3f18033616" - - CFLAGS=-coverage - -after_success: - - bash <(curl -s https://codecov.io/bash) - - #https://github.com/probonopd/uploadtool/ - - # ls -lh out/* Assuming you have some files in out/ that you would like to upload - - wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh - - bash upload.sh jgmenu_*_amd64.deb - -branches: - except: - - # Do not build tags that we create when we upload to GitHub Releases - - /^(?i:continuous)$/