diff --git a/data/config/behavior/default/actions.db b/data/config/behavior/default/actions.db index aec13cc5a..58b457760 100644 Binary files a/data/config/behavior/default/actions.db and b/data/config/behavior/default/actions.db differ diff --git a/data/config/behavior/default/grabs.db b/data/config/behavior/default/grabs.db index ba5c2cf21..f1c3d7452 100644 Binary files a/data/config/behavior/default/grabs.db and b/data/config/behavior/default/grabs.db differ diff --git a/data/config/behavior/default/settings.db b/data/config/behavior/default/settings.db index d514e1f51..3f9a8cedb 100644 Binary files a/data/config/behavior/default/settings.db and b/data/config/behavior/default/settings.db differ diff --git a/data/scripts/build_db.sh b/data/scripts/build_db.sh index 7121b7238..32caabbf9 100755 --- a/data/scripts/build_db.sh +++ b/data/scripts/build_db.sh @@ -177,6 +177,70 @@ edb_ed $DB add "/actions/"$NUM"/button" int 0 edb_ed $DB add "/actions/"$NUM"/key" str "m" edb_ed $DB add "/actions/"$NUM"/modifiers" int $MOD_CTRL_ALT NUM=$[ $NUM + 1 ]; +edb_ed $DB add "/actions/"$NUM"/name" str "Key_Binding" +edb_ed $DB add "/actions/"$NUM"/action" str "Desktop" +edb_ed $DB add "/actions/"$NUM"/params" str "0" +edb_ed $DB add "/actions/"$NUM"/event" int $ACT_KEY_DOWN +edb_ed $DB add "/actions/"$NUM"/button" int 0 +edb_ed $DB add "/actions/"$NUM"/key" str "F1" +edb_ed $DB add "/actions/"$NUM"/modifiers" int $MOD_ALT +NUM=$[ $NUM + 1 ]; +edb_ed $DB add "/actions/"$NUM"/name" str "Key_Binding" +edb_ed $DB add "/actions/"$NUM"/action" str "Desktop" +edb_ed $DB add "/actions/"$NUM"/params" str "1" +edb_ed $DB add "/actions/"$NUM"/event" int $ACT_KEY_DOWN +edb_ed $DB add "/actions/"$NUM"/button" int 0 +edb_ed $DB add "/actions/"$NUM"/key" str "F2" +edb_ed $DB add "/actions/"$NUM"/modifiers" int $MOD_ALT +NUM=$[ $NUM + 1 ]; +edb_ed $DB add "/actions/"$NUM"/name" str "Key_Binding" +edb_ed $DB add "/actions/"$NUM"/action" str "Desktop" +edb_ed $DB add "/actions/"$NUM"/params" str "2" +edb_ed $DB add "/actions/"$NUM"/event" int $ACT_KEY_DOWN +edb_ed $DB add "/actions/"$NUM"/button" int 0 +edb_ed $DB add "/actions/"$NUM"/key" str "F3" +edb_ed $DB add "/actions/"$NUM"/modifiers" int $MOD_ALT +NUM=$[ $NUM + 1 ]; +edb_ed $DB add "/actions/"$NUM"/name" str "Key_Binding" +edb_ed $DB add "/actions/"$NUM"/action" str "Desktop" +edb_ed $DB add "/actions/"$NUM"/params" str "3" +edb_ed $DB add "/actions/"$NUM"/event" int $ACT_KEY_DOWN +edb_ed $DB add "/actions/"$NUM"/button" int 0 +edb_ed $DB add "/actions/"$NUM"/key" str "F4" +edb_ed $DB add "/actions/"$NUM"/modifiers" int $MOD_ALT +NUM=$[ $NUM + 1 ]; +edb_ed $DB add "/actions/"$NUM"/name" str "Key_Binding" +edb_ed $DB add "/actions/"$NUM"/action" str "Desktop" +edb_ed $DB add "/actions/"$NUM"/params" str "4" +edb_ed $DB add "/actions/"$NUM"/event" int $ACT_KEY_DOWN +edb_ed $DB add "/actions/"$NUM"/button" int 0 +edb_ed $DB add "/actions/"$NUM"/key" str "F5" +edb_ed $DB add "/actions/"$NUM"/modifiers" int $MOD_ALT +NUM=$[ $NUM + 1 ]; +edb_ed $DB add "/actions/"$NUM"/name" str "Key_Binding" +edb_ed $DB add "/actions/"$NUM"/action" str "Desktop" +edb_ed $DB add "/actions/"$NUM"/params" str "5" +edb_ed $DB add "/actions/"$NUM"/event" int $ACT_KEY_DOWN +edb_ed $DB add "/actions/"$NUM"/button" int 0 +edb_ed $DB add "/actions/"$NUM"/key" str "F6" +edb_ed $DB add "/actions/"$NUM"/modifiers" int $MOD_ALT +NUM=$[ $NUM + 1 ]; +edb_ed $DB add "/actions/"$NUM"/name" str "Key_Binding" +edb_ed $DB add "/actions/"$NUM"/action" str "Desktop" +edb_ed $DB add "/actions/"$NUM"/params" str "6" +edb_ed $DB add "/actions/"$NUM"/event" int $ACT_KEY_DOWN +edb_ed $DB add "/actions/"$NUM"/button" int 0 +edb_ed $DB add "/actions/"$NUM"/key" str "F7" +edb_ed $DB add "/actions/"$NUM"/modifiers" int $MOD_ALT +NUM=$[ $NUM + 1 ]; +edb_ed $DB add "/actions/"$NUM"/name" str "Key_Binding" +edb_ed $DB add "/actions/"$NUM"/action" str "Desktop" +edb_ed $DB add "/actions/"$NUM"/params" str "7" +edb_ed $DB add "/actions/"$NUM"/event" int $ACT_KEY_DOWN +edb_ed $DB add "/actions/"$NUM"/button" int 0 +edb_ed $DB add "/actions/"$NUM"/key" str "F8" +edb_ed $DB add "/actions/"$NUM"/modifiers" int $MOD_ALT +NUM=$[ $NUM + 1 ]; edb_ed $DB add "/actions/count" int $NUM # basic settings diff --git a/src/actions.c b/src/actions.c index 893c7b67f..7e375d547 100644 --- a/src/actions.c +++ b/src/actions.c @@ -55,6 +55,8 @@ static void e_act_snap_start (void *o, E_Action *a, void *data, int x, int y, in static void e_act_zoom_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry); +static void e_act_desk_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry); + static void _e_action_find(char *action, int act, int button, char *key, Ev_Key_Modifiers mods, void *o) { @@ -467,6 +469,7 @@ e_actions_init(void) e_action_add_proto("Window_Max_Size", e_act_max_start, NULL, NULL); e_action_add_proto("Winodw_Snap", e_act_snap_start, NULL, NULL); e_action_add_proto("Window_Zoom", e_act_zoom_start, NULL, NULL); + e_action_add_proto("Desktop", e_act_desk_start, NULL, NULL); } @@ -1240,3 +1243,20 @@ e_act_zoom_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry UN(ry); } + +static void +e_act_desk_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry) +{ + int desk = 0; + + if (a->params) desk = atoi(a->params); + e_desktops_goto(desk); + return; + UN(a); + UN(data); + UN(x); + UN(y); + UN(rx); + UN(ry); +} + diff --git a/src/desktops.c b/src/desktops.c index 133fb7655..d82dc7e37 100644 --- a/src/desktops.c +++ b/src/desktops.c @@ -4,6 +4,7 @@ static Evas_List desktops = NULL; static Window e_base_win = 0; static int screen_w, screen_h; static int current_desk = 0; +static int current_desk_x = 0; static void e_idle(void *data); @@ -267,3 +268,18 @@ e_desktops_get_current(void) { return current_desk; } + +void +e_desktops_goto(int d) +{ + int dx; + E_Desktop *desk; + + dx = d - current_desk_x; + desk = e_desktops_get(0); + if (desk) + { + e_desktops_scroll(desk, -(dx * desk->real.w), 0); + } + current_desk_x = d; +} diff --git a/src/e.h b/src/e.h index bec052de4..03814dc5c 100644 --- a/src/e.h +++ b/src/e.h @@ -754,6 +754,7 @@ void e_desktops_hide(E_Desktop *d); int e_desktops_get_num(void); E_Desktop * e_desktops_get(int d); int e_desktops_get_current(void); +void e_desktops_goto(int num); void e_desktops_update(E_Desktop *desk); void e_resist_border(E_Border *b);