Aylur / ags

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

Question about Widget.Window #445

Closed Davido264 closed 2 weeks ago

Davido264 commented 3 weeks ago

I want to create a window that can be detected by hyprland, and then send it to a special workspace. Is this possible using ags?

faileon commented 3 weeks ago

I was wondering the same recently and kotontrion answered me on discord:

Widget.Window is alway a layer shell window. If you want to use a normal window you have to use new Gtk.Window

I've already tested this and can confirm it works.

kotontrion commented 3 weeks ago

Note that you can't use some AGS specific things like hook and bind with Gtk.Window directly.

If you want to use them you can add that by subclassing it yourself.

const window = Gtk.Window({
  ...
})

const RegularWindow = Widget.subclass(Gtk.Window)
const window2 = RegularWindow({
  ...
})

//does not work
window.hook(...)
window.keybind(...)

//works
window2.hook(...)
window2.keybind(...)
Davido264 commented 2 weeks ago

It works, thanks :3