Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package bemenu for openSUSE:Factory checked 
in at 2024-07-22 17:15:06
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/bemenu (Old)
 and      /work/SRC/openSUSE:Factory/.bemenu.new.17339 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "bemenu"

Mon Jul 22 17:15:06 2024 rev:27 rq:1188522 version:0.6.23

Changes:
--------
--- /work/SRC/openSUSE:Factory/bemenu/bemenu.changes    2024-07-08 
19:09:08.692681216 +0200
+++ /work/SRC/openSUSE:Factory/.bemenu.new.17339/bemenu.changes 2024-07-22 
17:15:22.034945551 +0200
@@ -1,0 +2,6 @@
+Fri Jul 19 04:33:19 UTC 2024 - Michael Vetter <mvet...@suse.com>
+
+- Update to 0.6.23:
+  * Disable cairo antialiasing with Wayland fractional scaling #413
+
+-------------------------------------------------------------------

Old:
----
  bemenu-0.6.22.tar.gz

New:
----
  bemenu-0.6.23.tar.gz

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

Other differences:
------------------
++++++ bemenu.spec ++++++
--- /var/tmp/diff_new_pack.rx1Cva/_old  2024-07-22 17:15:24.255034825 +0200
+++ /var/tmp/diff_new_pack.rx1Cva/_new  2024-07-22 17:15:24.255034825 +0200
@@ -18,7 +18,7 @@
 
 %define bcond_with curses
 Name:           bemenu
-Version:        0.6.22
+Version:        0.6.23
 Release:        0
 Summary:        Dynamic menu library and client program inspired by dmenu
 License:        MIT

++++++ bemenu-0.6.22.tar.gz -> bemenu-0.6.23.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/bemenu-0.6.22/VERSION new/bemenu-0.6.23/VERSION
--- old/bemenu-0.6.22/VERSION   2024-07-08 01:51:20.000000000 +0200
+++ new/bemenu-0.6.23/VERSION   2024-07-19 06:12:27.000000000 +0200
@@ -1 +1 @@
-0.6.22
+0.6.23
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/bemenu-0.6.22/lib/menu.c new/bemenu-0.6.23/lib/menu.c
--- old/bemenu-0.6.22/lib/menu.c        2024-07-08 01:51:20.000000000 +0200
+++ new/bemenu-0.6.23/lib/menu.c        2024-07-19 06:12:27.000000000 +0200
@@ -1084,19 +1084,35 @@
             break;
 
         case BM_KEY_PAGE_UP:
-            bm_menu_set_highlighted_index(menu, (menu->index < displayed ? 0 : 
menu->index - (displayed - 1)));
+            if (menu->lines_mode == BM_LINES_UP) {
+                bm_menu_set_highlighted_index(menu, (menu->index + displayed 
>= count ? count - 1 : menu->index + (displayed - 1)));
+            } else {
+                bm_menu_set_highlighted_index(menu, (menu->index < displayed ? 
0 : menu->index - (displayed - 1)));
+            }
             break;
 
         case BM_KEY_PAGE_DOWN:
-            bm_menu_set_highlighted_index(menu, (menu->index + displayed >= 
count ? count - 1 : menu->index + (displayed - 1)));
+            if (menu->lines_mode == BM_LINES_UP) {
+                bm_menu_set_highlighted_index(menu, (menu->index < displayed ? 
0 : menu->index - (displayed - 1)));
+            } else {
+                bm_menu_set_highlighted_index(menu, (menu->index + displayed 
>= count ? count - 1 : menu->index + (displayed - 1)));
+            }
             break;
 
         case BM_KEY_SHIFT_PAGE_UP:
-            bm_menu_set_highlighted_index(menu, 0);
+            if (menu->lines_mode == BM_LINES_UP) {
+                bm_menu_set_highlighted_index(menu, count - 1);
+            } else {
+                bm_menu_set_highlighted_index(menu, 0);
+            }
             break;
 
         case BM_KEY_SHIFT_PAGE_DOWN:
-            bm_menu_set_highlighted_index(menu, count - 1);
+            if (menu->lines_mode == BM_LINES_UP) {
+                bm_menu_set_highlighted_index(menu, 0);
+            } else {
+                bm_menu_set_highlighted_index(menu, count - 1);
+            }
             break;
 
         case BM_KEY_BACKSPACE:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/bemenu-0.6.22/lib/renderers/cairo_renderer.h 
new/bemenu-0.6.23/lib/renderers/cairo_renderer.h
--- old/bemenu-0.6.22/lib/renderers/cairo_renderer.h    2024-07-08 
01:51:20.000000000 +0200
+++ new/bemenu-0.6.23/lib/renderers/cairo_renderer.h    2024-07-19 
06:12:27.000000000 +0200
@@ -13,6 +13,7 @@
     cairo_surface_t *surface;
     PangoContext *pango;
     double scale;
+    bool antialiasing;
 };
 
 struct cairo_color {
@@ -67,7 +68,8 @@
     if (!(cairo->pango = pango_cairo_create_context(cairo->cr)))
         goto fail;
 
-    cairo_set_antialias(cairo->cr, CAIRO_ANTIALIAS_DEFAULT);
+    if (!cairo->antialiasing)
+        cairo_set_antialias(cairo->cr, CAIRO_ANTIALIAS_NONE);
 
     cairo->surface = surface;
     assert(cairo->scale > 0);
@@ -327,15 +329,15 @@
     memset(&result, 0, sizeof(result));
     uint32_t title_x = 0;
 
-    uint32_t total_height=menu->lines*height; /*Total height of the full menu*/
-    if (!menu->fixed_height){
-        total_height = MIN(count*height, total_height);
-    }
-    total_height += height+border_size*2;
-    total_height = MIN(total_height, (max_height/height)*height);
+    uint32_t total_height = menu->lines * height;
+    if (!menu->fixed_height) total_height = MIN(count * height, total_height);
+    total_height += height +border_size * 2;
+    total_height = MIN(total_height, (max_height / height) * height);
 
-    bm_cairo_rounded_path(cairo->cr, 1, 1, ((width + 
border_size)/cairo->scale)-2, total_height-2, border_radius);
-    cairo_clip(cairo->cr);
+    if (border_radius) {
+        bm_cairo_rounded_path(cairo->cr, 1, 1, ((width + border_size) / 
cairo->scale) - 2, total_height - 2, border_radius);
+        cairo_clip(cairo->cr);
+    }
 
     if (menu->title) {
         /* Essentially hide the title text if we are drawing lines "up". */
@@ -370,9 +372,7 @@
             bm_cairo_draw_line_str(cairo, &paint, &result, "");
         } else if (menu->password == BM_PASSWORD_INDICATOR) {
             char asterisk_print[1024] = "";
-        
             for (int i = 0; i < (int)(strlen(filter_text)); ++i) 
asterisk_print[i] = '*';
-        
             bm_cairo_draw_line(cairo, &paint, &result, "%s", asterisk_print);
         } else if (menu->password == BM_PASSWORD_NONE) {
             bm_cairo_draw_line(cairo, &paint, &result, "%s", filter_text);
@@ -410,18 +410,18 @@
         }
 
         const uint32_t page = (menu->index / lines) * lines;
-        
+
         for (uint32_t l = 0, i = page; l < lines && posy < max_height; ++i, 
++l) {
             if (!menu->fixed_height && i >= count) {
                 continue;
             }
 
-
             uint32_t is_fixed_up = (menu->fixed_height && menu->lines_mode == 
BM_LINES_UP);
             uint32_t required_empty = (count > lines ? 0 : lines - count);
-            int32_t last_item_index = (count < lines ? count - 1 + page : 
lines - 1 + page);
-            int32_t display_item_index = (menu->lines_mode == BM_LINES_DOWN ? 
i : menu->fixed_height ? last_item_index - i + page + required_empty  : 
last_item_index - i + page);
-            display_item_index = (display_item_index < 0 ? 0 : 
display_item_index);
+            uint32_t last_item_index = (count < lines ? count - 1 + page : 
lines - 1 + page);
+            last_item_index = MAX(MIN(last_item_index, count - 1), 0);
+            uint32_t display_item_index = (menu->lines_mode == BM_LINES_DOWN ? 
i : menu->fixed_height ? last_item_index - i + page + required_empty  : 
last_item_index - i + page);
+            display_item_index = MAX(MIN(display_item_index, count - 1), 0);
 
             bool highlighted = false;
             if ((i < count && !is_fixed_up) || (is_fixed_up && 
display_item_index <= last_item_index)) {
@@ -446,10 +446,10 @@
                 bm_cairo_color_from_menu_color(menu, BM_COLOR_ITEM_FG, 
&paint.fg);
                 bm_cairo_color_from_menu_color(menu, BM_COLOR_ITEM_BG, 
&paint.bg);
             }
-            
+
             char *line_str = "";
             if ((i < count && !is_fixed_up) || (is_fixed_up && 
display_item_index <= last_item_index)) {
-                line_str = 
bm_cairo_entry_message(items[display_item_index]->text, highlighted, 
menu->event_feedback, i,  count);
+                line_str = 
bm_cairo_entry_message(items[display_item_index]->text, highlighted, 
menu->event_feedback, i, count);
             }
 
             if (menu->prefix && highlighted) {
@@ -505,7 +505,7 @@
             cl += result.x_advance + 1;
         }
 
-        for (uint32_t i = menu->index; i < count && cl < (width/cairo->scale); 
++i) { 
+        for (uint32_t i = menu->index; i < count && cl < (width/cairo->scale); 
++i) {
             bool highlighted = (items[i] == 
bm_menu_get_highlighted_item(menu));
 
             if (highlighted) {
@@ -538,14 +538,14 @@
             paint.box = (struct box){ 1, 2, vpadding, -vpadding, 0, height };
             bm_cairo_draw_line(cairo, &paint, &result, ">");
         }
-        
+
     }
 
     if (menu->lines_mode == BM_LINES_UP) {
         if (menu->title) {
             bm_cairo_color_from_menu_color(menu, BM_COLOR_TITLE_FG, &paint.fg);
             bm_cairo_color_from_menu_color(menu, BM_COLOR_TITLE_BG, &paint.bg);
-        
+
             paint.pos = (struct pos){ border_size + 4, posy + vpadding + 
border_size };
             paint.box = (struct box){ 4, 16, vpadding, -vpadding, 0, height };
             bm_cairo_draw_line(cairo, &paint, &result, "%s", menu->title);
@@ -568,9 +568,7 @@
             bm_cairo_draw_line_str(cairo, &paint, &result, "");
         } else if (menu->password == BM_PASSWORD_INDICATOR) {
             char asterisk_print[1024] = "";
-        
             for (int i = 0; i < (int)(strlen(filter_text)); ++i) 
asterisk_print[i] = '*';
-        
             bm_cairo_draw_line(cairo, &paint, &result, "%s", asterisk_print);
         } else if (menu->password == BM_PASSWORD_NONE) {
             bm_cairo_draw_line(cairo, &paint, &result, "%s", filter_text);
@@ -587,7 +585,7 @@
         char counter[128];
         snprintf(counter, sizeof(counter), "[%u/%u]", filtered_item_count, 
total_item_count);
         bm_pango_get_text_extents(cairo, &paint, &result, "%s", counter);
-        
+
         bm_cairo_color_from_menu_color(menu, BM_COLOR_ITEM_FG, &paint.fg);
         bm_cairo_color_from_menu_color(menu, BM_COLOR_ITEM_BG, &paint.bg);
         paint.pos = (struct pos){ width/cairo->scale - result.x_advance - 10, 
vpadding + border_size };
@@ -604,7 +602,7 @@
         bm_cairo_rounded_path(cairo->cr, 1, 1, ((width + 
border_size)/cairo->scale)-2, total_height-2, border_radius);
     }
     cairo_set_line_width(cairo->cr, 2 * menu->border_size);
-    
+
     cairo_stroke(cairo->cr);
 
     out_result->height += 2 * border_size;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/bemenu-0.6.22/lib/renderers/wayland/window.c 
new/bemenu-0.6.23/lib/renderers/wayland/window.c
--- old/bemenu-0.6.22/lib/renderers/wayland/window.c    2024-07-08 
01:51:20.000000000 +0200
+++ new/bemenu-0.6.23/lib/renderers/wayland/window.c    2024-07-19 
06:12:27.000000000 +0200
@@ -108,7 +108,7 @@
 }
 
 static bool
-create_buffer(struct wl_shm *shm, struct buffer *buffer, int32_t width, 
int32_t height, uint32_t format, double scale)
+create_buffer(struct wl_shm *shm, struct buffer *buffer, int32_t width, 
int32_t height, uint32_t format, double scale, bool antialiasing)
 {
     int fd = -1;
     struct wl_shm_pool *pool = NULL;
@@ -154,6 +154,12 @@
         buffer->cairo.scale = scale;
     }
 
+    if (antialiasing) {
+        buffer->cairo.antialiasing = true;
+    } else {
+        buffer->cairo.antialiasing = false;
+    }
+
     if (!bm_cairo_create_for_surface(&buffer->cairo, surf)) {
         cairo_surface_destroy(surf);
         goto fail;
@@ -192,7 +198,7 @@
     if ((uint32_t) ceil(window->width * window->scale) != buffer->width || 
(uint32_t) ceil(window->height * window->scale) != buffer->height)
         destroy_buffer(buffer);
 
-    if (!buffer->buffer && !create_buffer(window->shm, buffer, 
ceil(window->width * window->scale), ceil(window->height * window->scale), 
WL_SHM_FORMAT_ARGB8888, window->scale))
+    if (!buffer->buffer && !create_buffer(window->shm, buffer, 
ceil(window->width * window->scale), ceil(window->height * window->scale), 
WL_SHM_FORMAT_ARGB8888, window->scale, !window->wayland->fractional_scaling))
         return NULL;
 
     return buffer;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/bemenu-0.6.22/lib/renderers/x11/window.c 
new/bemenu-0.6.23/lib/renderers/x11/window.c
--- old/bemenu-0.6.22/lib/renderers/x11/window.c        2024-07-08 
01:51:20.000000000 +0200
+++ new/bemenu-0.6.23/lib/renderers/x11/window.c        2024-07-19 
06:12:27.000000000 +0200
@@ -29,6 +29,8 @@
         buffer->cairo.scale = 1;
     }
 
+    buffer->cairo.antialiasing = true;
+
     if (!bm_cairo_create_for_surface(&buffer->cairo, surf)) {
         cairo_surface_destroy(surf);
         goto fail;

Reply via email to