Reload icons when apps change
GTK caches the icon theme and never rescans its directories, so newly installed apps showed up without their icons.
This commit is contained in:
parent
d6ebb048f8
commit
42d273798b
1 changed files with 7 additions and 1 deletions
8
grid.js
8
grid.js
|
|
@ -253,7 +253,13 @@ app.connect("activate", () => {
|
||||||
fillPages()
|
fillPages()
|
||||||
|
|
||||||
appInfoMonitor = Gio.AppInfoMonitor.get()
|
appInfoMonitor = Gio.AppInfoMonitor.get()
|
||||||
appInfoMonitor.connect("changed", fillPages)
|
appInfoMonitor.connect("changed", () => {
|
||||||
|
// GTK never rescans icon directories by itself, so new apps' icons wouldn't be found.
|
||||||
|
// Setting the search path, even to the same one, makes it reload.
|
||||||
|
const iconTheme = Gtk.IconTheme.get_for_display(win.get_display())
|
||||||
|
iconTheme.set_search_path(iconTheme.get_search_path())
|
||||||
|
fillPages()
|
||||||
|
})
|
||||||
|
|
||||||
const box = new Gtk.Box({ orientation: Gtk.Orientation.VERTICAL })
|
const box = new Gtk.Box({ orientation: Gtk.Orientation.VERTICAL })
|
||||||
box.append(carousel)
|
box.append(carousel)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue