Aylur / ags

A customizable and extensible shell
GNU General Public License v3.0
1.74k stars 94 forks source link

`App.windows` is always empty #437

Closed realSaltyFish closed 1 week ago

realSaltyFish commented 1 month ago

No matter what window I create and add, App.windows is always empty. Is this supposed to be the correct way to retrieve all windows?

Minimal config file:

App.add_window(Widget.Window({}))
console.log(JSON.stringify(App.windows))
h-banii commented 1 month ago

I never had to use it before so I don't know if this is the best way, but get_windows should work

App.add_window(Widget.Window({}));
console.log(App.get_windows());

Or use App.config

App.config({
  windows: [
    Widget.Window({
      name: 'yay',
    })
  ]
});

console.log(App.windows);
Aylur commented 1 week ago

it can be a bit confusing App.add_window is the default function of Gtk.Application the function you are looking for is App.addWindow in camelCase