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


Ignore:
Timestamp:
2023-01-16T20:34:01Z (15 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/fixed.c

    rb3eeae5 r46a47c0  
    11/*
    2  * Copyright (c) 2020 Jiri Svoboda
     2 * Copyright (c) 2023 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    4141static errno_t test_ctl_paint(void *);
    4242static ui_evclaim_t test_ctl_pos_event(void *, pos_event_t *);
    43 static void test_ctl_unfocus(void *);
     43static void test_ctl_unfocus(void *, unsigned);
    4444
    4545static ui_control_ops_t test_ctl_ops = {
     
    6666        /** @c true iff unfocus was called */
    6767        bool unfocus;
     68        /** Number of remaining foci */
     69        unsigned unfocus_nfocus;
    6870} test_resp_t;
    6971
     
    253255        resp.unfocus = false;
    254256
    255         ui_fixed_unfocus(fixed);
     257        ui_fixed_unfocus(fixed, 42);
    256258        PCUT_ASSERT_TRUE(resp.unfocus);
     259        PCUT_ASSERT_INT_EQUALS(42, resp.unfocus_nfocus);
    257260
    258261        ui_fixed_destroy(fixed);
     
    284287}
    285288
    286 static void test_ctl_unfocus(void *arg)
     289static void test_ctl_unfocus(void *arg, unsigned nfocus)
    287290{
    288291        test_resp_t *resp = (test_resp_t *) arg;
    289292
    290293        resp->unfocus = true;
     294        resp->unfocus_nfocus = nfocus;
    291295}
    292296
Note: See TracChangeset for help on using the changeset viewer.