Changeset 913add60 in mainline for uspace/app/taskbar/taskbar.c


Ignore:
Timestamp:
2022-10-31T10:53:53Z (2 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1b92d4b
Parents:
7cc30e9
git-author:
Jiri Svoboda <jiri@…> (2022-10-30 10:53:48)
git-committer:
Jiri Svoboda <jiri@…> (2022-10-31 10:53:53)
Message:

Deliver WM events for windows being added and removed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/taskbar/taskbar.c

    r7cc30e9 r913add60  
    5353};
    5454
     55static void taskbar_wm_window_added(void *, sysarg_t);
     56static void taskbar_wm_window_removed(void *, sysarg_t);
     57
     58static wndmgt_cb_t taskbar_wndmgt_cb = {
     59        .window_added = taskbar_wm_window_added,
     60        .window_removed = taskbar_wm_window_removed
     61};
     62
    5563/** Window close button was clicked.
    5664 *
     
    8997
    9098        if (wndmgt_svc != NULL) {
    91                 rc = wndmgt_open(wndmgt_svc, NULL, NULL, &taskbar->wndmgt);
     99                rc = wndmgt_open(wndmgt_svc, &taskbar_wndmgt_cb,
     100                    (void *)taskbar, &taskbar->wndmgt);
    92101                if (rc != EOK)
    93102                        goto error;
     
    241250}
    242251
     252/** Handle WM window added event.
     253 *
     254 * @param arg Argument (taskbar_t *)
     255 * @param wnd_id Window ID
     256 */
     257static void taskbar_wm_window_added(void *arg, sysarg_t wnd_id)
     258{
     259        taskbar_t *taskbar = (taskbar_t *)arg;
     260
     261        printf("wm_window_added: taskbar=%p wnd_id=%zu\n",
     262            (void *)taskbar, wnd_id);
     263}
     264
     265/** Handle WM window removed event.
     266 *
     267 * @param arg Argument (taskbar_t *)
     268 * @param wnd_id Window ID
     269 */
     270static void taskbar_wm_window_removed(void *arg, sysarg_t wnd_id)
     271{
     272        taskbar_t *taskbar = (taskbar_t *)arg;
     273
     274        printf("wm_window_removed: taskbar=%p wnd_id=%zu\n",
     275            (void *)taskbar, wnd_id);
     276}
     277
    243278/** @}
    244279 */
Note: See TracChangeset for help on using the changeset viewer.