ErikReider / SwayNotificationCenter

A simple GTK based notification daemon for SwayWM
GNU General Public License v3.0
1.15k stars 58 forks source link

[Bug] segfault when deleting an open group and then a non-group using the delete key #410

Open vrumger opened 3 months ago

vrumger commented 3 months ago

To Reproduce Steps to reproduce the behavior:

  1. get a notification group and a non-grouped notification
    notify-send --app-name a title message
    notify-send --app-name a title message
    notify-send --app-name b title message
  2. open the notification panel
  3. press enter to open the group
  4. press Del to delete the group
  5. press Del again to delete the non-grouped notification

Expected behavior it should delete the notifications

Please provide logs if you're experiencing notification errors / bugs

logs ``` (swaync:50171): GLib-GIO-DEBUG: 11:43:39.954: Using cross-namespace EXTERNAL authentication (this will deadlock if server is GDBus < 2.73.3) (swaync:50171): GLib-GIO-DEBUG: 11:43:39.954: _g_io_module_get_default: Found default implementation dconf (DConfSettingsBackend) for ‘gsettings-backend’ (swaync:50171): dconf-DEBUG: 11:43:39.954: watch_fast: "/org/gnome/desktop/interface/" (establishing: 0, active: 0) (swaync:50171): dconf-DEBUG: 11:43:39.955: watch_fast: "/org/gnome/desktop/peripherals/mouse/" (establishing: 0, active: 0) (swaync:50171): dconf-DEBUG: 11:43:39.955: watch_fast: "/org/gnome/desktop/sound/" (establishing: 0, active: 0) (swaync:50171): dconf-DEBUG: 11:43:39.955: watch_fast: "/org/gnome/desktop/privacy/" (establishing: 0, active: 0) (swaync:50171): dconf-DEBUG: 11:43:39.955: watch_fast: "/org/gnome/desktop/wm/preferences/" (establishing: 0, active: 0) (swaync:50171): dconf-DEBUG: 11:43:39.955: watch_fast: "/org/gnome/settings-daemon/plugins/xsettings/" (establishing: 0, active: 0) (swaync:50171): dconf-DEBUG: 11:43:39.955: watch_fast: "/org/gnome/desktop/a11y/" (establishing: 0, active: 0) (swaync:50171): dconf-DEBUG: 11:43:39.955: watch_fast: "/org/gnome/desktop/a11y/interface/" (establishing: 0, active: 0) (swaync:50171): GLib-GIO-DEBUG: 11:43:39.955: Using cross-namespace EXTERNAL authentication (this will deadlock if server is GDBus < 2.73.3) (swaync:50171): dconf-DEBUG: 11:43:39.957: watch_established: "/org/gnome/desktop/interface/" (establishing: 1) (swaync:50171): dconf-DEBUG: 11:43:39.957: watch_established: "/org/gnome/desktop/peripherals/mouse/" (establishing: 1) (swaync:50171): dconf-DEBUG: 11:43:39.957: watch_established: "/org/gnome/desktop/sound/" (establishing: 1) (swaync:50171): dconf-DEBUG: 11:43:39.957: watch_established: "/org/gnome/desktop/privacy/" (establishing: 1) (swaync:50171): dconf-DEBUG: 11:43:39.957: watch_established: "/org/gnome/desktop/wm/preferences/" (establishing: 1) (swaync:50171): dconf-DEBUG: 11:43:39.957: watch_established: "/org/gnome/settings-daemon/plugins/xsettings/" (establishing: 1) (swaync:50171): dconf-DEBUG: 11:43:39.957: watch_established: "/org/gnome/desktop/a11y/" (establishing: 1) (swaync:50171): dconf-DEBUG: 11:43:39.957: watch_established: "/org/gnome/desktop/a11y/interface/" (establishing: 1) (swaync:50171): Gdk-DEBUG: 11:43:39.970: Compositor prefers decoration mode 'server' (swaync:50171): GLib-DEBUG: 11:43:39.970: unsetenv() is not thread-safe and should not be used after threads are created (swaync:50171): GLib-GIO-DEBUG: 11:43:39.976: _g_io_module_get_default: Found default implementation gvfs (GDaemonVfs) for ‘gio-vfs’ (swaync:50171): dconf-DEBUG: 11:43:39.999: watch_fast: "/org/erikreider/swaync/" (establishing: 0, active: 0) ** INFO: 11:43:40.000: functions.vala:180: Looking for config file in these directories: - /home/avrumy/.config/swaync/config.json - /etc/xdg/swaync/config.json - /usr/local/etc/xdg/swaync/config.json ** INFO: 11:43:40.000: functions.vala:180: Looking for config file in these directories: - /etc/xdg/swaync/config.json - /home/avrumy/.config/swaync/config.json - /etc/xdg/swaync/config.json - /usr/local/etc/xdg/swaync/config.json ** Message: 11:43:40.000: configModel.vala:289: Loading Config: "/etc/xdg/swaync/config.json" ** (swaync:50171): DEBUG: 11:43:40.000: configModel.vala:314: { "positionX" : "right", "positionY" : "top", "layer" : "overlay", "layer-shell" : true, "cssPriority" : "application", "timeout" : 10, "timeout-low" : 5, "timeout-critical" : 0, "transition-time" : 200, "keyboard-shortcuts" : true, "image-visibility" : "when-available", "notification-window-width" : 500, "hide-on-clear" : false, "hide-on-action" : true, "control-center-positionX" : "none", "control-center-positionY" : "none", "control-center-margin-top" : 0, "control-center-margin-bottom" : 0, "control-center-margin-left" : 0, "control-center-margin-right" : 0, "control-center-layer" : "top", "control-center-exclusive-zone" : true, "categories-settings" : { }, "notification-visibility" : { "example-name" : { "app-name" : "Spotify", "urgency" : "Low", "state" : "muted", "override-urgency" : "unset" } }, "scripts" : { "example-script" : { "urgency" : "Normal", "exec" : "echo 'Do something...'", "run-on" : "receive" }, "example-action-script" : { "urgency" : "Normal", "exec" : "echo 'Do something actionable!'", "run-on" : "action" } }, "script-fail-notify" : true, "fit-to-screen" : true, "relative-timestamps" : true, "control-center-height" : 600, "control-center-width" : 500, "notification-2fa-action" : true, "notification-inline-replies" : false, "notification-icon-size" : 64, "notification-body-image-height" : 100, "notification-body-image-width" : 200, "widgets" : [ "inhibitors", "title", "dnd", "notifications" ], "widget-config" : { "inhibitors" : { "text" : "Inhibitors", "button-text" : "Clear All", "clear-all-button" : true }, "title" : { "text" : "Notifications", "clear-all-button" : true, "button-text" : "Clear All" }, "dnd" : { "text" : "Do Not Disturb" }, "label" : { "max-lines" : 5, "text" : "Label Text" }, "mpris" : { "image-size" : 96, "image-radius" : 12 }, "buttons-grid" : { "actions" : [ { "label" : "直", "type" : "toggle", "active" : true, "command" : "sh -c '[[ $SWAYNC_TOGGLE_STATE == true ]] && nmcli radio wifi on || nmcli radio wifi off'", "update_command" : "sh -c '[[ $(nmcli radio wifi) == \"enabled\" ]] && echo true || echo false'" } ] } } } ** INFO: 11:43:40.000: functions.vala:138: Looking for CSS file in these directories: - /etc/xdg/swaync/style.css - /usr/local/etc/xdg/swaync/style.css ** Message: 11:43:40.000: functions.vala:86: Loading CSS: "/etc/xdg/swaync/style.css" (swaync:50171): dconf-DEBUG: 11:43:40.000: watch_established: "/org/erikreider/swaync/" (establishing: 1) ** INFO: 11:43:40.001: functions.vala:138: Looking for CSS file in these directories: - /home/avrumy/.config/swaync/style.css - /etc/xdg/swaync/style.css - /usr/local/etc/xdg/swaync/style.css ** Message: 11:43:40.001: functions.vala:100: Loading CSS: "/etc/xdg/swaync/style.css" ** Message: 11:43:40.007: factory.vala:44: Loading widget: inhibitors ** Message: 11:43:40.007: factory.vala:44: Loading widget: title ** Message: 11:43:40.008: factory.vala:44: Loading widget: dnd ** (swaync:50171): DEBUG: 11:43:47.517: notiDaemon.vala:171: Notification: category: (null) image_data: false expire_timeout: -1 replaces_id: 0 desktop_entry: (null) body: message app_icon: action_icons: false time: 1711619027 hints: sender-pid: int64 50184 urgency: byte 0x01 applied_id: 1 image_path: (null) inline-reply: (null) app_name: a summary: title icon_data: false resident: false default_action: (null) actions: urgency: Normal ** (swaync:50171): DEBUG: 11:43:47.568: notiDaemon.vala:171: Notification: category: (null) image_data: false expire_timeout: -1 replaces_id: 0 desktop_entry: (null) body: message app_icon: action_icons: false time: 1711619027 hints: sender-pid: int64 50197 urgency: byte 0x01 applied_id: 2 image_path: (null) inline-reply: (null) app_name: a summary: title icon_data: false resident: false default_action: (null) actions: urgency: Normal ** (swaync:50171): DEBUG: 11:43:47.583: notiDaemon.vala:171: Notification: category: (null) image_data: false expire_timeout: -1 replaces_id: 0 desktop_entry: (null) body: message app_icon: action_icons: false time: 1711619027 hints: sender-pid: int64 50202 urgency: byte 0x01 applied_id: 3 image_path: (null) inline-reply: (null) app_name: b summary: title icon_data: false resident: false default_action: (null) actions: urgency: Normal Segmentation fault (core dumped) ```

Screenshots

https://github.com/ErikReider/SwayNotificationCenter/assets/32808683/554dbb7c-d575-4cb7-a5c4-070708d5c909

Desktop (please complete the following information):

ErikReider commented 2 months ago

Hmmm. Is this still an issue? Can't reproduce it on my end...

vrumger commented 2 months ago

yeah, i can still reproduce it. it seems to be related to the focus not being moved when deleting an open group