Changeset f1f433d in mainline for uspace/app/taskbar/wndlist.c
- Timestamp:
- 2022-11-04T20:54:04Z (3 years ago)
- Branches:
- master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3a6d44b7
- Parents:
- fc00f0d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/taskbar/wndlist.c
rfc00f0d rf1f433d 48 48 static void wndlist_wm_window_added(void *, sysarg_t); 49 49 static void wndlist_wm_window_removed(void *, sysarg_t); 50 static void wndlist_wm_window_changed(void *, sysarg_t); 50 51 51 52 static wndmgt_cb_t wndlist_wndmgt_cb = { 52 53 .window_added = wndlist_wm_window_added, 53 .window_removed = wndlist_wm_window_removed 54 .window_removed = wndlist_wm_window_removed, 55 .window_changed = wndlist_wm_window_changed 54 56 }; 55 57 … … 233 235 if (!paint) 234 236 return EOK; 237 238 return wndlist_repaint(wndlist); 239 } 240 241 /** Update window list entry. 242 * 243 * @param wndlist Window list 244 * @param entry Window list entry 245 * @return @c EOK on success or an error code 246 */ 247 errno_t wndlist_update(wndlist_t *wndlist, wndlist_entry_t *entry, 248 const char *caption) 249 { 250 errno_t rc; 251 assert(entry->wndlist == wndlist); 252 253 rc = ui_pbutton_set_caption(entry->button, caption); 254 if (rc != EOK) 255 return rc; 256 257 rc = ui_pbutton_paint(entry->button); 258 if (rc != EOK) 259 return rc; 235 260 236 261 return wndlist_repaint(wndlist); … … 325 350 } 326 351 352 /** Handle WM window changed event. 353 * 354 * @param arg Argument (wndlist_t *) 355 * @param wnd_id Window ID 356 */ 357 static void wndlist_wm_window_changed(void *arg, sysarg_t wnd_id) 358 { 359 wndlist_t *wndlist = (wndlist_t *)arg; 360 wndmgt_window_info_t *winfo = NULL; 361 wndlist_entry_t *entry; 362 errno_t rc; 363 364 printf("wm_window_changed: wndlist=%p wnd_id=%zu\n", 365 (void *)wndlist, wnd_id); 366 367 entry = wndlist_entry_by_id(wndlist, wnd_id); 368 if (entry == NULL) 369 return; 370 371 rc = wndmgt_get_window_info(wndlist->wndmgt, wnd_id, &winfo); 372 if (rc != EOK) 373 return; 374 375 (void) wndlist_update(wndlist, entry, winfo->caption); 376 wndmgt_free_window_info(winfo); 377 } 378 327 379 /** Find window list entry by ID. 328 380 *
Note:
See TracChangeset
for help on using the changeset viewer.