Changes in uspace/lib/ui/src/popup.c [d7f82635:d92b8e8f] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ui/src/popup.c
rd7f82635 rd92b8e8f 1 1 /* 2 * Copyright (c) 202 1Jiri Svoboda2 * Copyright (c) 2024 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 36 36 #include <errno.h> 37 37 #include <gfx/context.h> 38 //#include <io/kbd_event.h>38 #include <io/kbd_event.h> 39 39 #include <io/pos_event.h> 40 40 #include <mem.h> … … 47 47 48 48 static void ui_popup_window_close(ui_window_t *, void *); 49 static void ui_popup_window_kbd(ui_window_t *, void *, kbd_event_t *); 49 50 static void ui_popup_window_pos(ui_window_t *, void *, pos_event_t *); 50 51 51 52 static ui_window_cb_t ui_popup_window_cb = { 52 53 .close = ui_popup_window_close, 54 .kbd = ui_popup_window_kbd, 53 55 .pos = ui_popup_window_pos 54 56 }; … … 96 98 wparams.style &= ~ui_wds_decorated; 97 99 wparams.placement = ui_wnd_place_popup; 98 wparams.flags |= ui_wndf_popup; 100 wparams.flags |= ui_wndf_popup | ui_wndf_topmost; 101 wparams.idev_id = params->idev_id; 99 102 100 103 /* Compute position of parent rectangle relative to the screen */ … … 187 190 } 188 191 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 189 202 /** Handle close event in popup window. 190 203 * … … 200 213 } 201 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); 231 } 232 202 233 /** Handle position event in popup window. 203 234 * … … 211 242 ui_popup_t *popup = (ui_popup_t *)arg; 212 243 244 /* Remember ID of device that sent the last event */ 245 popup->idev_id = event->pos_id; 246 213 247 if (popup->cb != NULL && popup->cb->pos != NULL) 214 248 popup->cb->pos(popup, popup->arg, event);
Note:
See TracChangeset
for help on using the changeset viewer.