Changeset b4b4dafe in mainline for uspace/srv/hid/display/seat.c
- Timestamp:
- 2021-06-03T14:02:59Z (3 years ago)
- Children:
- 2e6394e
- Parents:
- 6baab83
- git-author:
- Jiri Svoboda <jiri@…> (2021-06-02 17:00:03)
- git-committer:
- Jiri Svoboda <jiri@…> (2021-06-03 14:02:59)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/display/seat.c
r6baab83 rb4b4dafe 1 1 /* 2 * Copyright (c) 20 19Jiri Svoboda2 * Copyright (c) 2021 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 106 106 } 107 107 108 /** Evacuate focus from window. 108 /** Set seat popup window. 109 * 110 * @param seat Seat 111 * @param wnd Popup window 112 */ 113 void ds_seat_set_popup(ds_seat_t *seat, ds_window_t *wnd) 114 { 115 seat->popup = wnd; 116 } 117 118 /** Evacuate seat references to window. 109 119 * 110 120 * If seat's focus is @a wnd, it will be set to a different window. 121 * If seat's popup window is @a wnd, it will be set to NULL. 111 122 * 112 123 * @param seat Seat 113 124 * @param wnd Window to evacuate focus from 114 125 */ 115 void ds_seat_evac_ focus(ds_seat_t *seat, ds_window_t *wnd)126 void ds_seat_evac_wnd_refs(ds_seat_t *seat, ds_window_t *wnd) 116 127 { 117 128 ds_window_t *nwnd; … … 126 137 ds_seat_set_focus(seat, nwnd); 127 138 } 139 140 if (seat->popup == wnd) 141 seat->popup = NULL; 128 142 } 129 143 … … 168 182 } 169 183 170 dwindow = seat->focus; 184 dwindow = seat->popup; 185 if (dwindow == NULL) 186 dwindow = seat->focus; 187 171 188 if (dwindow == NULL) 172 189 return EOK; … … 328 345 /* Focus window on button press */ 329 346 if (event->type == PTD_PRESS && event->btn_num == 1) { 330 if (wnd != NULL ) {347 if (wnd != NULL && (wnd->flags & wndf_popup) == 0) { 331 348 ds_seat_set_focus(seat, wnd); 332 349 } … … 410 427 411 428 wnd = ds_display_window_by_pos(seat->display, &seat->pntpos); 429 /* 430 * Deliver event to popup window, unless the pointer is over 431 * it (in which case it will be delivered to that window 432 * below, anyway. 433 */ 434 if (seat->popup != wnd && seat->popup != NULL) { 435 rc = ds_window_post_pos_event(seat->popup, event); 436 if (rc != EOK) 437 return rc; 438 } 439 412 440 if (seat->focus != wnd && seat->focus != NULL) { 413 441 rc = ds_window_post_pos_event(seat->focus, event);
Note:
See TracChangeset
for help on using the changeset viewer.