def _place_client(self, client, left, top, width, height):
        """Place a client on the screen

        Will prevent double margins by applying east and south margins only
        when the client is the rightmost or the bottommost window.
        """

        # Create a temporary margin list for the client
        if isinstance(self.margin, int):
            margin = [self.margin] * 4
        else:
            # We need to copy this list otherwise we'd be modifying self.margin!
            margin = self.margin.copy()

        rightmost = left + width - self.screen_rect.x + margin[1] >= self.screen_rect.width
        bottommost = top + height - self.screen_rect.y + margin[2] >= self.screen_rect.height

        if not rightmost:
            margin[1] = 0
        if not bottommost:
            margin[2] = 0

        client.place(
            left,
            top,
            width - 2 * self.border_width,
            height - 2 * self.border_width,
            self.border_width,
            self.border_focus if client.has_focus else self.border_normal,
            margin=margin,
        )
Place a client on the screen

        Will prevent double margins by applying east and south margins only
        when the client is the rightmost or the bottommost window.
        
libqtile/layout/xmonad.py