<commit_before>from base import Layout
from .. import manager


class Floating(Layout):
    """
        Floating layout, which does nothing with windows but handles focus order
    """
    defaults = manager.Defaults(
        ("border_focus", "#0000ff", "Border colour for the focused window."),
        ("border_normal", "#000000", "Border colour for un-focused winows."),
        ("border_width", 1, "Border width.")
    )
    name = "floating"
    def __init__(self, float_rules=None, **config):
        """
        If you have certain apps that you always want to float you can
        provide ``float_rules`` to do so.
        ``float_rules`` is a list of dictionaries containing:
        
        {wmname: WM_NAME, wmclass: WM_CLASS
        role: WM_WINDOW_ROLE}

        The keys must be specified as above.  You only need one, but
        you need to provide the value for it.  When a new window is
        opened it's ``match`` method is called with each of these
        rules.  If one matches, the window will float.  The following
        will float gimp and skype:

        float_rules=[dict(wmclass="skype"), dict(wmclass="gimp")]

        Specify these in the ``floating_layout`` in your config.
        """
        Layout.__init__(self, **config)
        self.clients = []
        self.focused = None
        self.float_rules = float_rules or []

    def match(self, win):
        """
        Used to default float some windows.
        """
        for rule_dict in self.float_rules:
            if win.match(**rule_dict):
                return True
        return False<commit_msg>make utility and splash screens float<commit_after>from base import Layout
from .. import manager

FLOAT_WM_TYPES = { 'utility':1,
                   'splash':1}

class Floating(Layout):
    """
        Floating layout, which does nothing with windows but handles focus order
    """
    defaults = manager.Defaults(
        ("border_focus", "#0000ff", "Border colour for the focused window."),
        ("border_normal", "#000000", "Border colour for un-focused winows."),
        ("border_width", 1, "Border width.")
    )
    name = "floating"
    def __init__(self, float_rules=None, **config):
        """
        If you have certain apps that you always want to float you can
        provide ``float_rules`` to do so.
        ``float_rules`` is a list of dictionaries containing:
        
        {wmname: WM_NAME, wmclass: WM_CLASS
        role: WM_WINDOW_ROLE}

        The keys must be specified as above.  You only need one, but
        you need to provide the value for it.  When a new window is
        opened it's ``match`` method is called with each of these
        rules.  If one matches, the window will float.  The following
        will float gimp and skype:

        float_rules=[dict(wmclass="skype"), dict(wmclass="gimp")]

        Specify these in the ``floating_layout`` in your config.
        """
        Layout.__init__(self, **config)
        self.clients = []
        self.focused = None
        self.float_rules = float_rules or []

    def match(self, win):
        """
        Used to default float some windows.
        """
        if win.window.get_wm_type() in FLOAT_WM_TYPES:
            return True
        for rule_dict in self.float_rules:
            if win.match(**rule_dict):
                return True
        return False
{'fraction_non_alphanumeric': 0.09601664684898929, 'fraction_numerical': 0.007134363852556481, 'mean_word_length': 2.2418111753371868, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7559839', 'n_tokens_mistral': 954, 'n_tokens_neox': 910, 'n_words': 343}