X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fbuttons.c;h=cffd190bc0f5c4c93fd7511fc9e015647b915b9b;hb=c5728b1ebc2a1d3753a6eea5a0f6335d077eef6b;hp=8148e4489c555c926ddfe74ffbdf14ca4bcc262d;hpb=4ec434ee1acb955d0e2e8c33558e5f9226904174;p=rocksndiamonds.git diff --git a/src/buttons.c b/src/buttons.c index 8148e448..cffd190b 100644 --- a/src/buttons.c +++ b/src/buttons.c @@ -1659,21 +1659,31 @@ static void DrawGadget(struct GadgetInfo *gi, boolean pressed, boolean direct) &gi->alt_design[state] : &gi->design[state]); - XCopyArea(display, gd->pixmap, (direct ? window : drawto), gc, + XCopyArea(display, gd->pixmap, drawto, gc, gd->x, gd->y, gi->width, gi->height, gi->x, gi->y); + + if (direct) + XCopyArea(display, gd->pixmap, window, gc, + gd->x, gd->y, gi->width, gi->height, gi->x, gi->y); + else + redraw_mask |= REDRAW_ALL; } void MapGadget(struct GadgetInfo *gi) { + if (gi == NULL) + return; + gi->mapped = TRUE; DrawGadget(gi, (gi->state == GD_BUTTON_PRESSED), FALSE); - - redraw_mask |= REDRAW_ALL; } void UnmapGadget(struct GadgetInfo *gi) { + if (gi == NULL) + return; + gi->mapped = FALSE; } @@ -1721,7 +1731,6 @@ void HandleGadgets(int mx, int my, int button) DrawGadget(gi, TRUE, TRUE); gi->state = GD_BUTTON_PRESSED; gi->event.type = GD_EVENT_MOVING; - gi->event.button = button; if (gi->event_mask & GD_EVENT_MOVING) gi->callback(gi); @@ -1736,7 +1745,6 @@ void HandleGadgets(int mx, int my, int button) { gi->state = GD_BUTTON_UNPRESSED; gi->event.type = GD_EVENT_RELEASED; - gi->event.button = button; DrawGadget(gi, FALSE, TRUE); if (gi->event_mask & GD_EVENT_RELEASED)