From 6c9330bfbdec98b64be526e4e388cd281692a8ab Mon Sep 17 00:00:00 2001 From: oscfdezdz <42654671+oscfdezdz@users.noreply.github.com> Date: Sat, 6 Apr 2024 19:41:32 +0200 Subject: [PATCH] manager: Resort extension list only with sort-enabled-first Helps https://github.com/mjakeman/extension-manager/issues/220 --- src/local/exm-manager.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/local/exm-manager.c b/src/local/exm-manager.c index e776dbe6..ddc9aeb2 100644 --- a/src/local/exm-manager.c +++ b/src/local/exm-manager.c @@ -1,6 +1,7 @@ -/* exm-manager.c +/* + * exm-manager.c * - * Copyright 2022-2024 Matthew Jakeman + * Copyright 2022-2025 Matthew Jakeman * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -26,6 +27,8 @@ #include "../exm-types.h" #include "../exm-enums.h" +#include "exm-config.h" + struct _ExmManager { GObject parent_instance; @@ -764,13 +767,19 @@ on_state_changed (ShellExtensions *object, return; } + GSettings *settings; + settings = g_settings_new (APP_ID); + // Emit items-changed signal to re-sort extension list + if (g_settings_get_boolean (settings, "sort-enabled-first")) { guint position; if (g_list_store_find_with_equal_func (list_store, extension, (GEqualFunc)is_extension_equal, &position)) g_list_model_items_changed (G_LIST_MODEL (list_store), position, 1, 1); } + g_object_unref (settings); + // If the extension that has changed has an update, then // one or more extensions have updates available. Lazily // check the exact number and emit the 'updates-available'