Menu

#558 LXPanel Menu doesn't use Path in desktop files

closed-fixed
nobody
lxpanel (297)
5
2013-08-25
2012-12-29
Anonymous
No

In the Freedesktop specifications for .desktop files (http://standards.freedesktop.org/desktop-entry-spec/latest/ar01s05.html), there is a Path key that can be used to set the working directory for an application. Some apps require to be run from their own dir to work (because they look for their data files in the current directory) and the Path key is used just for that.
It seems that the LXPanel Menu applet doesn't use the Path key (or fails to set the right directory) and when an application needs it, it just fails to start when run from the menu.

I'm not sure what the right way to fix this is (simply cd-ing to the right dir or setting an environment var?) but it should be quite simple. For the record, running software from the Applications entry of PCManFM works fine.

Using LXPanel 0.5.11 from the Ubuntu 12.10 repositories.

Discussion

  • Anonymous

    Anonymous - 2013-02-21

    I can confirm this in Lubuntu 12.10, as I cannot run CaveStory+ from the menu. (But runs fine from the desktop.)

     
  • Anonymous

    Anonymous - 2013-02-21

    Found the issue: http://lxde.git.sourceforge.net/git/gitweb.cgi?p=lxde/lxlauncher;a=blob;f=src/lxlauncher.c;h=e450f15c5b0aeb4373c108cbb2f9b2bba9c3e12c;hb=c0ed230f74a36f49e22dc4b96958c84336a5dcc2

    Lines 82-89 contains the functions that executes when clicking an application from the menu.

    82 static void on_app_btn_clicked( GtkButton* btn, MenuCacheApp* app )
    83 {
    84 lxlauncher_execute_app( gdk_screen_get_default(),
    85 NULL, menu_cache_app_get_exec(app),
    86 menu_cache_item_get_name(MENU_CACHE_ITEM(app)), NULL,
    87 menu_cache_app_get_use_terminal(app),
    88 NULL );
    89 }

    The second parameter in lxlauncher_execute_app() (which defines the working path) is NULL, it should be: menu_cache_app_get_working_dir(app)

    82 static void on_app_btn_clicked( GtkButton* btn, MenuCacheApp* app )
    83 {
    84 lxlauncher_execute_app( gdk_screen_get_default(),
    85 menu_cache_app_get_working_dir(app), menu_cache_app_get_exec(app),
    86 menu_cache_item_get_name(MENU_CACHE_ITEM(app)), NULL,
    87 menu_cache_app_get_use_terminal(app),
    88 NULL );
    89 }

     
  • Anonymous

    Anonymous - 2013-02-22

    Okay, was totally wrong last time. :P

    In LXPanel's misc.c there's a function called lxpanel_launch_app(): http://sourcecodebrowser.com/lxpanel/0.5.5/misc_8c.html#a92623acde5b503a468d41876c618a510

    This is what is called when an item left-clicked in the launchbar: http://sourcecodebrowser.com/lxpanel/0.5.5/launchbar_8c.html#a88f69c292653fbdf1a06c717cc6b1c3e

    The function lxpanel_launch_app() does not appear to manage working paths at all. (Unlike LXLauncher's lxlauncher_execute_app, both functions are so similar that I got confused. :P Should have realized it was the wrong program.)

     
  • Henry Gebhardt

    Henry Gebhardt - 2013-08-25
    • status: open --> closed-fixed
     
  • Henry Gebhardt

    Henry Gebhardt - 2013-08-25

    OK, should be fixed in the 'next-gtk2' branch in git.

     

Log in to post a comment.