|
|
@@ -193,11 +193,11 @@ pub fn main() !void { |
| 193 |
193 |
apply_config_values(); |
| 194 |
194 |
} else { |
| 195 |
195 |
std.debug.print("no config found, using defaults\n", .{}); |
| 196 |
|
- setup_default_keybinds(); |
|
196 |
+ initialize_default_config(); |
| 197 |
197 |
} |
| 198 |
198 |
} else { |
| 199 |
199 |
std.debug.print("failed to init lua, using defaults\n", .{}); |
| 200 |
|
- setup_default_keybinds(); |
|
200 |
+ initialize_default_config(); |
| 201 |
201 |
} |
| 202 |
202 |
|
| 203 |
203 |
var display = Display.open() catch |err| { |
|
|
@@ -447,7 +447,7 @@ fn make_keybind_str(mod: u32, key: u64, action: config_mod.Action, str_arg: []co |
| 447 |
447 |
return kb; |
| 448 |
448 |
} |
| 449 |
449 |
|
| 450 |
|
-fn setup_default_keybinds() void { |
|
450 |
+fn initialize_default_config() void { |
| 451 |
451 |
const mod_key: u32 = 1 << 6; |
| 452 |
452 |
const shift_key: u32 = 1 << 0; |
| 453 |
453 |
const control_key: u32 = 1 << 2; |
|
|
@@ -483,6 +483,9 @@ fn setup_default_keybinds() void { |
| 483 |
483 |
config.add_keybind(make_keybind_int(mod_key | control_key, keysym, .toggle_view_tag, tag_index)) catch {}; |
| 484 |
484 |
config.add_keybind(make_keybind_int(mod_key | control_key | shift_key, keysym, .toggle_tag, tag_index)) catch {}; |
| 485 |
485 |
} |
|
486 |
+ |
|
487 |
+ config.add_button(.{ .click = .client_win, .mod_mask = mod_key, .button = 1, .action = .move_mouse }) catch {}; |
|
488 |
+ config.add_button(.{ .click = .client_win, .mod_mask = mod_key, .button = 3, .action = .resize_mouse }) catch {}; |
| 486 |
489 |
} |
| 487 |
490 |
|
| 488 |
491 |
fn grab_keybinds(display: *Display) void { |
|
|
@@ -987,6 +990,7 @@ fn reload_config(display: *Display) void { |
| 987 |
990 |
ungrab_keybinds(display); |
| 988 |
991 |
|
| 989 |
992 |
config.keybinds.clearRetainingCapacity(); |
|
993 |
+ config.buttons.clearRetainingCapacity(); |
| 990 |
994 |
config.rules.clearRetainingCapacity(); |
| 991 |
995 |
config.blocks.clearRetainingCapacity(); |
| 992 |
996 |
|
|
|
@@ -1007,7 +1011,7 @@ fn reload_config(display: *Display) void { |
| 1007 |
1011 |
apply_config_values(); |
| 1008 |
1012 |
} else { |
| 1009 |
1013 |
std.debug.print("reload failed, restoring defaults\n", .{}); |
| 1010 |
|
- setup_default_keybinds(); |
|
1014 |
+ initialize_default_config(); |
| 1011 |
1015 |
} |
| 1012 |
1016 |
|
| 1013 |
1017 |
bar_mod.destroy_bars(gpa.allocator(), display.handle); |