from base import SubLayout, Rect
from sublayouts import VerticalStack, Floating
from subtile import SubTile

class HybridLayoutDemo(SubLayout):

    def _init_sublayouts(self):
        class TopWindow(VerticalStack):
            def filter_windows(self, windows):
                windows = [w for w in windows if w.name == "htop"]
                return ([windows[0],] if len(windows) else [])
            def request_rectangle(self, r, windows):
                if windows:
                    return r.split_horizontal(height=300)
                else:
                    return (Rect(), r)

        self.sublayouts.append(Floating(self.clientStack,
                                        self.theme,
                                        parent=self,
                                        )
                               )
        self.sublayouts.append(TopWindow(self.clientStack,
                                         self.theme,
                                         parent=self,
                                         autohide=True,
                                         )
                               )
        self.sublayouts.append(SubTile(self.clientStack,
                                       self.theme,
                                       parent=self,
                                       master_windows = 2,
                                       )
                               )
    
    def filter(self, client):
        return True

from base import SubLayout, Rect
from sublayouts import VerticalStack, Floating
from subtile import SubTile

class HybridLayoutDemo(SubLayout):

    def _init_sublayouts(self):
        class TopWindow(VerticalStack):
            def filter_windows(self, windows):
                windows = [w for w in windows if w.name == "htop"]
                return ([windows[0],] if len(windows) else [])
            def request_rectangle(self, r, windows):
                if windows:
                    return r.split_horizontal(height=300)
                else:
                    return (Rect(), r)

        self.sublayouts.append(Floating(self.clientStack,
                                        self.theme,
                                        parent=self,
                                        )
                               )
        self.sublayouts.append(TopWindow(self.clientStack,
                                         self.theme,
                                         parent=self,
                                         autohide=True,
                                         )
                               )
        self.sublayouts.append(SubTile(self.clientStack,
                                       self.theme,
                                       parent=self,
                                       master_windows = 2,
                                       )
                               )
    
    def filter(self, client):
        return True

    def request_rectangle(self, r, windows):
        return (r, Rect())

Add request_rectange to HybridLayoutDemo - no clue why this never was here, but it stops it actually working
Add request_rectange to HybridLayoutDemo - no clue why this never was here, but it stops it actually working

  from base import SubLayout, Rect
  from sublayouts import VerticalStack, Floating
  from subtile import SubTile
  
  class HybridLayoutDemo(SubLayout):
  
      def _init_sublayouts(self):
          class TopWindow(VerticalStack):
              def filter_windows(self, windows):
                  windows = [w for w in windows if w.name == "htop"]
                  return ([windows[0],] if len(windows) else [])
              def request_rectangle(self, r, windows):
                  if windows:
                      return r.split_horizontal(height=300)
                  else:
                      return (Rect(), r)
  
          self.sublayouts.append(Floating(self.clientStack,
                                          self.theme,
                                          parent=self,
                                          )
                                 )
          self.sublayouts.append(TopWindow(self.clientStack,
                                           self.theme,
                                           parent=self,
                                           autohide=True,
                                           )
                                 )
          self.sublayouts.append(SubTile(self.clientStack,
                                         self.theme,
                                         parent=self,
                                         master_windows = 2,
                                         )
                                 )
      
      def filter(self, client):
          return True
  
+     def request_rectangle(self, r, windows):
+         return (r, Rect())
+ 
Add request_rectange to HybridLayoutDemo - no clue why this never was here, but it stops it actually working
## Code Before:
from base import SubLayout, Rect
from sublayouts import VerticalStack, Floating
from subtile import SubTile

class HybridLayoutDemo(SubLayout):

    def _init_sublayouts(self):
        class TopWindow(VerticalStack):
            def filter_windows(self, windows):
                windows = [w for w in windows if w.name == "htop"]
                return ([windows[0],] if len(windows) else [])
            def request_rectangle(self, r, windows):
                if windows:
                    return r.split_horizontal(height=300)
                else:
                    return (Rect(), r)

        self.sublayouts.append(Floating(self.clientStack,
                                        self.theme,
                                        parent=self,
                                        )
                               )
        self.sublayouts.append(TopWindow(self.clientStack,
                                         self.theme,
                                         parent=self,
                                         autohide=True,
                                         )
                               )
        self.sublayouts.append(SubTile(self.clientStack,
                                       self.theme,
                                       parent=self,
                                       master_windows = 2,
                                       )
                               )
    
    def filter(self, client):
        return True

## Instruction:
Add request_rectange to HybridLayoutDemo - no clue why this never was here, but it stops it actually working
## Code After:
from base import SubLayout, Rect
from sublayouts import VerticalStack, Floating
from subtile import SubTile

class HybridLayoutDemo(SubLayout):

    def _init_sublayouts(self):
        class TopWindow(VerticalStack):
            def filter_windows(self, windows):
                windows = [w for w in windows if w.name == "htop"]
                return ([windows[0],] if len(windows) else [])
            def request_rectangle(self, r, windows):
                if windows:
                    return r.split_horizontal(height=300)
                else:
                    return (Rect(), r)

        self.sublayouts.append(Floating(self.clientStack,
                                        self.theme,
                                        parent=self,
                                        )
                               )
        self.sublayouts.append(TopWindow(self.clientStack,
                                         self.theme,
                                         parent=self,
                                         autohide=True,
                                         )
                               )
        self.sublayouts.append(SubTile(self.clientStack,
                                       self.theme,
                                       parent=self,
                                       master_windows = 2,
                                       )
                               )
    
    def filter(self, client):
        return True

    def request_rectangle(self, r, windows):
        return (r, Rect())
