Hook up the window border rendering code
This commit is contained in:
parent
319f06931a
commit
21c7b21f74
2 changed files with 6 additions and 1 deletions
|
|
@ -53,7 +53,8 @@ def add_window(self, windows, window, active_window_idx):
|
|||
def remove_window(self, windows, window, active_window_idx):
|
||||
windows.remove(window)
|
||||
active_window_idx = max(0, min(active_window_idx, len(windows) - 1))
|
||||
self(windows, active_window_idx)
|
||||
if windows:
|
||||
self(windows, active_window_idx)
|
||||
return active_window_idx
|
||||
|
||||
def set_active_window(self, windows, active_window_idx):
|
||||
|
|
|
|||
|
|
@ -123,6 +123,7 @@ def new_window(self, use_shell=True):
|
|||
window = Window(self, child, self.opts, self.args)
|
||||
tab_manager().add_child_fd(child.child_fd, window.read_ready, window.write_ready)
|
||||
self.active_window_idx = self.current_layout.add_window(self.windows, window, self.active_window_idx)
|
||||
self.borders(self.windows, self.active_window, self.current_layout.needs_window_borders and len(self.windows) > 1)
|
||||
glfw_post_empty_event()
|
||||
|
||||
def close_window(self):
|
||||
|
|
@ -131,6 +132,7 @@ def close_window(self):
|
|||
|
||||
def remove_window(self, window):
|
||||
self.active_window_idx = self.current_layout.remove_window(self.windows, window, self.active_window_idx)
|
||||
self.borders(self.windows, self.active_window, self.current_layout.needs_window_borders and len(self.windows) > 1)
|
||||
glfw_post_empty_event()
|
||||
|
||||
def set_active_window(self, window):
|
||||
|
|
@ -141,11 +143,13 @@ def set_active_window(self, window):
|
|||
if idx != self.active_window_idx:
|
||||
self.current_layout.set_active_window(self.windows, idx)
|
||||
self.active_window_idx = idx
|
||||
self.borders(self.windows, self.active_window, self.current_layout.needs_window_borders and len(self.windows) > 1)
|
||||
glfw_post_empty_event()
|
||||
|
||||
def next_window(self):
|
||||
if len(self.windows) > 1:
|
||||
self.active_window_idx = self.current_layout.next_window(self.windows, self.active_window_idx)
|
||||
self.borders(self.windows, self.active_window, self.current_layout.needs_window_borders and len(self.windows) > 1)
|
||||
glfw_post_empty_event()
|
||||
|
||||
def __iter__(self):
|
||||
|
|
|
|||
Loading…
Reference in a new issue