Hello community,

here is the log from the commit of package jgmenu for openSUSE:Factory checked 
in at 2020-02-06 13:08:47
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/jgmenu (Old)
 and      /work/SRC/openSUSE:Factory/.jgmenu.new.26092 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "jgmenu"

Thu Feb  6 13:08:47 2020 rev:13 rq:770386 version:4.0.2

Changes:
--------
--- /work/SRC/openSUSE:Factory/jgmenu/jgmenu.changes    2020-01-20 
22:53:44.907304363 +0100
+++ /work/SRC/openSUSE:Factory/.jgmenu.new.26092/jgmenu.changes 2020-02-06 
13:08:49.684355824 +0100
@@ -1,0 +2,8 @@
+Wed Feb  5 19:18:25 UTC 2020 - Michael Vetter <[email protected]>
+
+- Update to 4.0.2:
+  * sbuf.c: fix bug which could result in segfault.
+  * x11-ui.c: support unusual color-depths required by applications
+    such as x2go (issue #111).
+
+-------------------------------------------------------------------

Old:
----
  v4.0.1.tar.gz

New:
----
  v4.0.2.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ jgmenu.spec ++++++
--- /var/tmp/diff_new_pack.u01X9Q/_old  2020-02-06 13:08:50.468356251 +0100
+++ /var/tmp/diff_new_pack.u01X9Q/_new  2020-02-06 13:08:50.468356251 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           jgmenu
-Version:        4.0.1
+Version:        4.0.2
 Release:        0
 Summary:        Small X11 menu intended to be used with openbox and tint2
 License:        GPL-2.0-only

++++++ v4.0.1.tar.gz -> v4.0.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jgmenu-4.0.1/NEWS.md new/jgmenu-4.0.2/NEWS.md
--- old/jgmenu-4.0.1/NEWS.md    2020-01-19 22:10:32.000000000 +0100
+++ new/jgmenu-4.0.2/NEWS.md    2020-02-02 22:31:13.000000000 +0100
@@ -8,6 +8,7 @@
 
 ### 2020
 
+[v4.0.2](docs/relnotes/4.0.2.txt)  
 [v4.0.1](docs/relnotes/4.0.1.txt)  
 [v4.0](docs/relnotes/4.0.txt)  
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jgmenu-4.0.1/debian/changelog 
new/jgmenu-4.0.2/debian/changelog
--- old/jgmenu-4.0.1/debian/changelog   2020-01-19 22:10:32.000000000 +0100
+++ new/jgmenu-4.0.2/debian/changelog   2020-02-02 22:31:13.000000000 +0100
@@ -1,3 +1,9 @@
+jgmenu (4.0.2-1) unstable; urgency=medium
+
+  * New upstream release
+
+ -- Johan Malm <[email protected]>  Sun, 02 Feb 2020 21:28:47 +0000
+
 jgmenu (4.0.1-1) unstable; urgency=medium
 
   * New upstream release
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jgmenu-4.0.1/docs/relnotes/4.0.2.txt 
new/jgmenu-4.0.2/docs/relnotes/4.0.2.txt
--- old/jgmenu-4.0.1/docs/relnotes/4.0.2.txt    1970-01-01 01:00:00.000000000 
+0100
+++ new/jgmenu-4.0.2/docs/relnotes/4.0.2.txt    2020-02-02 22:31:13.000000000 
+0100
@@ -0,0 +1,11 @@
+jgmenu v4.0.2 release notes
+===========================
+
+Updates since v4.0.1
+--------------------
+
+  * sbuf.c: fix bug which could result in segfault.
+
+  * x11-ui.c: support unusual color-depths required by applications such
+    as x2go (issue #111). Thanks to s-rod for reporting this.
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jgmenu-4.0.1/scripts/cppcheck-wrapper.sh 
new/jgmenu-4.0.2/scripts/cppcheck-wrapper.sh
--- old/jgmenu-4.0.1/scripts/cppcheck-wrapper.sh        2020-01-19 
22:10:32.000000000 +0100
+++ new/jgmenu-4.0.2/scripts/cppcheck-wrapper.sh        2020-02-02 
22:31:13.000000000 +0100
@@ -15,7 +15,7 @@
        --suppress=readdirCalled:src/icon-find.c \
        --suppress=missingIncludeSystem \
        --suppress=variableScope \
-       --suppress=nullPointer:src/jgmenu-obtheme.c:58 \
+       --suppress=nullPointer:src/jgmenu-obtheme.c \
        --suppress=unusedFunction:src/hashmap.c \
        --suppress=unusedFunction:src/hashmap.h \
        --suppress=unusedFunction:src/list.h"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jgmenu-4.0.1/scripts/version-gen.sh 
new/jgmenu-4.0.2/scripts/version-gen.sh
--- old/jgmenu-4.0.1/scripts/version-gen.sh     2020-01-19 22:10:32.000000000 
+0100
+++ new/jgmenu-4.0.2/scripts/version-gen.sh     2020-02-02 22:31:13.000000000 
+0100
@@ -8,7 +8,7 @@
 # Change "default_version" before doing a `git tag -a ...`
 #
 
-default_version="4.0.1"
+default_version="4.0.2"
 
 v=$(git describe --dirty --abbrev=1 2>/dev/null)
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jgmenu-4.0.1/src/jgmenu-ob.c 
new/jgmenu-4.0.2/src/jgmenu-ob.c
--- old/jgmenu-4.0.1/src/jgmenu-ob.c    2020-01-19 22:10:32.000000000 +0100
+++ new/jgmenu-4.0.2/src/jgmenu-ob.c    2020-02-02 22:31:13.000000000 +0100
@@ -46,7 +46,7 @@
 static struct tag *curtag;
 static struct item *curitem;
 
-static void print_it(struct tag *tag)
+static void print_one_node(struct tag *tag)
 {
        struct item *item;
        struct sbuf label_escaped;
@@ -106,12 +106,12 @@
        /* print root menu first */
        list_for_each_entry(tag, &tags, list)
                if (tag->id && !strcmp(tag->id, root_menu))
-                       print_it(tag);
+                       print_one_node(tag);
 
        /* then print all other nodes */
        list_for_each_entry(tag, &tags, list)
                if (tag->id && strcmp(tag->id, root_menu))
-                       print_it(tag);
+                       print_one_node(tag);
 }
 
 static char *get_tag_label(const char *id)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jgmenu-4.0.1/src/sbuf.c new/jgmenu-4.0.2/src/sbuf.c
--- old/jgmenu-4.0.1/src/sbuf.c 2020-01-19 22:10:32.000000000 +0100
+++ new/jgmenu-4.0.2/src/sbuf.c 2020-02-02 22:31:13.000000000 +0100
@@ -4,7 +4,7 @@
 void sbuf_init(struct sbuf *s)
 {
        s->buf = xmalloc(1);
-       s->buf[0] = 0;
+       s->buf[0] = '\0';
        s->bufsiz = 1;
        s->len = 0;
 }
@@ -16,14 +16,14 @@
                s->buf = xrealloc(s->buf, s->bufsiz);
        }
        s->buf[s->len++] = ch;
-       s->buf[s->len] = 0;
+       s->buf[s->len] = '\0';
 }
 
 void sbuf_addstr(struct sbuf *s, const char *data)
 {
        int len;
 
-       if (!data)
+       if (!data || data[0] == '\0')
                return;
        len = strlen(data);
        if (s->bufsiz <= s->len + len + 1) {
@@ -63,7 +63,7 @@
 
        memcpy(s->buf, data + n_bytes, s->len - n_bytes);
        s->len -= n_bytes;
-       s->buf[s->len] = 0;
+       s->buf[s->len] = '\0';
 
        free(data);
 }
@@ -159,8 +159,8 @@
                src = p;
        }
        sbuf_addstr(&new, src);
-       xfree(s->buf);
-       s->buf = new.buf;
+       sbuf_cpy(s, new.buf);
+       xfree(new.buf);
 }
 
 void sbuf_replace_spaces_with_one_tab(struct sbuf *s)
@@ -175,13 +175,13 @@
                return;
        *p++ = '\0';
        sbuf_init(&new);
-       sbuf_addstr(&new, s->buf);
+       sbuf_cpy(&new, s->buf);
        sbuf_addch(&new, '\t');
        while (*p == ' ')
                ++p;
        sbuf_addstr(&new, p);
-       xfree(s->buf);
-       s->buf = new.buf;
+       sbuf_cpy(s, new.buf);
+       xfree(new.buf);
 }
 
 void sbuf_split(struct list_head *sl, const char *data, char field_separator)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jgmenu-4.0.1/src/set.c new/jgmenu-4.0.2/src/set.c
--- old/jgmenu-4.0.1/src/set.c  2020-01-19 22:10:32.000000000 +0100
+++ new/jgmenu-4.0.2/src/set.c  2020-02-02 22:31:13.000000000 +0100
@@ -78,7 +78,7 @@
        int i;
 
        for (i = 0; i < nr_entries; i++) {
-               if (!entries[i].key)
+               if (!entries[i].key[0])
                        continue;
                if (!strcmp(entries[i].key, key))
                        return 1;
@@ -95,7 +95,7 @@
                die("NULL passed to function %s()", __func__);
        /* look for existing entry */
        for (i = 0; i < nr_entries; i++) {
-               if (!entries[i].key)
+               if (!entries[i].key[0])
                        continue;
                if (!strcmp(entries[i].key, key)) {
                        e = entries + i;
@@ -118,11 +118,11 @@
        int i;
 
        for (i = 0; i < nr_entries; i++) {
-               if (!entries[i].key)
+               if (!entries[i].key[0])
                        continue;
-               if (strcmp(entries[i].key, key) != 0)
+               if (strcmp(entries[i].key, key))
                        continue;
-               if (!strcmp(entries[i].value, value) != 0)
+               if (!strcmp(entries[i].value, value))
                        return 1;
        }
        return 0;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jgmenu-4.0.1/src/x11-ui.c 
new/jgmenu-4.0.2/src/x11-ui.c
--- old/jgmenu-4.0.1/src/x11-ui.c       2020-01-19 22:10:32.000000000 +0100
+++ new/jgmenu-4.0.2/src/x11-ui.c       2020-02-02 22:31:13.000000000 +0100
@@ -80,7 +80,7 @@
        int i;
 
        for (i = 0; i < 50; i++) {
-               if (XGrabKeyboard(ui->dpy, DefaultRootWindow(ui->dpy), True,
+               if (XGrabKeyboard(ui->dpy, ui->root, True,
                                  GrabModeAsync, GrabModeAsync,
                                  CurrentTime) == GrabSuccess)
                        return;
@@ -102,7 +102,7 @@
         * gives (x,y) wrt root window.
         */
        for (i = 0; i < 50; i++) {
-               if (XGrabPointer(ui->dpy, DefaultRootWindow(ui->dpy),
+               if (XGrabPointer(ui->dpy, ui->root,
                                 False,
                                 ButtonPressMask | ButtonReleaseMask |
                                 PointerMotionMask | FocusChangeMask |
@@ -115,6 +115,19 @@
        die("cannot grab pointer");
 }
 
+static void get_visual_info(void)
+{
+       int i, depths[] = { 32, 24, 8, 4, 2, 1, 0 };
+
+       for (i = 0; depths[i]; i++) {
+               XMatchVisualInfo(ui->dpy, ui->screen, depths[i], TrueColor,
+                                &ui->vinfo);
+               if (ui->vinfo.visual)
+                       break;
+       }
+       info("color depth=%d", ui->vinfo.depth);
+}
+
 void ui_init(void)
 {
        /*
@@ -132,9 +145,8 @@
                die("cannot open display");
 
        ui->xim = XOpenIM(ui->dpy, NULL, NULL, NULL);
-       XMatchVisualInfo(ui->dpy, DefaultScreen(ui->dpy), 32, TrueColor, 
&ui->vinfo);
-
        ui->screen = DefaultScreen(ui->dpy);
+       get_visual_info();
        ui->root = RootWindow(ui->dpy, ui->screen);
 }
 
@@ -149,7 +161,7 @@
                return;
        info_has_been_shown = 1;
 
-       sr = XRRGetScreenResourcesCurrent(ui->dpy, DefaultRootWindow(ui->dpy));
+       sr = XRRGetScreenResourcesCurrent(ui->dpy, ui->root);
        info("%d xrandr crt controller(s) found", sr->ncrtc);
        for (i = 0; i < sr->ncrtc; i++) {
                ci = XRRGetCrtcInfo(ui->dpy, sr, sr->crtcs[i]);
@@ -178,7 +190,7 @@
 
        if (config.verbosity >= 3)
                print_screen_info();
-       sr = XRRGetScreenResourcesCurrent(ui->dpy, DefaultRootWindow(ui->dpy));
+       sr = XRRGetScreenResourcesCurrent(ui->dpy, ui->root);
        BUG_ON(!sr);
        n = sr->ncrtc;
 
@@ -237,10 +249,9 @@
 {
        ui->w[ui->cur].swa.override_redirect = True;
        ui->w[ui->cur].swa.event_mask = ExposureMask | KeyPressMask | 
VisibilityChangeMask | ButtonPressMask;
-       ui->w[ui->cur].swa.colormap = XCreateColormap(ui->dpy, 
DefaultRootWindow(ui->dpy), ui->vinfo.visual, AllocNone);
+       ui->w[ui->cur].swa.colormap = XCreateColormap(ui->dpy, ui->root, 
ui->vinfo.visual, AllocNone);
        ui->w[ui->cur].swa.background_pixel = 0;
        ui->w[ui->cur].swa.border_pixel = 0;
-
        ui->w[ui->cur].win = XCreateWindow(ui->dpy, ui->root, x, y, w, h, 0,
                                           ui->vinfo.depth, CopyFromParent,
                                           ui->vinfo.visual,
@@ -250,9 +261,7 @@
                                           &ui->w[ui->cur].swa);
        ui->w[ui->cur].xic = XCreateIC(ui->xim, XNInputStyle, XIMPreeditNothing 
| XIMStatusNothing,
                            XNClientWindow, ui->w[ui->cur].win, XNFocusWindow, 
ui->w[ui->cur].win, NULL);
-
        ui->w[ui->cur].gc = XCreateGC(ui->dpy, ui->w[ui->cur].win, 0, NULL);
-
        XStoreName(ui->dpy, ui->w[ui->cur].win, "jgmenu");
        XSetIconName(ui->dpy, ui->w[ui->cur].win, "jgmenu");
        set_wm_class();
@@ -273,7 +282,7 @@
 void ui_init_canvas(int max_width, int max_height)
 {
        ui->w[ui->cur].canvas = XCreatePixmap(ui->dpy, ui->root, max_width,
-                                             max_height, 32);
+                                             max_height, ui->vinfo.depth);
 }
 
 void ui_init_cairo(int canvas_width, int canvas_height, const char *font)
@@ -375,6 +384,12 @@
        ui->cur = w;
 }
 
+static void set_rgba(double *rgba)
+{
+       cairo_set_source_rgba(ui->w[ui->cur].c, rgba[0], rgba[1], rgba[2],
+                             rgba[3]);
+}
+
 void ui_draw_rectangle_rounded_at_top(double x, double y, double w, double h,
                                      double radius, double line_width, int 
fill, double *rgba)
 {
@@ -386,7 +401,7 @@
        cairo_arc(ui->w[ui->cur].c, x, y + h, 0, 90 * deg, 180 * deg);          
           /* SW */
        cairo_arc(ui->w[ui->cur].c, x + radius, y + radius, radius, 180 * deg, 
270 * deg);    /* NE */
        cairo_close_path(ui->w[ui->cur].c);
-       cairo_set_source_rgba(ui->w[ui->cur].c, rgba[0], rgba[1], rgba[2], 
rgba[3]);
+       set_rgba(rgba);
        if (fill) {
                cairo_set_line_width(ui->w[ui->cur].c, 0.0);
                cairo_fill_preserve(ui->w[ui->cur].c);
@@ -413,7 +428,7 @@
                cairo_arc(ui->w[ui->cur].c, x + radius, y + h - radius, radius, 
90 * deg, 180 * deg);
                cairo_arc(ui->w[ui->cur].c, x + radius, y + radius, radius, 180 
* deg, 270 * deg);
                cairo_close_path(ui->w[ui->cur].c);
-               cairo_set_source_rgba(ui->w[ui->cur].c, rgba[0], rgba[1], 
rgba[2], rgba[3]);
+               set_rgba(rgba);
                if (fill) {
                        cairo_set_line_width(ui->w[ui->cur].c, 0.0);
                        cairo_fill_preserve(ui->w[ui->cur].c);
@@ -422,7 +437,7 @@
                }
                cairo_stroke(ui->w[ui->cur].c);
        } else {
-               cairo_set_source_rgba(ui->w[ui->cur].c, rgba[0], rgba[1], 
rgba[2], rgba[3]);
+               set_rgba(rgba);
                cairo_set_line_width(ui->w[ui->cur].c, line_width);
                cairo_rectangle(ui->w[ui->cur].c, x, y, w, h);
                if (fill)
@@ -434,7 +449,7 @@
 
 void ui_draw_line(double x0, double y0, double x1, double y1, double 
line_width, double *rgba)
 {
-       cairo_set_source_rgba(ui->w[ui->cur].c, rgba[0], rgba[1], rgba[2], 
rgba[3]);
+       set_rgba(rgba);
        cairo_set_line_width(ui->w[ui->cur].c, line_width);
        cairo_move_to(ui->w[ui->cur].c, x0, y0);
        cairo_line_to(ui->w[ui->cur].c, x1, y1);
@@ -464,7 +479,7 @@
        pango_layout_set_font_description(ui->w[ui->cur].pangolayout, 
ui->w[ui->cur].pangofont);
        pango_layout_set_tabs(ui->w[ui->cur].pangolayout, tabs);
        pango_layout_set_markup(ui->w[ui->cur].pangolayout, s, -1);
-       cairo_set_source_rgba(ui->w[ui->cur].c, rgba[0], rgba[1], rgba[2], 
rgba[3]);
+       set_rgba(rgba);
        pango_cairo_update_layout(ui->w[ui->cur].c, ui->w[ui->cur].pangolayout);
        pango_layout_get_pixel_size(ui->w[ui->cur].pangolayout, NULL, &height);
        /* use (h - height) / 2 to center-align vertically */
@@ -487,7 +502,6 @@
        font = pango_font_description_from_string(fontdesc);
        pango_layout_set_font_description(layout, font);
        pango_layout_set_markup(layout, str, -1);
-       cairo_set_source_rgba(c, 0, 0, 0, 1.0);
        pango_cairo_update_layout(c, layout);
        pango_layout_get_pixel_size(layout, &point.x, &point.y);
        cairo_surface_destroy(cs);


Reply via email to