Changeset e3997a8 in mainline
- Timestamp:
- 2024-06-29T10:37:43Z (7 months ago)
- Branches:
- master
- Children:
- dc5647e
- Parents:
- af3235d
- git-author:
- Jiri Svoboda <jiri@…> (2024-06-29 10:27:24)
- git-committer:
- Jiri Svoboda <jiri@…> (2024-06-29 10:37:43)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/display/seat.c
raf3235d re3997a8 1 1 /* 2 * Copyright (c) 202 3Jiri Svoboda2 * Copyright (c) 2024 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 510 510 errno_t ds_seat_post_pos_event(ds_seat_t *seat, pos_event_t *event) 511 511 { 512 ds_window_t *wnd; 512 ds_window_t *pwindow; 513 ds_window_t *cwindow; 513 514 errno_t rc; 514 515 515 wnd = ds_display_window_by_pos(seat->display, &seat->pntpos);516 517 /* Deliver event to popup window. */ 518 if (seat->popup != NULL && event->type != POS_PRESS) {519 rc = ds_window_post_pos_event(seat->popup, event);520 if (rc != EOK)521 return rc;522 } 523 524 if (seat->focus != wnd && seat->focus != NULL) {525 rc = ds_window_post_pos_event(seat->focus, event);526 if (rc != EOK)527 return rc;528 529 /* Only deliver release events to the focused window */530 if ( event->type == POS_RELEASE)531 return EOK;532 } 533 534 if ( wnd!= NULL) {516 /* Window under pointer */ 517 pwindow = ds_display_window_by_pos(seat->display, &seat->pntpos); 518 519 /* Current window: popup or focused */ 520 cwindow = seat->popup; 521 if (cwindow == NULL) 522 cwindow = seat->focus; 523 524 /* 525 * Deliver move and release event to current window if different 526 * from pwindow 527 */ 528 if (event->type != POS_PRESS && cwindow != NULL && 529 cwindow != pwindow) { 530 rc = ds_window_post_pos_event(cwindow, event); 531 if (rc != EOK) 532 return rc; 533 } 534 535 if (pwindow != NULL) { 535 536 /* Moving over a window */ 536 ds_seat_set_client_cursor(seat, wnd->cursor); 537 538 /* 539 * Only deliver event if we didn't already deliver it 540 * to the same window above. 541 */ 542 if (wnd != seat->popup || event->type == POS_PRESS) { 543 rc = ds_window_post_pos_event(wnd, event); 544 if (rc != EOK) 545 return rc; 546 } 537 ds_seat_set_client_cursor(seat, pwindow->cursor); 538 539 rc = ds_window_post_pos_event(pwindow, event); 540 if (rc != EOK) 541 return rc; 547 542 } else { 548 543 /* Not over a window */ 549 ds_seat_set_client_cursor(seat, seat->display->cursor[dcurs_arrow]); 544 ds_seat_set_client_cursor(seat, 545 seat->display->cursor[dcurs_arrow]); 550 546 } 551 547 552 548 /* Click outside popup window */ 553 if (event->type == POS_PRESS && wnd!= seat->popup) {549 if (event->type == POS_PRESS && pwindow != seat->popup) { 554 550 /* Close popup window */ 555 551 ds_seat_set_popup(seat, NULL);
Note:
See TracChangeset
for help on using the changeset viewer.