Astal icon indicating copy to clipboard operation
Astal copied to clipboard

fix(hyprland): check if monitor exists before removing

Open spotdemo4 opened this issue 5 months ago • 0 comments

closes #350

The Hyprland IPC spams monitorremovedv2 when a monitor is removed:

08:11:44 monitoradded>>grimblastVD
08:11:44 monitoraddedv2>>2,grimblastVD,
...
08:11:45 monitorremoved>>grimblastVD
08:11:45 monitorremovedv2>>2,grimblastVD,
08:11:45 monitorremoved>>grimblastVD
08:11:45 monitorremovedv2>>2,grimblastVD,
08:11:45 monitorremoved>>grimblastVD
08:11:45 monitorremovedv2>>2,grimblastVD,

and currently there's no check to make sure the monitor actually exists before trying to remove it, causing an error:

** (gjs:126146): CRITICAL **: 08:15:51.597: astal_hyprland_monitor_get_id: assertion 'self != NULL' failed
** (gjs:126146): CRITICAL **: 08:15:51.598: astal_hyprland_monitor_get_id: assertion 'self != NULL' failed
(gjs:126146): GLib-GObject-CRITICAL **: 08:15:51.598: invalid (NULL) pointer instance
(gjs:126146): GLib-GObject-CRITICAL **: 08:15:51.598: g_signal_emit_by_name: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed

spotdemo4 avatar Jul 21 '25 12:07 spotdemo4