Skip to content

Commit

Permalink
manager: Sort extension list when sort-enabled-first is enabled
Browse files Browse the repository at this point in the history
Fix #220
  • Loading branch information
oscfdezdz committed Apr 6, 2024
1 parent fec37b2 commit fa89369
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/local/exm-manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#include "../exm-types.h"
#include "../exm-enums.h"

#include "exm-config.h"

struct _ExmManager
{
GObject parent_instance;
Expand Down Expand Up @@ -771,13 +773,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'
Expand Down

0 comments on commit fa89369

Please sign in to comment.