Changeset 46a47c0 in mainline for uspace/srv/hid/display/window.c


Ignore:
Timestamp:
2023-01-16T20:34:01Z (21 months ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b0ae23f
Parents:
b3eeae5
Message:

Make sure window is only show as inactive when it loses last focus

This currently affects the title bar and also the cursor in Terminal.

File:
1 edited

Legend:

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

    rb3eeae5 r46a47c0  
    680680errno_t ds_window_post_focus_event(ds_window_t *wnd)
    681681{
     682        display_wnd_focus_ev_t efocus;
    682683        errno_t rc;
    683684        ds_wmclient_t *wmclient;
     
    685686        log_msg(LOG_DEFAULT, LVL_DEBUG, "ds_window_post_focus_event");
    686687
    687         rc = ds_client_post_focus_event(wnd->client, wnd);
     688        /* Increase focus counter */
     689        ++wnd->nfocus;
     690        efocus.nfocus = wnd->nfocus;
     691
     692        rc = ds_client_post_focus_event(wnd->client, wnd, &efocus);
    688693        if (rc != EOK)
    689694                return rc;
    690 
    691         /* Increase focus counter */
    692         ++wnd->nfocus;
    693695
    694696        /* Notify window managers about window information change */
     
    709711errno_t ds_window_post_unfocus_event(ds_window_t *wnd)
    710712{
     713        display_wnd_unfocus_ev_t eunfocus;
    711714        errno_t rc;
    712715        ds_wmclient_t *wmclient;
     
    714717        log_msg(LOG_DEFAULT, LVL_DEBUG, "ds_window_post_unfocus_event");
    715718
    716         rc = ds_client_post_unfocus_event(wnd->client, wnd);
     719        /* Decrease focus counter */
     720        --wnd->nfocus;
     721        eunfocus.nfocus = wnd->nfocus;
     722
     723        rc = ds_client_post_unfocus_event(wnd->client, wnd, &eunfocus);
    717724        if (rc != EOK)
    718725                return rc;
    719 
    720         /* Decrease focus counter */
    721         --wnd->nfocus;
    722726
    723727        /* Notify window managers about window information change */
Note: See TracChangeset for help on using the changeset viewer.