Hello community, here is the log from the commit of package bemenu for openSUSE:Factory checked in at 2020-07-06 16:29:27 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/bemenu (Old) and /work/SRC/openSUSE:Factory/.bemenu.new.3060 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "bemenu" Mon Jul 6 16:29:27 2020 rev:6 rq:818829 version:0.5.0 Changes: -------- --- /work/SRC/openSUSE:Factory/bemenu/bemenu.changes 2020-04-14 16:16:47.695360588 +0200 +++ /work/SRC/openSUSE:Factory/.bemenu.new.3060/bemenu.changes 2020-07-06 16:31:27.223560522 +0200 @@ -1,0 +2,10 @@ +Sun Jul 5 07:58:26 UTC 2020 - Michael Vetter <[email protected]> + +- Update to 0.5.0: + * This release fixes rendering issues under HiDPI configuraitons + Notable new features: + * --scrollbar none + * BEMENU_SCALE env variable which can be used to force scaling + factor + +------------------------------------------------------------------- Old: ---- 0.4.1.tar.gz New: ---- 0.5.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ bemenu.spec ++++++ --- /var/tmp/diff_new_pack.q6xK0v/_old 2020-07-06 16:31:28.815565413 +0200 +++ /var/tmp/diff_new_pack.q6xK0v/_new 2020-07-06 16:31:28.819565425 +0200 @@ -18,7 +18,7 @@ %define bcond_with curses Name: bemenu -Version: 0.4.1 +Version: 0.5.0 Release: 0 Summary: Dynamic menu library and client program inspired by dmenu License: MIT ++++++ 0.4.1.tar.gz -> 0.5.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bemenu-0.4.1/GNUmakefile new/bemenu-0.5.0/GNUmakefile --- old/bemenu-0.4.1/GNUmakefile 2020-04-13 11:30:57.000000000 +0200 +++ new/bemenu-0.5.0/GNUmakefile 2020-06-28 17:12:20.000000000 +0200 @@ -38,7 +38,7 @@ $(libs): private override full=$(addsuffix .$(VERSION), $@) $(libs): private override major=$(addsuffix .$(firstword $(subst ., ,$(VERSION))), $@) $(libs): %: VERSION .git/index - $(LINK.c) -shared -fPIC $(filter %.c %.a,$^) $(LDLIBS) -o $(full) -Wl,-soname=$(major) + $(LINK.c) -shared -fPIC $(filter %.c %.a,$^) $(LDLIBS) -o $(full) -Wl,-soname,$(major) ln -fs $(full) $(major) ln -fs $(full) $@ @@ -100,10 +100,6 @@ install-lib-symlinks: $(libs) | install-libs cp -RP $^ $(addsuffix .$(firstword $(subst ., ,$(VERSION))), $^) "$(DESTDIR)$(PREFIX)$(libdir)" -install-renderers: - mkdir -p "$(DESTDIR)$(PREFIX)$(libdir)/bemenu" - -cp $(renderers) "$(DESTDIR)$(PREFIX)$(libdir)/bemenu" - install-bins: mkdir -p "$(DESTDIR)$(PREFIX)$(bindir)" -cp $(bins) "$(DESTDIR)$(PREFIX)$(bindir)" @@ -113,7 +109,23 @@ mkdir -p "$(DESTDIR)$(PREFIX)$(mandir)" cp $^ "$(DESTDIR)$(PREFIX)$(mandir)" -install: install-pkgconfig install-include install-lib-symlinks install-renderers install-bins install-man +install-renderers: install-curses install-wayland install-x11 + +install-curses: + mkdir -p "$(DESTDIR)$(PREFIX)$(libdir)/bemenu" + -cp bemenu-renderer-curses.so "$(DESTDIR)$(PREFIX)$(libdir)/bemenu" + +install-wayland: + mkdir -p "$(DESTDIR)$(PREFIX)$(libdir)/bemenu" + -cp bemenu-renderer-wayland.so "$(DESTDIR)$(PREFIX)$(libdir)/bemenu" + +install-x11: + mkdir -p "$(DESTDIR)$(PREFIX)$(libdir)/bemenu" + -cp bemenu-renderer-x11.so "$(DESTDIR)$(PREFIX)$(libdir)/bemenu" + +install-base: install-pkgconfig install-include install-lib-symlinks install-bins install-man + +install: install-base install-renderers @echo "Install OK!" doxygen: @@ -128,4 +140,6 @@ $(RM) -r html .DELETE_ON_ERROR: -.PHONY: all clean install install-pkgconfig install-include install-libs install-lib-symlinks install-man install-bins install-renderers doxygen clients curses x11 wayland +.PHONY: all clean install install-base install-pkgconfig install-include install-libs install-lib-symlinks \ + install-man install-bins install-renderers install-curses install-wayland install-x11 \ + doxygen clients curses x11 wayland diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bemenu-0.4.1/README.md new/bemenu-0.5.0/README.md --- old/bemenu-0.4.1/README.md 2020-04-13 11:30:57.000000000 +0200 +++ new/bemenu-0.5.0/README.md 2020-06-28 17:12:20.000000000 +0200 @@ -50,9 +50,9 @@ # You may need to setup your pkg-config to point to the brew version of the libraries # For example to build curses backend, you'd do: -PKG_CONFIG_PATH="/usr/local/opt/ncurses/lib/pkgconfig" gmake curses +PKG_CONFIG_PATH="/usr/local/opt/ncurses/lib/pkgconfig" sh build-osx.sh curses -# Other than that, follow the normal build steps, but use gmake instead of make +# Other than that, follow the normal build steps, but use `build-osx.sh` instead of make ``` ## Dependencies @@ -73,6 +73,7 @@ | BEMENU_BACKEND | Force backend by name | x11, wayland, curses | | BEMENU_RENDERER | Force backend by loading a .so file | Path to the .so file | | BEMENU_RENDERERS | Override the backend search path | Path to a directory | +| BEMENU_SCALE | Override the rendering scale factor | Float value | ## About Wayland support diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bemenu-0.4.1/build-osx.sh new/bemenu-0.5.0/build-osx.sh --- old/bemenu-0.4.1/build-osx.sh 1970-01-01 01:00:00.000000000 +0100 +++ new/bemenu-0.5.0/build-osx.sh 2020-06-28 17:12:20.000000000 +0200 @@ -0,0 +1,3 @@ +#!/bin/sh +sed 's/-soname/-install_name/' GNUmakefile > GNUmakefile.osx +gmake -f GNUmakefile.osx "$@" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bemenu-0.4.1/client/common/common.c new/bemenu-0.5.0/client/common/common.c --- old/bemenu-0.4.1/client/common/common.c 2020-04-13 11:30:57.000000000 +0200 +++ new/bemenu-0.5.0/client/common/common.c 2020-06-28 17:12:20.000000000 +0200 @@ -173,7 +173,7 @@ " -p, --prompt defines the prompt text to be displayed.\n" " -P, --prefix text to show before highlighted item.\n" " -I, --index select item at index automatically.\n" - " --scrollbar display scrollbar. (always, autohide)\n" + " --scrollbar display scrollbar. (none (default), always, autohide)\n" " --ifne only display menu if there are items.\n" " --fork always fork. (bemenu-run)\n" " --no-exec do not execute command. (bemenu-run)\n\n" @@ -290,7 +290,7 @@ client->selected = strtol(optarg, NULL, 10); break; case 0x100: - client->scrollbar = (!strcmp(optarg, "always") ? BM_SCROLLBAR_ALWAYS : (!strcmp(optarg, "autohide") ? BM_SCROLLBAR_AUTOHIDE : BM_SCROLLBAR_NONE)); + client->scrollbar = (!strcmp(optarg, "none") ? BM_SCROLLBAR_NONE : (!strcmp(optarg, "always") ? BM_SCROLLBAR_ALWAYS : (!strcmp(optarg, "autohide") ? BM_SCROLLBAR_AUTOHIDE : BM_SCROLLBAR_NONE))); break; case 0x115: client->ifne = true; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bemenu-0.4.1/lib/bemenu.h new/bemenu-0.5.0/lib/bemenu.h --- old/bemenu-0.4.1/lib/bemenu.h 2020-04-13 11:30:57.000000000 +0200 +++ new/bemenu-0.5.0/lib/bemenu.h 2020-06-28 17:12:20.000000000 +0200 @@ -137,7 +137,7 @@ /** * Scrollbar display mode constants for bm_menu instance scrollbar. * - * - @link ::bm_scrollbar_mode BM_SCROLLBAR_ALWAYS @endlink means that scrollbar is not displayed. + * - @link ::bm_scrollbar_mode BM_SCROLLBAR_NONE @endlink means that scrollbar is not displayed. * - @link ::bm_scrollbar_mode BM_SCROLLBAR_ALWAYS @endlink means that scrollbar is displayed always. * - @link ::bm_scrollbar_mode BM_SCROLLBAR_AUTOHIDE @endlink means that scrollbar is only displayed when there are more items than lines. * diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bemenu-0.4.1/lib/menu.c new/bemenu-0.5.0/lib/menu.c --- old/bemenu-0.4.1/lib/menu.c 2020-04-13 11:30:57.000000000 +0200 +++ new/bemenu-0.5.0/lib/menu.c 2020-06-28 17:12:20.000000000 +0200 @@ -710,8 +710,11 @@ break; case BM_KEY_DELETE: - if (menu->filter) - bm_utf8_rune_remove(menu->filter, menu->cursor + 1, NULL); + if (menu->filter) { + size_t width = bm_utf8_rune_next(menu->filter, menu->cursor); + if (width) + bm_utf8_rune_remove(menu->filter, menu->cursor + width, NULL); + } break; case BM_KEY_LINE_DELETE_LEFT: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bemenu-0.4.1/lib/renderers/cairo.h new/bemenu-0.5.0/lib/renderers/cairo.h --- old/bemenu-0.4.1/lib/renderers/cairo.h 2020-04-13 11:30:57.000000000 +0200 +++ new/bemenu-0.5.0/lib/renderers/cairo.h 2020-06-28 17:12:20.000000000 +0200 @@ -63,6 +63,8 @@ goto fail; cairo->surface = surface; + assert(cairo->scale > 0); + cairo_surface_set_device_scale(surface, cairo->scale, cairo->scale); return true; fail: @@ -132,9 +134,6 @@ if (!ret) return false; - assert(cairo->scale > 0); - cairo_scale(cairo->cr, cairo->scale, cairo->scale); - PangoLayout *layout = bm_pango_get_layout(cairo, paint, buffer); pango_cairo_update_layout(cairo->cr, layout); @@ -155,11 +154,8 @@ pango_cairo_show_layout(cairo->cr, layout); if (paint->draw_cursor) { - size_t chr = 0; - for (size_t c = 0; c < paint->cursor; ++chr, c += bm_utf8_rune_next(buffer, c)); - PangoRectangle rect; - pango_layout_index_to_pos(layout, chr, &rect); + pango_layout_index_to_pos(layout, paint->cursor, &rect); if (!rect.width) { struct cairo_result result = {0}; @@ -208,6 +204,7 @@ { assert(cairo && menu && out_result); + max_height /= cairo->scale; uint32_t height = fmin(menu->line_height, max_height); memset(out_result, 0, sizeof(struct cairo_paint_result)); @@ -342,10 +339,13 @@ /* single-line mode */ bm_pango_get_text_extents(cairo, &paint, &result, "lorem ipsum lorem ipsum lorem ipsum lorem"); uint32_t cl = fmin(title_x + result.x_advance, width / 4); - paint.pos = (struct pos){ cl, vpadding }; - paint.box = (struct box){ 1, 2, vpadding, vpadding, 0, ascii_height }; - bm_cairo_draw_line(cairo, &paint, &result, (count > 0 && (menu->wrap || menu->index > 0) ? "<" : " ")); - cl += result.x_advance + 1; + + if (count > 0) { + paint.pos = (struct pos){ cl, vpadding }; + paint.box = (struct box){ 1, 2, vpadding, vpadding, 0, ascii_height }; + bm_cairo_draw_line(cairo, &paint, &result, (count > 0 && (menu->wrap || menu->index > 0) ? "<" : " ")); + cl += result.x_advance + 1; + } for (uint32_t i = menu->index; i < count && cl < (width/cairo->scale); ++i) { bool highlighted = (items[i] == bm_menu_get_highlighted_item(menu)); @@ -378,6 +378,8 @@ bm_cairo_draw_line(cairo, &paint, &result, ">"); } } + + out_result->height *= cairo->scale; } #endif /* _BM_CAIRO_H */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bemenu-0.4.1/lib/renderers/wayland/wayland.c new/bemenu-0.5.0/lib/renderers/wayland/wayland.c --- old/bemenu-0.4.1/lib/renderers/wayland/wayland.c 2020-04-13 11:30:57.000000000 +0200 +++ new/bemenu-0.5.0/lib/renderers/wayland/wayland.c 2020-06-28 17:12:20.000000000 +0200 @@ -263,7 +263,13 @@ struct window *window = calloc(1, sizeof(struct window)); window->bottom = menu->bottom; - window->scale = output->scale; + + const char *scale = getenv("BEMENU_SCALE"); + if (scale) { + window->scale = fmax(strtof(scale, NULL), 1.0f); + } else { + window->scale = output->scale; + } if (!bm_wl_window_create(window, wayland->display, wayland->shm, output->output, wayland->layer_shell, surface)) free(window); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bemenu-0.4.1/lib/renderers/wayland/window.c new/bemenu-0.5.0/lib/renderers/wayland/window.c --- old/bemenu-0.4.1/lib/renderers/wayland/window.c 2020-04-13 11:30:57.000000000 +0200 +++ new/bemenu-0.5.0/lib/renderers/wayland/window.c 2020-06-28 17:12:20.000000000 +0200 @@ -146,12 +146,13 @@ if (!(surf = cairo_image_surface_create_for_data(data, CAIRO_FORMAT_ARGB32, width, height, stride))) goto fail; + buffer->cairo.scale = scale; + if (!bm_cairo_create_for_surface(&buffer->cairo, surf)) { cairo_surface_destroy(surf); goto fail; } - buffer->cairo.scale = scale; buffer->width = width; buffer->height = height; return true; @@ -232,7 +233,7 @@ break; struct cairo_paint_result result; - window->notify.render(&buffer->cairo, buffer->width, window->max_height * window->scale, menu, &result); + window->notify.render(&buffer->cairo, buffer->width, window->max_height, menu, &result); window->displayed = result.displayed; if (window->height == result.height) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bemenu-0.4.1/lib/renderers/x11/window.c new/bemenu-0.5.0/lib/renderers/x11/window.c --- old/bemenu-0.4.1/lib/renderers/x11/window.c 2020-04-13 11:30:57.000000000 +0200 +++ new/bemenu-0.5.0/lib/renderers/x11/window.c 2020-06-28 17:12:20.000000000 +0200 @@ -21,12 +21,18 @@ cairo_xlib_surface_set_size(surf, width, height); + const char *scale = getenv("BEMENU_SCALE"); + if (scale) { + buffer->cairo.scale = fmax(strtof(scale, NULL), 1.0f); + } else { + buffer->cairo.scale = 1; + } + if (!bm_cairo_create_for_surface(&buffer->cairo, surf)) { cairo_surface_destroy(surf); goto fail; } - buffer->cairo.scale = 1; buffer->width = width; buffer->height = height; buffer->created = true; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bemenu-0.4.1/man/bemenu.1 new/bemenu-0.5.0/man/bemenu.1 --- old/bemenu-0.4.1/man/bemenu.1 2020-04-13 11:30:57.000000000 +0200 +++ new/bemenu-0.5.0/man/bemenu.1 2020-06-28 17:12:20.000000000 +0200 @@ -80,6 +80,9 @@ Valid values for \fIWHEN\fR are: .RS .TP +.I none +Never show the scrollbar. (default) +.TP .I always Always show the scrollbar. .TP @@ -221,3 +224,9 @@ .RS Override the backend search path. .RE + +.TP +.B BEMENU_SCALE +.RS +Override the rendering scale factor. +.RE
