Changeset 46a47c0 in mainline for uspace/lib/ui/test/control.c


Ignore:
Timestamp:
2023-01-16T20:34:01Z (16 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/lib/ui/test/control.c

    rb3eeae5 r46a47c0  
    11/*
    2  * Copyright (c) 2021 Jiri Svoboda
     2 * Copyright (c) 2023 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    4444static ui_evclaim_t test_ctl_kbd_event(void *, kbd_event_t *);
    4545static ui_evclaim_t test_ctl_pos_event(void *, pos_event_t *);
    46 static void test_ctl_unfocus(void *);
     46static void test_ctl_unfocus(void *, unsigned);
    4747
    4848static ui_control_ops_t test_ctl_ops = {
     
    7979        /** @c true iff unfocus was called */
    8080        bool unfocus;
     81        /** Number of remaining foci that was sent */
     82        unsigned unfocus_nfocus;
    8183} test_resp_t;
    8284
     
    223225        resp.unfocus = false;
    224226
    225         ui_control_unfocus(control);
     227        ui_control_unfocus(control, 42);
    226228        PCUT_ASSERT_TRUE(resp.unfocus);
     229        PCUT_ASSERT_INT_EQUALS(42, resp.unfocus_nfocus);
    227230
    228231        ui_control_delete(control);
     
    264267}
    265268
    266 static void test_ctl_unfocus(void *arg)
     269static void test_ctl_unfocus(void *arg, unsigned nfocus)
    267270{
    268271        test_resp_t *resp = (test_resp_t *) arg;
    269272
    270273        resp->unfocus = true;
     274        resp->unfocus_nfocus = nfocus;
    271275}
    272276
Note: See TracChangeset for help on using the changeset viewer.