fix(services/spotlight): improve MPRIS artwork handling and scope keyword searches to single plugin
- mpris: native MediaArt cache lookup, dedupe play/pause emission, safe cleanup, artwork polling for already-playing browser players, drop os.system seek fallback - spotlight: scope plugin keyword and detect() matches to a single plugin via search_single instead of global search; register clipboard keywords (clip/clipboard)
This commit is contained in:
43 files changed
+1227
-637
No files matched your search
@@ -21,7 +21,7 @@ from services.modus import notification_service
|
||||
from shared.widgets.clipping_box import ClippingBox
|
||||
from shared.widgets.custom_image import CustomImage
|
||||
from shared.widgets.customrevealer import SlideRevealer
|
||||
from utils.functions import escape_markup_text, parse_timeout_string
|
||||
from utils.functions import escape_markup_text
|
||||
from utils.roam import modus_service
|
||||
from utils.icon_resolver import IconResolver
|
||||
|
||||
@@ -1071,9 +1071,6 @@ class ModusNoti(Window):
|
||||
# Preload assets immediately for optimal caching and display performance
|
||||
preload_notification_assets(notification)
|
||||
|
||||
# Implement smart queue management for smooth transitions
|
||||
GLib.get_monotonic_time() / 1000
|
||||
|
||||
# If queue is getting full, remove oldest notifications smoothly
|
||||
if len(self.notification_queue) >= self.MAX_QUEUE_SIZE:
|
||||
# Remove oldest notification from queue (not current showing one)
|
||||
@@ -1271,21 +1268,6 @@ class ModusNoti(Window):
|
||||
def update_config(self, new_config):
|
||||
"""Update notification configuration dynamically."""
|
||||
try:
|
||||
# Handle notification timeout changes
|
||||
if "notification_timeout" in new_config:
|
||||
timeout_str = new_config["notification_timeout"]
|
||||
# Parse the timeout string to milliseconds
|
||||
|
||||
parse_timeout_string(timeout_str)
|
||||
|
||||
# Handle ignored apps changes
|
||||
if "notification_ignored_apps" in new_config:
|
||||
new_config["notification_ignored_apps"]
|
||||
|
||||
# Handle limited apps history changes
|
||||
if "notification_limited_apps_history" in new_config:
|
||||
new_config["notification_limited_apps_history"]
|
||||
|
||||
# Update the current config
|
||||
self._current_config.update(new_config)
|
||||
|
||||
|
||||
@@ -178,13 +178,9 @@ class ExpandableNotificationGroup(Box):
|
||||
|
||||
self.add(self.collapsed_eventbox)
|
||||
|
||||
# Create expanded state (hidden initially)
|
||||
self.create_expanded_state()
|
||||
|
||||
def _get_notification_pixbuf_for_group(self, cached_notification):
|
||||
"""Get notification pixbuf at 64x64 - matches app icon size for consistency"""
|
||||
notification = cached_notification._notification
|
||||
getattr(notification, "id", None)
|
||||
pixbuf = None
|
||||
|
||||
# First try to get cached notification image using stored cache key
|
||||
@@ -372,10 +368,6 @@ class ExpandableNotificationGroup(Box):
|
||||
self.expanded_container.set_visible(False)
|
||||
return False # Don't repeat timeout
|
||||
|
||||
def _complete_collapse(self):
|
||||
"""Complete the collapse animation - no longer needed but kept for compatibility"""
|
||||
return False # Don't repeat timeout
|
||||
|
||||
def close_all(self, *args):
|
||||
"""Close all notifications in this group with proper cache cleanup"""
|
||||
# Close all notifications in this group
|
||||
@@ -462,7 +454,6 @@ class NotificationCenterWidget(NotificationWidget):
|
||||
|
||||
def _get_notification_pixbuf(self, notification):
|
||||
"""Get notification pixbuf at 64x64 - matches app icon size for consistency"""
|
||||
getattr(notification, "id", None)
|
||||
pixbuf = None
|
||||
|
||||
# First try to get cached notification image using stored cache key
|
||||
@@ -819,8 +810,11 @@ class NotificationCenter(AppletWindow):
|
||||
group_widget.remove(child)
|
||||
child.destroy()
|
||||
|
||||
# Recreate content
|
||||
# Recreate content (collapsed + expanded states)
|
||||
group_widget.create_collapsed_state()
|
||||
group_widget.create_expanded_state()
|
||||
group_widget.collapsed_eventbox.set_visible(True)
|
||||
group_widget.expanded_container.set_visible(False)
|
||||
group_widget.show_all()
|
||||
|
||||
except Exception as e:
|
||||
|
||||
Reference in new issue
Block a user