From 2ebbd99565d2a475bfbfad59f2d1dd12b5de0811 Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Wed, 29 Jun 2005 08:49:54 +0000 Subject: [PATCH] TODO-- SVN revision: 15565 --- TODO | 2 -- src/bin/e_border.c | 16 ++++++++-------- src/bin/e_config.c | 17 ++++++++++++++++- src/bin/e_config.h | 7 ++++++- 4 files changed, 30 insertions(+), 12 deletions(-) diff --git a/TODO b/TODO index b626e9107..fd63e2709 100644 --- a/TODO +++ b/TODO @@ -163,8 +163,6 @@ Some of the things (in very short form) that need to be done to E17... * winlist could divide windows up into blocks - sub-lists within a container pwer desktop (with stick windows considered to live on the "current" desk when winlist starts) -* make auto kill client and the kill() stuff config options -* make 10.0 sec ping time and the 10.0 sec wait for a SIGKILL an option * make it easy for modules to hook into ipc and extend it for themselves * gadman needs some changes to virtualise the canvas/container the gadget ends up in (eg in popups or border) diff --git a/src/bin/e_border.c b/src/bin/e_border.c index 9b41f8f88..986d1c7df 100644 --- a/src/bin/e_border.c +++ b/src/bin/e_border.c @@ -1691,23 +1691,21 @@ e_border_act_close_begin(E_Border *bd) if (bd->client.netwm.ping) e_border_ping(bd); } - else + else if (e_config->kill_if_close_not_possible) e_border_act_kill_begin(bd); } void e_border_act_kill_begin(E_Border *bd) { - if (bd->client.netwm.pid > 1) + if ((bd->client.netwm.pid > 1) && (e_config->kill_process)) { - printf("%i\n", bd->client.netwm.pid); kill(bd->client.netwm.pid, SIGINT); - bd->kill_timer = ecore_timer_add(10.0, _e_border_cb_kill_timer, bd); + bd->kill_timer = ecore_timer_add(e_config->kill_timer_wait, + _e_border_cb_kill_timer, bd); } else - { - ecore_x_kill(bd->client.win); - } + ecore_x_kill(bd->client.win); e_border_hide(bd, 0); } @@ -1846,7 +1844,9 @@ e_border_ping(E_Border *bd) ecore_x_netwm_ping_send(bd->client.win); bd->ping = ecore_time_get(); if (bd->ping_timer) ecore_timer_del(bd->ping_timer); - bd->ping_timer = ecore_timer_add(10.0, _e_border_cb_ping_timer, bd); + if (e_config->ping_clients) + bd->ping_timer = ecore_timer_add(e_config->ping_clients_wait, + _e_border_cb_ping_timer, bd); } void diff --git a/src/bin/e_config.c b/src/bin/e_config.c index 0fdccf55c..56a6721ba 100644 --- a/src/bin/e_config.c +++ b/src/bin/e_config.c @@ -170,6 +170,11 @@ e_config_init(void) E_CONFIG_VAL(D, T, winlist_pos_max_w, INT); E_CONFIG_VAL(D, T, winlist_pos_max_h, INT); E_CONFIG_VAL(D, T, maximize_policy, INT); + E_CONFIG_VAL(D, T, kill_if_close_not_possible, INT); + E_CONFIG_VAL(D, T, kill_process, INT); + E_CONFIG_VAL(D, T, kill_timer_wait, DOUBLE); + E_CONFIG_VAL(D, T, ping_clients, INT); + E_CONFIG_VAL(D, T, ping_clients_wait, DOUBLE); e_config = e_config_domain_load("e", _e_config_edd); if (e_config) @@ -262,6 +267,11 @@ e_config_init(void) e_config->winlist_pos_max_w = 320; e_config->winlist_pos_max_h = 320; e_config->maximize_policy = E_MAXIMIZE_FULLSCREEN; + e_config->kill_if_close_not_possible = 1; + e_config->kill_process = 1; + e_config->kill_timer_wait = 10.0; + e_config->ping_clients = 1; + e_config->ping_clients_wait = 10.0; { E_Config_Module *em; @@ -787,7 +797,12 @@ e_config_init(void) E_CONFIG_LIMIT(e_config->winlist_pos_max_w, 8, 4000); E_CONFIG_LIMIT(e_config->winlist_pos_max_h, 8, 4000); E_CONFIG_LIMIT(e_config->maximize_policy, E_MAXIMIZE_FULLSCREEN, E_MAXIMIZE_FILL); -; + E_CONFIG_LIMIT(e_config->kill_if_close_not_possible, 0, 1); + E_CONFIG_LIMIT(e_config->kill_process, 0, 1); + E_CONFIG_LIMIT(e_config->kill_timer_wait, 0.0, 120.0); + E_CONFIG_LIMIT(e_config->ping_clients, 0, 1); + E_CONFIG_LIMIT(e_config->ping_clients_wait, 0.0, 120.0); + /* apply lang config - exception because config is loaded after intl setup */ if ((e_config->language) && (strlen(e_config->language) > 0)) diff --git a/src/bin/e_config.h b/src/bin/e_config.h index 3fc60308c..35311fd90 100644 --- a/src/bin/e_config.h +++ b/src/bin/e_config.h @@ -46,7 +46,7 @@ typedef Eet_Data_Descriptor E_Config_DD; * defaults for e to work - started at 100 when we introduced this config * versioning feature */ -#define E_CONFIG_FILE_VERSION 114 +#define E_CONFIG_FILE_VERSION 115 #define E_EVAS_ENGINE_DEFAULT 0 #define E_EVAS_ENGINE_SOFTWARE_X11 1 @@ -124,6 +124,11 @@ struct _E_Config int winlist_pos_max_w; int winlist_pos_max_h; int maximize_policy; + int kill_if_close_not_possible; + int kill_process; + double kill_timer_wait; + int ping_clients; + double ping_clients_wait; }; /* FIXME: all of thsie needs to become eet lumps for enmcode/decode */