e: rename option use_composite to use_shaped_win

In order to move composite inside the core we need to kill the
use_composite option. However in some places it is being used to switch
between ARGB and shaped windows. It doesn't make much sense to keep the
advanced/engine dialog to let the user toggle this options if we have
composite always enabledm, but lets allow the user to shoot
himself on the foot (for now).

Next step will be to move the comp module files to core so user can't
unload it anymore.



SVN revision: 82433
This commit is contained in:
Lucas De Marchi 2013-01-09 03:21:25 +00:00
parent 3ae4bff477
commit 0675dd03a0
16 changed files with 47 additions and 52 deletions

View File

@ -20,7 +20,7 @@ group "E_Config" struct {
value "zone_desks_y_count" int: 1;
value "show_desktop_icons" int: 1;
value "edge_flip_dragging" int: 0;
value "use_composite" int: 1;
value "use_shaped_win" int: 0;
value "no_module_delay" int: 1;
group "modules" list {
group "E_Config_Module" struct {

View File

@ -20,7 +20,7 @@ group "E_Config" struct {
value "zone_desks_y_count" int: 1;
value "show_desktop_icons" int: 1;
value "edge_flip_dragging" int: 1;
value "use_composite" int: 1;
value "use_shaped_win" int: 0;
value "language" string: "en_US.UTF-8";
value "window_placement_policy" int: 0;
value "window_grouping" int: 0;

View File

@ -20,7 +20,7 @@ group "E_Config" struct {
value "zone_desks_y_count" int: 1;
value "show_desktop_icons" int: 1;
value "edge_flip_dragging" int: 1;
value "use_composite" int: 1;
value "use_shaped_win" int: 0;
value "language" string: "en_US.UTF-8";
value "window_placement_policy" int: 0;
value "window_grouping" int: 0;

View File

@ -8303,7 +8303,7 @@ _e_border_eval0(E_Border *bd)
bd->bg_object = o;
if ((e_config->use_composite) && (!bd->client.argb))
if ((!e_config->use_shaped_win) && (!bd->client.argb))
{
argb_option = edje_object_data_get(o, "argb");
if ((argb_option) && (!strcmp(argb_option, "1")))

View File

@ -669,7 +669,7 @@ e_config_init(void)
E_CONFIG_VAL(D, T, zone_desks_y_count, INT); /**/
E_CONFIG_VAL(D, T, show_desktop_icons, INT); /**/
E_CONFIG_VAL(D, T, edge_flip_dragging, INT); /**/
E_CONFIG_VAL(D, T, use_composite, INT); /**/
E_CONFIG_VAL(D, T, use_shaped_win, INT); /**/
E_CONFIG_VAL(D, T, language, STR); /**/
E_CONFIG_VAL(D, T, no_module_delay, INT); /**/
E_CONFIG_VAL(D, T, desklock_language, STR); /**/

View File

@ -68,7 +68,7 @@ struct _E_Config
int zone_desks_y_count; // GUI
int show_desktop_icons; // GUI
int edge_flip_dragging; // GUI
int use_composite; // GUI
int use_shaped_win; // GUI
int no_module_delay; // GUI
const char *language; // GUI
const char *desklock_language; // GUI

View File

@ -1537,7 +1537,7 @@ e_configure_option_init(void)
co->funcs[0].none = _e_configure_zone_desks_count_changed;
OPT_ADD(BOOL, edge_flip_dragging, _("Edge flip while dragging"), _("edge"), _("flip"), _("drag"), _("binding"));
OPT_HELP(_("Enable edge binding functionality while dragging objects to screen edge"));
OPT_ADD(BOOL, use_composite, _("Use ARGB instead of shaped windows"), _("border"));
OPT_ADD(BOOL, use_shaped_win, _("Use shaped windows instead of ARGB"), _("border"));
OPT_ADD(CUSTOM, modules, _("Module settings"), _("module"));
co->info = eina_stringshare_add("extensions/modules");

View File

@ -156,7 +156,7 @@ e_drag_new(E_Container *container, int x, int y,
drag->ecore_evas = e_canvas_new(drag->container->win,
drag->x, drag->y, drag->w, drag->h, 1, 1,
&(drag->evas_win));
if (e_config->use_composite)
if (!e_config->use_shaped_win)
ecore_evas_alpha_set(drag->ecore_evas, 1);
else
{

View File

@ -1766,7 +1766,7 @@ _e_menu_realize(E_Menu *m)
if (m->shaped)
{
if (e_config->use_composite)
if (!e_config->use_shaped_win)
{
ecore_evas_alpha_set(m->ecore_evas, m->shaped);

View File

@ -91,7 +91,7 @@ e_popup_show(E_Popup *pop)
E_OBJECT_TYPE_CHECK(pop, E_POPUP_TYPE);
if (pop->visible) return;
pop->visible = 1;
if ((pop->shaped) && (!e_config->use_composite))
if (pop->shaped && e_config->use_shaped_win)
{
ecore_evas_move(pop->ecore_evas,
pop->zone->container->manager->w,
@ -103,7 +103,7 @@ e_popup_show(E_Popup *pop)
else
{
ecore_evas_show(pop->ecore_evas);
if (!(pop->shaped && e_config->use_composite))
if (!pop->shaped || e_config->use_shaped_win)
e_container_shape_show(pop->shape);
}
}
@ -196,7 +196,7 @@ e_popup_edje_bg_object_set(E_Popup *pop, Evas_Object *o)
pop->shaped = 1;
else
pop->shaped = 0;
if (e_config->use_composite)
if (!e_config->use_shaped_win)
{
ecore_evas_alpha_set(pop->ecore_evas, pop->shaped);
eina_hash_del(_e_popup_hash, e_util_winid_str_get(pop->evas_win), pop);
@ -300,7 +300,7 @@ e_popup_idler_before(void)
pop->need_shape_export = 0;
}
if ((pop->visible) && (!pop->idle_enterer) &&
(!pop->shaped && e_config->use_composite))
(!pop->shaped && !e_config->use_shaped_win))
e_container_shape_show(pop->shape);
}
}

View File

@ -89,12 +89,6 @@ e_modapi_init(E_Module *m)
mod->conf->lock_fps = 0;
mod->conf->indirect = 0;
if (!e_config->use_composite)
{
e_config->use_composite = 1;
e_config_save_queue();
}
/* XXX: update old configs. add config versioning */
if (mod->conf->first_draw_delay == 0)
mod->conf->first_draw_delay = 0.20;

View File

@ -6,7 +6,7 @@ static void _free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
static int _basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
static Evas_Object *_basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata);
static int _basic_check_changed(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
static void _cb_composite_change(void *data, Evas_Object *obj);
static void _cb_shaped_change(void *data, Evas_Object *obj);
static void _cb_confirm_yes(void *data);
static void _cb_confirm_no(void *data);
@ -14,8 +14,8 @@ struct _E_Config_Dialog_Data
{
E_Config_Dialog *cfd;
int use_composite;
Evas_Object *o_composite;
int use_shaped_win;
Evas_Object *o_shaped;
};
E_Config_Dialog *
@ -53,7 +53,7 @@ _create_data(E_Config_Dialog *cfd)
static void
_fill_data(E_Config_Dialog_Data *cfdata)
{
cfdata->use_composite = e_config->use_composite;
cfdata->use_shaped_win = e_config->use_shaped_win;
}
static void
@ -65,7 +65,7 @@ _free_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
static int
_basic_apply_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
{
e_config->use_composite = cfdata->use_composite;
e_config->use_shaped_win = cfdata->use_shaped_win;
e_config_save_queue();
return 1;
}
@ -73,7 +73,7 @@ _basic_apply_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
static int
_basic_check_changed(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
{
return !(cfdata->use_composite == e_config->use_composite);
return !(cfdata->use_shaped_win == e_config->use_shaped_win);
}
static Evas_Object *
@ -84,10 +84,10 @@ _basic_create_widgets(E_Config_Dialog *cfd __UNUSED__, Evas *evas, E_Config_Dial
o = e_widget_list_add(evas, 0, 0);
of = e_widget_framelist_add(evas, _("General Settings"), 0);
ob = e_widget_check_add(evas, _("Use ARGB instead of shaped windows"),
&(cfdata->use_composite));
cfdata->o_composite = ob;
e_widget_on_change_hook_set(ob, _cb_composite_change, cfdata);
ob = e_widget_check_add(evas, _("Use shaped windows instead of ARGB"),
&(cfdata->use_shaped_win));
cfdata->o_shaped = ob;
e_widget_on_change_hook_set(ob, _cb_shaped_change, cfdata);
e_widget_framelist_object_append(of, ob);
e_widget_list_object_append(o, of, 1, 0, 0.5);
@ -95,25 +95,26 @@ _basic_create_widgets(E_Config_Dialog *cfd __UNUSED__, Evas *evas, E_Config_Dial
}
static void
_cb_composite_change(void *data, Evas_Object *obj __UNUSED__)
_cb_shaped_change(void *data, Evas_Object *obj __UNUSED__)
{
E_Config_Dialog_Data *cfdata = NULL;
if (!(cfdata = data)) return;
if (cfdata->use_composite)
if (cfdata->use_shaped_win)
{
if (!ecore_x_screen_is_composited(0))
{
/* pop dialog */
e_confirm_dialog_show(_("Use ARGB instead of shaped windows"),
"preferences-engine",
_("You have chosen to enable ARGB composite "
"support,<br>but your current screen does "
"not support composite.<br><br>"
"Are you sure you wish to enable ARGB support?"),
_("Enable"), NULL, _cb_confirm_yes, _cb_confirm_no,
cfdata, cfdata, NULL, NULL);
}
if (ecore_x_screen_is_composited(0))
{
/* pop dialog */
e_confirm_dialog_show(_("Use shaped windows instead of ARGB"),
"preferences-engine",
_("You have chosen to use shaped windows<br>"
"but your current screen is composited."
"<br><br>"
"Are you really sure you wish to use<br>"
"shaped windows?"),
NULL, NULL, _cb_confirm_yes,
_cb_confirm_no, cfdata, cfdata, NULL, NULL);
}
}
}
@ -123,7 +124,7 @@ _cb_confirm_yes(void *data)
E_Config_Dialog_Data *cfdata = NULL;
if (!(cfdata = data)) return;
cfdata->use_composite = 1;
cfdata->use_shaped_win = 1;
e_config_dialog_changed_set(cfdata->cfd, _basic_check_changed(cfdata->cfd, cfdata));
}
@ -134,8 +135,8 @@ _cb_confirm_no(void *data)
E_Config_Dialog_Data *cfdata = NULL;
if (!(cfdata = data)) return;
cfdata->use_composite = 0;
e_widget_check_checked_set(cfdata->o_composite, 0);
cfdata->use_shaped_win = 0;
e_widget_check_checked_set(cfdata->o_shaped, 0);
e_config_dialog_changed_set(cfdata->cfd, _basic_check_changed(cfdata->cfd, cfdata));
}

View File

@ -806,7 +806,7 @@ _evry_window_new(E_Zone *zone, E_Zone_Edge edge)
{
win->shaped = EINA_TRUE;
if (e_config->use_composite)
if (!e_config->use_shaped_win)
{
ecore_evas_alpha_set(win->ewin->ecore_evas, 1);
win->ewin->evas_win = ecore_evas_software_x11_window_get(win->ewin->ecore_evas);

View File

@ -107,8 +107,8 @@ gadman_init(E_Module *m)
Man->height = Man->container->h;
/* Check if composite is enable */
if (ecore_x_screen_is_composited(0) || e_config->use_composite)
Man->use_composite = 1;
if (e_config->use_shaped_win)
Man->use_shaped_win = 0;
/* with this we can trap screen resolution change (a better way?)*/
e_container_shape_change_callback_add(Man->container, on_shape_change, NULL);
@ -742,7 +742,7 @@ _gadman_gadcon_new(const char *name, Gadman_Layer_Type layer, E_Zone *zone, E_Ga
&(Man->top_win));
}
if (Man->use_composite)
if (!Man->use_shaped_win)
{
ecore_evas_alpha_set(Man->top_ee, 1);
Man->top_win = ecore_evas_software_x11_window_get(Man->top_ee);

View File

@ -63,7 +63,7 @@ struct _Manager
Ecore_Event_Handler *add;
int visible;
int use_composite;
int use_shaped_win;
Ecore_X_Window top_win;
Ecore_Evas *top_ee;
E_Container *container;

View File

@ -280,7 +280,7 @@ _theme_edje_object_set_aux(Evas_Object *obj, const char *group)
}
}
#define _theme_edje_object_set(_obj, _group) \
if (e_config->use_composite) \
if (!e_config->use_shaped_win) \
_theme_edje_object_set_aux(_obj, _group"/composite"); \
else \
_theme_edje_object_set_aux(_obj, _group);