a few other palces use config thing.. only 3 e_db_open references there now..


			
			
				devs/princeamd/enlightenment-0.17-elive
			
			
		
Carsten Haitzler 22 years ago
parent 922fbf4662
commit 2755e1ea78
  1. 20
      src/border.c
  2. 16
      src/resist.c

@ -409,13 +409,12 @@ e_focus_out(Eevent * ev)
E_DB_File *db;
int focus_mode;
char buf[4096];
settings_db = e_config_get("settings");
E_CFG_INT(cfg_focus_mode, "settings", "/focus/mode", 0);
E_CONFIG_INT_GET(cfg_focus_mode, focus_mode);
b->current.selected = 0;
/* settings - click to focus would affect grabs */
db = e_db_open_read(settings_db);
sprintf(buf, "/focus/mode");
if ((db) && (e_db_int_get(db, buf, &focus_mode)) && (!b->current.selected))
if (!b->current.selected)
{
if (focus_mode == 2) /* click to focus */
{
@ -430,7 +429,6 @@ e_focus_out(Eevent * ev)
b->grabs = evas_list_append(b->grabs, g);
e_button_grab(b->win.main, 0, XEV_BUTTON | XEV_MOUSE_MOVE, EV_KEY_MODIFIER_NONE, 1);
}
e_db_close(db);
}
b->changed = 1;
}
@ -1406,17 +1404,16 @@ void
e_border_attach_mouse_grabs(E_Border *b)
{
char *grabs_db;
char *settings_db;
E_DB_File *db;
int focus_mode;
char buf[4096];
E_CFG_INT(cfg_focus_mode, "settings", "/focus/mode", 0);
E_CONFIG_INT_GET(cfg_focus_mode, focus_mode);
grabs_db = e_config_get("grabs");
settings_db = e_config_get("settings");
/* settings - click to focus would affect grabs */
db = e_db_open_read(settings_db);
sprintf(buf, "/focus/mode");
if ((db) && (e_db_int_get(db, buf, &focus_mode)) && (!b->current.selected))
if ((!b->current.selected))
{
if (focus_mode == 2) /* click to focus */
{
@ -1430,7 +1427,6 @@ e_border_attach_mouse_grabs(E_Border *b)
g->remove_after = 1;
b->grabs = evas_list_append(b->grabs, g);
e_button_grab(b->win.main, 0, XEV_BUTTON | XEV_MOUSE_MOVE, EV_KEY_MODIFIER_NONE, 1);
e_db_close(db);
}
}

@ -9,23 +9,21 @@ e_resist_border(E_Border *b)
int ok = 0;
int dx, dy, d;
int resist_x = 0, resist_y = 0;
char *settings_db;
Evas_List l, rects = NULL;
E_Rect *r;
settings_db = e_config_get("settings");
E_DB_INT_GET(settings_db, "/move/resist", resist, ok);
if (!ok) resist = 1;
E_CFG_INT(cfg_resist, "settings", "/move/resist", 1);
E_CFG_INT(cfg_desk_resist, "settings", "/move/resist/desk", 32);
E_CFG_INT(cfg_win_resist, "settings", "/move/resist/win", 12);
E_CONFIG_INT_GET(cfg_resist, resist);
E_CONFIG_INT_GET(cfg_desk_resist, desk_resist);
E_CONFIG_INT_GET(cfg_win_resist, win_resist);
if (!resist)
{
b->current.x = b->current.requested.x;
b->current.y = b->current.requested.y;
return;
}
ok = 0; E_DB_INT_GET(settings_db, "/move/resist/desk", desk_resist, ok);
if (!ok) desk_resist = 32;
ok = 0; E_DB_INT_GET(settings_db, "/move/resist/win", win_resist, ok);
if (!ok) win_resist = 12;
if (!b->desk) return;
dx = b->current.requested.x - b->previous.requested.x;
dy = b->current.requested.y - b->previous.requested.y;

Loading…
Cancel
Save