desks: Assign some default desktop names
By default, desktops should (realistically) be assigned some form of name so that they are not blank. This Fixes the issue of no Desktop labels in the Virtual Desktop menu, and also fixes the issue mentioned in the below ticket where "Show on Specific Desktop" dialog would not show any type of description for the desktops when trying to place a shelf. NB: Uses the format of Desktop X,Y (ie: Desktop 0,1) Fixes T8838 @fix
This commit is contained in:
parent
e45170f27f
commit
f4e0d7612e
|
@ -116,7 +116,13 @@ e_desk_new(E_Zone *zone, int x, int y)
|
|||
break;
|
||||
}
|
||||
|
||||
if (!ok) desk->name = eina_stringshare_add("");
|
||||
if (!ok)
|
||||
{
|
||||
char buff[PATH_MAX];
|
||||
|
||||
snprintf(buff, sizeof(buff), _("Desktop %d,%d"), desk->x, desk->y);
|
||||
desk->name = eina_stringshare_add(buff);
|
||||
}
|
||||
|
||||
/* Get window profile name for current desktop */
|
||||
if (zone->randr2_id)
|
||||
|
@ -170,8 +176,16 @@ e_desk_name_add(int zone, int desk_x, int desk_y, const char *name)
|
|||
cfname->zone = zone;
|
||||
cfname->desk_x = desk_x;
|
||||
cfname->desk_y = desk_y;
|
||||
if (name) cfname->name = eina_stringshare_add(name);
|
||||
else cfname->name = NULL;
|
||||
if (name)
|
||||
cfname->name = eina_stringshare_add(name);
|
||||
else
|
||||
{
|
||||
char buff[PATH_MAX];
|
||||
|
||||
snprintf(buff, sizeof(buff), _("Desktop %d,%d"),
|
||||
cfname->desk_x, cfname->desk_y);
|
||||
cfname->name = eina_stringshare_add(buff);
|
||||
}
|
||||
e_config->desktop_names = eina_list_append(e_config->desktop_names, cfname);
|
||||
}
|
||||
|
||||
|
@ -219,7 +233,16 @@ e_desk_name_update(void)
|
|||
((int)zone->num != cfname->zone)) continue;
|
||||
if ((cfname->desk_x != d_x) ||
|
||||
(cfname->desk_y != d_y)) continue;
|
||||
e_desk_name_set(desk, cfname->name);
|
||||
if (cfname->name)
|
||||
e_desk_name_set(desk, cfname->name);
|
||||
else
|
||||
{
|
||||
char buff[PATH_MAX];
|
||||
|
||||
snprintf(buff, sizeof(buff), _("Desktop %d,%d"),
|
||||
cfname->desk_x, cfname->desk_y);
|
||||
e_desk_name_set(desk, buff);
|
||||
}
|
||||
ok = 1;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -71,6 +71,14 @@ _fill_data(E_Config_Dialog_Data *cfdata)
|
|||
|
||||
if (dn->name)
|
||||
cfdata->name = strdup(dn->name);
|
||||
else
|
||||
{
|
||||
char buff[PATH_MAX];
|
||||
|
||||
snprintf(buff, sizeof(buff), _("Desktop %d,%d"),
|
||||
cfdata->desk_x, cfdata->desk_y);
|
||||
cfdata->name = strdup(buff);
|
||||
}
|
||||
ok = 1;
|
||||
break;
|
||||
}
|
||||
|
@ -103,8 +111,12 @@ _basic_apply(E_Config_Dialog *cfd EINA_UNUSED, E_Config_Dialog_Data *cfdata)
|
|||
{
|
||||
if ((!cfdata->name) || (!cfdata->name[0]))
|
||||
{
|
||||
char buff[PATH_MAX];
|
||||
|
||||
free(cfdata->name);
|
||||
cfdata->name = strdup("");
|
||||
snprintf(buff, sizeof(buff), _("Desktop %d,%d"),
|
||||
cfdata->desk_x, cfdata->desk_y);
|
||||
cfdata->name = strdup(buff);
|
||||
}
|
||||
|
||||
e_desk_name_del(cfdata->zone_num,
|
||||
|
@ -151,7 +163,9 @@ _basic_create(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata)
|
|||
|
||||
if (cfdata->hdl)
|
||||
ecore_event_handler_del(cfdata->hdl);
|
||||
cfdata->hdl = ecore_event_handler_add(E_EVENT_BG_UPDATE, _cb_bg_change, cfdata);
|
||||
|
||||
cfdata->hdl =
|
||||
ecore_event_handler_add(E_EVENT_BG_UPDATE, _cb_bg_change, cfdata);
|
||||
|
||||
return o;
|
||||
}
|
||||
|
@ -192,4 +206,3 @@ _cb_bg_change(void *data, int type, void *event)
|
|||
|
||||
return ECORE_CALLBACK_PASS_ON;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue