diff --git a/config.py b/config.py index 5fcd314..c755174 100644 --- a/config.py +++ b/config.py @@ -16,6 +16,9 @@ # Whether new windows should tile or float by default (default is False) floats_default = False +# Whether tiled windows should have their decorations removed +remove_decorations = False + # How much to increment the master area proportion size proportion_change = 0.05 diff --git a/pt3/client.py b/pt3/client.py index 5221e9f..f1c4614 100644 --- a/pt3/client.py +++ b/pt3/client.py @@ -5,6 +5,7 @@ import xpybutil import xpybutil.event as event import xpybutil.ewmh as ewmh +import xpybutil.motif as motif import xpybutil.icccm as icccm import xpybutil.rect as rect import xpybutil.util as util @@ -54,8 +55,6 @@ def __init__(self, wid): self.save() def remove(self): - if config.tiles_below and not self.floating: - ewmh.request_wm_state_checked(self.wid,0,util.get_atom('_NET_WM_STATE_BELOW')).check() tile.update_client_removal(self) debug('Disconnecting from %s' % self) event.disconnect('ConfigureNotify', self.parentid) @@ -77,6 +76,8 @@ def save(self): def restore(self): debug('Restoring %s' % self) + if config.remove_decorations: + motif.set_hints_checked(self.wid,2,decoration=1).check() if config.tiles_below: ewmh.request_wm_state_checked(self.wid,0,util.get_atom('_NET_WM_STATE_BELOW')).check() if self.saved_state: diff --git a/pt3/layouts/layout_vert_horz.py b/pt3/layouts/layout_vert_horz.py index 9ec857b..1aa60a1 100644 --- a/pt3/layouts/layout_vert_horz.py +++ b/pt3/layouts/layout_vert_horz.py @@ -122,7 +122,6 @@ def focus_master(self): def toggle_float(self): assert self.tiling - self._get_focused().floating = not self._get_focused().floating self.store.toggle_float(self._get_focused()) self.tile() diff --git a/pt3/layouts/store.py b/pt3/layouts/store.py index 5b56d07..eeed440 100644 --- a/pt3/layouts/store.py +++ b/pt3/layouts/store.py @@ -1,6 +1,7 @@ import pt3.config as config import xpybutil.ewmh as ewmh import xpybutil.util as util +import xpybutil.motif as motif class Store(object): def __init__(self): @@ -9,8 +10,14 @@ def __init__(self): def add(self, c, above=None): if c.floating: + if config.remove_decorations: + motif.set_hints_checked(c.wid,2,decoration=1).check() # add decorations + if config.tiles_below: + ewmh.request_wm_state_checked(c.wid,0,util.get_atom('_NET_WM_STATE_BELOW')).check() self.floats.append(c) else: + if config.remove_decorations: + motif.set_hints_checked(c.wid,2,decoration=2).check() #remove decorations if config.tiles_below: ewmh.request_wm_state_checked(c.wid,1,util.get_atom('_NET_WM_STATE_BELOW')).check() if len(self.masters) < self.mcnt: @@ -24,8 +31,6 @@ def remove(self, c): if c in self.floats: self.floats.remove(c) else: - if config.tiles_below: - ewmh.request_wm_state_checked(c.wid,0,util.get_atom('_NET_WM_STATE_BELOW')).check() if c in self.masters: self.masters.remove(c) if len(self.masters) < self.mcnt and self.slaves: @@ -71,6 +76,7 @@ def switch(self, c1, c2): def toggle_float(self, c): self.remove(c) + c.floating = not c.floating self.add(c) def __len__(self):