- Fix hide-on-mouseover for XShape WMs

- Fix hide-on-mouseover in wayfire
- Remove edge cases for Cinnamon as they are no longer required
This commit is contained in:
trigg 2025-08-28 21:56:15 +01:00
parent 36368d94d2
commit 013f9c2090
2 changed files with 3 additions and 14 deletions

View file

@ -192,10 +192,6 @@ class OverlayWindow(Gtk.Window):
if self.hide_on_mouseover: if self.hide_on_mouseover:
# We've mouse-overed # We've mouse-overed
if self.draw_blank: if self.draw_blank:
self.set_untouchable()
context.set_source_rgba(0.0, 0.0, 0.0, 0.0)
context.set_operator(cairo.OPERATOR_SOURCE)
context.paint()
return return
else: else:
(width, height) = self.get_size() (width, height) = self.get_size()
@ -236,10 +232,6 @@ class OverlayWindow(Gtk.Window):
if (self.floating != floating or self.pos_x != pos_x or if (self.floating != floating or self.pos_x != pos_x or
self.pos_y != pos_y or self.width != width or self.height != height): self.pos_y != pos_y or self.width != width or self.height != height):
# Special case for Cinnamon desktop : see https://github.com/trigg/Discover/issues/322
if ('XDG_SESSION_DESKTOP' in os.environ and
os.environ['XDG_SESSION_DESKTOP'] == 'cinnamon'):
floating = True
self.floating = floating self.floating = floating
self.pos_x = pos_x self.pos_x = pos_x
@ -487,15 +479,17 @@ class OverlayWindow(Gtk.Window):
"""Callback when mouseover occurs, hides overlay""" """Callback when mouseover occurs, hides overlay"""
self.draw_blank = True self.draw_blank = True
self.set_needs_redraw() self.set_needs_redraw()
self.hide()
GLib.timeout_add_seconds(self.timeout_mouse_over, self.mouseout_timed)
return True return True
def mouseout(self, _a=None, _b=None): def mouseout(self, _a=None, _b=None):
"""Callback when mouseout occurs, sets a timer to show overlay""" """Callback when mouseout occurs, sets a timer to show overlay"""
GLib.timeout_add_seconds(self.timeout_mouse_over, self.mouseout_timed)
return True return True
def mouseout_timed(self, _a=None, _b=None): def mouseout_timed(self, _a=None, _b=None):
"""Callback a short while after mouseout occured, shows overlay""" """Callback a short while after mouseout occured, shows overlay"""
self.draw_blank = False self.draw_blank = False
self.show()
self.set_needs_redraw() self.set_needs_redraw()
return False return False

View file

@ -732,9 +732,6 @@ class MainSettingsWindow():
self.widget['core_settings_min'].set_sensitive(self.show_sys_tray_icon) self.widget['core_settings_min'].set_sensitive(self.show_sys_tray_icon)
if 'XDG_SESSION_DESKTOP' in os.environ and os.environ['XDG_SESSION_DESKTOP'] == 'cinnamon':
self.widget['voice_anchor_float'].set_sensitive(False)
self.widget['core_audio_assist'].set_active( self.widget['core_audio_assist'].set_active(
config.getboolean("general", "audio_assist", fallback=False)) config.getboolean("general", "audio_assist", fallback=False))
@ -1000,8 +997,6 @@ class MainSettingsWindow():
def update_floating_anchor(self): def update_floating_anchor(self):
floating = self.widget['voice_anchor_float'].get_active() == 0 floating = self.widget['voice_anchor_float'].get_active() == 0
if 'XDG_SESSION_DESKTOP' in os.environ and os.environ['XDG_SESSION_DESKTOP'] == 'cinnamon':
floating = True
if floating: if floating:
self.widget['voice_align_1'].hide() self.widget['voice_align_1'].hide()