Changeset 1c6c3e1d in mainline for uspace/srv/hid/display/seat.c


Ignore:
Timestamp:
2023-10-22T17:55:33Z (15 months ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
ticket/834-toolchain-update
Children:
350ec74
Parents:
315d487 (diff), 133461c (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' into ticket

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hid/display/seat.c

    r315d487 r1c6c3e1d  
    8888        seat->client_cursor = display->cursor[dcurs_arrow];
    8989        seat->wm_cursor = NULL;
     90        seat->focus = ds_display_first_window(display);
    9091
    9192        *rseat = seat;
     
    204205
    205206        /* Find alternate window that is neither system nor minimized */
    206         nwnd = ds_window_find_alt(wnd, ~(wndf_minimized | wndf_system));
     207        nwnd = ds_window_find_prev(wnd, ~(wndf_minimized | wndf_system));
    207208
    208209        if (nwnd == NULL) {
    209210                /* Find alternate window that is not minimized */
    210                 nwnd = ds_window_find_alt(wnd, ~wndf_minimized);
     211                nwnd = ds_window_find_prev(wnd, ~wndf_minimized);
    211212        }
    212213
     
    223224        ds_window_t *nwnd;
    224225
    225         /* Find alternate window that is not a system window */
    226         nwnd = ds_window_find_alt(seat->focus, ~wndf_system);
     226        if (seat->focus != NULL) {
     227                /* Find alternate window that is not a system window */
     228                nwnd = ds_window_find_next(seat->focus, ~wndf_system);
     229        } else {
     230                /* Currently no focus. Focus topmost window. */
     231                nwnd = ds_display_first_window(seat->display);
     232        }
    227233
    228234        /* Only switch focus if there is another window */
     
    509515        wnd = ds_display_window_by_pos(seat->display, &seat->pntpos);
    510516
    511         /* Click outside popup window */
    512         if (event->type == POS_PRESS && wnd != seat->popup) {
    513                 /* Close popup window */
    514                 ds_seat_set_popup(seat, NULL);
    515         }
    516 
    517517        /* Deliver event to popup window. */
    518         if (seat->popup != NULL) {
     518        if (seat->popup != NULL && event->type != POS_PRESS) {
    519519                rc = ds_window_post_pos_event(seat->popup, event);
    520520                if (rc != EOK)
     
    540540                 * to the same window above.
    541541                 */
    542                 if (wnd != seat->popup) {
     542                if (wnd != seat->popup || event->type == POS_PRESS) {
    543543                        rc = ds_window_post_pos_event(wnd, event);
    544544                        if (rc != EOK)
     
    550550        }
    551551
     552        /* Click outside popup window */
     553        if (event->type == POS_PRESS && wnd != seat->popup) {
     554                /* Close popup window */
     555                ds_seat_set_popup(seat, NULL);
     556        }
     557
    552558        return EOK;
    553559}
Note: See TracChangeset for help on using the changeset viewer.