From 33a1a91f02d1b18ce1098e55c2d02eb9b91b2958 Mon Sep 17 00:00:00 2001 From: metrics Date: Mon, 13 Nov 2006 07:26:14 +0000 Subject: [PATCH] Add composite support for popups (shelves, menus and exebuf) configurable via enlightenment_remote. SVN revision: 27081 --- src/bin/e_config.c | 2 ++ src/bin/e_config.h | 1 + src/bin/e_ipc_handlers.h | 40 +++++++++++++++++++++++++++++++++++ src/bin/e_ipc_handlers_list.h | 4 ++++ src/bin/e_popup.c | 9 +++++++- 5 files changed, 55 insertions(+), 1 deletion(-) diff --git a/src/bin/e_config.c b/src/bin/e_config.c index 1e83550e4..49a9e7bda 100644 --- a/src/bin/e_config.c +++ b/src/bin/e_config.c @@ -360,6 +360,7 @@ e_config_init(void) E_CONFIG_VAL(D, T, evas_engine_drag, INT); /**/ E_CONFIG_VAL(D, T, evas_engine_win, INT); /**/ E_CONFIG_VAL(D, T, evas_engine_zone, INT); /**/ + E_CONFIG_VAL(D, T, use_composite, INT); /**/ E_CONFIG_VAL(D, T, language, STR); /**/ E_CONFIG_LIST(D, T, modules, _e_config_module_edd); /**/ E_CONFIG_LIST(D, T, font_fallbacks, _e_config_font_fallback_edd); /**/ @@ -579,6 +580,7 @@ e_config_init(void) e_config->evas_engine_drag = E_EVAS_ENGINE_DEFAULT; e_config->evas_engine_win = E_EVAS_ENGINE_DEFAULT; e_config->evas_engine_zone = E_EVAS_ENGINE_DEFAULT; + e_config->use_composite = 0; e_config->language = NULL; e_config->window_placement_policy = E_WINDOW_PLACEMENT_SMART; e_config->focus_policy = E_FOCUS_SLOPPY; diff --git a/src/bin/e_config.h b/src/bin/e_config.h index b906151bf..1255b649b 100644 --- a/src/bin/e_config.h +++ b/src/bin/e_config.h @@ -109,6 +109,7 @@ struct _E_Config int evas_engine_drag; // NO GUI - maybe remove? int evas_engine_win; // NO GUI - maybe remove? int evas_engine_zone; // NO GUI - maybe remove? + int use_composite; // NO GUI const char *language; // GUI Evas_List *modules; // GUI Evas_List *font_fallbacks; // GUI diff --git a/src/bin/e_ipc_handlers.h b/src/bin/e_ipc_handlers.h index eef6898c8..288844538 100644 --- a/src/bin/e_ipc_handlers.h +++ b/src/bin/e_ipc_handlers.h @@ -7592,3 +7592,43 @@ break; END_INT; #endif #undef HDL + +/****************************************************************************/ +#define HDL E_IPC_OP_USE_COMPOSITE_SET +#if (TYPE == E_REMOTE_OPTIONS) + OP("-use-composite-set", 1, "Set whether composite should be used", 0, HDL) +#elif (TYPE == E_REMOTE_OUT) + REQ_INT(atoi(params[0]), HDL); +#elif (TYPE == E_WM_IN) + START_INT(val, HDL); + e_config->use_composite = val; + E_CONFIG_LIMIT(e_config->use_composite, 0, 1); + SAVE; + END_INT; +#elif (TYPE == E_REMOTE_IN) +#endif +#undef HDL + +/****************************************************************************/ +#define HDL E_IPC_OP_USE_COMPOSITE_GET +#if (TYPE == E_REMOTE_OPTIONS) + OP("-use-composite-get", 0, "Get whether composite should be used", 1, HDL) +#elif (TYPE == E_REMOTE_OUT) + REQ_NULL(HDL); +#elif (TYPE == E_WM_IN) + SEND_INT(e_config->use_composite, E_IPC_OP_USE_COMPOSITE_GET_REPLY, HDL); +#elif (TYPE == E_REMOTE_IN) +#endif +#undef HDL + +/****************************************************************************/ +#define HDL E_IPC_OP_USE_COMPOSITE_GET_REPLY +#if (TYPE == E_REMOTE_OPTIONS) +#elif (TYPE == E_REMOTE_OUT) +#elif (TYPE == E_WM_IN) +#elif (TYPE == E_REMOTE_IN) + START_INT(val, HDL); + printf("REPLY: %d\n", val); + END_INT; +#endif +#undef HDL diff --git a/src/bin/e_ipc_handlers_list.h b/src/bin/e_ipc_handlers_list.h index be4d02049..525d088b9 100644 --- a/src/bin/e_ipc_handlers_list.h +++ b/src/bin/e_ipc_handlers_list.h @@ -389,3 +389,7 @@ #define E_IPC_OP_EDGE_FLIP_DRAGGING_SET 360 #define E_IPC_OP_EDGE_FLIP_DRAGGING_GET 361 #define E_IPC_OP_EDGE_FLIP_DRAGGING_GET_REPLY 362 + +#define E_IPC_OP_USE_COMPOSITE_SET 363 +#define E_IPC_OP_USE_COMPOSITE_GET 364 +#define E_IPC_OP_USE_COMPOSITE_GET_REPLY 365 diff --git a/src/bin/e_popup.c b/src/bin/e_popup.c index 5692a8828..26c955630 100644 --- a/src/bin/e_popup.c +++ b/src/bin/e_popup.c @@ -169,7 +169,14 @@ e_popup_edje_bg_object_set(E_Popup *pop, Evas_Object *o) pop->shaped = 1; else pop->shaped = 0; - ecore_evas_shaped_set(pop->ecore_evas, pop->shaped); + if (e_config->use_composite) + { + ecore_evas_alpha_set(pop->ecore_evas, pop->shaped); + pop->evas_win = ecore_evas_software_x11_window_get(pop->ecore_evas); + e_container_window_raise(pop->zone->container, pop->evas_win, pop->layer); + } + else + ecore_evas_shaped_set(pop->ecore_evas, pop->shaped); } }