Skip to content

Commit

Permalink
API consistency with x11 move_to_{top,bottom}
Browse files Browse the repository at this point in the history
  • Loading branch information
Joe Rabinoff committed Jan 3, 2024
1 parent cdee122 commit ec987d8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
10 changes: 8 additions & 2 deletions libqtile/backend/base/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,25 +197,31 @@ def move_down(self, force: bool = False) -> None:
"""

@expose_command()
def move_to_top(self) -> None:
def move_to_top(self, force: bool = False) -> None:
"""
Move this window above all windows in the current layer
e.g. if you have 3 windows all with "keep_above" set, calling
this method will move the window to the top of those three windows.
Calling this on a "normal" window will not raise it above a "kept_above"
window.
Will not raise a window where "keep_below" is True unless
force is set to True.
"""

@expose_command()
def move_to_bottom(self) -> None:
def move_to_bottom(self, force: bool = False) -> None:
"""
Move this window below all windows in the current layer
e.g. if you have 3 windows all with "keep_above" set, calling
this method will move the window to the bottom of those three windows.
Calling this on a "normal" window will not raise it below a "kept_below"
window.
Will not lower a window where "keep_above" is True unless
force is set to True.
"""


Expand Down
12 changes: 6 additions & 6 deletions libqtile/backend/wayland/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -777,12 +777,12 @@ def is_visible(self) -> bool:
return self.container.node.enabled

@expose_command()
def move_to_top(self) -> None:
def move_to_top(self, force=False) -> None:
if self.tree:
self.tree.node.raise_to_top()

@expose_command()
def move_to_bottom(self) -> None:
def move_to_bottom(self, force=False) -> None:
if self.tree:
self.tree.node.lower_to_bottom()

Expand Down Expand Up @@ -916,11 +916,11 @@ def bring_to_front(self) -> None:
self.container.node.raise_to_top()

@expose_command()
def move_to_top(self) -> None:
def move_to_top(self, force=False) -> None:
self.container.node.raise_to_top()

@expose_command()
def move_to_bottom(self) -> None:
def move_to_bottom(self, force=False) -> None:
self.container.node.lower_to_bottom()

@expose_command()
Expand Down Expand Up @@ -1128,11 +1128,11 @@ def bring_to_front(self) -> None:
self.tree.node.raise_to_top()

@expose_command()
def move_to_top(self) -> None:
def move_to_top(self, force=False) -> None:
self.tree.node.raise_to_top()

@expose_command()
def move_to_bottom(self) -> None:
def move_to_bottom(self, force=False) -> None:
self.tree.node.lower_to_bottom()


Expand Down

0 comments on commit ec987d8

Please sign in to comment.