value "show_splash" int: 0;
value "init_default_theme" string: "default.edj";
value "desktop_default_name" string: "%i-%i";
+ value "desktop_default_window_profile" string: "";
value "menus_scroll_speed" double: 1000.0;
value "menus_fast_mouse_move_threshhold" double: 300.0;
value "menus_click_drag_timeout" double: 0.25;
value "xkb.only_label" int: 0;
value "xkb.default_model" string: "default";
value "exe_always_single_instance" uchar: 0;
+ value "use_desktop_window_profile" int: 0;
value "powersave.none" double: 0.25;
value "powersave.low" double: 5.0;
value "powersave.medium" double: 60.0;
value "show_splash" int: 1;
value "init_default_theme" string: "default.edj";
value "desktop_default_name" string: "%i-%i";
+ value "desktop_default_window_profile" string: "mobile";
value "menus_scroll_speed" double: 1000.0000000000000000000000000;
value "menus_fast_mouse_move_threshhold" double: 300.0000000000000000000000000;
value "menus_click_drag_timeout" double: 0.2500000000000000000000000;
value "xkb.only_label" int: 0;
value "xkb.default_model" string: "default";
value "exe_always_single_instance" uchar: 1;
+ value "use_desktop_window_profile" int: 0;
}
value "show_splash" int: 1;
value "init_default_theme" string: "default.edj";
value "desktop_default_name" string: "%i-%i";
+ value "desktop_default_window_profile" string: "standard";
value "menus_scroll_speed" double: 1000.0;
value "menus_fast_mouse_move_threshhold" double: 300.0;
value "menus_click_drag_timeout" double: 0.25;
value "xkb.only_label" int: 0;
value "xkb.default_model" string: "default";
value "exe_always_single_instance" uchar: 0;
+ value "use_desktop_window_profile" int: 0;
}
void *event);
static void _e_border_cb_drag_finished(E_Drag *drag,
int dropped);
+static Eina_Bool _e_border_cb_desk_window_profile_change(void *data,
+ int ev_type,
+ void *ev);
static void _e_border_eval(E_Border *bd);
static void _e_border_eval0(E_Border *bd);
_e_border_cb_config_icon_theme, NULL);
E_LIST_HANDLER_APPEND(handlers, E_EVENT_CONFIG_MODE_CHANGED,
_e_border_cb_config_mode, NULL);
+ E_LIST_HANDLER_APPEND(handlers, E_EVENT_DESK_WINDOW_PROFILE_CHANGE,
+ _e_border_cb_desk_window_profile_change, NULL);
if (!borders_hash) borders_hash = eina_hash_string_superfast_new(NULL);
video_parent = EINA_TRUE;
else if (atoms[i] == ECORE_X_ATOM_E_VIDEO_POSITION)
video_position = EINA_TRUE;
+ /* loop to check for window profile list atom */
+ else if (atoms[i] == ECORE_X_ATOM_E_WINDOW_PROFILE_SUPPORTED)
+ bd->client.e.fetch.profile = 1;
}
if (video_position && video_parent)
{
E_OBJECT_CHECK(desk);
E_OBJECT_TYPE_CHECK(desk, E_DESK_TYPE);
if (bd->desk == desk) return;
+ if ((e_config->use_desktop_window_profile) &&
+ (bd->client.e.state.profile.use))
+ {
+ if (bd->client.e.state.profile.wait_for_done) return;
+ if (strcmp(bd->client.e.state.profile.name, desk->window_profile) != 0)
+ {
+ ecore_x_e_window_profile_change_request_send(bd->client.win,
+ desk->window_profile);
+ bd->client.e.state.profile.wait_for_done = 1;
+ return;
+ }
+ }
ecore_x_window_shadow_tree_flush();
if (bd->fullscreen)
{
static void
_e_border_free(E_Border *bd)
{
+ if (bd->client.e.state.profile.use)
+ {
+ if (bd->client.e.state.profile.available_list)
+ {
+ int i;
+ for (i = 0; i < bd->client.e.state.profile.num; i++)
+ {
+ if (bd->client.e.state.profile.available_list[i])
+ {
+ eina_stringshare_del(bd->client.e.state.profile.available_list[i]);
+ bd->client.e.state.profile.available_list[i] = NULL;
+ }
+ }
+ E_FREE(bd->client.e.state.profile.available_list);
+ bd->client.e.state.profile.available_list = NULL;
+ }
+
+ bd->client.e.state.profile.num = 0;
+
+ if (bd->client.e.state.profile.name)
+ {
+ eina_stringshare_del(bd->client.e.state.profile.name);
+ bd->client.e.state.profile.name = NULL;
+ }
+
+ bd->client.e.state.profile.wait_for_done = 0;
+ bd->client.e.state.profile.use = 0;
+ }
if (bd->client.e.state.video_parent && bd->client.e.state.video_parent_border)
{
bd->client.e.state.video_parent_border->client.e.state.video_child =
bd->client.netwm.fetch.state = 1;
bd->changed = 1;
}
+ else if (e->atom == ECORE_X_ATOM_E_WINDOW_PROFILE_SUPPORTED)
+ {
+ bd->client.e.fetch.profile = 1;
+ bd->changed = 1;
+ }
+ else if (e->atom == ECORE_X_ATOM_E_WINDOW_PROFILE_AVAILABLE_LIST)
+ {
+ bd->client.e.fetch.profile = 1;
+ bd->changed = 1;
+ }
return ECORE_CALLBACK_PASS_ON;
}
static Eina_Bool
_e_border_cb_client_message(void *data __UNUSED__,
int ev_type __UNUSED__,
- void *ev __UNUSED__)
+ void *ev)
{
- /*
- E_Border *bd;
- Ecore_X_Event_Client_Message *e;
+ E_Border *bd;
+ Ecore_X_Event_Client_Message *e;
+ char *profile = NULL;
- e = ev;
- bd = e_border_find_by_client_window(e->win);
- if (!bd) return 1;
- */
- return 1;
+ e = (Ecore_X_Event_Client_Message *)ev;
+ bd = e_border_find_by_client_window(e->win);
+ if (!bd) return ECORE_CALLBACK_PASS_ON;
+
+ if (e->message_type == ECORE_X_ATOM_E_WINDOW_PROFILE_CHANGE)
+ {
+ if (bd->client.e.state.profile.use)
+ {
+ profile = ecore_x_atom_name_get(e->data.l[1]);
+ ecore_x_e_window_profile_change_request_send(bd->client.win,
+ profile);
+ bd->client.e.state.profile.wait_for_done = 1;
+ }
+ }
+ else if (e->message_type == ECORE_X_ATOM_E_WINDOW_PROFILE_CHANGE_DONE)
+ {
+ if ((bd->client.e.state.profile.use) &&
+ (bd->client.e.state.profile.wait_for_done))
+ {
+ E_Container *con = bd->zone->container;
+ E_Desk *desk = NULL;
+
+ profile = ecore_x_atom_name_get(e->data.l[1]);
+ if (profile)
+ {
+ if (bd->client.e.state.profile.name)
+ eina_stringshare_del(bd->client.e.state.profile.name);
+ bd->client.e.state.profile.name = eina_stringshare_add(profile);
+ }
+
+ bd->client.e.state.profile.wait_for_done = 0;
+
+ desk = e_container_desk_window_profile_get(con, profile);
+ if ((desk) && (bd->desk != desk))
+ e_border_desk_set(bd, desk);
+ }
+ }
+
+ if (profile)
+ free(profile);
+
+ return ECORE_CALLBACK_PASS_ON;
}
static Eina_Bool
}
static Eina_Bool
+_e_border_cb_desk_window_profile_change(void *data __UNUSED__,
+ int ev_type __UNUSED__,
+ void *ev)
+{
+ E_Event_Desk_Window_Profile_Change *e;
+ Eina_List *l = NULL;
+ E_Border *bd;
+
+ e = (E_Event_Desk_Window_Profile_Change *)ev;
+ EINA_LIST_FOREACH(borders, l, bd)
+ {
+ if (!e_object_is_del(E_OBJECT(bd)))
+ {
+ bd->client.e.fetch.profile = 1;
+ bd->changed = 1;
+ }
+ }
+ return ECORE_CALLBACK_PASS_ON;
+}
+
+static Eina_Bool
_e_border_post_move_resize_job(void *data)
{
E_Border *bd;
{
int change_urgent = 0;
int rem_change = 0;
+ Eina_Bool need_desk_set = EINA_FALSE;
if (e_object_is_del(E_OBJECT(bd)))
{
bd->client.e.fetch.state = 0;
rem_change = 1;
}
+ if (bd->client.e.fetch.profile)
+ {
+ const char **list = NULL;
+ int n, i, res;
+ unsigned int use;
+
+ if (bd->client.e.state.profile.name)
+ {
+ eina_stringshare_del(bd->client.e.state.profile.name);
+ bd->client.e.state.profile.name = NULL;
+ }
+
+ if (bd->client.e.state.profile.available_list)
+ {
+ for (i = 0; i < bd->client.e.state.profile.num; i++)
+ {
+ if (bd->client.e.state.profile.available_list[i])
+ {
+ eina_stringshare_del(bd->client.e.state.profile.available_list[i]);
+ bd->client.e.state.profile.available_list[i] = NULL;
+ }
+ }
+ E_FREE(bd->client.e.state.profile.available_list);
+ bd->client.e.state.profile.available_list = NULL;
+ }
+ bd->client.e.state.profile.num = 0;
+
+ res = ecore_x_window_prop_card32_get(bd->client.win,
+ ECORE_X_ATOM_E_WINDOW_PROFILE_SUPPORTED,
+ &use,
+ 1);
+ if ((res == 1) && (use == 1))
+ {
+ Ecore_X_Atom val;
+ res = ecore_x_window_prop_atom_get(bd->client.win,
+ ECORE_X_ATOM_E_WINDOW_PROFILE_CHANGE,
+ &val, 1);
+ if (res == 1)
+ {
+ char *name = ecore_x_atom_name_get(val);
+ if (name)
+ {
+ bd->client.e.state.profile.name = eina_stringshare_add(name);
+ free(name);
+ }
+ }
+
+ if (ecore_x_e_window_available_profiles_get(bd->client.win, &list, &n))
+ {
+ bd->client.e.state.profile.available_list = E_NEW(const char *, n);
+ for (i = 0; i < n; i++)
+ bd->client.e.state.profile.available_list[i] = eina_stringshare_add(list[i]);
+ bd->client.e.state.profile.num = n;
+ }
+ need_desk_set = EINA_TRUE;
+ bd->client.e.state.profile.use = 1;
+
+ if (list)
+ free(list);
+ }
+
+ bd->client.e.fetch.profile = 0;
+ }
if (bd->client.netwm.fetch.type)
{
e_hints_window_type_get(bd);
bd->client.netwm.update.state = 0;
}
+ if ((e_config->use_desktop_window_profile) && (need_desk_set))
+ {
+ if (!(bd->client.e.state.profile.name) &&
+ (bd->client.e.state.profile.num >= 1))
+ {
+ const char *p = NULL;
+ int i;
+ for (i = 0; i < bd->client.e.state.profile.num; i++)
+ {
+ if (!bd->client.e.state.profile.available_list[i])
+ continue;
+ p = bd->client.e.state.profile.available_list[i];
+ if (strcmp(bd->desk->window_profile, p) == 0)
+ {
+ bd->client.e.state.profile.name = eina_stringshare_add(bd->desk->window_profile);
+ break;
+ }
+ }
+
+ if (!bd->client.e.state.profile.name)
+ {
+ E_Container *con = bd->zone->container;
+ E_Desk *desk = NULL;
+
+ for (i = 0; i < bd->client.e.state.profile.num; i++)
+ {
+ if (!bd->client.e.state.profile.available_list[i])
+ continue;
+ p = bd->client.e.state.profile.available_list[i];
+ desk = e_container_desk_window_profile_get(con, p);
+ if ((desk) && (bd->desk != desk))
+ {
+ bd->client.e.state.profile.name = eina_stringshare_add(p);
+ break;
+ }
+ }
+ }
+ }
+
+ if (!bd->client.e.state.profile.name)
+ {
+ bd->client.e.state.profile.name = eina_stringshare_add(bd->desk->window_profile);
+ }
+
+ ecore_x_e_window_profile_change_request_send(bd->client.win,
+ bd->client.e.state.profile.name);
+ bd->client.e.state.profile.wait_for_done = 1;
+ }
+
if (bd->new_client)
{
E_Event_Border_Add *ev;
Ecore_X_Window video_parent;
E_Border *video_parent_border;
Eina_List *video_child;
+ struct
+ {
+ const char *name;
+ const char **available_list;
+ int num;
+ unsigned char wait_for_done : 1;
+ unsigned char use : 1;
+ } profile;
unsigned char centered : 1;
unsigned char video : 1;
unsigned char state : 1;
unsigned char video_parent : 1;
unsigned char video_position : 1;
+ unsigned char profile : 1;
} fetch;
} e;
static E_Config_DD *_e_config_desktop_bg_edd = NULL;
static E_Config_DD *_e_config_desklock_bg_edd = NULL;
static E_Config_DD *_e_config_desktop_name_edd = NULL;
+static E_Config_DD *_e_config_desktop_window_profile_edd = NULL;
static E_Config_DD *_e_config_remember_edd = NULL;
static E_Config_DD *_e_config_color_class_edd = NULL;
static E_Config_DD *_e_config_gadcon_edd = NULL;
E_CONFIG_VAL(D, T, desk_y, INT);
E_CONFIG_VAL(D, T, name, STR);
+ _e_config_desktop_window_profile_edd = E_CONFIG_DD_NEW("E_Config_Desktop_Window_Profile", E_Config_Desktop_Window_Profile);
+#undef T
+#undef D
+#define T E_Config_Desktop_Window_Profile
+#define D _e_config_desktop_window_profile_edd
+ E_CONFIG_VAL(D, T, container, INT);
+ E_CONFIG_VAL(D, T, zone, INT);
+ E_CONFIG_VAL(D, T, desk_x, INT);
+ E_CONFIG_VAL(D, T, desk_y, INT);
+ E_CONFIG_VAL(D, T, profile, STR);
+
_e_config_path_append_edd = E_CONFIG_DD_NEW("E_Path_Dir", E_Path_Dir);
#undef T
#undef D
E_CONFIG_VAL(D, T, init_default_theme, STR); /**/
E_CONFIG_VAL(D, T, desktop_default_background, STR); /**/
E_CONFIG_VAL(D, T, desktop_default_name, STR); /**/
+ E_CONFIG_VAL(D, T, desktop_default_window_profile, STR); /**/
E_CONFIG_LIST(D, T, desktop_backgrounds, _e_config_desktop_bg_edd); /**/
E_CONFIG_LIST(D, T, desktop_names, _e_config_desktop_name_edd); /**/
+ E_CONFIG_LIST(D, T, desktop_window_profiles, _e_config_desktop_window_profile_edd);
E_CONFIG_VAL(D, T, menus_scroll_speed, DOUBLE); /**/
E_CONFIG_VAL(D, T, menus_fast_mouse_move_threshhold, DOUBLE); /**/
E_CONFIG_VAL(D, T, menus_click_drag_timeout, DOUBLE); /**/
//E_CONFIG_VAL(D, T, xkb.cur_group, INT);
E_CONFIG_VAL(D, T, exe_always_single_instance, UCHAR);
+
+ E_CONFIG_VAL(D, T, use_desktop_window_profile, INT);
e_config_load();
e_config_save_queue();
E_CONFIG_DD_FREE(_e_config_desktop_bg_edd);
E_CONFIG_DD_FREE(_e_config_desklock_bg_edd);
E_CONFIG_DD_FREE(_e_config_desktop_name_edd);
+ E_CONFIG_DD_FREE(_e_config_desktop_window_profile_edd);
E_CONFIG_DD_FREE(_e_config_remember_edd);
E_CONFIG_DD_FREE(_e_config_gadcon_edd);
E_CONFIG_DD_FREE(_e_config_gadcon_client_edd);
e_config->window_activehint_policy = 2;
IFCFGEND;
+ IFCFG(0x0162);
+ COPYSTR(desktop_default_window_profile);
+ COPYVAL(use_desktop_window_profile);
+ IFCFGEND;
+
e_config->config_version = E_CONFIG_FILE_VERSION;
_e_config_free(tcfg);
}
E_Config_Env_Var *evr;
E_Config_XKB_Layout *cl;
E_Config_XKB_Option *op;
+ E_Config_Desktop_Window_Profile *wp;
if (!ecf) return;
+ EINA_LIST_FREE(ecf->desktop_window_profiles, wp)
+ {
+ eina_stringshare_del(wp->profile);
+ E_FREE(wp);
+ }
+
eina_stringshare_del(ecf->xkb.default_model);
EINA_LIST_FREE(ecf->xkb.used_layouts, cl)
if (ecf->init_default_theme) eina_stringshare_del(ecf->init_default_theme);
if (ecf->desktop_default_background) eina_stringshare_del(ecf->desktop_default_background);
if (ecf->desktop_default_name) eina_stringshare_del(ecf->desktop_default_name);
+ if (ecf->desktop_default_window_profile) eina_stringshare_del(ecf->desktop_default_window_profile);
if (ecf->language) eina_stringshare_del(ecf->language);
eina_stringshare_del(ecf->desklock_language);
eina_stringshare_del(ecf->xkb.selected_layout);
typedef struct _E_Config_Desktop_Background E_Config_Desktop_Background;
typedef struct _E_Config_Desklock_Background E_Config_Desklock_Background;
typedef struct _E_Config_Desktop_Name E_Config_Desktop_Name;
+typedef struct _E_Config_Desktop_Window_Profile E_Config_Desktop_Window_Profile;
typedef struct _E_Config_Gadcon E_Config_Gadcon;
typedef struct _E_Config_Gadcon_Client E_Config_Gadcon_Client;
typedef struct _E_Config_Shelf E_Config_Shelf;
/* increment this whenever a new set of config values are added but the users
* config doesn't need to be wiped - simply new values need to be put in
*/
-#define E_CONFIG_FILE_GENERATION 0x0161
+#define E_CONFIG_FILE_GENERATION 0x0162
#define E_CONFIG_FILE_VERSION ((E_CONFIG_FILE_EPOCH << 16) | E_CONFIG_FILE_GENERATION)
struct _E_Config
const char *desktop_default_background; // GUI
Eina_List *desktop_backgrounds; // GUI
const char *desktop_default_name;
+ const char *desktop_default_window_profile;
Eina_List *desktop_names; // GUI
+ Eina_List *desktop_window_profiles; // GUI
double menus_scroll_speed; // GUI
double menus_fast_mouse_move_threshhold; // GUI
double menus_click_drag_timeout; // GUI
} xkb;
unsigned char exe_always_single_instance;
+ int use_desktop_window_profile; // GUI
};
struct _E_Config_Desklock_Background
const char *name;
};
+struct _E_Config_Desktop_Window_Profile
+{
+ int container;
+ int zone;
+ int desk_x;
+ int desk_y;
+ const char *profile;
+};
+
struct _E_Config_Gadcon
{
const char *name;
return NULL;
}
+EAPI E_Desk *
+e_container_desk_window_profile_get(E_Container *con,
+ const char *profile)
+{
+ Eina_List *l = NULL;
+ E_Zone *zone = NULL;
+ int x, y;
+
+ E_OBJECT_CHECK_RETURN(con, NULL);
+ E_OBJECT_TYPE_CHECK_RETURN(con, E_CONTAINER_TYPE, NULL);
+
+ EINA_LIST_FOREACH(con->zones, l, zone)
+ {
+ for (x = 0; x < zone->desk_x_count; x++)
+ {
+ for (y = 0; y < zone->desk_y_count; y++)
+ {
+ E_Desk *desk = e_desk_at_xy_get(zone, x, y);
+ if ((desk->window_profile) &&
+ strcmp(desk->window_profile, profile) == 0)
+ {
+ return desk;
+ }
+ }
+ }
+ }
+
+ return NULL;
+}
+
EAPI E_Container_Shape *
e_container_shape_add(E_Container *con)
{
EAPI E_Zone *e_container_zone_number_get(E_Container *con, int num);
EAPI E_Zone *e_container_zone_id_get(E_Container *con, int id);
+EAPI E_Desk *e_container_desk_window_profile_get(E_Container *con, const char *profile);
+
EAPI E_Container_Shape *e_container_shape_add(E_Container *con);
EAPI void e_container_shape_show(E_Container_Shape *es);
EAPI void e_container_shape_hide(E_Container_Shape *es);
static void _e_desk_event_desk_after_show_free(void *data, void *ev);
static void _e_desk_event_desk_deskshow_free(void *data, void *ev);
static void _e_desk_event_desk_name_change_free(void *data, void *ev);
+static void _e_desk_event_desk_window_profile_change_free(void *data, void *ev);
static void _e_desk_show_begin(E_Desk *desk, int mode, int x, int dy);
static void _e_desk_show_end(E_Desk *desk);
static Eina_Bool _e_desk_show_animator(void *data);
static void _e_desk_hide_begin(E_Desk *desk, int mode, int dx, int dy);
static void _e_desk_hide_end(E_Desk *desk);
static Eina_Bool _e_desk_hide_animator(void *data);
+static void _e_desk_window_profile_change_protocol_set(void);
EAPI int E_EVENT_DESK_SHOW = 0;
EAPI int E_EVENT_DESK_BEFORE_SHOW = 0;
EAPI int E_EVENT_DESK_AFTER_SHOW = 0;
EAPI int E_EVENT_DESK_DESKSHOW = 0;
EAPI int E_EVENT_DESK_NAME_CHANGE = 0;
+EAPI int E_EVENT_DESK_WINDOW_PROFILE_CHANGE = 0;
EINTERN int
e_desk_init(void)
E_EVENT_DESK_AFTER_SHOW = ecore_event_type_new();
E_EVENT_DESK_DESKSHOW = ecore_event_type_new();
E_EVENT_DESK_NAME_CHANGE = ecore_event_type_new();
+ E_EVENT_DESK_WINDOW_PROFILE_CHANGE = ecore_event_type_new();
return 1;
}
E_Desk *desk;
Eina_List *l;
E_Config_Desktop_Name *cfname;
+ E_Config_Desktop_Window_Profile *cfprof;
char name[40];
int ok = 0;
desk->name = eina_stringshare_add(name);
}
+ /* Get window profile name for current desktop */
+ ok = 0;
+ EINA_LIST_FOREACH(e_config->desktop_window_profiles, l, cfprof)
+ {
+ if ((cfprof->container >= 0) &&
+ ((int)zone->container->num != cfprof->container)) continue;
+ if ((cfprof->zone >= 0) &&
+ ((int)zone->num != cfprof->zone)) continue;
+ if ((cfprof->desk_x != desk->x) || (cfprof->desk_y != desk->y))
+ continue;
+ desk->window_profile = eina_stringshare_add(cfprof->profile);
+ ok = 1;
+ break;
+ }
+
+ if (!ok)
+ {
+ desk->window_profile = eina_stringshare_add
+ (e_config->desktop_default_window_profile);
+ }
+
return desk;
}
e_desk_show(e_desk_at_xy_get(zone, x, y));
}
+EAPI void
+e_desk_window_profile_set(E_Desk *desk,
+ const char *profile)
+{
+ E_Event_Desk_Window_Profile_Change *ev;
+
+ E_OBJECT_CHECK(desk);
+ E_OBJECT_TYPE_CHECK(desk, E_DESK_TYPE);
+
+ eina_stringshare_replace(&desk->window_profile, profile);
+
+ ev = E_NEW(E_Event_Desk_Window_Profile_Change, 1);
+ ev->desk = desk;
+ e_object_ref(E_OBJECT(desk));
+ ecore_event_add(E_EVENT_DESK_WINDOW_PROFILE_CHANGE, ev,
+ _e_desk_event_desk_window_profile_change_free, NULL);
+}
+
+EAPI void
+e_desk_window_profile_add(int container,
+ int zone,
+ int desk_x,
+ int desk_y,
+ const char *profile)
+{
+ E_Config_Desktop_Window_Profile *cfprof;
+
+ e_desk_window_profile_del(container, zone, desk_x, desk_y);
+
+ cfprof = E_NEW(E_Config_Desktop_Window_Profile, 1);
+ cfprof->container = container;
+ cfprof->zone = zone;
+ cfprof->desk_x = desk_x;
+ cfprof->desk_y = desk_y;
+ if (profile) cfprof->profile = eina_stringshare_add(profile);
+ else cfprof->profile = NULL;
+ e_config->desktop_window_profiles = eina_list_append(e_config->desktop_window_profiles, cfprof);
+}
+
+EAPI void
+e_desk_window_profile_del(int container,
+ int zone,
+ int desk_x,
+ int desk_y)
+{
+ Eina_List *l = NULL;
+ E_Config_Desktop_Window_Profile *cfprof = NULL;
+
+ EINA_LIST_FOREACH(e_config->desktop_window_profiles, l, cfprof)
+ {
+ if (!((cfprof->container == container) &&
+ (cfprof->zone == zone) &&
+ (cfprof->desk_x == desk_x) &&
+ (cfprof->desk_y == desk_y)))
+ continue;
+
+ e_config->desktop_window_profiles =
+ eina_list_remove_list(e_config->desktop_window_profiles, l);
+ if (cfprof->profile) eina_stringshare_del(cfprof->profile);
+ E_FREE(cfprof);
+ break;
+ }
+}
+
+EAPI void
+e_desk_window_profile_update(void)
+{
+ Eina_List *m, *c, *z, *l;
+ E_Manager *man;
+ E_Container *con;
+ E_Zone *zone;
+ E_Desk *desk;
+ E_Config_Desktop_Window_Profile *cfprof;
+ int d_x, d_y, ok;
+
+ _e_desk_window_profile_change_protocol_set();
+
+ if (!(e_config->use_desktop_window_profile))
+ return;
+
+ EINA_LIST_FOREACH(e_manager_list(), m, man)
+ {
+ EINA_LIST_FOREACH(man->containers, c, con)
+ {
+ EINA_LIST_FOREACH(con->zones, z, zone)
+ {
+ for (d_x = 0; d_x < zone->desk_x_count; d_x++)
+ {
+ for (d_y = 0; d_y < zone->desk_y_count; d_y++)
+ {
+ desk = zone->desks[d_x + zone->desk_x_count * d_y];
+ ok = 0;
+
+ EINA_LIST_FOREACH(e_config->desktop_window_profiles, l, cfprof)
+ {
+ if ((cfprof->container >= 0) &&
+ ((int)con->num != cfprof->container)) continue;
+ if ((cfprof->zone >= 0) &&
+ ((int)zone->num != cfprof->zone)) continue;
+ if ((cfprof->desk_x != d_x) ||
+ (cfprof->desk_y != d_y)) continue;
+ e_desk_window_profile_set(desk, cfprof->profile);
+ ok = 1;
+ break;
+ }
+
+ if (!ok)
+ {
+ e_desk_window_profile_set
+ (desk, e_config->desktop_default_window_profile);
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
static void
_e_desk_free(E_Desk *desk)
{
}
static void
+_e_desk_event_desk_window_profile_change_free(void *data __UNUSED__, void *event)
+{
+ E_Event_Desk_Window_Profile_Change *ev;
+ ev = event;
+ e_object_unref(E_OBJECT(ev->desk));
+ E_FREE(ev);
+}
+
+static void
_e_desk_show_begin(E_Desk *desk, int mode, int dx, int dy)
{
E_Border_List *bl;
return ECORE_CALLBACK_RENEW;
}
+
+static void
+_e_desk_window_profile_change_protocol_set(void)
+{
+ Eina_List *l = NULL;
+ E_Manager *man;
+
+ EINA_LIST_FOREACH(e_manager_list(), l, man)
+ {
+ ecore_x_e_window_profile_supported_set
+ (man->root, e_config->use_desktop_window_profile);
+ }
+}
typedef struct _E_Event_Desk_Before_Show E_Event_Desk_Before_Show;
typedef struct _E_Event_Desk_After_Show E_Event_Desk_After_Show;
typedef struct _E_Event_Desk_Name_Change E_Event_Desk_Name_Change;
+typedef struct _E_Event_Desk_Window_Profile_Change E_Event_Desk_Window_Profile_Change;
#else
#ifndef E_DESK_H
E_Zone *zone;
const char *name;
+ const char *window_profile;
int x, y;
unsigned char visible : 1;
unsigned int deskshow_toggle : 1;
E_Desk *desk;
};
+struct _E_Event_Desk_Window_Profile_Change
+{
+ E_Desk *desk;
+};
+
EINTERN int e_desk_init(void);
EINTERN int e_desk_shutdown(void);
EAPI E_Desk *e_desk_new(E_Zone *zone, int x, int y);
EAPI void e_desk_row_remove(E_Zone *zone);
EAPI void e_desk_col_add(E_Zone *zone);
EAPI void e_desk_col_remove(E_Zone *zone);
+EAPI void e_desk_window_profile_set(E_Desk *desk, const char *profile);
+EAPI void e_desk_window_profile_add(int container, int zone, int desk_x, int desk_y, const char *profile);
+EAPI void e_desk_window_profile_del(int container, int zone, int desk_x, int desk_y);
+EAPI void e_desk_window_profile_update(void);
extern EAPI int E_EVENT_DESK_SHOW;
extern EAPI int E_EVENT_DESK_BEFORE_SHOW;
extern EAPI int E_EVENT_DESK_AFTER_SHOW;
extern EAPI int E_EVENT_DESK_DESKSHOW;
extern EAPI int E_EVENT_DESK_NAME_CHANGE;
+extern EAPI int E_EVENT_DESK_WINDOW_PROFILE_CHANGE;
#endif
#endif
free(roots);
return 0;
}
+ ecore_x_e_window_profile_supported_set(roots[i],
+ e_config->use_desktop_window_profile);
}
free(roots);
int desk_y;
char *bg;
char *name;
+ char *profile;
Evas_Object *preview;
Ecore_Event_Handler *hdl;
const char *bg;
char name[40];
int ok = 0;
+ E_Config_Desktop_Window_Profile *prof;
bg = e_bg_file_get(cfdata->con_num, cfdata->zone_num, cfdata->desk_x, cfdata->desk_y);
if (!bg)
snprintf(name, sizeof(name), _(e_config->desktop_default_name), cfdata->desk_x, cfdata->desk_y);
cfdata->name = strdup(name);
}
+
+ ok = 0;
+ EINA_LIST_FOREACH(e_config->desktop_window_profiles, l, prof)
+ {
+ if (!((prof->container == cfdata->con_num) &&
+ (prof->zone == cfdata->zone_num) &&
+ (prof->desk_x == cfdata->desk_x) &&
+ (prof->desk_y == cfdata->desk_y)))
+ continue;
+
+ if (prof->profile)
+ cfdata->profile = strdup(prof->profile);
+ ok = 1;
+ break;
+ }
+
+ if (!ok)
+ cfdata->profile = strdup(e_config->desktop_default_window_profile);
}
static void *
E_FREE(cfdata->bg);
if (cfdata->name)
E_FREE(cfdata->name);
+ if (cfdata->profile)
+ E_FREE(cfdata->profile);
E_FREE(cfdata);
}
cfdata->name = strdup(name);
}
+ if (!cfdata->profile[0])
+ cfdata->profile = strdup(e_config->desktop_default_window_profile);
+
e_desk_name_del(cfdata->con_num, cfdata->zone_num,
cfdata->desk_x, cfdata->desk_y);
e_desk_name_add(cfdata->con_num, cfdata->zone_num,
cfdata->desk_x, cfdata->desk_y, cfdata->name);
e_desk_name_update();
+
+ e_desk_window_profile_del(cfdata->con_num, cfdata->zone_num,
+ cfdata->desk_x, cfdata->desk_y);
+ e_desk_window_profile_add(cfdata->con_num, cfdata->zone_num,
+ cfdata->desk_x, cfdata->desk_y, cfdata->profile);
+ e_desk_window_profile_update();
e_bg_del(cfdata->con_num, cfdata->zone_num, cfdata->desk_x, cfdata->desk_y);
e_bg_add(cfdata->con_num, cfdata->zone_num,
ob = e_widget_entry_add(evas, &(cfdata->name), NULL, NULL, NULL);
e_widget_frametable_object_append(of, ob, 1, 0, 2, 1, 1, 1, 1, 0);
e_widget_list_object_append(o, of, 1, 1, 0.5);
+
+ of = e_widget_frametable_add(evas, _("Desktop Window Profile"), 0);
+ ob = e_widget_label_add(evas, _("Profile Name:"));
+ e_widget_frametable_object_append(of, ob, 0, 0, 1, 1, 1, 1, 1, 0);
+ ob = e_widget_entry_add(evas, &(cfdata->profile), NULL, NULL, NULL);
+ e_widget_entry_readonly_set(ob, !(e_config->use_desktop_window_profile));
+ e_widget_frametable_object_append(of, ob, 1, 0, 2, 1, 1, 1, 1, 0);
+ e_widget_list_object_append(o, of, 1, 1, 0.5);
of = e_widget_frametable_add(evas, _("Desktop Wallpaper"), 0);
ob = e_widget_preview_add(evas, 240, (240 * zone->h) / zone->w);
int y;
int edge_flip_dragging;
int flip_wrap;
+ int use_desktop_window_profile;
int flip_mode;
int flip_interp;
double flip_speed;
cfdata->y = e_config->zone_desks_y_count;
cfdata->edge_flip_dragging = e_config->edge_flip_dragging;
cfdata->flip_wrap = e_config->desk_flip_wrap;
+ cfdata->use_desktop_window_profile = e_config->use_desktop_window_profile;
cfdata->flip_mode = e_config->desk_flip_animate_mode;
cfdata->flip_interp = e_config->desk_flip_animate_interpolation;
cfdata->flip_speed = e_config->desk_flip_animate_time;
e_config->edge_flip_dragging = cfdata->edge_flip_dragging;
e_config->desk_flip_wrap = cfdata->flip_wrap;
+ if (e_config->use_desktop_window_profile != cfdata->use_desktop_window_profile)
+ {
+ e_config->use_desktop_window_profile = cfdata->use_desktop_window_profile;
+ e_desk_window_profile_update();
+ }
+
e_config_save_queue();
return 1; /* Apply was OK */
}
(e_config->desk_flip_animate_interpolation != cfdata->flip_interp) ||
(e_config->desk_flip_animate_time != cfdata->flip_speed) ||
(e_config->edge_flip_dragging != cfdata->edge_flip_dragging) ||
- (e_config->desk_flip_wrap != cfdata->flip_wrap));
+ (e_config->desk_flip_wrap != cfdata->flip_wrap) ||
+ (e_config->use_desktop_window_profile != cfdata->use_desktop_window_profile));
}
/**--GUI--**/
e_widget_framelist_object_append(of, ob);
e_widget_list_object_append(o, of, 1, 0, 0.5);
+
+ of = e_widget_framelist_add(evas, _("Desktop Window Profile"), 0);
+
+ ob = e_widget_check_add(evas, _("Use desktop window profile"),
+ &(cfdata->use_desktop_window_profile));
+ e_widget_framelist_object_append(of, ob);
+
+ e_widget_list_object_append(o, of, 1, 0, 0.5);
e_widget_toolbook_page_append(otb, NULL, _("Desktops"), o, 1, 1, 1, 1,
0.5, 0.0);