diff options
author | Seunghun Lee <shiin.lee@samsung.com> | 2012-08-21 21:12:51 +0900 |
---|---|---|
committer | Seunghun Lee <shiin.lee@samsung.com> | 2012-08-21 21:12:51 +0900 |
commit | da657a5ef0c9d2b780cbd7e26880058fe09acf4a (patch) | |
tree | 39b7302e6e055d8db14158031f6fc7e2b68f4d34 /src/bin | |
parent | ac8fa492451a1268eec649ea98e67184842f11a0 (diff) | |
download | e17-master.tar.gz e17-master.tar.bz2 e17-master.zip |
Migrating source code to RSA from private.HEADsubmit/master/20120920.1511192.0_alphamaster2.0alpha
Diffstat (limited to 'src/bin')
-rw-r--r-- | src/bin/e_border.c | 126 | ||||
-rw-r--r-- | src/bin/e_border.h | 4 | ||||
-rw-r--r-- | src/bin/e_config.c | 46 | ||||
-rw-r--r-- | src/bin/e_config.h | 50 | ||||
-rw-r--r-- | src/bin/e_container.c | 70 | ||||
-rw-r--r-- | src/bin/e_container.h | 2 | ||||
-rw-r--r-- | src/bin/e_desk.c | 148 | ||||
-rw-r--r-- | src/bin/e_desk.h | 12 | ||||
-rw-r--r--[-rwxr-xr-x] | src/bin/e_fm/e_fm_ipc.h | 0 | ||||
-rw-r--r--[-rwxr-xr-x] | src/bin/e_fm/e_fm_main_hal.h | 0 | ||||
-rw-r--r--[-rwxr-xr-x] | src/bin/e_fm/e_fm_main_udisks.h | 0 | ||||
-rw-r--r-- | src/bin/e_gadcon.c | 4 | ||||
-rw-r--r-- | src/bin/e_hints.c | 7 | ||||
-rw-r--r-- | src/bin/e_main.c | 2 | ||||
-rw-r--r-- | src/bin/e_manager.c | 31 | ||||
-rw-r--r-- | src/bin/e_manager.h | 13 | ||||
-rw-r--r-- | src/bin/e_module.c | 11 | ||||
-rw-r--r-- | src/bin/e_utils.c | 21 | ||||
-rw-r--r-- | src/bin/e_utils.h | 4 |
19 files changed, 507 insertions, 44 deletions
diff --git a/src/bin/e_border.c b/src/bin/e_border.c index 10128ce..4d8b2a0 100644 --- a/src/bin/e_border.c +++ b/src/bin/e_border.c @@ -124,6 +124,9 @@ static Eina_Bool _e_border_cb_grab_replay(void *data, 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); @@ -299,6 +302,7 @@ e_border_init(void) handlers = eina_list_append(handlers, ecore_event_handler_add(EFREET_EVENT_DESKTOP_CACHE_UPDATE, _e_border_cb_efreet_cache_update, NULL)); handlers = eina_list_append(handlers, ecore_event_handler_add(EFREET_EVENT_ICON_CACHE_UPDATE, _e_border_cb_efreet_cache_update, NULL)); handlers = eina_list_append(handlers, ecore_event_handler_add(E_EVENT_CONFIG_ICON_THEME, _e_border_cb_config_icon_theme, NULL)); + handlers = eina_list_append(handlers, ecore_event_handler_add(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); @@ -600,6 +604,9 @@ e_border_new(E_Container *con, 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_PROFILE_LIST) + bd->client.e.fetch.profile_list = 1; } if (video_position && video_parent) { @@ -675,6 +682,12 @@ e_border_new(E_Container *con, desk[0] = deskx; desk[1] = desky; ecore_x_window_prop_card32_set(win, E_ATOM_DESK, desk, 2); + if (strcmp(bd->desk->window_profile, + e_config->desktop_default_window_profile) != 0) + { + ecore_x_e_window_profile_set(bd->client.win, + bd->desk->window_profile); + } focus_stack = eina_list_append(focus_stack, bd); @@ -4371,6 +4384,7 @@ e_border_resize_limit(E_Border *bd, static void _e_border_free(E_Border *bd) { + const char *str; if (bd->client.e.state.video_parent) { Eina_List *l; @@ -4533,6 +4547,14 @@ _e_border_free(E_Border *bd) if (bd->internal_icon) eina_stringshare_del(bd->internal_icon); if (bd->internal_icon_key) eina_stringshare_del(bd->internal_icon_key); if (bd->icon_object) evas_object_del(bd->icon_object); + EINA_LIST_FREE(bd->client.e.state.profiles, str) + { + if (str) eina_stringshare_del(str); + } + bd->client.e.state.profiles = NULL; + if (bd->client.e.state.profile) + eina_stringshare_del(bd->client.e.state.profile); + bd->client.e.state.profile = NULL; evas_object_del(bd->bg_object); e_canvas_del(bd->bg_ecore_evas); ecore_evas_free(bd->bg_ecore_evas); @@ -5366,6 +5388,11 @@ _e_border_cb_window_property(void *data __UNUSED__, bd->client.e.fetch.video_parent = 1; bd->changed = 1; } + else if (e->atom == ECORE_X_ATOM_E_PROFILE_LIST) + { + bd->client.e.fetch.profile_list = 1; + bd->changed = 1; + } return ECORE_CALLBACK_PASS_ON; } @@ -6407,6 +6434,27 @@ _e_border_cb_drag_finished(E_Drag *drag, } 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; + E_Border *bd; + + e = ev; + EINA_LIST_FOREACH(borders, l, bd) + { + if ((bd) && (!e_object_is_del(E_OBJECT(bd)))) + { + bd->client.e.fetch.profile_list = 1; + bd->changed = 1; + } + } + return ECORE_CALLBACK_PASS_ON; +} + +static Eina_Bool _e_border_post_move_resize_job(void *data) { E_Border *bd; @@ -6500,6 +6548,7 @@ _e_border_eval0(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))) { @@ -6626,6 +6675,52 @@ _e_border_eval0(E_Border *bd) bd->client.e.fetch.state = 0; rem_change = 1; } + if (bd->client.e.fetch.profile_list) + { + const char **profiles = NULL; + const char *str; + int num, i; + + if (bd->client.e.state.profile) + eina_stringshare_del(bd->client.e.state.profile); + EINA_LIST_FREE(bd->client.e.state.profiles, str) + { + if (str) eina_stringshare_del(str); + } + bd->client.e.state.profile = NULL; + bd->client.e.state.profiles = NULL; + bd->client.e.state.profile_list = 0; + + if (ecore_x_e_window_profile_list_get(bd->client.win, + &profiles, &num)) + { + bd->client.e.state.profile_list = 1; + for (i = 0; i < num; i++) + { + str = eina_stringshare_add(profiles[i]); + bd->client.e.state.profiles = eina_list_append(bd->client.e.state.profiles, str); + } + + /* We should set desk to contain given border after creating E_BORDER_ADD event. + * If not, e will have an E_BORDER_SHOW event before E_BORDER_ADD event. + */ + need_desk_set = EINA_TRUE; + } + else + { + if (strcmp(bd->desk->window_profile, + e_config->desktop_default_window_profile) != 0) + { + ecore_x_e_window_profile_set(bd->client.win, + bd->desk->window_profile); + } + } + + if (profiles) + free(profiles); + + bd->client.e.fetch.profile_list = 0; + } if (bd->client.netwm.fetch.type) { e_hints_window_type_get(bd); @@ -7236,6 +7331,29 @@ _e_border_eval0(E_Border *bd) bd->client.border.changed = 1; } + if (need_desk_set) + { + E_Container *con = bd->zone->container; + E_Desk *desk = NULL; + Eina_List *l; + const char *str; + EINA_LIST_FOREACH(bd->client.e.state.profiles, l, str) + { + desk = e_container_desk_window_profile_get(con, str); + if (desk) + { + if (bd->desk != desk) + { + bd->client.e.state.profile = eina_stringshare_add(str); + if (bd->zone != desk->zone) + e_border_zone_set(bd, desk->zone); + e_border_desk_set(bd, desk); + } + break; + } + } + } + /* PRE_POST_FETCH calls e_remember apply for new client */ _e_border_hook_call(E_BORDER_HOOK_EVAL_PRE_POST_FETCH, bd); _e_border_hook_call(E_BORDER_HOOK_EVAL_POST_FETCH, bd); @@ -7460,7 +7578,6 @@ _e_border_eval0(E_Border *bd) static void _e_border_latest_stacked_focus (E_Border* bd) { - Eina_List *l = NULL; E_Border *temp_bd; int root_w, root_h; @@ -7473,6 +7590,7 @@ _e_border_latest_stacked_focus (E_Border* bd) { if ((temp_bd->x >= root_w) || (temp_bd->y >= root_h)) continue; if (((temp_bd->x + temp_bd->w) <= 0) || ((temp_bd->y + temp_bd->h) <= 0)) continue; + if (temp_bd->client.illume.win_state.state == ECORE_X_ILLUME_WINDOW_STATE_FLOATING) continue; if ((!temp_bd->iconic) && (temp_bd->visible) && (temp_bd->desk == bd->desk) && (temp_bd->client.icccm.accepts_focus || temp_bd->client.icccm.take_focus) && @@ -7501,7 +7619,6 @@ _e_border_latest_stacked_focus (E_Border* bd) static void _e_border_check_stack (E_Border *bd) { - Eina_List* l = NULL; E_Border* temp_bd = NULL;; E_Border* top_bd = NULL; int passed_focus = 0; @@ -7515,6 +7632,7 @@ _e_border_check_stack (E_Border *bd) { if ((temp_bd->x >= root_w) || (temp_bd->y >= root_h)) continue; if (((temp_bd->x + temp_bd->w) <= 0) || ((temp_bd->y + temp_bd->h) <= 0)) continue; + if (temp_bd->client.illume.win_state.state == ECORE_X_ILLUME_WINDOW_STATE_FLOATING) continue; if ((!temp_bd->iconic) && (temp_bd->visible) && (temp_bd->desk == bd->desk) && (temp_bd->client.icccm.accepts_focus || temp_bd->client.icccm.take_focus) && @@ -7570,9 +7688,8 @@ _e_border_check_stack (E_Border *bd) } static void -_e_border_focus_top_stack_set (E_Border* bd) +_e_border_focus_top_stack_set(E_Border* bd) { - Eina_List *l = NULL; E_Border *temp_bd; int root_w, root_h; @@ -7585,6 +7702,7 @@ _e_border_focus_top_stack_set (E_Border* bd) { if ((temp_bd->x >= root_w) || (temp_bd->y >= root_h)) continue; if (((temp_bd->x + temp_bd->w) <= 0) || ((temp_bd->y + temp_bd->h) <= 0)) continue; + if (temp_bd->client.illume.win_state.state == ECORE_X_ILLUME_WINDOW_STATE_FLOATING) continue; if ((!temp_bd->iconic) && (temp_bd->visible) && (temp_bd->desk == bd->desk) && (temp_bd->client.icccm.accepts_focus || temp_bd->client.icccm.take_focus) && diff --git a/src/bin/e_border.h b/src/bin/e_border.h index ab1bd3d..86f0843 100644 --- a/src/bin/e_border.h +++ b/src/bin/e_border.h @@ -355,15 +355,19 @@ struct _E_Border Ecore_X_Window video_parent; E_Border *video_parent_border; Eina_List *video_child; + const char *profile; + Eina_List *profiles; unsigned char centered : 1; unsigned char video : 1; + unsigned char profile_list : 1; } state; struct { unsigned char state : 1; unsigned char video_parent : 1; unsigned char video_position : 1; + unsigned char profile_list : 1; } fetch; } e; diff --git a/src/bin/e_config.c b/src/bin/e_config.c index 7f9cfe5..ffc2d46 100644 --- a/src/bin/e_config.c +++ b/src/bin/e_config.c @@ -40,6 +40,7 @@ static E_Config_DD *_e_config_bindings_acpi_edd = NULL; static E_Config_DD *_e_config_path_append_edd = NULL; static E_Config_DD *_e_config_desktop_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; @@ -276,6 +277,17 @@ e_config_init(void) 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 @@ -625,8 +637,10 @@ e_config_init(void) 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); /**/ @@ -925,6 +939,7 @@ e_config_shutdown(void) E_CONFIG_DD_FREE(_e_config_path_append_edd); E_CONFIG_DD_FREE(_e_config_desktop_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); @@ -1559,6 +1574,20 @@ e_config_domain_system_load(const char *domain, E_Config_DD *edd) static void _e_config_mv_error(const char *from, const char *to) { +#if _F_USE_EXTN_DIALOG_ + char buf[8192]; + snprintf(buf, sizeof(buf), + _("Enlightenment has had an error while moving config files<br>" + "from:<br>" + "%s<br>" + "<br>" + "to:<br>" + "%s<br>" + "<br>" + "The rest of the write has been aborted for safety.<br>"), + from, to); + e_util_extn_dialog_show(_("Enlightenment Settings Write Problems"), buf); +#else if (!_e_config_error_dialog) { E_Dialog *dia; @@ -1591,6 +1620,7 @@ _e_config_mv_error(const char *from, const char *to) _e_config_error_dialog = dia; } } +#endif } EAPI int @@ -2010,6 +2040,7 @@ _e_config_free(E_Config *ecf) 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); if (ecf->transition_start) eina_stringshare_del(ecf->transition_start); if (ecf->transition_desk) eina_stringshare_del(ecf->transition_desk); @@ -2132,6 +2163,20 @@ _e_config_eet_close_handle(Eet_File *ef, char *file) { /* delete any partially-written file */ ecore_file_unlink(file); +#if _F_USE_EXTN_DIALOG_ + char buf[8192]; + snprintf(buf, sizeof(buf), + _("Enlightenment has had an error while writing<br>" + "its config file.<br>" + "%s<br>" + "<br>" + "The file where the error occurred was:<br>" + "%s<br>" + "<br>" + "This file has been deleted to avoid corrupt data.<br>"), + erstr, file); + e_util_extn_dialog_show(_("Enlightenment Settings Write Problems"), buf); +#else /* only show dialog for first error - further ones are likely */ /* more of the same error */ if (!_e_config_error_dialog) @@ -2166,6 +2211,7 @@ _e_config_eet_close_handle(Eet_File *ef, char *file) _e_config_error_dialog = dia; } } +#endif return 0; } return 1; diff --git a/src/bin/e_config.h b/src/bin/e_config.h index 86e278f..5f7bc27 100644 --- a/src/bin/e_config.h +++ b/src/bin/e_config.h @@ -2,25 +2,26 @@ #define E_CONFIG_LIMIT(v, min, max) {if (v > max) v = max; else if (v < min) v = min;} -typedef struct _E_Config E_Config; -typedef struct _E_Config_Module E_Config_Module; -typedef struct _E_Config_Theme E_Config_Theme; -typedef struct _E_Config_Binding_Mouse E_Config_Binding_Mouse; -typedef struct _E_Config_Binding_Key E_Config_Binding_Key; -typedef struct _E_Config_Binding_Edge E_Config_Binding_Edge; -typedef struct _E_Config_Binding_Signal E_Config_Binding_Signal; -typedef struct _E_Config_Binding_Wheel E_Config_Binding_Wheel; -typedef struct _E_Config_Binding_Acpi E_Config_Binding_Acpi; -typedef struct _E_Config_Desktop_Background E_Config_Desktop_Background; -typedef struct _E_Config_Desktop_Name E_Config_Desktop_Name; -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; -typedef struct _E_Config_Shelf_Desk E_Config_Shelf_Desk; -typedef struct _E_Config_Mime_Icon E_Config_Mime_Icon; -typedef struct _E_Config_Syscon_Action E_Config_Syscon_Action; -typedef struct _E_Config_Env_Var E_Config_Env_Var; -typedef struct _E_Event_Config_Icon_Theme E_Event_Config_Icon_Theme; +typedef struct _E_Config E_Config; +typedef struct _E_Config_Module E_Config_Module; +typedef struct _E_Config_Theme E_Config_Theme; +typedef struct _E_Config_Binding_Mouse E_Config_Binding_Mouse; +typedef struct _E_Config_Binding_Key E_Config_Binding_Key; +typedef struct _E_Config_Binding_Edge E_Config_Binding_Edge; +typedef struct _E_Config_Binding_Signal E_Config_Binding_Signal; +typedef struct _E_Config_Binding_Wheel E_Config_Binding_Wheel; +typedef struct _E_Config_Binding_Acpi E_Config_Binding_Acpi; +typedef struct _E_Config_Desktop_Background E_Config_Desktop_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; +typedef struct _E_Config_Shelf_Desk E_Config_Shelf_Desk; +typedef struct _E_Config_Mime_Icon E_Config_Mime_Icon; +typedef struct _E_Config_Syscon_Action E_Config_Syscon_Action; +typedef struct _E_Config_Env_Var E_Config_Env_Var; +typedef struct _E_Event_Config_Icon_Theme E_Event_Config_Icon_Theme; #else #ifndef E_CONFIG_H @@ -44,7 +45,9 @@ 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 @@ -449,6 +452,15 @@ struct _E_Config_Desktop_Name 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; diff --git a/src/bin/e_container.c b/src/bin/e_container.c index 3f71fe8..46d422a 100644 --- a/src/bin/e_container.c +++ b/src/bin/e_container.c @@ -86,12 +86,12 @@ e_container_new(E_Manager *man) if (!getenv("EVAS_RENDER_MODE")) { int have_comp = 0; - Eina_List *l; + Eina_List *ll; E_Config_Module *em; // FIXME: major hack. checking in advance for comp. eventully comp // will be rolled into e17 core and this won't be needed - EINA_LIST_FOREACH(e_config->modules, l, em) + EINA_LIST_FOREACH(e_config->modules, ll, em) { if (!strcmp(em->name, "comp")) { @@ -363,6 +363,36 @@ e_container_zone_id_get(E_Container *con, int id) 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) { @@ -1116,7 +1146,7 @@ static void _e_container_resize_handle(E_Container *con) { E_Event_Container_Resize *ev; - Eina_List *l, *screens, *zones = NULL; + Eina_List *l, *screens, *zones = NULL, *ll; E_Zone *zone; E_Screen *scr; int i; @@ -1135,8 +1165,14 @@ _e_container_resize_handle(E_Container *con) con->zones = NULL; EINA_LIST_FOREACH(screens, l, scr) { + zone = NULL; + printf("@@@ SCREENS: %i %i | %i %i %ix%i\n", scr->screen, scr->escreen, scr->x, scr->y, scr->w, scr->h); - zone = e_container_zone_id_get(con, scr->escreen); + EINA_LIST_FOREACH(zones, ll, zone) + { + if (zone->id == scr->escreen) break; + zone = NULL; + } if (zone) { printf("@@@ FOUND ZONE %i %i\n", zone->num, zone->id); @@ -1151,7 +1187,7 @@ _e_container_resize_handle(E_Container *con) Eina_List *ll; E_Config_Shelf *cf_es; - printf("@@@ container resize handle\n"); + printf("@@@ container resize handle - new zone\n"); zone = e_zone_new(con, scr->screen, scr->escreen, scr->x, scr->y, scr->w, scr->h); /* find any shelves configured for this zone and add them in */ EINA_LIST_FOREACH(e_config->shelves, ll, cf_es) @@ -1164,17 +1200,12 @@ _e_container_resize_handle(E_Container *con) if (zones) { E_Zone *spare_zone = NULL; - Eina_List *ll; - EINA_LIST_FOREACH(con->zones, ll, spare_zone) - { - if (eina_list_data_find(zones, spare_zone)) - spare_zone = NULL; - else break; - } + if (con->zones) spare_zone = con->zones->data; + EINA_LIST_FREE(zones, zone) { - Eina_List *shelves, *ll, *del_shelves; + Eina_List *shelves, *ll2, *del_shelves; E_Shelf *es; E_Border_List *bl; E_Border *bd; @@ -1182,7 +1213,7 @@ _e_container_resize_handle(E_Container *con) /* delete any shelves on this zone */ shelves = e_shelf_list(); del_shelves = NULL; - EINA_LIST_FOREACH(shelves, ll, es) + EINA_LIST_FOREACH(shelves, ll2, es) { if (es->zone == zone) del_shelves = eina_list_append(del_shelves, es); @@ -1207,11 +1238,14 @@ _e_container_resize_handle(E_Container *con) } else { - E_Zone *zone; + E_Zone *z; - zone = e_container_zone_number_get(con, 0); - e_zone_move_resize(zone, 0, 0, con->w, con->h); - e_shelf_zone_move_resize_handle(zone); + z = e_container_zone_number_get(con, 0); + if (z) + { + e_zone_move_resize(z, 0, 0, con->w, con->h); + e_shelf_zone_move_resize_handle(z); + } } ecore_event_add(E_EVENT_CONTAINER_RESIZE, ev, _e_container_event_container_resize_free, NULL); diff --git a/src/bin/e_container.h b/src/bin/e_container.h index 2c6dbaf..58fa91d 100644 --- a/src/bin/e_container.h +++ b/src/bin/e_container.h @@ -110,6 +110,8 @@ EAPI E_Zone *e_container_zone_at_point_get(E_Container *con, int x, int y); 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); diff --git a/src/bin/e_desk.c b/src/bin/e_desk.c index 70ae582..6006e71 100644 --- a/src/bin/e_desk.c +++ b/src/bin/e_desk.c @@ -11,6 +11,7 @@ static void _e_desk_event_desk_before_show_free(void *data, void *ev); 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); @@ -23,6 +24,7 @@ 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) @@ -32,6 +34,7 @@ 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; } @@ -47,6 +50,7 @@ e_desk_new(E_Zone *zone, int x, int y) E_Desk *desk; Eina_List *l; E_Config_Desktop_Name *cfname; + E_Config_Desktop_Window_Profile *cfprof; char name[40]; int ok = 0; @@ -80,6 +84,27 @@ e_desk_new(E_Zone *zone, int x, int y) 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; } @@ -517,6 +542,119 @@ e_desk_prev(E_Zone *zone) 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; + + 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) { @@ -578,6 +716,16 @@ _e_desk_event_desk_name_change_free(void *data __UNUSED__, void *event) } 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; diff --git a/src/bin/e_desk.h b/src/bin/e_desk.h index 9ee9547..bbe4355 100644 --- a/src/bin/e_desk.h +++ b/src/bin/e_desk.h @@ -6,6 +6,7 @@ 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_DeskShow E_Event_Desk_DeskShow; 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 @@ -19,6 +20,7 @@ struct _E_Desk E_Zone *zone; const char *name; + const char *window_profile; int x, y; unsigned char visible : 1; unsigned int deskshow_toggle : 1; @@ -50,6 +52,11 @@ struct _E_Event_Desk_Name_Change 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); @@ -70,12 +77,17 @@ EAPI void e_desk_row_add(E_Zone *zone); 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 diff --git a/src/bin/e_fm/e_fm_ipc.h b/src/bin/e_fm/e_fm_ipc.h index 404e666..404e666 100755..100644 --- a/src/bin/e_fm/e_fm_ipc.h +++ b/src/bin/e_fm/e_fm_ipc.h diff --git a/src/bin/e_fm/e_fm_main_hal.h b/src/bin/e_fm/e_fm_main_hal.h index 9ce1c12..9ce1c12 100755..100644 --- a/src/bin/e_fm/e_fm_main_hal.h +++ b/src/bin/e_fm/e_fm_main_hal.h diff --git a/src/bin/e_fm/e_fm_main_udisks.h b/src/bin/e_fm/e_fm_main_udisks.h index f9bc659..f9bc659 100755..100644 --- a/src/bin/e_fm/e_fm_main_udisks.h +++ b/src/bin/e_fm/e_fm_main_udisks.h diff --git a/src/bin/e_gadcon.c b/src/bin/e_gadcon.c index a76d6ba..a05c52f 100644 --- a/src/bin/e_gadcon.c +++ b/src/bin/e_gadcon.c @@ -279,6 +279,10 @@ e_gadcon_custom_del(E_Gadcon *gc) { E_OBJECT_CHECK(gc); E_OBJECT_TYPE_CHECK(gc, E_GADCON_TYPE); + + if (eina_list_data_find(custom_populate_requests, gc)) + custom_populate_requests = eina_list_remove(custom_populate_requests, gc); + gadcons = eina_list_remove(gadcons, gc); } diff --git a/src/bin/e_hints.c b/src/bin/e_hints.c index 30ebb35..d88f11b 100644 --- a/src/bin/e_hints.c +++ b/src/bin/e_hints.c @@ -1421,6 +1421,13 @@ e_hints_window_desktop_set(E_Border *bd) deskpos[1] = bd->desk->y; ecore_x_window_prop_card32_set(bd->client.win, E_ATOM_DESK, deskpos, 2); + if (strcmp(bd->desk->window_profile, + e_config->desktop_default_window_profile) != 0) + { + ecore_x_e_window_profile_set(bd->client.win, + bd->desk->window_profile); + } + #if 0 ecore_x_netwm_desktop_set(bd->client.win, current); #endif diff --git a/src/bin/e_main.c b/src/bin/e_main.c index 5ec0880..76b3452 100644 --- a/src/bin/e_main.c +++ b/src/bin/e_main.c @@ -134,7 +134,9 @@ main(int argc, char **argv) Eina_Bool after_restart = EINA_FALSE; double t = 0.0, tstart = 0.0; char *s = NULL, buff[32]; +#ifndef _F_DO_NOT_USE_SIG_HANDLER_ struct sigaction action; +#endif #ifdef TS_DO t0 = t1 = t2 = ecore_time_unix_get(); #endif diff --git a/src/bin/e_manager.c b/src/bin/e_manager.c index 8451fcf..917dc7e 100644 --- a/src/bin/e_manager.c +++ b/src/bin/e_manager.c @@ -673,6 +673,30 @@ e_manager_comp_src_move_unlock(E_Manager *man, E_Manager_Comp_Source *src) } #endif +#ifdef _F_COMP_COMPOSITE_MODE_ +EAPI void +e_manager_comp_composite_mode_set(E_Manager *man, E_Zone *zone, Eina_Bool set) +{ + E_OBJECT_CHECK(man); + E_OBJECT_CHECK(zone); + E_OBJECT_TYPE_CHECK(man, E_MANAGER_TYPE); + E_OBJECT_TYPE_CHECK(zone, E_ZONE_TYPE); + if (!man->comp) return; + man->comp->func.composite_mode_set(man->comp->data, man, zone, set); +} + +EAPI Eina_Bool +e_manager_comp_composite_mode_get(E_Manager *man, E_Zone *zone) +{ + E_OBJECT_CHECK_RETURN(man, EINA_FALSE); + E_OBJECT_CHECK_RETURN(zone, EINA_FALSE); + E_OBJECT_TYPE_CHECK_RETURN(man, E_MANAGER_TYPE, EINA_FALSE); + E_OBJECT_TYPE_CHECK_RETURN(zone, E_ZONE_TYPE, EINA_FALSE); + if (!man->comp) return EINA_FALSE; + return man->comp->func.composite_mode_get(man->comp->data, man, zone); +} +#endif /* _F_COMP_COMPOSITE_MODE_ */ + EAPI void e_manager_comp_event_resize_send(E_Manager *man) { @@ -1039,9 +1063,7 @@ _e_manager_windows_group_raise (E_Border* bd) leader_win = bd->client.icccm.client_leader; if (leader_win) { - Eina_List* border_list; Eina_List* restack_list; - Eina_List *l; E_Border *temp_bd; E_Border *top_bd; E_Border_List *bl; @@ -1199,13 +1221,16 @@ _e_manager_cb_client_message(void *data __UNUSED__, int ev_type __UNUSED__, void e_border_focus_set(bd, 1, 1); else { - Eina_List* l = NULL; E_Border* temp_bd = NULL; E_Border_List *bl; bl = e_container_border_list_last(bd->zone->container); while ((temp_bd = e_container_border_list_prev(bl))) { + if ((temp_bd->x >= bd->zone->w) || (temp_bd->y >= bd->zone->h)) continue; + if (((temp_bd->x + temp_bd->w) <= 0) || ((temp_bd->y + temp_bd->h) <= 0)) continue; + if (temp_bd->client.illume.win_state.state == ECORE_X_ILLUME_WINDOW_STATE_FLOATING) continue; + if ((!temp_bd->iconic) && (temp_bd->visible) && (temp_bd->desk == bd->desk) && (temp_bd->client.icccm.accepts_focus || temp_bd->client.icccm.take_focus) && (temp_bd->client.netwm.type != ECORE_X_WINDOW_TYPE_DOCK) && diff --git a/src/bin/e_manager.h b/src/bin/e_manager.h index 916c6cd..83b3d87 100644 --- a/src/bin/e_manager.h +++ b/src/bin/e_manager.h @@ -56,6 +56,10 @@ struct _E_Manager_Comp Eina_Bool (*src_move_lock) (void *data, E_Manager *man, E_Manager_Comp_Source *src); Eina_Bool (*src_move_unlock) (void *data, E_Manager *man, E_Manager_Comp_Source *src); #endif +#ifdef _F_COMP_COMPOSITE_MODE_ + void (*composite_mode_set) (void *data, E_Manager *man, E_Zone *zone, Eina_Bool set); + Eina_Bool (*composite_mode_get) (void *data, E_Manager *man, E_Zone *zone); +#endif } func; void *data; }; @@ -151,5 +155,14 @@ EAPI Eina_Bool e_manager_comp_src_input_region_set(E_Manager *man, E_Mana EAPI Eina_Bool e_manager_comp_src_move_lock(E_Manager *man, E_Manager_Comp_Source *src); EAPI Eina_Bool e_manager_comp_src_move_unlock(E_Manager *man, E_Manager_Comp_Source *src); #endif +#ifdef _F_COMP_COMPOSITE_MODE_ +// set the composite rendering state of a zone. +// if set is EINA_TRUE, then composite module will be running with composite rendering mode. +// if set is EINA_FALSE, then composite module may be running with nocomposite mode on given zone. +EAPI void e_manager_comp_composite_mode_set(E_Manager *man, E_Zone *zone, Eina_Bool set); +// get the composite rendering state of a zone. +// if return value is EINA_TRUE, zone is rendered with composite mode. +EAPI Eina_Bool e_manager_comp_composite_mode_get(E_Manager *man, E_Zone *zone); +#endif #endif #endif diff --git a/src/bin/e_module.c b/src/bin/e_module.c index 633f96d..fc9a404 100644 --- a/src/bin/e_module.c +++ b/src/bin/e_module.c @@ -501,6 +501,16 @@ _e_module_free(E_Module *m) free(m); } +#if _F_USE_EXTN_DIALOG_ +static void +_e_module_dialog_disable_show(const char *title, + const char *body, + E_Module *m __UNUSED__) +{ + printf("MODULE ERR:\n%s\n", body); + e_util_extn_dialog_show(title, body); +} +#else static void _e_module_dialog_disable_show(const char *title, const char *body, E_Module *m) { @@ -523,6 +533,7 @@ _e_module_dialog_disable_show(const char *title, const char *body, E_Module *m) e_win_centered_set(dia->win, 1); e_dialog_show(dia); } +#endif static void _e_module_cb_dialog_disable(void *data, E_Dialog *dia) diff --git a/src/bin/e_utils.c b/src/bin/e_utils.c index b5128b9..ba357a4 100644 --- a/src/bin/e_utils.c +++ b/src/bin/e_utils.c @@ -1637,3 +1637,24 @@ e_util_fullscreen_any(void) } return EINA_FALSE; } + +#if _F_USE_EXTN_DIALOG_ +/** + * Using external elementary dialog util instead of e_dialog to display error or warning + * messages. It is a temporary solution for supporting consistent UX theme. The external + * dialog is a simple EFL application which is based on elementary. Thus window manager + * can display message using elementary UX theme, along with other system popup. + */ +EAPI void +e_util_extn_dialog_show(const char *title, + const char *txt) +{ + Ecore_Exe *exe; + char cmd[4096]; + + /* external_dialog_name, icccm_name, icccm_class, popup_title, popup_contents */ + snprintf(cmd, sizeof(cmd), "/usr/bin/extndialog E _extn_dialog \'%s\' \'%s\'", title, txt); + exe = ecore_exe_run(cmd, NULL); + if (exe) ecore_exe_free(exe); +} +#endif diff --git a/src/bin/e_utils.h b/src/bin/e_utils.h index 835f0d0..9070315 100644 --- a/src/bin/e_utils.h +++ b/src/bin/e_utils.h @@ -103,5 +103,9 @@ EAPI int e_util_container_desk_count_get(E_Container *con); EAPI Eina_Bool e_util_fullscreen_curreny_any(void); EAPI Eina_Bool e_util_fullscreen_any(void); +#if _F_USE_EXTN_DIALOG_ +EAPI void e_util_extn_dialog_show(const char *title, const char *txt); +#endif + #endif #endif |