Only move view to top if needed

This commit is contained in:
Isaac Freund 2020-03-29 14:03:12 +02:00
parent 7e7dfe563a
commit a2901c90ba
No known key found for this signature in database
GPG Key ID: 86DED400DDFD7A11

View File

@ -115,9 +115,11 @@ pub const Server = struct {
c.XKB_KEY_Return => {
if (self.root.focused_view) |current_focus| {
const node = @fieldParentPtr(std.TailQueue(View).Node, "data", current_focus);
self.root.views.remove(node);
self.root.views.prepend(node);
self.root.arrange();
if (node != self.root.views.first) {
self.root.views.remove(node);
self.root.views.prepend(node);
self.root.arrange();
}
}
},
c.XKB_KEY_H => {