Changeset fb420e48 in mainline for uspace/srv/hid/display/display.c


Ignore:
Timestamp:
2019-12-16T13:47:33Z (6 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8e9781f
Parents:
c2250702
git-author:
Jiri Svoboda <jiri@…> (2019-12-15 13:47:28)
git-committer:
Jiri Svoboda <jiri@…> (2019-12-16 13:47:33)
Message:

Use window dimensions for picking window to focus

File:
1 edited

Legend:

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

    rc2250702 rfb420e48  
    172172{
    173173        ds_window_t *wnd;
     174        gfx_rect_t drect;
    174175
    175176        wnd = ds_display_first_window(display);
    176177        while (wnd != NULL) {
    177                 // XXX Need to know window dimensions
    178                 if (pos->x >= wnd->dpos.x && pos->y >= wnd->dpos.y &&
    179                     pos->x <= wnd->dpos.x + 100 && pos->y <= wnd->dpos.y + 100) {
     178                /* Window bounding rectangle on display */
     179                gfx_rect_translate(&wnd->dpos, &wnd->rect, &drect);
     180
     181                if (gfx_pix_inside_rect(pos, &drect))
    180182                        return wnd;
    181                 }
    182183
    183184                wnd = ds_display_next_window(wnd);
Note: See TracChangeset for help on using the changeset viewer.