git.lucas.co / cce-compositor
Wayland compositor (wlroots)
git clone https://git.lucas.co/cce-compositor.git

commit5f02226dd988e391457e403be70e4b0685f21179
parent467e0ddee3
authorIsaac Freund <[email protected]>
date2020-03-29 14:07
Swap bindngs for send to top and start terminal

 src/server.zig | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/src/server.zig b/src/server.zig
index dca5e9a..7281ae8 100644
--- a/src/server.zig
+++ b/src/server.zig
@@ -112,16 +112,6 @@ pub const Server = struct {
         // This function assumes the proper modifier is held down.
         if (modifiers & @intCast(u32, c.WLR_MODIFIER_SHIFT) != 0) {
             switch (sym) {
-                c.XKB_KEY_Return => {
-                    if (self.root.focused_view) |current_focus| {
-                        const node = @fieldParentPtr(std.TailQueue(View).Node, "data", current_focus);
-                        if (node != self.root.views.first) {
-                            self.root.views.remove(node);
-                            self.root.views.prepend(node);
-                            self.root.arrange();
-                        }
-                    }
-                },
                 c.XKB_KEY_H => {
                     if (self.root.master_count < self.root.views.len) {
                         self.root.master_count += 1;
@@ -134,6 +124,13 @@ pub const Server = struct {
                         self.root.arrange();
                     }
                 },
+                c.XKB_KEY_Return => {
+                    // Spawn an instance of alacritty
+                    // const argv = [_][]const u8{ "/bin/sh", "-c", "WAYLAND_DEBUG=1 alacritty" };
+                    const argv = [_][]const u8{ "/bin/sh", "-c", "alacritty" };
+                    const child = std.ChildProcess.init(&argv, std.heap.c_allocator) catch unreachable;
+                    std.ChildProcess.spawn(child) catch unreachable;
+                },
                 else => return false,
             }
         } else {
@@ -154,11 +151,14 @@ pub const Server = struct {
                     }
                 },
                 c.XKB_KEY_Return => {
-                    // Spawn an instance of alacritty
-                    // const argv = [_][]const u8{ "/bin/sh", "-c", "WAYLAND_DEBUG=1 alacritty" };
-                    const argv = [_][]const u8{ "/bin/sh", "-c", "alacritty" };
-                    const child = std.ChildProcess.init(&argv, std.heap.c_allocator) catch unreachable;
-                    std.ChildProcess.spawn(child) catch unreachable;
+                    if (self.root.focused_view) |current_focus| {
+                        const node = @fieldParentPtr(std.TailQueue(View).Node, "data", current_focus);
+                        if (node != self.root.views.first) {
+                            self.root.views.remove(node);
+                            self.root.views.prepend(node);
+                            self.root.arrange();
+                        }
+                    }
                 },
                 else => return false,
             }