@@ -147,6 +147,7 @@ def __init__(self, monitor_id: int = 0, **kwargs):
147147 self .is_hovered = False
148148 self ._prevent_occlusion = False
149149 self ._occlusion_timer_id = None
150+ self ._forced_occlusion = False
150151
151152 self .icon_resolver = IconResolver ()
152153 self ._all_apps = get_desktop_applications ()
@@ -452,6 +453,8 @@ def on_button_leave(self, widget, event):
452453 def on_notch_hover_area_enter (self , widget , event ):
453454 """Handle hover enter for the entire notch area"""
454455 self .is_hovered = True
456+ if self ._forced_occlusion :
457+ return False
455458 if data .PANEL_THEME == "Notch" and data .BAR_POSITION != "Top" :
456459 self .notch_revealer .set_reveal_child (True )
457460 return False
@@ -467,7 +470,6 @@ def on_notch_hover_area_leave(self, widget, event):
467470 return False
468471
469472 def close_notch (self ):
470- # Update monitor manager state
471473 if self .monitor_manager :
472474 self .monitor_manager .set_notch_state (self .monitor_id , False )
473475
@@ -483,6 +485,14 @@ def close_notch(self):
483485 if data .PANEL_THEME != "Notch" :
484486 self .notch_revealer .set_reveal_child (False )
485487
488+ if self .bar and not self .bar .get_visible () and data .BAR_POSITION == "Top" :
489+ if data .BAR_THEME == "Pills" :
490+ self .set_margin ("-40px 0px 0px 0px" )
491+ elif data .BAR_THEME in ["Dense" , "Edge" ]:
492+ self .set_margin ("-46px 0px 0px 0px" )
493+ else :
494+ self .set_margin ("-40px 8px 8px 8px" )
495+
486496 def open_notch (self , widget_name : str ):
487497 # Debug info for troubleshooting
488498 if hasattr (self , '_debug_monitor_focus' ) and self ._debug_monitor_focus :
@@ -705,6 +715,9 @@ def _open_notch_internal(self, widget_name: str):
705715 self .bar .revealer_right .set_reveal_child (not hide_bar_revealers )
706716 self .bar .revealer_left .set_reveal_child (not hide_bar_revealers )
707717
718+ if self .bar and not self .bar .get_visible () and data .BAR_POSITION == "Top" :
719+ self .set_margin ("0px 8px 8px 8px" )
720+
708721 self ._is_notch_open = True
709722
710723 def toggle_hidden (self ):
@@ -868,6 +881,22 @@ def _check_occlusion(self):
868881 self .notch_revealer .set_reveal_child (not is_occluded )
869882
870883 return True
884+
885+ def force_occlusion (self ):
886+ """Force notch to occlusion mode (hidden)."""
887+ self ._forced_occlusion = True
888+ self ._prevent_occlusion = False
889+ self .notch_revealer .set_reveal_child (False )
890+
891+ def restore_from_occlusion (self ):
892+ """Restore notch from occlusion mode."""
893+ import config .data as data
894+ self ._forced_occlusion = False
895+ if data .PANEL_THEME == "Notch" :
896+ if data .BAR_POSITION == "Top" :
897+ self .notch_revealer .set_reveal_child (True )
898+ else :
899+ self ._prevent_occlusion = False
871900
872901 def _get_current_window_class (self ):
873902 """Get the class of the currently active window"""
0 commit comments