Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/ui/src/popup.c

    rd92b8e8f rd7f82635  
    11/*
    2  * Copyright (c) 2024 Jiri Svoboda
     2 * Copyright (c) 2021 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    3636#include <errno.h>
    3737#include <gfx/context.h>
    38 #include <io/kbd_event.h>
     38//#include <io/kbd_event.h>
    3939#include <io/pos_event.h>
    4040#include <mem.h>
     
    4747
    4848static void ui_popup_window_close(ui_window_t *, void *);
    49 static void ui_popup_window_kbd(ui_window_t *, void *, kbd_event_t *);
    5049static void ui_popup_window_pos(ui_window_t *, void *, pos_event_t *);
    5150
    5251static ui_window_cb_t ui_popup_window_cb = {
    5352        .close = ui_popup_window_close,
    54         .kbd = ui_popup_window_kbd,
    5553        .pos = ui_popup_window_pos
    5654};
     
    9896        wparams.style &= ~ui_wds_decorated;
    9997        wparams.placement = ui_wnd_place_popup;
    100         wparams.flags |= ui_wndf_popup | ui_wndf_topmost;
    101         wparams.idev_id = params->idev_id;
     98        wparams.flags |= ui_wndf_popup;
    10299
    103100        /* Compute position of parent rectangle relative to the screen */
     
    190187}
    191188
    192 /** Get ID of device that sent the last position event.
    193  *
    194  * @param popup Popup window
    195  * @return Input device ID
    196  */
    197 sysarg_t ui_popup_get_idev_id(ui_popup_t *popup)
    198 {
    199         return popup->idev_id;
    200 }
    201 
    202189/** Handle close event in popup window.
    203190 *
     
    211198        if (popup->cb != NULL && popup->cb->close != NULL)
    212199                popup->cb->close(popup, popup->arg);
    213 }
    214 
    215 /** Handle keyboard event in popup window.
    216  *
    217  * @param window Window
    218  * @param arg Argument (ui_popup_t *)
    219  * @param event Keyboard event
    220  */
    221 static void ui_popup_window_kbd(ui_window_t *window, void *arg,
    222     kbd_event_t *event)
    223 {
    224         ui_popup_t *popup = (ui_popup_t *)arg;
    225 
    226         /* Remember ID of device that sent the last event */
    227         popup->idev_id = event->kbd_id;
    228 
    229         if (popup->cb != NULL && popup->cb->kbd != NULL)
    230                 popup->cb->kbd(popup, popup->arg, event);
    231200}
    232201
     
    242211        ui_popup_t *popup = (ui_popup_t *)arg;
    243212
    244         /* Remember ID of device that sent the last event */
    245         popup->idev_id = event->pos_id;
    246 
    247213        if (popup->cb != NULL && popup->cb->pos != NULL)
    248214                popup->cb->pos(popup, popup->arg, event);
Note: See TracChangeset for help on using the changeset viewer.