Aylur / ags

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

Example notification popups widget not working #340

Closed InKeaton closed 3 months ago

InKeaton commented 3 months ago

Hi!

I was trying to build my notification popups system, starting from the example provided. But it does not seem to work.

The errors found seem to be two:

  1. In notification-popups/notificationPopups.js the following block of code:
const icon = Widget.Box({
        vpack: 'start',
        class_name: 'icon',
        child: NotificationIcon(n),
    });

seems to have a type error. The exact error is the following (It is in italian, i hope it that the core of the problem is understandable):

L'argomento di tipo '{ vpack: "start"; class_name: string; child: Box<Gtk.Widget, unknown> | Icon<unknown>; }' non è assegnabile al parametro di tipo 'Box<Widget, unknown>[] | BoxProps<Box<Widget, unknown>, unknown, Box<Box<Widget, unknown>, unknown>> | undefined'.
  I tipi della proprietà 'child' sono incompatibili.
    Il tipo 'Box<Widget, unknown> | Icon<unknown>' non è assegnabile al tipo '(Widget & Box<Widget, unknown>) | Binding<any, any, Widget & Box<Widget, unknown>> | undefined'.
      Il tipo 'Icon<unknown>' non è assegnabile al tipo '(Widget & Box<Widget, unknown>) | Binding<any, any, Widget & Box<Widget, unknown>> | undefined'.
        Il tipo 'Icon<unknown>' non è assegnabile al tipo 'Widget & Box<Widget, unknown>'.
          Nel tipo 'Icon<unknown>' mancano le proprietà seguenti del tipo 'Box<Widget, unknown>': child, children, vertical, baseline_position e altre 58.

I'm using the default files obtained with ags --init If i run ags and send a notification with notify-send, the widget is not shown, and the error reported is the following:

(com.github.Aylur.ags:5507): Gjs-CRITICAL **: 11:40:19.927: Attempting to call back into JSAPI during the sweeping phase of GC. This is most likely caused by not destroying a Clutter actor or Gtk+ widget with ::destroy signals connected, but can also be caused by using the destroy(), dispose(), or remove() vfuncs. Because it would crash the application, it has been blocked and the JS callback not invoked.
The offending signal was destroy on Ags_Icon 0x26e86f0.
== Stack trace for context 0x211a060 ==
#0        222ca08 i   resource:///org/gnome/gjs/modules/core/overrides/GLib.js:266 (9958067c420 @ 139)
  1. Even if i remove the parts of code regarding the icon, the widget still does not seem to work as intended. The widget is not shown, and no error or warning seems to be reported. This was an error of mine with css, i've fixed it

I'm on NixOs, With the latest ags version (1.8.0). No notification daemon is running co-currently From what i see the code has been updated lastly in december, so i imagine that it could have been broken by an update? Either way, i hope you can help me with this. :)

Thanks in advance

Aylur commented 3 months ago

not sure why it didn't show up for you, I couldn't replicate it I updated it, now it doesn't bind to the popups property, but instead hooks into the dismissed and notified signals, so it should be more optimized