Skip to content

Commit d470101

Browse files
committed
toggle beta
1 parent 1fe4988 commit d470101

File tree

2 files changed

+30
-9
lines changed

2 files changed

+30
-9
lines changed

modules/dock.py

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,19 @@ def check_occlusion_state(self):
640640
if self.integrated_mode:
641641
return False
642642

643-
if self.is_mouse_over_dock_area or self._drag_in_progress or self._prevent_occlusion or self._forced_occlusion:
643+
# When forced occlusion is active, only show on hover
644+
if self._forced_occlusion:
645+
if self.is_mouse_over_dock_area:
646+
if not self.dock_revealer.get_reveal_child():
647+
self.dock_revealer.set_reveal_child(True)
648+
self.dock_full.remove_style_class("occluded")
649+
else:
650+
if self.dock_revealer.get_reveal_child():
651+
self.dock_revealer.set_reveal_child(False)
652+
self.dock_full.add_style_class("occluded")
653+
return True
654+
655+
if self.is_mouse_over_dock_area or self._drag_in_progress or self._prevent_occlusion:
644656
if not self.dock_revealer.get_reveal_child():
645657
self.dock_revealer.set_reveal_child(True)
646658
if not self.always_show:
@@ -821,16 +833,24 @@ def update_visibility(visible):
821833
dock.dock_revealer.set_reveal_child(False)
822834

823835
def force_occlusion(self):
824-
"""Force dock to occlusion mode (hidden but responds to hover)."""
836+
"""Force dock to hide and act as if always_show is False."""
825837
if self.integrated_mode:
826838
return
839+
# Save current always_show state
840+
self._saved_always_show = self.always_show
841+
# Set to False to enable hover behavior
842+
self.always_show = False
827843
self._forced_occlusion = True
828844
if not self.is_mouse_over_dock_area:
829845
self.dock_revealer.set_reveal_child(False)
830846

831847
def restore_from_occlusion(self):
832-
"""Restore dock from forced occlusion mode."""
848+
"""Restore dock to its previous always_show state."""
833849
if self.integrated_mode:
834850
return
835851
self._forced_occlusion = False
852+
# Restore saved always_show state
853+
if hasattr(self, '_saved_always_show'):
854+
self.always_show = self._saved_always_show
855+
delattr(self, '_saved_always_show')
836856
self.check_occlusion_state()

modules/notch.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -455,8 +455,6 @@ def on_notch_hover_area_enter(self, widget, event):
455455
self.is_hovered = True
456456
if data.PANEL_THEME == "Notch" and data.BAR_POSITION != "Top":
457457
self.notch_revealer.set_reveal_child(True)
458-
elif self._forced_occlusion:
459-
self.notch_revealer.set_reveal_child(True)
460458
return False
461459

462460
def on_notch_hover_area_leave(self, widget, event):
@@ -466,9 +464,6 @@ def on_notch_hover_area_leave(self, widget, event):
466464
return False
467465

468466
self.is_hovered = False
469-
470-
if self._forced_occlusion:
471-
self.notch_revealer.set_reveal_child(False)
472467

473468
return False
474469

@@ -879,7 +874,10 @@ def _check_occlusion(self):
879874
occlusion_edge = "top"
880875
occlusion_size = 40
881876

882-
if not (self.is_hovered or self._is_notch_open or self._prevent_occlusion or self._forced_occlusion):
877+
if self._forced_occlusion:
878+
# When forced occlusion is active, show only on hover
879+
self.notch_revealer.set_reveal_child(self.is_hovered)
880+
elif not (self.is_hovered or self._is_notch_open or self._prevent_occlusion):
883881
is_occluded = check_occlusion((occlusion_edge, occlusion_size))
884882
self.notch_revealer.set_reveal_child(not is_occluded)
885883

@@ -890,6 +888,9 @@ def force_occlusion(self):
890888
self._forced_occlusion = True
891889
self._prevent_occlusion = False
892890
self.notch_revealer.set_reveal_child(False)
891+
# Start occlusion check timer if in vertical mode (left/right)
892+
if data.BAR_POSITION in ["Left", "Right"]:
893+
GLib.timeout_add(100, self._check_occlusion)
893894

894895
def restore_from_occlusion(self):
895896
"""Restore notch from occlusion mode."""

0 commit comments

Comments
 (0)