Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

manager: Resort extension list only with sort-enabled-first #625

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions src/local/exm-manager.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* exm-manager.c
/*
* exm-manager.c
*
* Copyright 2022-2024 Matthew Jakeman <[email protected]>
* Copyright 2022-2025 Matthew Jakeman <[email protected]>
*
* 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
Expand All @@ -26,6 +27,8 @@
#include "../exm-types.h"
#include "../exm-enums.h"

#include "exm-config.h"

struct _ExmManager
{
GObject parent_instance;
Expand Down Expand Up @@ -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'
Expand Down
Loading