Changes in uspace/srv/hid/display/seat.c [e3997a8:1543d4c] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/display/seat.c
re3997a8 r1543d4c 1 1 /* 2 * Copyright (c) 202 4Jiri Svoboda2 * Copyright (c) 2023 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 *pwindow; 513 ds_window_t *cwindow; 512 ds_window_t *wnd; 514 513 errno_t rc; 515 514 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 different526 * from pwindow527 */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) {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) { 536 535 /* Moving over a window */ 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; 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 } 542 547 } else { 543 548 /* Not over a window */ 544 ds_seat_set_client_cursor(seat, 545 seat->display->cursor[dcurs_arrow]); 549 ds_seat_set_client_cursor(seat, seat->display->cursor[dcurs_arrow]); 546 550 } 547 551 548 552 /* Click outside popup window */ 549 if (event->type == POS_PRESS && pwindow!= seat->popup) {553 if (event->type == POS_PRESS && wnd != seat->popup) { 550 554 /* Close popup window */ 551 555 ds_seat_set_popup(seat, NULL);
Note:
See TracChangeset
for help on using the changeset viewer.