From 83985771de909862980383d293e2b93fcf7bc448 Mon Sep 17 00:00:00 2001 From: skeezix Date: Wed, 11 Jan 2012 23:21:40 -0500 Subject: [PATCH] Attempting fix for latest mmenu beta (using .desktop loading) not exec'ing some pnd applications. I think -s was botched, and some attributes not used (cpu speed), which have been fixed/added now, using additional X-Pandora attributes to avoid 'guesswork' --- lib/pnd_desktop.c | 27 +++++++++++++++++++++++++++ minimenu/mmenu.conf | 2 +- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/lib/pnd_desktop.c b/lib/pnd_desktop.c index 54e40a5..168ae74 100644 --- a/lib/pnd_desktop.c +++ b/lib/pnd_desktop.c @@ -174,6 +174,17 @@ unsigned char pnd_emit_dotdesktop ( char *targetpath, char *pndrun, pnd_disco_t // emit fprintf ( f, "%s", buffer ); + + // and lets copy in some stuff in case it makes .desktop consumers life easier + if ( p -> exec ) { fprintf ( f, "X-Pandora-Exec=%s\n", p -> exec ); } + if ( p -> appdata_dirname ) { fprintf ( f, "X-Pandora-Appdata-Dirname=%s\n", p -> appdata_dirname ); } + if ( p -> execargs ) { fprintf ( f, "X-Pandora-ExecArgs=%s\n", p -> execargs ); } + if ( p -> object_flags & PND_DISCO_FLAG_OVR ) { fprintf ( f, "X-Pandora-Object-Flag-OVR=%s\n", "Yes" ); } + if ( p -> object_type == pnd_object_type_pnd ) { + fprintf ( f, "X-Pandora-Object-Path=%s\n", p -> object_path ); + fprintf ( f, "X-Pandora-Object-Filename=%s\n", p -> object_filename ); + } + } // categories @@ -850,6 +861,18 @@ pnd_disco_t *pnd_parse_dotdesktop ( char *ddpath, unsigned int flags ) { p -> clockspeed = strdup ( dd + 21 ); } else if ( strncmp ( dd, "X-Pandora-Startdir=", 19 ) == 0 ) { p -> startdir = strdup ( dd + 19 ); + } else if ( strncmp ( dd, "X-Pandora-Appdata-Dirname=", 26 ) == 0 ) { + p -> appdata_dirname = strdup ( dd + 26 ); + } else if ( strncmp ( dd, "X-Pandora-ExecArgs=", 19 ) == 0 ) { + p -> execargs = strdup ( dd + 19 ); + } else if ( strncmp ( dd, "X-Pandora-Exec=", 15 ) == 0 ) { + p -> exec = strdup ( dd + 15 ); + } else if ( strncmp ( dd, "X-Pandora-Object-Path=", 22 ) == 0 ) { + p -> object_path = strdup ( dd + 22 ); + } else if ( strncmp ( dd, "X-Pandora-Object-Filename=", 26 ) == 0 ) { + p -> object_filename = strdup ( dd + 26 ); + } else if ( strncmp ( dd, "X-Pandora-Object-Flag-OVR=", 26 ) == 0 ) { + p -> object_flags |= PND_DISCO_FLAG_OVR; } else if ( strncmp ( dd, "X-Pandora-MainCategory=", 23 ) == 0 ) { p -> main_category = strdup ( dd + 23 ); @@ -875,6 +898,7 @@ pnd_disco_t *pnd_parse_dotdesktop ( char *ddpath, unsigned int flags ) { if ( e ) { // probably libpnd app +#if 0 // no needed due to above X-Pandora attributes if ( e ) { e += 5; @@ -896,6 +920,7 @@ pnd_disco_t *pnd_parse_dotdesktop ( char *ddpath, unsigned int flags ) { char *space = strchr ( p, ' ' ); strncpy ( pndpath, p, space - p - 1 ); } +#endif } else { // probably not libpnd app @@ -965,6 +990,7 @@ pnd_disco_t *pnd_parse_dotdesktop ( char *ddpath, unsigned int flags ) { // additional p -> object_type = pnd_object_type_pnd; +#if 0 // nolonger needed due to above X-Pandora attributes char *source; if ( pndpath [ 0 ] ) { source = pndpath; @@ -980,6 +1006,7 @@ pnd_disco_t *pnd_parse_dotdesktop ( char *ddpath, unsigned int flags ) { p -> object_path = "./"; p -> object_filename = strdup ( source ); } +#endif // return disco-t return ( p ); diff --git a/minimenu/mmenu.conf b/minimenu/mmenu.conf index f1cb81c..70cb134 100644 --- a/minimenu/mmenu.conf +++ b/minimenu/mmenu.conf @@ -25,7 +25,7 @@ defer_icon_us 100000 # when background loading icons (load_icons_later), time b threaded_preview 0 # if 1, will try to load the preview in background, to avoid slowing up navigation loglevel 0 # 0 is debug, lots of crap; 3 is better, means 'errors only'. Output may screw up the wrapper! x11_present_sh /bin/pidof X # command to invoke to determine if X11 is running or not; expects a number on X is present. -disco_pnds 1 # if nonzero, will do application discovery on pnd-files +disco_pnds 0 # if nonzero, will do application discovery on pnd-files disco_dotdesktop 1 # if nonzero, will do application discovery on .desktop files disco_dotdesktop_all 0 # if nonzero, will include non-libpnd .desktop; if 0, just libpnd (pnd-found by pndnotifyd) will be included desktop_apps 1 # search the pnd standard desktop searchpath for apps -- 2.39.2