be a bit nicer in auto desktop creation from bd

SVN revision: 51657
This commit is contained in:
Carsten Haitzler 2010-08-26 12:14:38 +00:00
parent 121f40d86f
commit 1301f7e510
1 changed files with 10 additions and 3 deletions

View File

@ -66,14 +66,15 @@ e_desktop_border_create(E_Border *bd)
{ {
Efreet_Desktop *desktop = NULL; Efreet_Desktop *desktop = NULL;
const char *desktop_dir, *icon_dir; const char *desktop_dir, *icon_dir;
const char *bname, *bclass; const char *bname, *bclass, *btitle;
char path[PATH_MAX]; char path[PATH_MAX];
bname = bd->client.icccm.name; bname = bd->client.icccm.name;
if ((bname) && (bname[0] == 0)) bname = NULL; if ((bname) && (bname[0] == 0)) bname = NULL;
bclass = bd->client.icccm.class; bclass = bd->client.icccm.class;
if ((bclass) && (bclass[0] == 0)) bclass = NULL; if ((bclass) && (bclass[0] == 0)) bclass = NULL;
btitle = e_border_name_get(bd);
desktop_dir = e_user_desktop_dir_get(); desktop_dir = e_user_desktop_dir_get();
if ((!desktop_dir) || (!e_util_dir_check(desktop_dir))) return NULL; if ((!desktop_dir) || (!e_util_dir_check(desktop_dir))) return NULL;
@ -114,6 +115,11 @@ e_desktop_border_create(E_Border *bd)
return NULL; return NULL;
} }
if (bclass) desktop->name = strdup(bclass); if (bclass) desktop->name = strdup(bclass);
else if (bname) desktop->name = strdup(bname);
else if (btitle) desktop->name = strdup(btitle);
if (btitle) desktop->comment = strdup(btitle);
if (bclass) desktop->startup_wm_class = strdup(bclass); if (bclass) desktop->startup_wm_class = strdup(bclass);
if (bd->client.icccm.command.argc > 0) if (bd->client.icccm.command.argc > 0)
// FIXME this should concat the entire argv array together // FIXME this should concat the entire argv array together
@ -121,7 +127,8 @@ e_desktop_border_create(E_Border *bd)
else if (bname) else if (bname)
desktop->exec = strdup(bname); desktop->exec = strdup(bname);
if (bd->client.netwm.startup_id > 0) desktop->startup_notify = 1; // disable this
// if (bd->client.netwm.startup_id > 0) desktop->startup_notify = 1;
if (bd->client.netwm.icons) if (bd->client.netwm.icons)
{ {
/* FIXME /* FIXME