• Bug#1103872: Bug#1103871: unblock: vala-panel/24.05-3 (6/10)

    From Mike Gabriel@21:1/5 to Paul Gevers on Sat Apr 26 07:40:01 2025
    [continued from previous message]

    - g_signal_connect(action, "activate", G_CALLBACK(state_radio_cb), xml);
    - }
    - else if (action_type == DBUS_MENU_ACTION_CHECKMARK)
    - {
    - g_signal_handlers_disconnect_by_func_only(action, activate_checkbox_cb);
    - g_signal_connect(action, "activate", G_CALLBACK(activate_checkbox_cb), xml);
    - }
    - else
    - {
    - g_signal_handlers_disconnect_by_func_only(action, activate_ordinary_cb);
    - g_signal_connect(action, "activate", G_CALLBACK(activate_ordinary_cb), xml);
    - }
    -}
    -
    -G_GNUC_INTERNAL GAction *dbus_menu_action_reference(u_int32_t id, DBusMenuXml *xml,
    - DBusMenuModel *submenu,
    - GActionMap *action_group, - DBusMenuActionType action_type)
    -{
    - bool is_submenu = action_type == DBUS_MENU_ACTION_SUBMENU;
    - const char *action_prefix = is_submenu ? SUBMENU_PREFIX : ACTION_PREFIX;
    - g_autofree char *name = g_strdup_printf("%s%u", action_prefix, id); - GAction *ret = g_action_map_lookup_action(action_group, name);
    - bool check_parameter = false;
    - if (ret)
    - {
    - g_object_ref(ret);
    - const GVariantType *state_type = g_action_get_state_type(ret); - if (state_type == NULL)
    - check_parameter = check_parameter || action_type == DBUS_MENU_ACTION_NORMAL;
    - else if (is_submenu)
    - {
    - check_parameter = check_parameter ||
    - g_variant_type_equal(state_type, G_VARIANT_TYPE_BOOLEAN);
    - }
    - else
    - {
    - check_parameter = check_parameter ||
    - (action_type == DBUS_MENU_ACTION_RADIO &&
    - g_variant_type_equal(state_type, G_VARIANT_TYPE_STRING));
    - check_parameter =
    - check_parameter ||
    - (action_type == DBUS_MENU_ACTION_CHECKMARK &&
    - g_variant_type_equal(state_type, G_VARIANT_TYPE_BOOLEAN));
    - }
    - if (check_parameter)
    - dbus_menu_action_replace_signals(ret, xml, submenu, action_type);
    - else
    - g_action_map_remove_action(action_group, name);
    - }
    - if (ret == NULL || !check_parameter)
    - {
    - if (is_submenu)
    - ret = dbus_menu_submenu_action_new(submenu);
    - else
    - ret = dbus_menu_action_new(xml, id, action_type);
    - g_action_map_add_action(G_ACTION_MAP(action_group), ret);
    - }
    - return ret;
    -}
    -
    -G_GNUC_INTERNAL void dbus_menu_action_lock(GAction *action)
    -{
    - g_signal_handlers_block_by_func_only(action, activate_checkbox_cb);
    - g_signal_handlers_block_by_func_only(action, state_radio_cb);
    -}
    -
    -G_GNUC_INTERNAL void dbus_menu_action_unlock(GAction *action)
    -{
    - g_signal_handlers_unblock_by_func_only(action, activate_checkbox_cb);
    - g_signal_handlers_unblock_by_func_only(action, state_radio_cb);
    -}
    diff -Nru -w vala-panel-appmenu-0.7.6+dfsg1/lib/dbusmenu-importer/utils.h vala-panel-appmenu-24.05+dfsg/lib/dbusmenu-importer/utils.h
    --- vala-panel-appmenu-0.7.6+dfsg1/lib/dbusmenu-importer/utils.h 2020-10-28 22:08:48.000000000 +0100
    +++ vala-panel-appmenu-24.05+dfsg/lib/dbusmenu-importer/utils.h 1970-01-01 01:00:00.000000000 +0100
    @@ -1,45 +0,0 @@
    -/*
    - * vala-panel-appmenu
    - * Copyright (C) 2018 Konstantin Pugin <ria.freelander@gmail.com>
    - *
    - * This program is free software: you can redistribute it and/or modify
    - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or
    - * (at your option) any later version.
    - *
    - * This program is distributed in the hope that it will be useful,
    - * but WITHOUT ANY WARRANTY; without even the implied warranty of
    - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    - * GNU General Public License for more details.
    - *
    - * You should have received a copy of the GNU Lesser General Public License
    - * along with this program. If not, see <http://www.gnu.org/licenses/>.
    - */
    -
    -#ifndef