From afdc6b19ef0e9992f4cc04859071255b31420e19 Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Tue, 31 Jan 2006 08:02:18 +0000 Subject: [PATCH] todo items gone. window icon is now choosable - eap or app provided one. SVN revision: 20140 --- TODO | 7 +-- src/bin/e_border.c | 88 ++++++++++++++++++--------- src/bin/e_config.c | 4 ++ src/bin/e_config.h | 1 + src/bin/e_int_config_window_display.c | 8 +++ 5 files changed, 74 insertions(+), 34 deletions(-) diff --git a/TODO b/TODO index f51c404a8..0c8199db6 100644 --- a/TODO +++ b/TODO @@ -8,6 +8,7 @@ Some of the things (in very short form) that need to be done to E17... BUGS / FIXES ------------------------------------------------------------------------------- +* BUG: itray. need i say more (it's riddled with problems) * BUG: dnd icon from window that has no .eap defining its ocon to ibar and the ibar icon ends up blank (cant build .eap freom ARGB pixels) * BUG: edge flip for desktops still active if turned off when dragging a window @@ -70,12 +71,6 @@ Some of the things (in very short form) that need to be done to E17... adjusted size) is smaller that screen max size, fill in space in between with black. for 3. we want to fill the inbewteen space with some theme defined image data -* netwm window types and states need addressing (do special/appropriate things) - for each of them. -* do something with the icccm urgency field hint -* different borders for non-resizable windows, shaped windows etc. -* window icons should be able to be chosen if e eapp icon overrides netwm - icon or the other way around (and remember this). * actions to make current zone different (warp mouse to there) * actions to make the current container different * titlebar/border expansion/gadget panel for modules to put window widgets in diff --git a/src/bin/e_border.c b/src/bin/e_border.c index 33d706761..ba27dd824 100644 --- a/src/bin/e_border.c +++ b/src/bin/e_border.c @@ -2356,37 +2356,52 @@ e_border_icon_add(E_Border *bd, Evas *evas) e_util_edje_icon_set(o, "enlightenment/e"); return o; } - if ((bd->client.icccm.name) && (bd->client.icccm.class)) + if (e_config->use_app_icon) { - char *title = ""; - - if (bd->client.netwm.name) title = bd->client.netwm.name; - else title = bd->client.icccm.title; - a = e_app_window_name_class_title_role_find(bd->client.icccm.name, - bd->client.icccm.class, - title, - bd->client.icccm.window_role); + if (bd->client.netwm.icons) + { + o = e_icon_add(evas); + e_icon_data_set(o, bd->client.netwm.icons[0].data, + bd->client.netwm.icons[0].width, + bd->client.netwm.icons[0].height); + e_icon_alpha_set(o, 1); + return o; + } } - if (!a) + if (!o) { - a = e_app_launch_id_pid_find(bd->client.netwm.startup_id, - bd->client.netwm.pid); - } - if (a) - { - o = e_app_icon_add(evas, a); - bd->app = a; - e_object_ref(E_OBJECT(bd->app)); - return o; - } - else if (bd->client.netwm.icons) - { - o = e_icon_add(evas); - e_icon_data_set(o, bd->client.netwm.icons[0].data, - bd->client.netwm.icons[0].width, - bd->client.netwm.icons[0].height); - e_icon_alpha_set(o, 1); - return o; + if ((bd->client.icccm.name) && (bd->client.icccm.class)) + { + char *title = ""; + + if (bd->client.netwm.name) title = bd->client.netwm.name; + else title = bd->client.icccm.title; + a = e_app_window_name_class_title_role_find(bd->client.icccm.name, + bd->client.icccm.class, + title, + bd->client.icccm.window_role); + } + if (!a) + { + a = e_app_launch_id_pid_find(bd->client.netwm.startup_id, + bd->client.netwm.pid); + } + if (a) + { + o = e_app_icon_add(evas, a); + bd->app = a; + e_object_ref(E_OBJECT(bd->app)); + return o; + } + else if (bd->client.netwm.icons) + { + o = e_icon_add(evas); + e_icon_data_set(o, bd->client.netwm.icons[0].data, + bd->client.netwm.icons[0].width, + bd->client.netwm.icons[0].height); + e_icon_alpha_set(o, 1); + return o; + } } if (!o) { @@ -4480,6 +4495,8 @@ _e_border_cb_grab_replay(void *data, int type, void *event) static void _e_border_eval(E_Border *bd) { + int change_urgent = 0; + /* fetch any info queued to be fetched */ if (bd->client.icccm.fetch.title) { @@ -4675,6 +4692,8 @@ _e_border_eval(E_Border *bd) &is_urgent)) { bd->client.icccm.accepts_focus = accepts_focus; + if (bd->client.icccm.urgent != is_urgent) + change_urgent = 1; bd->client.icccm.urgent = is_urgent; /* If this is a new window, set the state as requested. */ @@ -5137,6 +5156,8 @@ _e_border_eval(E_Border *bd) edje_object_signal_emit(bd->bg_object, "fullscreen", ""); if (bd->hung) edje_object_signal_emit(bd->bg_object, "hung", ""); + if (bd->client.icccm.urgent) + edje_object_signal_emit(bd->bg_object, "urgent", ""); evas_object_move(bd->bg_object, 0, 0); evas_object_resize(bd->bg_object, bd->w, bd->h); @@ -5825,6 +5846,17 @@ _e_border_eval(E_Border *bd) } bd->changes.icon = 0; } + + if (change_urgent) + { + if (bd->client.icccm.urgent) + edje_object_signal_emit(bd->bg_object, "urgent", ""); + else + edje_object_signal_emit(bd->bg_object, "not_urgent", ""); + /* FIXME: we should probably do something with the pager or + * maybe raising the window if it becomes urgent + */ + } bd->new_client = 0; diff --git a/src/bin/e_config.c b/src/bin/e_config.c index e75274d5d..3b2b4f1cd 100644 --- a/src/bin/e_config.c +++ b/src/bin/e_config.c @@ -401,6 +401,7 @@ e_config_init(void) E_CONFIG_VAL(D, T, exebuf_pos_max_w, INT); E_CONFIG_VAL(D, T, exebuf_pos_max_h, INT); E_CONFIG_LIST(D, T, color_classes, _e_config_color_class_edd); + E_CONFIG_VAL(D, T, use_app_icon, INT); e_config = e_config_domain_load("e", _e_config_edd); if (e_config) { @@ -546,6 +547,8 @@ e_config_init(void) e_config->exebuf_pos_min_h = 160; e_config->exebuf_pos_max_w = 400; e_config->exebuf_pos_max_h = 320; + e_config->color_classes = NULL; + e_config->use_app_icon = 0; { E_Config_Module *em; @@ -1537,6 +1540,7 @@ e_config_init(void) E_CONFIG_LIMIT(e_config->menu_eap_name_show, 0, 1); E_CONFIG_LIMIT(e_config->menu_eap_generic_show, 0, 1); E_CONFIG_LIMIT(e_config->menu_eap_comment_show, 0, 1); + E_CONFIG_LIMIT(e_config->use_app_icon, 0, 1); return 1; } diff --git a/src/bin/e_config.h b/src/bin/e_config.h index 549f6ce9a..feba0429f 100644 --- a/src/bin/e_config.h +++ b/src/bin/e_config.h @@ -200,6 +200,7 @@ struct _E_Config int exebuf_pos_max_w; int exebuf_pos_max_h; Evas_List *color_classes; + int use_app_icon; }; struct _E_Config_Module diff --git a/src/bin/e_int_config_window_display.c b/src/bin/e_int_config_window_display.c index ca53807a1..a4a8b6d51 100644 --- a/src/bin/e_int_config_window_display.c +++ b/src/bin/e_int_config_window_display.c @@ -27,6 +27,7 @@ struct _E_Config_Dialog_Data int border_shade_animate; int border_shade_transition; double border_shade_speed; + int use_app_icon; }; /* a nice easy setup function that does the dirty work */ @@ -66,6 +67,7 @@ _fill_data(E_Config_Dialog_Data *cfdata) cfdata->resize_info_visible) cfdata->move_resize_info = 1; if (cfdata->border_shade_animate) cfdata->animate_shading = 1; cfdata->placement = cfdata->window_placement_policy; + cfdata->use_app_icon = e_config->use_app_icon; } static void * @@ -122,6 +124,7 @@ _advanced_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata) e_config->border_shade_animate = cfdata->border_shade_animate; e_config->border_shade_transition = cfdata->border_shade_transition; e_config->border_shade_speed = cfdata->border_shade_speed; + e_config->use_app_icon = cfdata->use_app_icon; e_config_save_queue(); return 1; /* Apply was OK */ } @@ -209,5 +212,10 @@ _advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data e_widget_framelist_object_append(of, ob); e_widget_list_object_append(o, of, 1, 1, 0.5); + of = e_widget_framelist_add(evas, _("Window Frame"), 0); + ob = e_widget_check_add(evas, _("Use application provided icon instead"), &(cfdata->use_app_icon)); + e_widget_framelist_object_append(of, ob); + e_widget_list_object_append(o, of, 1, 1, 0.5); + return o; }