Changeset a2f173b in mainline for uspace/lib/ui/src/wdecor.c


Ignore:
Timestamp:
2020-10-21T21:49:13Z (4 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
58a67050
Parents:
172188a
Message:

Improve close button event routing

Button event processing routine is the best place to determine whether
the event goes to the button or not. It can also 'grab' button release
events simply by claiming them.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/ui/src/wdecor.c

    r172188a ra2f173b  
    280280        gfx_coord2_t pos;
    281281        ui_wdecor_geom_t geom;
     282        ui_evclaim_t claim;
    282283
    283284        pos.x = event->hpos;
     
    286287        ui_wdecor_get_geom(wdecor, &geom);
    287288
    288         if (gfx_pix_inside_rect(&pos, &geom.btn_close_rect)) {
    289                 ui_pbutton_pos_event(wdecor->btn_close, event);
     289        claim = ui_pbutton_pos_event(wdecor->btn_close, event);
     290        if (claim == ui_claimed)
    290291                return;
    291         }
    292292
    293293        if (event->type == POS_PRESS &&
Note: See TracChangeset for help on using the changeset viewer.