@@ -7,15 +7,13 @@ namespace SwayNotificationCenter {
77 new HashTable<string, uint32> (str_hash, str_equal);
88
99 public ControlCenter control_center;
10- public NotificationWindow noti_window;
1110
1211 public NotiDaemon (SwayncDaemon swaync_daemon) {
1312 this . notify[" dnd" ]. connect (() = > on_dnd_toggle (dnd));
1413
1514 // Init dnd from gsettings
1615 self_settings. bind (" dnd-state" , this , " dnd" , SettingsBindFlags . DEFAULT );
1716
18- this . noti_window = new NotificationWindow ();
1917 this . control_center = new ControlCenter (swaync_daemon, this );
2018 }
2119
@@ -25,7 +23,7 @@ namespace SwayNotificationCenter {
2523 */
2624 public void set_noti_window_visibility (bool value )
2725 throws DBusError , IOError {
28- noti_window . change_visibility (value );
26+ NotificationWindow . instance . change_visibility (value );
2927 }
3028
3129 /* * Toggles the current Do Not Disturb state */
@@ -53,7 +51,7 @@ namespace SwayNotificationCenter {
5351 /* * Method to close notification and send DISMISSED signal */
5452 public void manually_close_notification (uint32 id, bool timeout)
5553 throws DBusError , IOError {
56- noti_window . close_notification (id);
54+ NotificationWindow . instance . close_notification (id);
5755 if (! timeout) {
5856 control_center. close_notification (id);
5957 NotificationClosed (id, ClosedReasons . DISMISSED );
@@ -66,14 +64,14 @@ namespace SwayNotificationCenter {
6664
6765 /* * Closes all popup and controlcenter notifications */
6866 public void close_all_notifications () throws DBusError , IOError {
69- noti_window . close_all_notifications ();
67+ NotificationWindow . instance . close_all_notifications ();
7068 control_center. close_all_notifications ();
7169 }
7270
7371 /* * Closes latest popup notification */
7472 public void hide_latest_notification (bool close)
7573 throws DBusError , IOError {
76- uint32 ? id = noti_window . get_latest_notification ();
74+ uint32 ? id = NotificationWindow . instance . get_latest_notification ();
7775 if (id == null ) return ;
7876 manually_close_notification (id, ! close);
7977 }
@@ -157,7 +155,7 @@ namespace SwayNotificationCenter {
157155 // Replace notification logic
158156 if (id == replaces_id) {
159157 param. replaces = true ;
160- noti_window . close_notification (id);
158+ NotificationWindow . instance . close_notification (id);
161159 control_center. close_notification (id, true );
162160 } else if (param. synchronous != null
163161 && param. synchronous. length > 0 ) {
@@ -168,7 +166,7 @@ namespace SwayNotificationCenter {
168166 param. synchronous, null , out r_id)) {
169167 param. replaces = true ;
170168 // Close the notification
171- noti_window . close_notification (r_id);
169+ NotificationWindow . instance . close_notification (r_id);
172170 control_center. close_notification (r_id, true );
173171 }
174172 synchronous_ids. set (param. synchronous, id);
@@ -179,7 +177,7 @@ namespace SwayNotificationCenter {
179177 && ! control_center. get_visibility ()) {
180178 if (param. urgency == UrgencyLevels . CRITICAL ||
181179 (! dnd && param. urgency != UrgencyLevels . CRITICAL )) {
182- noti_window . add_notification (param, this );
180+ NotificationWindow . instance . add_notification (param, this );
183181 }
184182 }
185183 // Only add notification to CC if it isn't IGNORED and not transient
@@ -255,7 +253,7 @@ namespace SwayNotificationCenter {
255253 */
256254 [DBus (name = " CloseNotification" )]
257255 public void close_notification (uint32 id) throws DBusError , IOError {
258- noti_window . close_notification (id);
256+ NotificationWindow . instance . close_notification (id);
259257 control_center. close_notification (id);
260258 NotificationClosed (id, ClosedReasons . CLOSED_BY_CLOSENOTIFICATION );
261259 }
0 commit comments