Changeset 5d380b6 in mainline for uspace/lib/ui/include


Ignore:
Timestamp:
2023-01-20T11:50:41Z (3 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b1f0a14
Parents:
6828a56
git-author:
Jiri Svoboda <jiri@…> (2023-01-20 19:50:21)
git-committer:
Jiri Svoboda <jiri@…> (2023-01-20 11:50:41)
Message:

Create menu windows in the correct seat

Add a mechanism to set the seat of a new display window, UI window,
UI popup - input device ID. This is set to the ID of the device which
activated the menu (mouse, keyboard). The display server determines
the correct seat from there.

This makes sure clicking outside closes the correct pop-up window.

Location:
uspace/lib/ui/include
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/ui/include/types/ui/popup.h

    r6828a56 r5d380b6  
    11/*
    2  * Copyright (c) 2021 Jiri Svoboda
     2 * Copyright (c) 2023 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    4040#include <io/kbd_event.h>
    4141#include <io/pos_event.h>
     42#include <types/common.h>
    4243
    4344struct ui_popup;
     
    5051        /** Placement rectangle close to which popup should be placed */
    5152        gfx_rect_t place;
     53        /** Input device ID associated with the popup's seat */
     54        sysarg_t idev_id;
    5255} ui_popup_params_t;
    5356
  • uspace/lib/ui/include/types/ui/window.h

    r6828a56 r5d380b6  
    8989        /** Parent rectangle for popup windows */
    9090        gfx_rect_t prect;
     91        /** Input device associated with the window's seat */
     92        sysarg_t idev_id;
    9193} ui_wnd_params_t;
    9294
  • uspace/lib/ui/include/ui/menu.h

    r6828a56 r5d380b6  
    11/*
    2  * Copyright (c) 2022 Jiri Svoboda
     2 * Copyright (c) 2023 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    4242#include <io/pos_event.h>
    4343#include <stdbool.h>
     44#include <types/common.h>
    4445#include <types/ui/menu.h>
    4546#include <types/ui/menubar.h>
     
    5657extern void ui_menu_get_rect(ui_menu_t *, gfx_coord2_t *, gfx_rect_t *);
    5758extern char32_t ui_menu_get_accel(ui_menu_t *);
    58 extern errno_t ui_menu_open(ui_menu_t *, gfx_rect_t *);
     59extern errno_t ui_menu_open(ui_menu_t *, gfx_rect_t *, sysarg_t);
    5960extern void ui_menu_close(ui_menu_t *);
    6061extern bool ui_menu_is_open(ui_menu_t *);
  • uspace/lib/ui/include/ui/menubar.h

    r6828a56 r5d380b6  
    11/*
    2  * Copyright (c) 2022 Jiri Svoboda
     2 * Copyright (c) 2023 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    4040#include <gfx/coord.h>
    4141#include <io/pos_event.h>
     42#include <types/common.h>
    4243#include <types/ui/menubar.h>
    4344#include <types/ui/control.h>
     
    5657extern ui_evclaim_t ui_menu_bar_kbd_event(ui_menu_bar_t *, kbd_event_t *);
    5758extern ui_evclaim_t ui_menu_bar_pos_event(ui_menu_bar_t *, pos_event_t *);
    58 extern void ui_menu_bar_press_accel(ui_menu_bar_t *, char32_t);
     59extern void ui_menu_bar_press_accel(ui_menu_bar_t *, char32_t, sysarg_t);
    5960extern void ui_menu_bar_unfocus(ui_menu_bar_t *);
    6061extern void ui_menu_bar_activate(ui_menu_bar_t *);
Note: See TracChangeset for help on using the changeset viewer.