forked from enlightenment/enlightenment
a few other palces use config thing.. only 3 e_db_open references there now..
and they read lists from db's SVN revision: 4213
This commit is contained in:
parent
922fbf4662
commit
2755e1ea78
18
src/border.c
18
src/border.c
|
@ -409,13 +409,12 @@ e_focus_out(Eevent * ev)
|
||||||
E_DB_File *db;
|
E_DB_File *db;
|
||||||
int focus_mode;
|
int focus_mode;
|
||||||
char buf[4096];
|
char buf[4096];
|
||||||
|
E_CFG_INT(cfg_focus_mode, "settings", "/focus/mode", 0);
|
||||||
|
|
||||||
settings_db = e_config_get("settings");
|
E_CONFIG_INT_GET(cfg_focus_mode, focus_mode);
|
||||||
b->current.selected = 0;
|
b->current.selected = 0;
|
||||||
/* settings - click to focus would affect grabs */
|
/* settings - click to focus would affect grabs */
|
||||||
db = e_db_open_read(settings_db);
|
if (!b->current.selected)
|
||||||
sprintf(buf, "/focus/mode");
|
|
||||||
if ((db) && (e_db_int_get(db, buf, &focus_mode)) && (!b->current.selected))
|
|
||||||
{
|
{
|
||||||
if (focus_mode == 2) /* click to focus */
|
if (focus_mode == 2) /* click to focus */
|
||||||
{
|
{
|
||||||
|
@ -430,7 +429,6 @@ e_focus_out(Eevent * ev)
|
||||||
b->grabs = evas_list_append(b->grabs, g);
|
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_button_grab(b->win.main, 0, XEV_BUTTON | XEV_MOUSE_MOVE, EV_KEY_MODIFIER_NONE, 1);
|
||||||
}
|
}
|
||||||
e_db_close(db);
|
|
||||||
}
|
}
|
||||||
b->changed = 1;
|
b->changed = 1;
|
||||||
}
|
}
|
||||||
|
@ -1406,17 +1404,16 @@ void
|
||||||
e_border_attach_mouse_grabs(E_Border *b)
|
e_border_attach_mouse_grabs(E_Border *b)
|
||||||
{
|
{
|
||||||
char *grabs_db;
|
char *grabs_db;
|
||||||
char *settings_db;
|
|
||||||
E_DB_File *db;
|
E_DB_File *db;
|
||||||
int focus_mode;
|
int focus_mode;
|
||||||
char buf[4096];
|
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");
|
grabs_db = e_config_get("grabs");
|
||||||
settings_db = e_config_get("settings");
|
|
||||||
/* settings - click to focus would affect grabs */
|
/* settings - click to focus would affect grabs */
|
||||||
db = e_db_open_read(settings_db);
|
if ((!b->current.selected))
|
||||||
sprintf(buf, "/focus/mode");
|
|
||||||
if ((db) && (e_db_int_get(db, buf, &focus_mode)) && (!b->current.selected))
|
|
||||||
{
|
{
|
||||||
if (focus_mode == 2) /* click to focus */
|
if (focus_mode == 2) /* click to focus */
|
||||||
{
|
{
|
||||||
|
@ -1430,7 +1427,6 @@ e_border_attach_mouse_grabs(E_Border *b)
|
||||||
g->remove_after = 1;
|
g->remove_after = 1;
|
||||||
b->grabs = evas_list_append(b->grabs, g);
|
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_button_grab(b->win.main, 0, XEV_BUTTON | XEV_MOUSE_MOVE, EV_KEY_MODIFIER_NONE, 1);
|
||||||
e_db_close(db);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
14
src/resist.c
14
src/resist.c
|
@ -9,23 +9,21 @@ e_resist_border(E_Border *b)
|
||||||
int ok = 0;
|
int ok = 0;
|
||||||
int dx, dy, d;
|
int dx, dy, d;
|
||||||
int resist_x = 0, resist_y = 0;
|
int resist_x = 0, resist_y = 0;
|
||||||
char *settings_db;
|
|
||||||
Evas_List l, rects = NULL;
|
Evas_List l, rects = NULL;
|
||||||
E_Rect *r;
|
E_Rect *r;
|
||||||
|
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);
|
||||||
|
|
||||||
settings_db = e_config_get("settings");
|
E_CONFIG_INT_GET(cfg_resist, resist);
|
||||||
E_DB_INT_GET(settings_db, "/move/resist", resist, ok);
|
E_CONFIG_INT_GET(cfg_desk_resist, desk_resist);
|
||||||
if (!ok) resist = 1;
|
E_CONFIG_INT_GET(cfg_win_resist, win_resist);
|
||||||
if (!resist)
|
if (!resist)
|
||||||
{
|
{
|
||||||
b->current.x = b->current.requested.x;
|
b->current.x = b->current.requested.x;
|
||||||
b->current.y = b->current.requested.y;
|
b->current.y = b->current.requested.y;
|
||||||
return;
|
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;
|
if (!b->desk) return;
|
||||||
dx = b->current.requested.x - b->previous.requested.x;
|
dx = b->current.requested.x - b->previous.requested.x;
|
||||||
dy = b->current.requested.y - b->previous.requested.y;
|
dy = b->current.requested.y - b->previous.requested.y;
|
||||||
|
|
Loading…
Reference in New Issue