reopen fileman and dialog windows after restart of e.

- modules using e_configure_registry_add must be modified to 
  use registry path as window class for this to work
- fileman now uses e_remember to remember position instead of 
  handling it separately
- added option to window remember for remembering dialogs and 
  fileman windows automatically


SVN revision: 42607
devs/princeamd/enlightenment-0.17-elive
Hannes Janetzek 14 years ago
parent 74c9efaa78
commit 91211ef9c4
  1. 2
      src/bin/e_config.c
  2. 11
      src/bin/e_config_dialog.c
  3. 2
      src/bin/e_eap_editor.c
  4. 22
      src/bin/e_main.c
  5. 37
      src/bin/e_module.c
  6. 1
      src/bin/e_module.h
  7. 706
      src/bin/e_remember.c
  8. 6
      src/bin/e_remember.h
  9. 10
      src/modules/conf_applications/e_int_config_apps.c
  10. 4
      src/modules/conf_borders/e_int_config_borders.c
  11. 2
      src/modules/conf_clientlist/e_int_config_clientlist.c
  12. 4
      src/modules/conf_colors/e_int_config_color_classes.c
  13. 4
      src/modules/conf_desk/e_int_config_desk.c
  14. 4
      src/modules/conf_desklock/e_int_config_desklock.c
  15. 4
      src/modules/conf_desks/e_int_config_desks.c
  16. 16
      src/modules/conf_dialogs/e_int_config_dialogs.c
  17. 4
      src/modules/conf_display/e_int_config_display.c
  18. 4
      src/modules/conf_dpms/e_int_config_dpms.c
  19. 4
      src/modules/conf_edgebindings/e_int_config_edgebindings.c
  20. 4
      src/modules/conf_engine/e_int_config_engine.c
  21. 4
      src/modules/conf_exebuf/e_int_config_exebuf.c
  22. 4
      src/modules/conf_fonts/e_int_config_fonts.c
  23. 4
      src/modules/conf_icon_theme/e_int_config_icon_themes.c
  24. 4
      src/modules/conf_imc/e_int_config_imc.c
  25. 4
      src/modules/conf_interaction/e_int_config_interaction.c
  26. 4
      src/modules/conf_intl/e_int_config_intl.c
  27. 4
      src/modules/conf_keybindings/e_int_config_keybindings.c
  28. 4
      src/modules/conf_menus/e_int_config_menus.c
  29. 4
      src/modules/conf_mime/e_int_config_mime.c
  30. 4
      src/modules/conf_mouse/e_int_config_mouse.c
  31. 4
      src/modules/conf_mouse_cursor/e_int_config_cursor.c
  32. 4
      src/modules/conf_mousebindings/e_int_config_mousebindings.c
  33. 4
      src/modules/conf_paths/e_int_config_paths.c
  34. 4
      src/modules/conf_performance/e_int_config_performance.c
  35. 4
      src/modules/conf_profiles/e_int_config_profiles.c
  36. 4
      src/modules/conf_scale/e_int_config_scale.c
  37. 4
      src/modules/conf_screensaver/e_int_config_screensaver.c
  38. 4
      src/modules/conf_shelves/e_int_config_shelf.c
  39. 4
      src/modules/conf_startup/e_int_config_startup.c
  40. 4
      src/modules/conf_theme/e_int_config_theme.c
  41. 4
      src/modules/conf_transitions/e_int_config_transitions.c
  42. 4
      src/modules/conf_wallpaper/e_int_config_wallpaper.c
  43. 2
      src/modules/conf_wallpaper2/e_int_config_wallpaper.c
  44. 20
      src/modules/conf_window_display/e_int_config_window_display.c
  45. 4
      src/modules/conf_window_focus/e_int_config_focus.c
  46. 4
      src/modules/conf_window_manipulation/e_int_config_window_geometry.c
  47. 4
      src/modules/conf_window_manipulation/e_int_config_window_maxpolicy.c
  48. 4
      src/modules/conf_window_manipulation/e_int_config_window_stacking.c
  49. 42
      src/modules/conf_window_remembers/e_int_config_remembers.c
  50. 4
      src/modules/conf_winlist/e_int_config_winlist.c
  51. 4
      src/modules/dropshadow/e_mod_config.c
  52. 4
      src/modules/everything/e_mod_main.c
  53. 4
      src/modules/everything/evry_config.c
  54. 156
      src/modules/fileman/e_fwin.c
  55. 4
      src/modules/fileman/e_mod_config.c
  56. 4
      src/modules/gadman/e_mod_config.c
  57. 4
      src/modules/mixer/conf_module.c
  58. 2
      src/modules/mixer/e_mod_main.c

@ -1046,7 +1046,7 @@ e_config_load(void)
E_CONFIG_LIMIT(e_config->desk_flip_pan_bg, 0, 1);
E_CONFIG_LIMIT(e_config->desk_flip_pan_x_axis_factor, 0.0, 1.0);
E_CONFIG_LIMIT(e_config->desk_flip_pan_y_axis_factor, 0.0, 1.0);
E_CONFIG_LIMIT(e_config->remember_internal_windows, 0, 1);
E_CONFIG_LIMIT(e_config->remember_internal_windows, 0, 3);
E_CONFIG_LIMIT(e_config->desk_auto_switch, 0, 1);
E_CONFIG_LIMIT(e_config->dpms_enable, 0, 1);

@ -167,11 +167,12 @@ _e_config_dialog_go(E_Config_Dialog *cfd, E_Config_Dialog_CFData_Type type)
pdia = cfd->dia;
/* FIXME: get name/class form new call and use here */
if (type == E_CONFIG_DIALOG_CFDATA_TYPE_BASIC)
snprintf(buf, sizeof(buf), "%s...%s", cfd->class, "BASIC");
else
snprintf(buf, sizeof(buf), "%s...%s", cfd->class, "ADVANCED");
/* if (type == E_CONFIG_DIALOG_CFDATA_TYPE_BASIC)
* snprintf(buf, sizeof(buf), "%s...%s", cfd->class, "BASIC");
* else
* snprintf(buf, sizeof(buf), "%s...%s", cfd->class, "ADVANCED"); */
snprintf(buf, sizeof(buf), "_config::%s", cfd->class);
if (!pdia) /* creating window for the first time */
{
if ((cfd->view->normal_win) || (e_config->cfgdlg_normal_wins))

@ -213,7 +213,7 @@ _e_desktop_edit_view_create(E_Desktop_Edit *editor, E_Container *con)
editor->cfd =
e_config_dialog_new(con, _("Desktop Entry Editor"), "E",
"_desktop_editor_dialog",
"applications/new_application",
"preferences-applications", 0, v, editor);
if (!editor->cfd)

@ -818,16 +818,6 @@ main(int argc, char **argv)
}
_e_main_shutdown_push(e_exec_shutdown);
e_init_status_set(_("Setup Remembers"));
TS("remember");
/* do remember stuff */
if (!e_remember_init(after_restart ? E_STARTUP_RESTART: E_STARTUP_START))
{
e_error_message_show(_("Enlightenment cannot setup remember settings."));
_e_main_shutdown(-1);
}
_e_main_shutdown_push(e_remember_shutdown);
TS("container freeze");
e_container_all_freeze();
@ -891,6 +881,16 @@ main(int argc, char **argv)
}
_e_main_shutdown_push(e_module_shutdown);
e_init_status_set(_("Setup Remembers"));
TS("remember");
/* do remember stuff */
if (!e_remember_init(after_restart ? E_STARTUP_RESTART: E_STARTUP_START))
{
e_error_message_show(_("Enlightenment cannot setup remember settings."));
_e_main_shutdown(-1);
}
_e_main_shutdown_push(e_remember_shutdown);
e_init_status_set(_("Setup Color Classes"));
TS("colorclasses");
/* setup color_class */
@ -1084,6 +1084,8 @@ main(int argc, char **argv)
/* Store current selected desktops */
_e_main_desk_save();
e_remember_internal_save();
/* unroll our stack of shutdown functions with exit code of 0 */
_e_main_shutdown(0);

@ -24,12 +24,14 @@ static Ecore_Idler *_e_module_idler = NULL;
static Eina_List *_e_modules_delayed = NULL;
EAPI int E_EVENT_MODULE_UPDATE = 0;
EAPI int E_EVENT_MODULE_INIT_END = 0;
/* externally accessible functions */
EAPI int
e_module_init(void)
{
E_EVENT_MODULE_UPDATE = ecore_event_type_new();
E_EVENT_MODULE_INIT_END = ecore_event_type_new();
return 1;
}
@ -91,6 +93,11 @@ e_module_all_load(void)
if (m) e_module_enable(m);
}
}
if (!_e_modules_delayed)
{
ecore_event_add(E_EVENT_MODULE_INIT_END, NULL, NULL, NULL);
}
}
EAPI E_Module *
@ -514,16 +521,6 @@ _e_module_cb_dialog_disable(void *data, E_Dialog *dia)
e_config_save_queue();
}
static void
_e_module_event_update_free(void *data, void *event)
{
E_Event_Module_Update *ev;
if (!(ev = event)) return;
E_FREE(ev->name);
E_FREE(ev);
}
static int
_e_module_cb_idler(void *data)
{
@ -539,7 +536,14 @@ _e_module_cb_idler(void *data)
if (m) e_module_enable(m);
eina_stringshare_del(name);
}
if (_e_modules_delayed) return 1;
if (_e_modules_delayed)
{
e_util_wakeup();
return 1;
}
ecore_event_add(E_EVENT_MODULE_INIT_END, NULL, NULL, NULL);
_e_module_idler = NULL;
return 0;
}
@ -553,3 +557,14 @@ _e_module_sort_priority(const void *d1, const void *d2)
m2 = d2;
return (m2->priority - m1->priority);
}
static void
_e_module_event_update_free(void *data, void *event)
{
E_Event_Module_Update *ev;
if (!(ev = event)) return;
E_FREE(ev->name);
E_FREE(ev);
}

@ -17,6 +17,7 @@ typedef struct _E_Event_Module_Update E_Event_Module_Update;
#define E_MODULE_TYPE 0xE0b0100b
extern EAPI int E_EVENT_MODULE_UPDATE;
extern EAPI int E_EVENT_MODULE_INIT_END;
struct _E_Event_Module_Update
{

@ -6,16 +6,32 @@
#define REMEMBER_HIERARCHY 1
#define REMEMBER_SIMPLE 0
typedef struct _E_Remember_List E_Remember_List;
struct _E_Remember_List
{
Eina_List *list;
};
/* local subsystem functions */
static void _e_remember_free(E_Remember *rem);
static void _e_remember_update(E_Border *bd, E_Remember *rem);
static E_Remember *_e_remember_find(E_Border *bd, int check_usable);
static void _e_remember_cb_hook_pre_post_fetch(void *data, void *bd);
static void _e_remember_cb_hook_eval_post_new_border(void *data, void *bd);
static void _e_remember_init_edd(void);
static int _e_remember_restore_cb(void *data, int type, void *event);
/* local subsystem globals */
static Eina_List *hooks = NULL;
static E_Config_DD *e_remember_edd = NULL;
static E_Config_DD *e_remember_list_edd = NULL;
static E_Remember_List *remembers = NULL;
static Eina_List *handlers = NULL;
/* FIXME: match netwm window type */
/* static Eina_List *e_remember_restart_list = NULL; */
/* local subsystem globals */
/* externally accessible functions */
EAPI int
@ -41,6 +57,16 @@ e_remember_init(E_Startup_Mode mode)
_e_remember_cb_hook_eval_post_new_border, NULL);
if (h) hooks = eina_list_append(hooks, h);
_e_remember_init_edd();
remembers = e_config_domain_load("e_remember_restart", e_remember_list_edd);
if (remembers)
{
handlers = eina_list_append
(handlers, ecore_event_handler_add
(E_EVENT_MODULE_INIT_END, _e_remember_restore_cb, NULL));
}
return 1;
}
@ -48,13 +74,118 @@ EAPI int
e_remember_shutdown(void)
{
E_Border_Hook *h;
Ecore_Event_Handler *hh;
EINA_LIST_FREE(hooks, h)
e_border_hook_del(h);
E_CONFIG_DD_FREE(e_remember_edd);
E_CONFIG_DD_FREE(e_remember_list_edd);
EINA_LIST_FREE(handlers, hh)
ecore_event_handler_del(hh);
return 1;
}
EAPI void
e_remember_internal_save(void)
{
Eina_List *l;
E_Border *bd;
E_Remember *rem;
//printf("internal save %d\n", restart);
if (!remembers)
remembers = E_NEW(E_Remember_List, 1);
else
{
EINA_LIST_FREE(remembers->list, rem)
_e_remember_free(rem);
}
EINA_LIST_FOREACH(e_border_client_list(), l, bd)
{
if (!bd->internal) continue;
rem = E_NEW(E_Remember, 1);
if (!rem) break;
e_remember_default_match_set(rem, bd);
rem->apply = (E_REMEMBER_APPLY_POS | E_REMEMBER_APPLY_SIZE |
E_REMEMBER_APPLY_BORDER | E_REMEMBER_APPLY_LAYER |
E_REMEMBER_APPLY_SHADE | E_REMEMBER_APPLY_ZONE |
E_REMEMBER_APPLY_DESKTOP | E_REMEMBER_APPLY_LOCKS |
E_REMEMBER_APPLY_SKIP_WINLIST |
E_REMEMBER_APPLY_SKIP_PAGER |
E_REMEMBER_APPLY_SKIP_TASKBAR);
_e_remember_update(bd, rem);
remembers->list = eina_list_append(remembers->list, rem);
}
e_config_domain_save("e_remember_restart", e_remember_list_edd, remembers);
}
static int
_e_remember_restore_cb(void *data, int type, void *event)
{
E_Remember *rem;
Eina_List *l;
E_Action *act_fm, *act;
const char *path;
E_Container *con;
act_fm = e_action_find("fileman");
con = e_container_current_get(e_manager_current_get());
EINA_LIST_FOREACH(remembers->list, l, rem)
{
if (!rem->class) continue;
//printf("internal restore %s\n", rem->class);
if (!strncmp(rem->class, "e_fwin::", 8))
{
//printf("internal restore fm %p\n", (void *) act_fm);
if (!act_fm)
continue;
if (!strlen(rem->class) > 8)
continue;
path = rem->class + 8;
act_fm->func.go(NULL, path);
}
else if (!strncmp(rem->class, "_config::", 9))
{
/* TODO parse _config::params::path */
path = rem->class + 9;
//printf("internal restore config %s\n", path);
if (e_configure_registry_exists(path))
{
e_configure_registry_call(path, con, NULL);
}
}
else if (!strcmp(rem->class, "_configure"))
{
/* TODO this is just for settings panel. it could also
use e_configure_registry_item_add */
/* ..or make a general path for window that are started
by actions */
act = e_action_find("configuration");
if (act)
act->func.go(NULL, NULL);
}
}
if (handlers) eina_list_free(handlers);
handlers = NULL;
return 0;
}
EAPI E_Remember *
e_remember_new(void)
{
@ -213,16 +344,16 @@ e_remember_default_match_set(E_Remember *rem, E_Border *bd)
EAPI void
e_remember_update(E_Border *bd)
{
E_Remember *rem;
if (bd->new_client) return;
if (!bd->remember) return;
if (bd->remember->keep_settings) return;
rem = bd->remember;
/* e_remember_match_update(rem); */
_e_remember_update(bd, bd->remember);
e_config_save_queue();
}
static void
_e_remember_update(E_Border *bd, E_Remember *rem)
{
if (rem->apply & E_REMEMBER_APPLY_POS ||
rem->apply & E_REMEMBER_APPLY_SIZE)
{
@ -304,8 +435,6 @@ e_remember_update(E_Border *bd)
e_desk_xy_get(bd->desk, &rem->prop.desk_x, &rem->prop.desk_y);
if (rem->apply & E_REMEMBER_APPLY_FULLSCREEN)
rem->prop.fullscreen = bd->fullscreen;
e_config_save_queue();
}
/* local subsystem functions */
@ -423,12 +552,51 @@ _e_remember_free(E_Remember *rem)
free(rem);
}
static void
_e_remember_cb_hook_eval_post_new_border(void *data, void *border)
{
E_Border *bd = border;
if (!bd->new_client) return;
if ((bd->internal) && (!bd->remember) &&
(e_config->remember_internal_windows) &&
(!bd->internal_no_remember) &&
(bd->client.icccm.class && bd->client.icccm.class[0]))
{
E_Remember *rem;
if (!strncmp(bd->client.icccm.class, "e_fwin", 6))
{
if (!(e_config->remember_internal_windows & E_REMEMBER_INTERNAL_FM_WINS))
return;
}
else
{
if (!(e_config->remember_internal_windows & E_REMEMBER_INTERNAL_DIALOGS))
return;
}
rem = e_remember_new();
if (!rem) return;
e_remember_default_match_set(rem, bd);
rem->apply = E_REMEMBER_APPLY_POS | E_REMEMBER_APPLY_SIZE | E_REMEMBER_APPLY_BORDER;
e_remember_use(rem);
e_remember_update(bd);
bd->remember = rem;
}
}
static void
_e_remember_cb_hook_pre_post_fetch(void *data, void *border)
{
E_Border *bd = border;
E_Remember *rem = NULL;
int temporary = 0;
if (!bd->new_client) return;
if (!bd->remember)
@ -440,256 +608,326 @@ _e_remember_cb_hook_pre_post_fetch(void *data, void *border)
e_remember_use(rem);
}
}
if (bd->remember)
if (bd->internal && remembers && bd->client.icccm.class)
{
rem = bd->remember;
if (rem->apply & E_REMEMBER_APPLY_ZONE)
Eina_List *l;
EINA_LIST_FOREACH(remembers->list, l, rem)
{
E_Zone *zone;
zone = e_container_zone_number_get(bd->zone->container, rem->prop.zone);
if (zone)
e_border_zone_set(bd, zone);
if (!strcmp(rem->class, bd->client.icccm.class))
break;
}
if (rem->apply & E_REMEMBER_APPLY_DESKTOP)
if (rem)
{
E_Desk *desk;
temporary = 1;
remembers->list = eina_list_remove(remembers->list, rem);
}
else rem = bd->remember;
}
if (!rem)
return;
desk = e_desk_at_xy_get(bd->zone, rem->prop.desk_x, rem->prop.desk_y);
if (desk)
{
e_border_desk_set(bd, desk);
if (e_config->desk_auto_switch)
e_desk_show(desk);
}
if (rem->apply & E_REMEMBER_APPLY_ZONE)
{
E_Zone *zone;
zone = e_container_zone_number_get(bd->zone->container, rem->prop.zone);
if (zone)
e_border_zone_set(bd, zone);
}
if (rem->apply & E_REMEMBER_APPLY_DESKTOP)
{
E_Desk *desk;
desk = e_desk_at_xy_get(bd->zone, rem->prop.desk_x, rem->prop.desk_y);
if (desk)
{
e_border_desk_set(bd, desk);
if (e_config->desk_auto_switch)
e_desk_show(desk);
}
if (rem->apply & E_REMEMBER_APPLY_SIZE)
}
if (rem->apply & E_REMEMBER_APPLY_SIZE)
{
bd->client.w = rem->prop.w;
bd->client.h = rem->prop.h;
/* we can trust internal windows */
if (bd->internal)
{
bd->client.w = rem->prop.w;
bd->client.h = rem->prop.h;
/* we can trust internal windows */
if (bd->internal)
if (bd->zone->w != rem->prop.res_x)
{
if (bd->zone->w != rem->prop.res_x)
{
if (bd->client.w > (bd->zone->w - 64))
bd->client.w = bd->zone->w - 64;
}
if (bd->zone->h != rem->prop.res_y)
{
if (bd->client.h > (bd->zone->h - 64))
bd->client.h = bd->zone->h - 64;
}
if (bd->client.icccm.min_w > bd->client.w)
bd->client.w = bd->client.icccm.min_w;
if (bd->client.icccm.max_w < bd->client.w)
bd->client.w = bd->client.icccm.max_w;
if (bd->client.icccm.min_h > bd->client.h)
bd->client.h = bd->client.icccm.min_h;
if (bd->client.icccm.max_h < bd->client.h)
bd->client.h = bd->client.icccm.max_h;
if (bd->client.w > (bd->zone->w - 64))
bd->client.w = bd->zone->w - 64;
}
bd->w = bd->client.w + bd->client_inset.l + bd->client_inset.r;
bd->h = bd->client.h + bd->client_inset.t + bd->client_inset.b;
bd->changes.size = 1;
bd->changes.shape = 1;
if (bd->zone->h != rem->prop.res_y)
{
if (bd->client.h > (bd->zone->h - 64))
bd->client.h = bd->zone->h - 64;
}
if (bd->client.icccm.min_w > bd->client.w)
bd->client.w = bd->client.icccm.min_w;
if (bd->client.icccm.max_w < bd->client.w)
bd->client.w = bd->client.icccm.max_w;
if (bd->client.icccm.min_h > bd->client.h)
bd->client.h = bd->client.icccm.min_h;
if (bd->client.icccm.max_h < bd->client.h)
bd->client.h = bd->client.icccm.max_h;
}
if ((rem->apply & E_REMEMBER_APPLY_POS) && (!bd->re_manage))
bd->w = bd->client.w + bd->client_inset.l + bd->client_inset.r;
bd->h = bd->client.h + bd->client_inset.t + bd->client_inset.b;
bd->changes.size = 1;
bd->changes.shape = 1;
}
if ((rem->apply & E_REMEMBER_APPLY_POS) && (!bd->re_manage))
{
bd->x = rem->prop.pos_x;
bd->y = rem->prop.pos_y;
if (bd->zone->w != rem->prop.res_x)
{
bd->x = rem->prop.pos_x;
bd->y = rem->prop.pos_y;
if (bd->zone->w != rem->prop.res_x)
int px;
px = bd->x + (bd->w / 2);
if (px < ((rem->prop.res_x * 1) / 3))
{
int px;
px = bd->x + (bd->w / 2);
if (px < ((rem->prop.res_x * 1) / 3))
{
if (bd->zone->w >= (rem->prop.res_x / 3))
bd->x = rem->prop.pos_x;
else
bd->x = ((rem->prop.pos_x - 0) * bd->zone->w) /
(rem->prop.res_x / 3);
}
else if (px < ((rem->prop.res_x * 2) / 3))
{
if (bd->zone->w >= (rem->prop.res_x / 3))
bd->x = (bd->zone->w / 2) +
(px - (rem->prop.res_x / 2)) -
(bd->w / 2);
else
bd->x = (bd->zone->w / 2) +
(((px - (rem->prop.res_x / 2)) * bd->zone->w) /
(rem->prop.res_x / 3)) -
(bd->w / 2);
}
if (bd->zone->w >= (rem->prop.res_x / 3))
bd->x = rem->prop.pos_x;
else
{
if (bd->zone->w >= (rem->prop.res_x / 3))
bd->x = bd->zone->w +
rem->prop.pos_x - rem->prop.res_x +
(rem->prop.w - bd->client.w);
else
bd->x = bd->zone->w +
(((rem->prop.pos_x - rem->prop.res_x) * bd->zone->w) /
(rem->prop.res_x / 3)) +
(rem->prop.w - bd->client.w);
}
if ((rem->prop.pos_x >= 0) && (bd->x < 0))
bd->x = 0;
else if (((rem->prop.pos_x + rem->prop.w) < rem->prop.res_x) &&
((bd->x + bd->w) > bd->zone->w))
bd->x = bd->zone->w - bd->w;
bd->x = ((rem->prop.pos_x - 0) * bd->zone->w) /
(rem->prop.res_x / 3);
}
if (bd->zone->h != rem->prop.res_y)
else if (px < ((rem->prop.res_x * 2) / 3))
{
int py;
py = bd->y + (bd->h / 2);
if (py < ((rem->prop.res_y * 1) / 3))
{
if (bd->zone->h >= (rem->prop.res_y / 3))
bd->y = rem->prop.pos_y;
else
bd->y = ((rem->prop.pos_y - 0) * bd->zone->h) /
(rem->prop.res_y / 3);
}
else if (py < ((rem->prop.res_y * 2) / 3))
{
if (bd->zone->h >= (rem->prop.res_y / 3))
bd->y = (bd->zone->h / 2) +
(py - (rem->prop.res_y / 2)) -
(bd->h / 2);
else
bd->y = (bd->zone->h / 2) +
(((py - (rem->prop.res_y / 2)) * bd->zone->h) /
(rem->prop.res_y / 3)) -
(bd->h / 2);
}
if (bd->zone->w >= (rem->prop.res_x / 3))
bd->x = (bd->zone->w / 2) +
(px - (rem->prop.res_x / 2)) -
(bd->w / 2);
else
{
if (bd->zone->h >= (rem->prop.res_y / 3))
bd->y = bd->zone->h +
rem->prop.pos_y - rem->prop.res_y +
(rem->prop.h - bd->client.h);
else
bd->y = bd->zone->h +
(((rem->prop.pos_y - rem->prop.res_y) * bd->zone->h) /
(rem->prop.res_y / 3)) +
(rem->prop.h - bd->client.h);
}
if ((rem->prop.pos_y >= 0) && (bd->y < 0))
bd->y = 0;
else if (((rem->prop.pos_y + rem->prop.h) < rem->prop.res_y) &&
((bd->y + bd->h) > bd->zone->h))
bd->y = bd->zone->h - bd->h;
bd->x = (bd->zone->w / 2) +
(((px - (rem->prop.res_x / 2)) * bd->zone->w) /
(rem->prop.res_x / 3)) -
(bd->w / 2);
}
// if (bd->zone->w != rem->prop.res_x)
// bd->x = (rem->prop.pos_x * bd->zone->w) / rem->prop.res_x;
// if (bd->zone->h != rem->prop.res_y)
// bd->y = (rem->prop.pos_y * bd->zone->h) / rem->prop.res_y;
bd->x += bd->zone->x;
bd->y += bd->zone->y;
bd->placed = 1;
bd->changes.pos = 1;
}
if (rem->apply & E_REMEMBER_APPLY_LAYER)
{
bd->layer = rem->prop.layer;
if (bd->layer == 100)
e_hints_window_stacking_set(bd, E_STACKING_NONE);
else if (bd->layer == 150)
e_hints_window_stacking_set(bd, E_STACKING_ABOVE);
e_container_border_raise(bd);
}
if (rem->apply & E_REMEMBER_APPLY_BORDER)
{
if (rem->prop.border)
else
{
if (bd->bordername) eina_stringshare_del(bd->bordername);
if (rem->prop.border) bd->bordername = eina_stringshare_add(rem->prop.border);
else bd->bordername = NULL;
bd->client.border.changed = 1;
if (bd->zone->w >= (rem->prop.res_x / 3))
bd->x = bd->zone->w +
rem->prop.pos_x - rem->prop.res_x +
(rem->prop.w - bd->client.w);
else
bd->x = bd->zone->w +
(((rem->prop.pos_x - rem->prop.res_x) * bd->zone->w) /
(rem->prop.res_x / 3)) +
(rem->prop.w - bd->client.w);
}
if ((rem->prop.pos_x >= 0) && (bd->x < 0))
bd->x = 0;
else if (((rem->prop.pos_x + rem->prop.w) < rem->prop.res_x) &&
((bd->x + bd->w) > bd->zone->w))
bd->x = bd->zone->w - bd->w;
}
if (rem->apply & E_REMEMBER_APPLY_FULLSCREEN)
{
if (rem->prop.fullscreen)
e_border_fullscreen(bd, e_config->fullscreen_policy);
}
if (rem->apply & E_REMEMBER_APPLY_STICKY)
if (bd->zone->h != rem->prop.res_y)
{
if (rem->prop.sticky) e_border_stick(bd);
}
if (rem->apply & E_REMEMBER_APPLY_SHADE)
{
if (rem->prop.shaded >= 100)
e_border_shade(bd, rem->prop.shaded - 100);
else if (rem->prop.shaded >= 50)
e_border_unshade(bd, rem->prop.shaded - 50);
int py;
py = bd->y + (bd->h / 2);
if (py < ((rem->prop.res_y * 1) / 3))
{
if (bd->zone->h >= (rem->prop.res_y / 3))
bd->y = rem->prop.pos_y;
else
bd->y = ((rem->prop.pos_y - 0) * bd->zone->h) /
(rem->prop.res_y / 3);
}
else if (py < ((rem->prop.res_y * 2) / 3))
{
if (bd->zone->h >= (rem->prop.res_y / 3))
bd->y = (bd->zone->h / 2) +
(py - (rem->prop.res_y / 2)) -
(bd->h / 2);
else
bd->y = (bd->zone->h / 2) +
(((py - (rem->prop.res_y / 2)) * bd->zone->h) /
(rem->prop.res_y / 3)) -
(bd->h / 2);
}
else
{
if (bd->zone->h >= (rem->prop.res_y / 3))
bd->y = bd->zone->h +
rem->prop.pos_y - rem->prop.res_y +
(rem->prop.h - bd->client.h);
else
bd->y = bd->zone->h +
(((rem->prop.pos_y - rem->prop.res_y) * bd->zone->h) /
(rem->prop.res_y / 3)) +
(rem->prop.h - bd->client.h);
}
if ((rem->prop.pos_y >= 0) && (bd->y < 0))
bd->y = 0;
else if (((rem->prop.pos_y + rem->prop.h) < rem->prop.res_y) &&
((bd->y + bd->h) > bd->zone->h))
bd->y = bd->zone->h - bd->h;
}
if (rem->apply & E_REMEMBER_APPLY_LOCKS)
// if (bd->zone->w != rem->prop.res_x)
// bd->x = (rem->prop.pos_x * bd->zone->w) / rem->prop.res_x;
// if (bd->zone->h != rem->prop.res_y)
// bd->y = (rem->prop.pos_y * bd->zone->h) / rem->prop.res_y;
bd->x += bd->zone->x;
bd->y += bd->zone->y;
bd->placed = 1;
bd->changes.pos = 1;
}
if (rem->apply & E_REMEMBER_APPLY_LAYER)
{
bd->layer = rem->prop.layer;
if (bd->layer == 100)
e_hints_window_stacking_set(bd, E_STACKING_NONE);
else if (bd->layer == 150)
e_hints_window_stacking_set(bd, E_STACKING_ABOVE);
e_container_border_raise(bd);
}
if (rem->apply & E_REMEMBER_APPLY_BORDER)
{
if (rem->prop.border)
{
bd->lock_user_location = rem->prop.lock_user_location;
bd->lock_client_location = rem->prop.lock_client_location;
bd->lock_user_size = rem->prop.lock_user_size;
bd->lock_client_size = rem->prop.lock_client_size;
bd->lock_user_stacking = rem->prop.lock_user_stacking;
bd->lock_client_stacking = rem->prop.lock_client_stacking;
bd->lock_user_iconify = rem->prop.lock_user_iconify;
bd->lock_client_iconify = rem->prop.lock_client_iconify;
bd->lock_user_desk = rem->prop.lock_user_desk;
bd->lock_client_desk = rem->prop.lock_client_desk;
bd->lock_user_sticky = rem->prop.lock_user_sticky;
bd->lock_client_sticky = rem->prop.lock_client_sticky;
bd->lock_user_shade = rem->prop.lock_user_shade;
bd->lock_client_shade = rem->prop.lock_client_shade;
bd->lock_user_maximize = rem->prop.lock_user_maximize;
bd->lock_client_maximize = rem->prop.lock_client_maximize;
bd->lock_user_fullscreen = rem->prop.lock_user_fullscreen;
bd->lock_client_fullscreen = rem->prop.lock_client_fullscreen;
bd->lock_border = rem->prop.lock_border;
bd->lock_close = rem->prop.lock_close;
bd->lock_focus_in = rem->prop.lock_focus_in;
bd->lock_focus_out = rem->prop.lock_focus_out;
bd->lock_life = rem->prop.lock_life;
if (bd->bordername) eina_stringshare_del(bd->bordername);
if (rem->prop.border) bd->bordername = eina_stringshare_add(rem->prop.border);
else bd->bordername = NULL;
bd->client.border.changed = 1;
}
if (rem->apply & E_REMEMBER_APPLY_SKIP_WINLIST)
bd->user_skip_winlist = rem->prop.skip_winlist;
if (rem->apply & E_REMEMBER_APPLY_SKIP_PAGER)
bd->client.netwm.state.skip_pager = rem->prop.skip_pager;
if (rem->apply & E_REMEMBER_APPLY_SKIP_TASKBAR)
bd->client.netwm.state.skip_taskbar = rem->prop.skip_taskbar;
if (rem->apply & E_REMEMBER_APPLY_ICON_PREF)
bd->icon_preference = rem->prop.icon_preference;
if (rem->apply & E_REMEMBER_SET_FOCUS_ON_START)
bd->want_focus = 1;
}
if (rem->apply & E_REMEMBER_APPLY_FULLSCREEN)
{
if (rem->prop.fullscreen)
e_border_fullscreen(bd, e_config->fullscreen_policy);
}
if (rem->apply & E_REMEMBER_APPLY_STICKY)
{
if (rem->prop.sticky) e_border_stick(bd);
}
if (rem->apply & E_REMEMBER_APPLY_SHADE)
{
if (rem->prop.shaded >= 100)
e_border_shade(bd, rem->prop.shaded - 100);
else if (rem->prop.shaded >= 50)
e_border_unshade(bd, rem->prop.shaded - 50);
}
if (rem->apply & E_REMEMBER_APPLY_LOCKS)
{
bd->lock_user_location = rem->prop.lock_user_location;
bd->lock_client_location = rem->prop.lock_client_location;
bd->lock_user_size = rem->prop.lock_user_size;
bd->lock_client_size = rem->prop.lock_client_size;
bd->lock_user_stacking = rem->prop.lock_user_stacking;
bd->lock_client_stacking = rem->prop.lock_client_stacking;
bd->lock_user_iconify = rem->prop.lock_user_iconify;
bd->lock_client_iconify = rem->prop.lock_client_iconify;
bd->lock_user_desk = rem->prop.lock_user_desk;
bd->lock_client_desk = rem->prop.lock_client_desk;
bd->lock_user_sticky = rem->prop.lock_user_sticky;
bd->lock_client_sticky = rem->prop.lock_client_sticky;
bd->lock_user_shade = rem->prop.lock_user_shade;
bd->lock_client_shade = rem->prop.lock_client_shade;
bd->lock_user_maximize = rem->prop.lock_user_maximize;
bd->lock_client_maximize = rem->prop.lock_client_maximize;
bd->lock_user_fullscreen = rem->prop.lock_user_fullscreen;
bd->lock_client_fullscreen = rem->prop.lock_client_fullscreen;
bd->lock_border = rem->prop.lock_border;
bd->lock_close = rem->prop.lock_close;
bd->lock_focus_in = rem->prop.lock_focus_in;
bd->lock_focus_out = rem->prop.lock_focus_out;
bd->lock_life = rem->prop.lock_life;
}
if (rem->apply & E_REMEMBER_APPLY_SKIP_WINLIST)
bd->user_skip_winlist = rem->prop.skip_winlist;
if (rem->apply & E_REMEMBER_APPLY_SKIP_PAGER)
bd->client.netwm.state.skip_pager = rem->prop.skip_pager;
if (rem->apply & E_REMEMBER_APPLY_SKIP_TASKBAR)
bd->client.netwm.state.skip_taskbar = rem->prop.skip_taskbar;
if (rem->apply & E_REMEMBER_APPLY_ICON_PREF)
bd->icon_preference = rem->prop.icon_preference;
if (rem->apply & E_REMEMBER_SET_FOCUS_ON_START)
bd->want_focus = 1;
if (temporary)
_e_remember_free(rem);
}
static void
_e_remember_cb_hook_eval_post_new_border(void *data, void *border)
_e_remember_init_edd(void)
{
E_Border *bd = border;
if (!bd->new_client) return;
if ((bd->internal) && (!bd->remember) &&
(e_config->remember_internal_windows) &&
(!bd->internal_no_remember))
{
E_Remember *rem;
rem = e_remember_new();
if (!rem) return;
e_remember_default_match_set(rem, bd);
rem->apply = E_REMEMBER_APPLY_POS | E_REMEMBER_APPLY_SIZE | E_REMEMBER_APPLY_BORDER;
e_remember_use(rem);
e_remember_update(bd);
bd->remember = rem;
}
e_remember_edd = E_CONFIG_DD_NEW("E_Remember", E_Remember);
#undef T
#undef D
#define T E_Remember
#define D e_remember_edd
E_CONFIG_VAL(D, T, match, INT);
E_CONFIG_VAL(D, T, apply_first_only, UCHAR);
E_CONFIG_VAL(D, T, keep_settings, UCHAR);
E_CONFIG_VAL(D, T, name, STR);
E_CONFIG_VAL(D, T, class, STR);
E_CONFIG_VAL(D, T, title, STR);
E_CONFIG_VAL(D, T, role, STR);
E_CONFIG_VAL(D, T, type, INT);
E_CONFIG_VAL(D, T, transient, UCHAR);
E_CONFIG_VAL(D, T, apply, INT);
E_CONFIG_VAL(D, T, max_score, INT);
E_CONFIG_VAL(D, T, prop.pos_x, INT);
E_CONFIG_VAL(D, T, prop.pos_y, INT);
E_CONFIG_VAL(D, T, prop.res_x, INT);
E_CONFIG_VAL(D, T, prop.res_y, INT);
E_CONFIG_VAL(D, T, prop.pos_w, INT);
E_CONFIG_VAL(D, T, prop.pos_h, INT);
E_CONFIG_VAL(D, T, prop.w, INT);
E_CONFIG_VAL(D, T, prop.h, INT);
E_CONFIG_VAL(D, T, prop.layer, INT);
E_CONFIG_VAL(D, T, prop.lock_user_location, UCHAR);
E_CONFIG_VAL(D, T, prop.lock_client_location, UCHAR);
E_CONFIG_VAL(D, T, prop.lock_user_size, UCHAR);
E_CONFIG_VAL(D, T, prop.lock_client_size, UCHAR);
E_CONFIG_VAL(D, T, prop.lock_user_stacking, UCHAR);
E_CONFIG_VAL(D, T, prop.lock_client_stacking, UCHAR);
E_CONFIG_VAL(D, T, prop.lock_user_iconify, UCHAR);
E_CONFIG_VAL(D, T, prop.lock_client_iconify, UCHAR);
E_CONFIG_VAL(D, T, prop.lock_user_desk, UCHAR);
E_CONFIG_VAL(D, T, prop.lock_client_desk, UCHAR);
E_CONFIG_VAL(D, T, prop.lock_user_sticky, UCHAR);
E_CONFIG_VAL(D, T, prop.lock_client_sticky, UCHAR);
E_CONFIG_VAL(D, T, prop.lock_user_shade, UCHAR);
E_CONFIG_VAL(D, T, prop.lock_client_shade, UCHAR);
E_CONFIG_VAL(D, T, prop.lock_user_maximize, UCHAR);
E_CONFIG_VAL(D, T, prop.lock_client_maximize, UCHAR);
E_CONFIG_VAL(D, T, prop.lock_user_fullscreen, UCHAR);
E_CONFIG_VAL(D, T, prop.lock_client_fullscreen, UCHAR);
E_CONFIG_VAL(D, T, prop.lock_border, UCHAR);
E_CONFIG_VAL(D, T, prop.lock_close, UCHAR);
E_CONFIG_VAL(D, T, prop.lock_focus_in, UCHAR);
E_CONFIG_VAL(D, T, prop.lock_focus_out, UCHAR);
E_CONFIG_VAL(D, T, prop.lock_life, UCHAR);
E_CONFIG_VAL(D, T, prop.border, STR);
E_CONFIG_VAL(D, T, prop.sticky, UCHAR);
E_CONFIG_VAL(D, T, prop.shaded, UCHAR);
E_CONFIG_VAL(D, T, prop.skip_winlist, UCHAR);
E_CONFIG_VAL(D, T, prop.skip_pager, UCHAR);
E_CONFIG_VAL(D, T, prop.skip_taskbar, UCHAR);
E_CONFIG_VAL(D, T, prop.fullscreen, UCHAR);
E_CONFIG_VAL(D, T, prop.desk_x, INT);
E_CONFIG_VAL(D, T, prop.desk_y, INT);
E_CONFIG_VAL(D, T, prop.zone, INT);
E_CONFIG_VAL(D, T, prop.head, INT);
E_CONFIG_VAL(D, T, prop.command, STR);
E_CONFIG_VAL(D, T, prop.icon_preference, UCHAR);
E_CONFIG_VAL(D, T, prop.desktop_file, STR);
#undef T
#undef D
e_remember_list_edd = E_CONFIG_DD_NEW("E_Remember_List", E_Remember_List);
#undef T
#undef D
#define T E_Remember_List
#define D e_remember_list_edd
E_CONFIG_LIST(D, T, list, e_remember_edd);
#undef T
#undef D
}

@ -29,13 +29,15 @@ typedef struct _E_Remember E_Remember;
#define E_REMEMBER_SET_FOCUS_ON_START (1 << 14)
#define E_REMEMBER_APPLY_FULLSCREEN (1 << 15)
#define E_REMEMBER_INTERNAL_DIALOGS (1 << 0)
#define E_REMEMBER_INTERNAL_FM_WINS (1 << 1)
#else
#ifndef E_REMEMBER_H
#define E_REMEMBER_H
struct _E_Remember
{
unsigned char delete_me;
int match;
unsigned char apply_first_only;
unsigned char keep_settings;
@ -110,6 +112,6 @@ EAPI E_Remember *e_remember_find_usable(E_Border *bd);
EAPI void e_remember_match_update(E_Remember *rem);
EAPI void e_remember_update(E_Border *bd);
EAPI int e_remember_default_match_set(E_Remember *rem, E_Border *bd);
EAPI void e_remember_internal_save(void);
#endif
#endif

@ -48,7 +48,7 @@ e_int_config_apps_favs(E_Container *con, const char *params __UNUSED__)
e_user_dir_concat_static(buf, "applications/menu/favorite.menu");
data = E_NEW(E_Config_Data, 1);
data->title = eina_stringshare_add(_("Favorites Menu"));
data->dialog = eina_stringshare_add("_config_apps_favs_dialog");
data->dialog = eina_stringshare_add("menus/favorites_menu");
data->icon = eina_stringshare_add("user-bookmarks");
data->filename = eina_stringshare_add(buf);
@ -102,7 +102,7 @@ e_int_config_apps_ibar(E_Container *con, const char *params __UNUSED__)
e_user_dir_concat_static(buf, "applications/bar/default/.order");
data = E_NEW(E_Config_Data, 1);
data->title = eina_stringshare_add(_("IBar Applications"));
data->dialog = eina_stringshare_add("_config_apps_ibar_dialog");
data->dialog = eina_stringshare_add("applications/ibar_applications");
data->icon = eina_stringshare_add("preferences-applications-ibar");
data->filename = eina_stringshare_add(buf);
@ -117,7 +117,7 @@ e_int_config_apps_ibar_other(E_Container *con, const char *path)
if (!path) return NULL;
data = E_NEW(E_Config_Data, 1);
data->title = eina_stringshare_add(_("IBar Applications"));
data->dialog = eina_stringshare_add("_config_apps_ibar_dialog");
data->dialog = eina_stringshare_add("internal/ibar_other");
data->icon = eina_stringshare_add("preferences-applications-ibar");
data->filename = eina_stringshare_add(path);
@ -133,7 +133,7 @@ e_int_config_apps_startup(E_Container *con, const char *params __UNUSED__)
e_user_dir_concat_static(buf, "applications/startup/.order");
data = E_NEW(E_Config_Data, 1);
data->title = eina_stringshare_add(_("Startup Applications"));
data->dialog = eina_stringshare_add("_config_apps_startup_dialog");
data->dialog = eina_stringshare_add("applications/startup_applications");
data->icon = eina_stringshare_add("preferences-applications-startup");
data->filename = eina_stringshare_add(buf);
@ -149,7 +149,7 @@ e_int_config_apps_restart(E_Container *con, const char *params __UNUSED__)
e_user_dir_concat_static(buf, "applications/restart/.order");
data = E_NEW(E_Config_Data, 1);
data->title = eina_stringshare_add(_("Restart Applications"));
data->dialog = eina_stringshare_add("_config_apps_restart_dialog");
data->dialog = eina_stringshare_add("applications/restart_applications");
data->icon = eina_stringshare_add("preferences-applications-restart");
data->filename = eina_stringshare_add(buf);

@ -28,7 +28,7 @@ e_int_config_borders(E_Container *con, const char *params __UNUSED__)
v = _config_view_new();
if (!v) return NULL;
cfd = e_config_dialog_new(con, _("Default Border Style"),
"E", "_config_border_style_dialog",
"E", "appearance/borders",
"preferences-system-windows", 0, v, con);
return cfd;
}
@ -48,7 +48,7 @@ e_int_config_borders_border(E_Container *con __UNUSED__, const char *params)
if (!v) return NULL;
cfd = e_config_dialog_new(bd->zone->container,
_("Window Border Selection"),
"E", "_config_border_border_style_dialog",
"E", "internal/borders_border",
"preferences-system-windows", 0, v, bd);
bd->border_border_dialog = cfd;
return cfd;

@ -38,7 +38,7 @@ e_int_config_clientlist(E_Container *con, const char *params __UNUSED__)
v->advanced.create_widgets = NULL;
cfd = e_config_dialog_new(con, _("Client List Settings"), "E",
"_config_clientlist_dialog",
"menus/client_list_menu",
"preferences-winlist", 0, v, NULL);
return cfd;
}

@ -116,7 +116,7 @@ e_int_config_color_classes(E_Container *con, const char *params __UNUSED__)
E_Config_Dialog *cfd;
E_Config_Dialog_View *v;
if (e_config_dialog_find("E", "_config_color_classes_dialog")) return NULL;
if (e_config_dialog_find("E", "appearance/colors")) return NULL;
v = E_NEW(E_Config_Dialog_View, 1);
if (!v) return NULL;
@ -127,7 +127,7 @@ e_int_config_color_classes(E_Container *con, const char *params __UNUSED__)
v->advanced.apply_cfdata = _adv_apply_data;
v->advanced.create_widgets = _adv_create_widgets;
cfd = e_config_dialog_new(con, _("Colors"), "E", "_config_color_classes_dialog",
cfd = e_config_dialog_new(con, _("Colors"), "E", "appearance/colors",
"preferences-desktop-color", 0, v, NULL);
return cfd;
}

@ -33,7 +33,7 @@ e_int_config_desk(E_Container *con, const char *params)
if (sscanf(params, "%i %i %i %i", &con_num, &zone_num, &dx, &dy) != 4)
return NULL;
if (e_config_dialog_find("E", "_config_desk_dialog")) return NULL;
if (e_config_dialog_find("E", "internal/desk")) return NULL;
v = E_NEW(E_Config_Dialog_View, 1);
@ -49,7 +49,7 @@ e_int_config_desk(E_Container *con, const char *params)
v->basic.create_widgets = _basic_create;
v->override_auto_apply = 1;
cfd = e_config_dialog_new(con, _("Desk Settings"), "E", "_config_desk_dialog",
cfd = e_config_dialog_new(con, _("Desk Settings"), "E", "internal/desk",
"preferences-desktop", 0, v, cfdata);
return cfd;
}

@ -79,7 +79,7 @@ e_int_config_desklock(E_Container *con, const char *params __UNUSED__)
E_Config_Dialog *cfd;
E_Config_Dialog_View *v;
if (e_config_dialog_find("E", "_config_desklock_dialog")) return NULL;
if (e_config_dialog_find("E", "screen/screen_lock")) return NULL;
v = E_NEW(E_Config_Dialog_View, 1);
if (!v) return NULL;
v->create_cfdata = _create_data;
@ -94,7 +94,7 @@ e_int_config_desklock(E_Container *con, const char *params __UNUSED__)
v->override_auto_apply = 1;
cfd = e_config_dialog_new(con, _("Screen Lock Settings"), "E",
"_config_desklock_dialog", "preferences-desklock",
"screen/screen_lock", "preferences-desklock",
0, v, NULL);
return cfd;
}

@ -45,7 +45,7 @@ e_int_config_desks(E_Container *con, const char *params __UNUSED__)
E_Config_Dialog *cfd;
E_Config_Dialog_View *v;
if (e_config_dialog_find("E", "_config_desks_dialog")) return NULL;
if (e_config_dialog_find("E", "screen/virtual_desktops")) return NULL;
v = E_NEW(E_Config_Dialog_View, 1);
/* methods */
@ -60,7 +60,7 @@ e_int_config_desks(E_Container *con, const char *params __UNUSED__)
/* create config diaolg for NULL object/data */
cfd = e_config_dialog_new(con,
_("Virtual Desktops Settings"),
"E", "_config_desks_dialog",
"E", "screen/virtual_desktops",
"preferences-desktop", 0, v, NULL);
return cfd;
}

@ -15,6 +15,7 @@ struct _E_Config_Dialog_Data
int cfgdlg_auto_apply;
int cfgdlg_default_mode;
int cfgdlg_normal_wins;
int remember_windows;
};
EAPI E_Config_Dialog *
@ -23,7 +24,7 @@ e_int_config_dialogs(E_Container *con, const char *params __UNUSED__)
E_Config_Dialog *cfd;
E_Config_Dialog_View *v;