Skip to content

Commit

Permalink
Merge branch 'master' into xmonad-three-columns
Browse files Browse the repository at this point in the history
  • Loading branch information
m-col committed Feb 6, 2022
2 parents 34b4e11 + c14284d commit 66c4b39
Show file tree
Hide file tree
Showing 61 changed files with 710 additions and 487 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ jobs:
LIBDRM: 2.4.109
strategy:
matrix:
# if you change one of these, be sure to update
# /tox.ini:[gh-actions] as well
# If you change one of these, be sure to update:
# - /tox.ini:[gh-actions]
# - /setup.cfg:[mypy]
# - /libqtile/scripts/check.py mypy argument
python-version: [pypy-3.7, 3.7, 3.8, 3.9, '3.10']
steps:
- uses: actions/checkout@v2
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ Qtile x.x.x, released xxxx-xx-xx:
* features
- Add `lazy.window.center()` command to center a floating window on the screen.
- Add MonadThreeCol layout based on XMonad's ThreeColumns.
- Wayland: added power-output-management-v1 protocol support, added idle protocol,
added idle inhibit protocol
* bugfixes
- Fix `Systray` crash on `reconfigure_screens`.
- Fix bug where widgets can't be mirrored in same bar.

Qtile 0.20.0, released 2022-01-24:
* features
Expand Down
3 changes: 3 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,13 @@ def __dir__(self):
'wlroots.wlr_types',
'wlroots.wlr_types.cursor',
'wlroots.wlr_types.foreign_toplevel_management_v1',
'wlroots.wlr_types.idle',
'wlroots.wlr_types.idle_inhibit_v1',
'wlroots.wlr_types.keyboard',
'wlroots.wlr_types.layer_shell_v1',
'wlroots.wlr_types.output_management_v1',
'wlroots.wlr_types.pointer_constraints_v1',
'wlroots.wlr_types.output_power_management_v1',
'wlroots.wlr_types.server_decoration',
'wlroots.wlr_types.virtual_keyboard_v1',
'wlroots.wlr_types.xdg_shell',
Expand Down
7 changes: 1 addition & 6 deletions docs/manual/install/fedora.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,4 @@
Installing on Fedora
====================

Stable versions of Qtile are currently packaged for current versions of Fedora.
To install this package, run:

.. code-block:: bash
dnf -y install qtile
Stable versions of Qtile are not currently packaged for the current version of Fedora. Users are advised to follow the instructions of :ref:`installing-from-source`.
74 changes: 37 additions & 37 deletions libqtile/backend/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from libqtile.log_utils import logger

if typing.TYPE_CHECKING:
from typing import Any, Dict, List, Optional, Tuple, Union
from typing import Any

from libqtile import config
from libqtile.command.base import ItemT
Expand Down Expand Up @@ -55,19 +55,19 @@ def setup_listener(self, qtile: Qtile) -> None:
def remove_listener(self) -> None:
"""Setup a listener for the given qtile instance"""

def update_desktops(self, groups: List[_Group], index: int) -> None:
def update_desktops(self, groups: list[_Group], index: int) -> None:
"""Set the current desktops of the window manager"""

@abstractmethod
def get_screen_info(self) -> List[Tuple[int, int, int, int]]:
def get_screen_info(self) -> list[tuple[int, int, int, int]]:
"""Get the screen information"""

@abstractmethod
def grab_key(self, key: Union[config.Key, config.KeyChord]) -> Tuple[int, int]:
def grab_key(self, key: config.Key | config.KeyChord) -> tuple[int, int]:
"""Configure the backend to grab the key event"""

@abstractmethod
def ungrab_key(self, key: Union[config.Key, config.KeyChord]) -> Tuple[int, int]:
def ungrab_key(self, key: config.Key | config.KeyChord) -> tuple[int, int]:
"""Release the given key event"""

@abstractmethod
Expand Down Expand Up @@ -96,7 +96,7 @@ def distribute_windows(self, initial: bool) -> None:
def warp_pointer(self, x: int, y: int) -> None:
"""Warp the pointer to the given coordinates relative."""

def update_client_list(self, windows_map: Dict[int, WindowType]) -> None:
def update_client_list(self, windows_map: dict[int, WindowType]) -> None:
"""Update the list of windows being managed"""

@contextlib.contextmanager
Expand All @@ -114,14 +114,14 @@ def flush(self) -> None:
def graceful_shutdown(self):
"""Try to close windows gracefully before exiting"""

def simulate_keypress(self, modifiers: List[str], key: str) -> None:
def simulate_keypress(self, modifiers: list[str], key: str) -> None:
"""Simulate a keypress with given modifiers"""

def keysym_from_name(self, name: str) -> int:
"""Get the keysym for a key from its name"""
raise NotImplementedError

def cmd_info(self) -> Dict:
def cmd_info(self) -> dict:
"""Get basic information about the running backend."""
return {"backend": self.name, "display_name": self.display_name}

Expand All @@ -140,7 +140,7 @@ class _Window(CommandObject, metaclass=ABCMeta):
def __init__(self):
self.borderwidth: int = 0
self.name: str = "<no name>"
self.reserved_space: Optional[Tuple[int, int, int, int]] = None
self.reserved_space: tuple[int, int, int, int] | None = None
# Window.cmd_static sets this in case it is hooked to client_new to stop the
# Window object from being managed, now that a Static is being used instead
self.defunct: bool = False
Expand All @@ -162,15 +162,15 @@ def unhide(self) -> None:
def kill(self) -> None:
"""Kill the window"""

def get_wm_class(self) -> Optional[List]:
def get_wm_class(self) -> list | None:
"""Return the class(es) of the window"""
return None

def get_wm_type(self) -> Optional[str]:
def get_wm_type(self) -> str | None:
"""Return the type of the window"""
return None

def get_wm_role(self) -> Optional[str]:
def get_wm_role(self) -> str | None:
"""Return the role of the window"""
return None

Expand Down Expand Up @@ -214,7 +214,7 @@ def _select(self, name, sel):
return None

@abstractmethod
def info(self) -> Dict[str, Any]:
def info(self) -> dict[str, Any]:
"""
Return information on this window.
Expand All @@ -231,7 +231,7 @@ def info(self) -> Dict[str, Any]:
"""
return {}

def cmd_info(self) -> Dict:
def cmd_info(self) -> dict:
"""Return a dictionary of info."""
return self.info()

Expand All @@ -248,15 +248,15 @@ class Window(_Window, metaclass=ABCMeta):
qtile: Qtile

# If float_x or float_y are None, the window has never floated
float_x: Optional[int]
float_y: Optional[int]
float_x: int | None
float_y: int | None

def __repr__(self):
return "Window(name=%r, wid=%i)" % (self.name, self.wid)

@property
@abstractmethod
def group(self) -> Optional[_Group]:
def group(self) -> _Group | None:
"""The group to which this window belongs."""

@property
Expand Down Expand Up @@ -298,7 +298,7 @@ def focus(self, warp: bool) -> None:
"""Focus this window and optional warp the pointer to it."""

@abstractmethod
def togroup(self, group_name: Optional[str] = None, *, switch_group: bool = False) -> None:
def togroup(self, group_name: str | None = None, *, switch_group: bool = False) -> None:
"""Move window to a specified group
Also switch to that group if switch_group is True.
Expand All @@ -312,7 +312,7 @@ def has_user_set_position(self) -> bool:
"""Whether this window has user-defined geometry"""
return False

def is_transient_for(self) -> Optional["WindowType"]:
def is_transient_for(self) -> WindowType | None:
"""What window is this window a transient window for?"""
return None

Expand All @@ -331,11 +331,11 @@ def cmd_match(self, *args, **kwargs) -> bool:
return self.match(*args, **kwargs)

@abstractmethod
def cmd_get_position(self) -> Tuple[int, int]:
def cmd_get_position(self) -> tuple[int, int]:
"""Get the (x, y) of the window"""

@abstractmethod
def cmd_get_size(self) -> Tuple[int, int]:
def cmd_get_size(self) -> tuple[int, int]:
"""Get the (width, height) of the window"""

@abstractmethod
Expand Down Expand Up @@ -405,8 +405,8 @@ def cmd_bring_to_front(self) -> None:

def cmd_togroup(
self,
group_name: Optional[str] = None,
groupName: Optional[str] = None, # Deprecated # noqa: N803
group_name: str | None = None,
groupName: str | None = None, # Deprecated # noqa: N803
switch_group: bool = False,
) -> None:
"""Move window to a specified group
Expand All @@ -421,7 +421,7 @@ def cmd_togroup(
group_name = groupName
self.togroup(group_name, switch_group=switch_group)

def cmd_toscreen(self, index: Optional[int] = None) -> None:
def cmd_toscreen(self, index: int | None = None) -> None:
"""Move window to a specified screen.
If index is not specified, we assume the current screen
Expand Down Expand Up @@ -480,11 +480,11 @@ def cmd_kill(self) -> None:
@abstractmethod
def cmd_static(
self,
screen: Optional[int] = None,
x: Optional[int] = None,
y: Optional[int] = None,
width: Optional[int] = None,
height: Optional[int] = None,
screen: int | None = None,
x: int | None = None,
y: int | None = None,
width: int | None = None,
height: int | None = None,
) -> None:
"""Makes this window a static window, attached to a Screen.
Expand Down Expand Up @@ -561,7 +561,7 @@ class Static(_Window, metaclass=ABCMeta):
def __repr__(self):
return "Static(name=%r, wid=%s)" % (self.name, self.wid)

def info(self) -> Dict:
def info(self) -> dict:
"""Return a dictionary of info."""
return dict(
name=self.name,
Expand All @@ -585,8 +585,8 @@ class Drawer:
"""

# We need to track extent of drawing to know when to redraw.
previous_rect: Tuple[int, int, Optional[int], Optional[int]]
current_rect: Tuple[int, int, Optional[int], Optional[int]]
previous_rect: tuple[int, int, int | None, int | None]
current_rect: tuple[int, int, int | None, int | None]

def __init__(self, qtile: Qtile, win: Internal, width: int, height: int):
self.qtile = qtile
Expand All @@ -598,7 +598,7 @@ def __init__(self, qtile: Qtile, win: Internal, width: int, height: int):
self.ctx: cairocffi.Context
self._reset_surface()

self.mirrors: Dict[Drawer, bool] = {}
self.mirrors: dict[Drawer, bool] = {}

self.current_rect = (0, 0, 0, 0)
self.previous_rect = (-1, -1, -1, -1)
Expand Down Expand Up @@ -723,8 +723,8 @@ def draw(
self,
offsetx: int = 0,
offsety: int = 0,
width: Optional[int] = None,
height: Optional[int] = None,
width: int | None = None,
height: int | None = None,
):
"""
A wrapper for the draw operation.
Expand Down Expand Up @@ -756,8 +756,8 @@ def _draw(
self,
offsetx: int = 0,
offsety: int = 0,
width: Optional[int] = None,
height: Optional[int] = None,
width: int | None = None,
height: int | None = None,
):
"""
This draws our cached operations to the Internal window.
Expand Down

0 comments on commit 66c4b39

Please sign in to comment.