By using this site, you agree to have cookies stored on your device, strictly for functional purposes, such as storing your session and preferences.

Dismiss

Set rectangles more often

roundabout,
created on Thursday, 31 July 2025, 10:43:20 (1753958600), received on Thursday, 31 July 2025, 10:43:36 (1753958616)
Author identity: Vlad <vlad.muntoiu@gmail.com>

9c3a154633c1b43afb97d1d35278abd6b38fcf5b

applets/wf-window-list/__init__.py

@@ -223,13 +223,21 @@ class WFWindowList(panorama_panel.Applet):

                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                        button = self.toplevel_buttons[handle]
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                        button.window_title = title
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            def on_button_click(self, button: WindowButton):
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                if button.window_state.focused:
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                    # Already pressed in, so minimise the focused window
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                    # Set a rectangle for animation
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                self.set_all_rectangles()
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            def set_all_rectangles(self):
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                for button in self.toplevel_buttons.values():
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                        surface = WlSurface()
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                        surface._ptr = self.wl_surface_ptr
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                        button.window_id.set_rectangle(surface, *get_widget_rect(button))
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            def on_button_click(self, button: WindowButton):
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                # Set a rectangle for animation
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                surface = WlSurface()
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                surface._ptr = self.wl_surface_ptr
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                button.window_id.set_rectangle(surface, *get_widget_rect(button))
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                if button.window_state.focused:
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                    # Already pressed in, so minimise the focused window
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                        button.window_id.set_minimized()
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                    else:
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                        button.window_id.unset_minimized()
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        

@@ -247,6 +255,8 @@ class WFWindowList(panorama_panel.Applet):

                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                        else:
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                            self.initial_button.set_active(True)
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                self.set_all_rectangles()
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                def on_app_id_changed(self, handle, app_id):
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                    if handle in self.toplevel_buttons:
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                        button = self.toplevel_buttons[handle]
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        

@@ -257,6 +267,8 @@ class WFWindowList(panorama_panel.Applet):

                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                        self.remove(self.toplevel_buttons[handle])
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                        self.toplevel_buttons.pop(handle)
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                self.set_all_rectangles()
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                def make_context_menu(self):
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                    menu = Gio.Menu()
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                    menu.append("Window list _options", "applet.options")