Compare commits
3 Commits
09d5e4b4d0
...
0d43c79ad6
| Author | SHA1 | Date | |
|---|---|---|---|
|
0d43c79ad6
|
|||
|
83ed661ba6
|
|||
|
59520777c3
|
@@ -134,14 +134,30 @@ bool config_defaults_build(
|
|||||||
{.type = ZDWM_ACTION_WINDOW_FOCUS_CYCLE, .as.window_focus_cycle.delta = -1}
|
{.type = ZDWM_ACTION_WINDOW_FOCUS_CYCLE, .as.window_focus_cycle.delta = -1}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
zdwm_action_t window_cycle_output_action = {
|
||||||
|
.type = ZDWM_ACTION_WINDOW_CYCLE_OUTPUT,
|
||||||
|
.as.window_cycle_output = {.delta = 1, .keep_focus = true},
|
||||||
|
};
|
||||||
|
BIND_DEFAULT(Super("o"), window_cycle_output_action);
|
||||||
|
|
||||||
char buffer[64] = {0};
|
char buffer[64] = {0};
|
||||||
for (uint32_t i = 0; i < 9; ++i) {
|
for (uint32_t i = 0; i < 9; ++i) {
|
||||||
snprintf(buffer, sizeof(buffer), "%s+%d", Super_key, i + 1);
|
snprintf(buffer, sizeof(buffer), Super("%d"), i + 1);
|
||||||
zdwm_action_t action = {
|
zdwm_action_t switch_workspace_action = {
|
||||||
.type = ZDWM_ACTION_WINDOW_SEND_TO_WORKSPACE_SAME_OUTPUT_BY_INDEX,
|
.type = ZDWM_ACTION_WORKSPACE_SWITCH_SAME_OUTPUT_BY_INDEX,
|
||||||
.as.workspace_switch_same_output_by_index.index = i,
|
.as.workspace_switch_same_output_by_index.index = i,
|
||||||
};
|
};
|
||||||
BIND_DEFAULT(buffer, action);
|
BIND_DEFAULT(buffer, switch_workspace_action);
|
||||||
|
|
||||||
|
snprintf(buffer, sizeof(buffer), Super("Shift+%d"), i + 1);
|
||||||
|
zdwm_action_t send_window_to_workspace_action = {
|
||||||
|
.type = ZDWM_ACTION_WINDOW_SEND_TO_WORKSPACE_SAME_OUTPUT_BY_INDEX,
|
||||||
|
.as.window_send_to_workspace_same_output_by_index = {
|
||||||
|
.index = i,
|
||||||
|
.switch_workspace = false,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
BIND_DEFAULT(buffer, send_window_to_workspace_action);
|
||||||
}
|
}
|
||||||
|
|
||||||
#undef BIND_DEFAULT
|
#undef BIND_DEFAULT
|
||||||
|
|||||||
@@ -175,7 +175,6 @@ bool binding_table_add_bind(
|
|||||||
if (!parse_key_sequence(key_sequence, &modifiers, &keysym)) return false;
|
if (!parse_key_sequence(key_sequence, &modifiers, &keysym)) return false;
|
||||||
|
|
||||||
auto item = array_push(mode->items, mode->count, mode->capacity);
|
auto item = array_push(mode->items, mode->count, mode->capacity);
|
||||||
item->key_str = key_sequence;
|
|
||||||
item->modifiers = modifiers;
|
item->modifiers = modifiers;
|
||||||
item->keysym = keysym;
|
item->keysym = keysym;
|
||||||
item->action = action;
|
item->action = action;
|
||||||
|
|||||||
@@ -10,7 +10,6 @@
|
|||||||
typedef struct binding_table_t binding_table_t;
|
typedef struct binding_table_t binding_table_t;
|
||||||
|
|
||||||
typedef struct key_binding_t {
|
typedef struct key_binding_t {
|
||||||
const char *key_str;
|
|
||||||
modifier_mask_t modifiers;
|
modifier_mask_t modifiers;
|
||||||
keysym_t keysym;
|
keysym_t keysym;
|
||||||
zdwm_action_t action;
|
zdwm_action_t action;
|
||||||
|
|||||||
@@ -330,11 +330,12 @@ static void send_window_to_workspace_same_output_by_index(
|
|||||||
const zdwm_action_data_window_send_to_workspace_t *data,
|
const zdwm_action_data_window_send_to_workspace_t *data,
|
||||||
command_buffer_t *command_buffer
|
command_buffer_t *command_buffer
|
||||||
) {
|
) {
|
||||||
|
auto target_workspace = state_workspace_at(state, (size_t)data->index);
|
||||||
|
if (!target_workspace) return;
|
||||||
|
|
||||||
auto output = state_output_at(state, state->current_output_index);
|
auto output = state_output_at(state, state->current_output_index);
|
||||||
auto current_workspace =
|
auto current_workspace =
|
||||||
state_workspace_get(state, output->current_workspace_id);
|
state_workspace_get(state, output->current_workspace_id);
|
||||||
|
|
||||||
auto target_workspace = state_workspace_at(state, (size_t)data->index);
|
|
||||||
if (current_workspace->id == target_workspace->id) return;
|
if (current_workspace->id == target_workspace->id) return;
|
||||||
|
|
||||||
if (data->switch_workspace) {
|
if (data->switch_workspace) {
|
||||||
|
|||||||
Reference in New Issue
Block a user