Skip to content

Commit

Permalink
Work around async creation of background apps entry
Browse files Browse the repository at this point in the history
  • Loading branch information
stuarthayhurst committed Aug 13, 2023
1 parent 9127390 commit 14b03a8
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions extension/extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
//Main imports
import St from 'gi://St';
import Gio from 'gi://Gio';
import GLib from 'gi://GLib';
import GObject from 'gi://GObject';

import * as Main from 'resource:///org/gnome/shell/ui/main.js';
Expand Down Expand Up @@ -263,10 +264,18 @@ class QuickSettingsManager {
//Add the toggles to the system menu
QuickSettingsMenu._addItems(this._quickSettingToggles);

/* TODO:
- This is a bad idea
- When the shell provides a better way to add above background apps, it should be used instead
- This is a temporary hacky fix
*/

//Place the toggles above the background apps entry
this._quickSettingToggles.forEach((item) => {
QuickSettingsMenu.menu._grid.set_child_below_sibling(item,
QuickSettingsMenu._backgroundApps.quickSettingsItems[0]);
GLib.idle_add(GLib.PRIORITY_DEFAULT, () => {
this._quickSettingToggles.forEach((item) => {
QuickSettingsMenu.menu._grid.set_child_below_sibling(item,
QuickSettingsMenu._backgroundApps.quickSettingsItems[0]);
});
});
}

Expand Down

0 comments on commit 14b03a8

Please sign in to comment.