Ticket #4915: lxpanel-0.5.12-interpret-%c-in-desktop-files.patch

File lxpanel-0.5.12-interpret-%c-in-desktop-files.patch, 1.4 KB (added by Miklos Karacsony, 11 years ago)
  • TabularUnified src/plugins/menu.c

    From c483bc086cdcd4c7b6bf0d9a3b0ea331892a803f Mon Sep 17 00:00:00 2001
    From: Max Krummenacher <max.oss.09@gmail.com>
    Date: Sat, 18 Jan 2014 10:52:21 +0100
    Subject: [PATCH] menu: fix ID: 3614733, doesn't interpret %c in .desktop
    
    lxpanel doesn't interpret %c in .desktop files correctly - ID: 3614733
    As a result items using %c won't start, e.g. a lot of KDE applications fail
    as %c is replaced by nothing.
    Exec=kmines -caption %c
    
    Handle also %i correctly.
    
    While at it fix inconsistent whitespace (tab to spaces).
    ---
     src/plugins/menu.c | 12 +++++++++++-
     1 file changed, 11 insertions(+), 1 deletion(-)
    
    diff --git a/src/plugins/menu.c b/src/plugins/menu.c
    index 1a06eae..bf5d83c 100644
    a b menu_pos(GtkMenu *menu, gint *x, gint *y, gboolean *push_in, GtkWidget *widget)  
    198198
    199199static void on_menu_item( GtkMenuItem* mi, MenuCacheItem* item )
    200200{
    201     lxpanel_launch_app( menu_cache_app_get_exec(MENU_CACHE_APP(item)),
     201    char * exec;
     202    /* handle %c, %i field codes */
     203    exec = translate_exec_to_cmd(
     204            menu_cache_app_get_exec(MENU_CACHE_APP(item)),
     205            menu_cache_item_get_icon(item),
     206            menu_cache_item_get_name(item),
     207            NULL);
     208
     209    lxpanel_launch_app( exec,
    202210            NULL, menu_cache_app_get_use_terminal(MENU_CACHE_APP(item)));
     211
     212    g_free(exec);
    203213}
    204214
    205215/* load icon when mapping the menu item to speed up */