Changeset 3c54869 in mainline for uspace/srv/hid/display/window.c


Ignore:
Timestamp:
2023-01-04T20:24:44Z (16 months ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5d86797
Parents:
cdd6fc9
Message:

Highlight active window in task bar

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hid/display/window.c

    rcdd6fc9 r3c54869  
    11/*
    2  * Copyright (c) 2022 Jiri Svoboda
     2 * Copyright (c) 2023 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    678678errno_t ds_window_post_focus_event(ds_window_t *wnd)
    679679{
     680        errno_t rc;
     681        ds_wmclient_t *wmclient;
     682
    680683        log_msg(LOG_DEFAULT, LVL_DEBUG, "ds_window_post_focus_event");
    681684
    682         return ds_client_post_focus_event(wnd->client, wnd);
     685        rc = ds_client_post_focus_event(wnd->client, wnd);
     686        if (rc != EOK)
     687                return rc;
     688
     689        /* Increase focus counter */
     690        ++wnd->nfocus;
     691
     692        /* Notify window managers about window information change */
     693        wmclient = ds_display_first_wmclient(wnd->display);
     694        while (wmclient != NULL) {
     695                ds_wmclient_post_wnd_changed_event(wmclient, wnd->id);
     696                wmclient = ds_display_next_wmclient(wmclient);
     697        }
     698
     699        return EOK;
    683700}
    684701
     
    690707errno_t ds_window_post_unfocus_event(ds_window_t *wnd)
    691708{
     709        errno_t rc;
     710        ds_wmclient_t *wmclient;
     711
    692712        log_msg(LOG_DEFAULT, LVL_DEBUG, "ds_window_post_unfocus_event");
    693713
    694         return ds_client_post_unfocus_event(wnd->client, wnd);
     714        rc = ds_client_post_unfocus_event(wnd->client, wnd);
     715        if (rc != EOK)
     716                return rc;
     717
     718        /* Decrease focus counter */
     719        --wnd->nfocus;
     720
     721        /* Notify window managers about window information change */
     722        wmclient = ds_display_first_wmclient(wnd->display);
     723        while (wmclient != NULL) {
     724                ds_wmclient_post_wnd_changed_event(wmclient, wnd->id);
     725                wmclient = ds_display_next_wmclient(wmclient);
     726        }
     727
     728        return EOK;
    695729}
    696730
Note: See TracChangeset for help on using the changeset viewer.