Changeset ee3b28a9 in mainline for uspace/app/taskbar/taskbar.c
- Timestamp:
- 2024-02-26T13:30:48Z (9 months ago)
- Branches:
- master
- Children:
- d92b8e8f
- Parents:
- 90ba06c
- git-author:
- Jiri Svoboda <jiri@…> (2024-02-25 16:12:29)
- git-committer:
- Jiri Svoboda <jiri@…> (2024-02-26 13:30:48)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/taskbar/taskbar.c
r90ba06c ree3b28a9 1 1 /* 2 * Copyright (c) 202 3Jiri Svoboda2 * Copyright (c) 2024 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 48 48 #include "wndlist.h" 49 49 50 #define TASKBAR_CONFIG_FILE "/cfg/taskbar.sif" 51 50 52 static void taskbar_wnd_close(ui_window_t *, void *); 51 53 static void taskbar_wnd_kbd(ui_window_t *, void *, kbd_event_t *); 52 54 static void taskbar_wnd_pos(ui_window_t *, void *, pos_event_t *); 55 static void taskbar_notif_cb(void *); 53 56 54 57 static ui_window_cb_t window_cb = { … … 201 204 } 202 205 203 rc = tbsmenu_load(taskbar->tbsmenu, "/cfg/taskbar.sif");206 rc = tbsmenu_load(taskbar->tbsmenu, TASKBAR_CONFIG_FILE); 204 207 if (rc != EOK) { 205 208 printf("Error loading start menu from '%s'.\n", 206 "/cfg/taskbar.sif"); 209 TASKBAR_CONFIG_FILE); 210 } 211 212 rc = tbarcfg_listener_create(TBARCFG_NOTIFY_DEFAULT, 213 taskbar_notif_cb, (void *)taskbar, &taskbar->lst); 214 if (rc != EOK) { 215 printf("Error listening for configuration changes.\n"); 207 216 } 208 217 … … 287 296 return EOK; 288 297 error: 298 if (taskbar->lst != NULL) 299 tbarcfg_listener_destroy(taskbar->lst); 289 300 if (taskbar->clock != NULL) 290 301 taskbar_clock_destroy(taskbar->clock); … … 304 315 void taskbar_destroy(taskbar_t *taskbar) 305 316 { 317 if (taskbar->lst != NULL) 318 tbarcfg_listener_destroy(taskbar->lst); 306 319 ui_fixed_remove(taskbar->fixed, taskbar_clock_ctl(taskbar->clock)); 307 320 taskbar_clock_destroy(taskbar->clock); … … 312 325 } 313 326 327 /** Configuration change notification callback. 328 * 329 * Called when configuration changed. 330 * 331 * @param arg Argument (taskbar_t *) 332 */ 333 static void taskbar_notif_cb(void *arg) 334 { 335 taskbar_t *taskbar = (taskbar_t *)arg; 336 337 ui_lock(taskbar->ui); 338 tbsmenu_reload(taskbar->tbsmenu); 339 ui_unlock(taskbar->ui); 340 } 341 314 342 /** @} 315 343 */
Note:
See TracChangeset
for help on using the changeset viewer.