Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package mako for openSUSE:Factory checked in at 2023-06-01 17:20:24 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/mako (Old) and /work/SRC/openSUSE:Factory/.mako.new.2531 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "mako" Thu Jun 1 17:20:24 2023 rev:9 rq:1090236 version:1.8.0 Changes: -------- --- /work/SRC/openSUSE:Factory/mako/mako.changes 2023-03-06 18:55:30.608652091 +0100 +++ /work/SRC/openSUSE:Factory/.mako.new.2531/mako.changes 2023-06-01 17:20:28.642500750 +0200 @@ -1,0 +2,8 @@ +Thu Jun 1 09:43:48 UTC 2023 - Michael Vetter <[email protected]> + +- Update to 1.8.9: + * A new `makoctl history` command to display history + * An action name can be passed to `makoctl invoke` + * `makoctl list` now includes desktop-entry and urgency + +------------------------------------------------------------------- Old: ---- v1.7.1.tar.gz New: ---- v1.8.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ mako.spec ++++++ --- /var/tmp/diff_new_pack.SCrccm/_old 2023-06-01 17:20:29.594506393 +0200 +++ /var/tmp/diff_new_pack.SCrccm/_new 2023-06-01 17:20:29.598506418 +0200 @@ -1,7 +1,7 @@ # # spec file for package mako # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: mako -Version: 1.7.1 +Version: 1.8.0 Release: 0 Summary: A Wayland notification daemon License: MIT ++++++ v1.7.1.tar.gz -> v1.8.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mako-1.7.1/config.c new/mako-1.8.0/config.c --- old/mako-1.7.1/config.c 2022-07-06 20:50:13.000000000 +0200 +++ new/mako-1.8.0/config.c 2023-06-01 10:33:17.000000000 +0200 @@ -126,7 +126,8 @@ style->anchor = ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP | ZWLR_LAYER_SURFACE_V1_ANCHOR_RIGHT; - style->button_bindings.left.action = MAKO_BINDING_INVOKE_DEFAULT_ACTION; + style->button_bindings.left.action = MAKO_BINDING_INVOKE_ACTION; + style->button_bindings.left.action_name = strdup(DEFAULT_ACTION_KEY); style->button_bindings.right.action = MAKO_BINDING_DISMISS; style->button_bindings.middle.action = MAKO_BINDING_NONE; style->touch_binding.action = MAKO_BINDING_DISMISS; @@ -141,6 +142,7 @@ static void finish_binding(struct mako_binding *binding) { free(binding->command); + free(binding->action_name); } void finish_style(struct mako_style *style) { @@ -163,6 +165,9 @@ if (src->command != NULL) { dst->command = strdup(src->command); } + if (src->action_name != NULL) { + dst->action_name = strdup(src->action_name); + } } // Update `target` with the values specified in `style`. If a failure occurs, @@ -646,7 +651,11 @@ } else if (strcmp(value, "dismiss-group") == 0) { binding.action = MAKO_BINDING_DISMISS_GROUP; } else if (strcmp(value, "invoke-default-action") == 0) { - binding.action = MAKO_BINDING_INVOKE_DEFAULT_ACTION; + binding.action = MAKO_BINDING_INVOKE_ACTION; + binding.action_name = strdup(DEFAULT_ACTION_KEY); + } else if (has_prefix(value, "invoke-action ")) { + binding.action = MAKO_BINDING_INVOKE_ACTION; + binding.action_name = strdup(value + strlen("invoke-action ")); } else if (has_prefix(value, "exec ")) { binding.action = MAKO_BINDING_EXEC; binding.command = strdup(value + strlen("exec ")); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mako-1.7.1/contrib/completions/bash/makoctl new/mako-1.8.0/contrib/completions/bash/makoctl --- old/mako-1.7.1/contrib/completions/bash/makoctl 2022-07-06 20:50:13.000000000 +0200 +++ new/mako-1.8.0/contrib/completions/bash/makoctl 2023-06-01 10:33:17.000000000 +0200 @@ -11,6 +11,7 @@ 'invoke' 'menu' 'list' + 'history' 'reload' 'set-mode' 'help' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mako-1.7.1/contrib/completions/fish/makoctl.fish new/mako-1.8.0/contrib/completions/fish/makoctl.fish --- old/mako-1.7.1/contrib/completions/fish/makoctl.fish 2022-07-06 20:50:13.000000000 +0200 +++ new/mako-1.8.0/contrib/completions/fish/makoctl.fish 2023-06-01 10:33:17.000000000 +0200 @@ -12,6 +12,7 @@ complete -c makoctl -n '__fish_makoctl_complete_no_subcommand' -a invoke -d 'Invoke an action on the notification (the last one if none is given)' -x complete -c makoctl -n '__fish_makoctl_complete_no_subcommand' -a menu -d 'Use a program to select one action to be invoked on the notification (the last one if none is given)' -x complete -c makoctl -n '__fish_makoctl_complete_no_subcommand' -a list -d 'List notifications' -x +complete -c makoctl -n '__fish_makoctl_complete_no_subcommand' -a history -d 'List history' -x complete -c makoctl -n '__fish_makoctl_complete_no_subcommand' -a reload -d 'Reload the configuration file' -x complete -c makoctl -n '__fish_makoctl_complete_no_subcommand' -a help -d 'Show help message and quit' -x diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mako-1.7.1/contrib/completions/zsh/_makoctl new/mako-1.8.0/contrib/completions/zsh/_makoctl --- old/mako-1.7.1/contrib/completions/zsh/_makoctl 2022-07-06 20:50:13.000000000 +0200 +++ new/mako-1.8.0/contrib/completions/zsh/_makoctl 2023-06-01 10:33:17.000000000 +0200 @@ -7,6 +7,7 @@ 'restore:Restore the most recently expired notification from the history buffer' 'invoke:Invoke an action on the first notification. If action is not specified, invoke the default action' 'list:Retrieve a list of current notifications' + 'history:Retrieve a list of dismissed notifications' 'reload:Reload the configuration file' 'help:Show help message and quit' ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mako-1.7.1/dbus/mako.c new/mako-1.8.0/dbus/mako.c --- old/mako-1.7.1/dbus/mako.c 2022-07-06 20:50:13.000000000 +0200 +++ new/mako-1.8.0/dbus/mako.c 2023-06-01 10:33:17.000000000 +0200 @@ -140,9 +140,7 @@ return sd_bus_reply_method_return(msg, ""); } -static int handle_list_notifications(sd_bus_message *msg, void *data, - sd_bus_error *ret_error) { - struct mako_state *state = data; +static int handle_list(sd_bus_message *msg, struct wl_list *list) { sd_bus_message *reply = NULL; int ret = sd_bus_message_new_method_return(msg, &reply); @@ -156,7 +154,7 @@ } struct mako_notification *notif; - wl_list_for_each(notif, &state->notifications, link) { + wl_list_for_each(notif, list, link) { ret = sd_bus_message_open_container(reply, 'a', "{sv}"); if (ret < 0) { return ret; @@ -180,6 +178,12 @@ return ret; } + ret = sd_bus_message_append(reply, "{sv}", "desktop-entry", + "s", notif->desktop_entry); + if (ret < 0) { + return ret; + } + ret = sd_bus_message_append(reply, "{sv}", "summary", "s", notif->summary); if (ret < 0) { @@ -198,6 +202,12 @@ return ret; } + ret = sd_bus_message_append(reply, "{sv}", "urgency", + "y", notif->urgency); + if (ret < 0) { + return ret; + } + ret = sd_bus_message_open_container(reply, 'e', "sv"); if (ret < 0) { return ret; @@ -261,6 +271,18 @@ return 0; } +static int handle_list_notifications(sd_bus_message *msg, void *data, + sd_bus_error *ret_error) { + struct mako_state *state = data; + return handle_list(msg, &state->notifications); +} + +static int handle_list_history(sd_bus_message *msg, void *data, + sd_bus_error *ret_error) { + struct mako_state *state = data; + return handle_list(msg, &state->history); +} + /** * The way surfaces are re-build here is not quite intuitive. * 1. All surfaces are destroyed. @@ -422,6 +444,7 @@ SD_BUS_METHOD("InvokeAction", "us", "", handle_invoke_action, SD_BUS_VTABLE_UNPRIVILEGED), SD_BUS_METHOD("RestoreNotification", "", "", handle_restore_action, SD_BUS_VTABLE_UNPRIVILEGED), SD_BUS_METHOD("ListNotifications", "", "aa{sv}", handle_list_notifications, SD_BUS_VTABLE_UNPRIVILEGED), + SD_BUS_METHOD("ListHistory", "", "aa{sv}", handle_list_history, SD_BUS_VTABLE_UNPRIVILEGED), SD_BUS_METHOD("Reload", "", "", handle_reload, SD_BUS_VTABLE_UNPRIVILEGED), SD_BUS_METHOD("SetMode", "s", "", handle_set_mode, SD_BUS_VTABLE_UNPRIVILEGED), SD_BUS_METHOD("ListModes", "", "as", handle_list_modes, SD_BUS_VTABLE_UNPRIVILEGED), diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mako-1.7.1/icon.c new/mako-1.8.0/icon.c --- old/mako-1.7.1/icon.c 2022-07-06 20:50:13.000000000 +0200 +++ new/mako-1.8.0/icon.c 2023-06-01 10:33:17.000000000 +0200 @@ -20,6 +20,27 @@ #include <gdk-pixbuf/gdk-pixbuf.h> #include "cairo-pixbuf.h" +static bool validate_icon_name(const char* icon_name) { + int icon_len = strlen(icon_name); + if (icon_len > 1024) { + return false; + } + int index; + for (index = 0; index < icon_len; index ++) { + bool is_number = icon_name[index] >= '0' && icon_name[index] <= '9'; + bool is_abc = (icon_name[index] >= 'A' && icon_name[index] <= 'Z') || + (icon_name[index] >= 'a' && icon_name[index] <= 'z'); + bool is_other = icon_name[index] == '-' + || icon_name[index] == '.' || icon_name[index] == '_'; + + bool is_legal = is_number || is_abc || is_other; + if (!is_legal) { + return false; + } + } + return true; +} + static GdkPixbuf *load_image(const char *path) { if (strlen(path) == 0) { return NULL; @@ -124,6 +145,11 @@ char *icon_path = NULL; int32_t last_icon_size = 0; + + if (!validate_icon_name(icon_name)) { + return NULL; + } + while (theme_path) { if (strlen(theme_path) == 0) { continue; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mako-1.7.1/include/config.h new/mako-1.8.0/include/config.h --- old/mako-1.7.1/include/config.h 2022-07-06 20:50:13.000000000 +0200 +++ new/mako-1.8.0/include/config.h 2023-06-01 10:33:17.000000000 +0200 @@ -12,13 +12,14 @@ MAKO_BINDING_DISMISS, MAKO_BINDING_DISMISS_GROUP, MAKO_BINDING_DISMISS_ALL, - MAKO_BINDING_INVOKE_DEFAULT_ACTION, + MAKO_BINDING_INVOKE_ACTION, MAKO_BINDING_EXEC, }; struct mako_binding { enum mako_binding_action action; - char *command; // for MAKO_BINDING_EXEC + char *command; // for MAKO_BINDING_EXEC + char *action_name; // for MAKO_BINDING_INVOKE_ACTION }; enum mako_sort_criteria { @@ -109,6 +110,8 @@ struct mako_style superstyle; }; +#define DEFAULT_ACTION_KEY "default" + void init_default_config(struct mako_config *config); void finish_config(struct mako_config *config); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mako-1.7.1/include/notification.h new/mako-1.8.0/include/notification.h --- old/mako-1.7.1/include/notification.h 2022-07-06 20:50:13.000000000 +0200 +++ new/mako-1.8.0/include/notification.h 2023-06-01 10:33:17.000000000 +0200 @@ -76,8 +76,6 @@ uint32_t serial; }; -#define DEFAULT_ACTION_KEY "default" - typedef char *(*mako_format_func_t)(char variable, bool *markup, void *data); bool hotspot_at(struct mako_hotspot *hotspot, int32_t x, int32_t y); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mako-1.7.1/mako.5.scd new/mako-1.8.0/mako.5.scd --- old/mako-1.7.1/mako.5.scd 2022-07-06 20:50:13.000000000 +0200 +++ new/mako-1.8.0/mako.5.scd 2023-06-01 10:33:17.000000000 +0200 @@ -33,7 +33,7 @@ Bindings allow one to perform an action when an event is triggered. Supported values are _none_, _dismiss_, _dismiss-all_, _dismiss-group_, -_invoke-default-action_ and _exec <command>_. +_invoke-action <action>_, _invoke-default-action_ and _exec <command>_. *on-button-left*=_action_ Default: invoke-default-action @@ -64,6 +64,16 @@ on-notify=exec mpv /usr/share/sounds/freedesktop/stereo/message.oga ``` +When using _invoke-action_ or _invoke-default-action_ a xdg-activation +token will be sent to the client, allowing the client to request focus +from the compositor. The compositor must support the xdg_activation_v1 +protocol and allow the focus request for the example to work correctly: + +``` +[app-name="some-app-id" actionable] +on-button-left=invoke-action mail-reply-sender +``` + # STYLE OPTIONS *font*=_font_ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mako-1.7.1/makoctl new/mako-1.8.0/makoctl --- old/mako-1.7.1/makoctl 2022-07-06 20:50:13.000000000 +0200 +++ new/mako-1.8.0/makoctl 2023-06-01 10:33:17.000000000 +0200 @@ -20,6 +20,7 @@ echo " with the given id, or the last" echo " notification if none is given" echo " list List notifications" + echo " history List history" echo " reload Reload the configuration file" echo " mode List modes" echo " mode [-a mode]... [-r mode]... Add/remove modes" @@ -133,6 +134,9 @@ "list") call ListNotifications ;; +"history") + call ListHistory + ;; "reload") call Reload ;; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mako-1.7.1/makoctl.1.scd new/mako-1.8.0/makoctl.1.scd --- old/mako-1.7.1/makoctl.1.scd 2022-07-06 20:50:13.000000000 +0200 +++ new/mako-1.8.0/makoctl.1.scd 2023-06-01 10:33:17.000000000 +0200 @@ -67,11 +67,14 @@ *list* Retrieve a list of current notifications. +*history* + Retrieve a list of dismissed notifications. + *reload* Reloads the configuration file. -*mode* -*mode* -s <mode>... +*mode* ++ +*mode* -s <mode>... ++ *mode* [-a mode]... [-r mode]... When run without any option, retrieves a list of current modes. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mako-1.7.1/meson.build new/mako-1.8.0/meson.build --- old/mako-1.7.1/meson.build 2022-07-06 20:50:13.000000000 +0200 +++ new/mako-1.8.0/meson.build 2023-06-01 10:33:17.000000000 +0200 @@ -1,7 +1,7 @@ project( 'mako', 'c', - version: '1.7.1', + version: '1.8.0', license: 'MIT', meson_version: '>=0.60.0', default_options: [ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mako-1.7.1/notification.c new/mako-1.8.0/notification.c --- old/mako-1.7.1/notification.c 2022-07-06 20:50:13.000000000 +0200 +++ new/mako-1.8.0/notification.c 2023-06-01 10:33:17.000000000 +0200 @@ -349,6 +349,25 @@ return NULL; } +static void try_invoke_action(struct mako_notification *notif, + const char *target_action, + const struct mako_binding_context *ctx) { + struct mako_action *action; + wl_list_for_each(action, ¬if->actions, link) { + if (strcmp(action->key, target_action) == 0) { + char *activation_token = NULL; + if (ctx != NULL) { + activation_token = create_xdg_activation_token( + ctx->surface, ctx->seat, ctx->serial); + } + notify_action_invoked(action, activation_token); + free(activation_token); + break; + } + } + close_notification(notif, MAKO_NOTIFICATION_CLOSE_DISMISSED); +} + void notification_execute_binding(struct mako_notification *notif, const struct mako_binding *binding, const struct mako_binding_context *ctx) { @@ -364,21 +383,9 @@ case MAKO_BINDING_DISMISS_ALL: close_all_notifications(notif->state, MAKO_NOTIFICATION_CLOSE_DISMISSED); break; - case MAKO_BINDING_INVOKE_DEFAULT_ACTION:; - struct mako_action *action; - wl_list_for_each(action, ¬if->actions, link) { - if (strcmp(action->key, DEFAULT_ACTION_KEY) == 0) { - char *activation_token = NULL; - if (ctx != NULL) { - activation_token = create_xdg_activation_token(ctx->surface, - ctx->seat, ctx->serial); - } - notify_action_invoked(action, activation_token); - free(activation_token); - break; - } - } - close_notification(notif, MAKO_NOTIFICATION_CLOSE_DISMISSED); + case MAKO_BINDING_INVOKE_ACTION: + assert(binding->action_name != NULL); + try_invoke_action(notif, binding->action_name, ctx); break; case MAKO_BINDING_EXEC: assert(binding->command != NULL); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mako-1.7.1/render.c new/mako-1.8.0/render.c --- old/mako-1.7.1/render.c 2022-07-06 20:50:13.000000000 +0200 +++ new/mako-1.8.0/render.c 2023-06-01 10:33:17.000000000 +0200 @@ -271,30 +271,32 @@ switch (style->icon_location) { case MAKO_ICON_LOCATION_LEFT: xpos = offset_x + style->border_size + - (text_x - icon->width) / 2; + style->padding.left; ypos = ypos_center; break; case MAKO_ICON_LOCATION_RIGHT: xpos = offset_x + notif_width - style->border_size - - icon->width - style->margin.right; + style->padding.right - icon->width; ypos = ypos_center; break; case MAKO_ICON_LOCATION_TOP: xpos = xpos_center; - ypos = offset_y + style->border_size; + ypos = offset_y + style->border_size + + style->padding.top; break; case MAKO_ICON_LOCATION_BOTTOM: xpos = xpos_center; - ypos = offset_y + text_y + text_height + style->margin.bottom; + ypos = offset_y + notif_height - style->border_size - + style->padding.bottom - icon->height; break; } draw_icon(cairo, icon, xpos, ypos, scale); } if (icon_vertical) { - text_x = (notif_width - text_width) / 2; + text_x = (notif_width - text_width - border_size) / 2; } else { - text_y = (notif_height - text_height) / 2; + text_y = (notif_height - text_height - border_size) / 2; } // Render text diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mako-1.7.1/wayland.c new/mako-1.8.0/wayland.c --- old/mako-1.7.1/wayland.c 2022-07-06 20:50:13.000000000 +0200 +++ new/mako-1.8.0/wayland.c 2023-06-01 10:33:17.000000000 +0200 @@ -229,6 +229,9 @@ struct mako_surface *surface; wl_list_for_each(surface, &state->surfaces, link) { + if (!surface->surface_output) { + continue; + } if (surface->surface_output->scale > scale) { scale = surface->surface_output->scale; }
