Changeset 46a47c0 in mainline for uspace/lib/display/test/display.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/display/test/display.c

    rb3eeae5 r46a47c0  
    11/*
    2  * Copyright (c) 2022 Jiri Svoboda
     2 * Copyright (c) 2023 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    5151
    5252static void test_close_event(void *);
    53 static void test_focus_event(void *);
     53static void test_focus_event(void *, unsigned);
    5454static void test_kbd_event(void *, kbd_event_t *);
    5555static void test_pos_event(void *, pos_event_t *);
    56 static void test_unfocus_event(void *);
     56static void test_unfocus_event(void *, unsigned);
    5757
    5858static errno_t test_window_create(void *, display_wnd_params_t *, sysarg_t *);
     
    166166        bool set_color_called;
    167167        bool close_event_called;
     168
    168169        bool focus_event_called;
    169170        bool kbd_event_called;
     
    16771678        resp.event_cnt = 1;
    16781679        resp.event.etype = wev_focus;
     1680        resp.event.ev.focus.nfocus = 42;
    16791681        resp.wnd_id = wnd->id;
    16801682        resp.focus_event_called = false;
     
    16931695        PCUT_ASSERT_INT_EQUALS(resp.event.etype,
    16941696            resp.revent.etype);
     1697        PCUT_ASSERT_INT_EQUALS(resp.event.ev.focus.nfocus,
     1698            resp.revent.ev.focus.nfocus);
    16951699
    16961700        rc = display_window_destroy(wnd);
     
    18961900        resp.event_cnt = 1;
    18971901        resp.event.etype = wev_unfocus;
     1902        resp.event.ev.unfocus.nfocus = 42;
    18981903        resp.wnd_id = wnd->id;
    18991904        resp.unfocus_event_called = false;
     
    19121917        PCUT_ASSERT_INT_EQUALS(resp.event.etype,
    19131918            resp.revent.etype);
     1919        PCUT_ASSERT_INT_EQUALS(resp.event.ev.focus.nfocus,
     1920            resp.revent.ev.focus.nfocus);
    19141921
    19151922        rc = display_window_destroy(wnd);
     
    20572064}
    20582065
    2059 static void test_focus_event(void *arg)
     2066static void test_focus_event(void *arg, unsigned nfocus)
    20602067{
    20612068        test_response_t *resp = (test_response_t *) arg;
    20622069
    20632070        resp->revent.etype = wev_focus;
     2071        resp->revent.ev.focus.nfocus = nfocus;
    20642072
    20652073        fibril_mutex_lock(&resp->event_lock);
     
    20952103}
    20962104
    2097 static void test_unfocus_event(void *arg)
     2105static void test_unfocus_event(void *arg, unsigned nfocus)
    20982106{
    20992107        test_response_t *resp = (test_response_t *) arg;
    21002108
    21012109        resp->revent.etype = wev_unfocus;
     2110        resp->revent.ev.unfocus.nfocus = nfocus;
    21022111
    21032112        fibril_mutex_lock(&resp->event_lock);
Note: See TracChangeset for help on using the changeset viewer.