Changeset 5f483be in mainline


Ignore:
Timestamp:
2020-05-24T20:38:57Z (5 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d8e2485
Parents:
b3b00b6
Message:

Do not deliver events that triggered WM actions to the client

This could cause e.g. false button press.

File:
1 edited

Legend:

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

    rb3b00b6 r5f483be  
    471471            (int) pos->x, (int) pos->y);
    472472
    473         if (wnd->state != dsw_moving)
    474                 return;
     473        assert(wnd->state == dsw_moving);
    475474
    476475        gfx_coord2_subtract(pos, &wnd->orig_pos, &dmove);
     
    500499            (int) pos->x, (int) pos->y);
    501500
    502         if (wnd->state != dsw_moving)
    503                 return;
     501        assert(wnd->state == dsw_moving);
    504502
    505503        gfx_rect_translate(&wnd->preview_pos, &wnd->rect, &drect);
     
    569567            (int) pos->x, (int) pos->y);
    570568
    571         if (wnd->state != dsw_resizing)
    572                 return;
     569        assert(wnd->state == dsw_resizing);
    573570
    574571        (void) ds_display_paint(wnd->display, NULL);
     
    604601            (int) pos->x, (int) pos->y);
    605602
    606         if (wnd->state != dsw_resizing)
    607                 return;
     603        assert(wnd->state == dsw_resizing);
    608604
    609605        gfx_rect_translate(&wnd->dpos, &wnd->preview_rect, &drect);
     
    672668        inside = gfx_pix_inside_rect(&pos, &drect);
    673669
    674         if (event->type == POS_PRESS && event->btn_num == 2 && inside)
     670        if (event->type == POS_PRESS && event->btn_num == 2 && inside) {
    675671                ds_window_start_move(wnd, &pos);
     672                return EOK;
     673        }
    676674
    677675        if (event->type == POS_RELEASE) {
    678                 ds_window_finish_move(wnd, &pos);
    679                 ds_window_finish_resize(wnd, &pos);
     676                if (wnd->state == dsw_moving) {
     677                        ds_window_finish_move(wnd, &pos);
     678                        return EOK;
     679                }
     680
     681                if (wnd->state == dsw_resizing) {
     682                        ds_window_finish_resize(wnd, &pos);
     683                        return EOK;
     684                }
    680685        }
    681686
    682687        if (event->type == POS_UPDATE) {
    683                 ds_window_update_move(wnd, &pos);
    684                 ds_window_update_resize(wnd, &pos);
     688                if (wnd->state == dsw_moving) {
     689                        ds_window_update_move(wnd, &pos);
     690                        return EOK;
     691                }
     692
     693                if (wnd->state == dsw_resizing) {
     694                        ds_window_update_resize(wnd, &pos);
     695                        return EOK;
     696                }
    685697        }
    686698
Note: See TracChangeset for help on using the changeset viewer.