projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rnd-19981216-1
[rocksndiamonds.git]
/
src
/
buttons.c
diff --git
a/src/buttons.c
b/src/buttons.c
index 8148e4489c555c926ddfe74ffbdf14ca4bcc262d..cffd190bc0f5c4c93fd7511fc9e015647b915b9b 100644
(file)
--- 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]);
&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);
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)
{
}
void MapGadget(struct GadgetInfo *gi)
{
+ if (gi == NULL)
+ return;
+
gi->mapped = TRUE;
DrawGadget(gi, (gi->state == GD_BUTTON_PRESSED), FALSE);
gi->mapped = TRUE;
DrawGadget(gi, (gi->state == GD_BUTTON_PRESSED), FALSE);
-
- redraw_mask |= REDRAW_ALL;
}
void UnmapGadget(struct GadgetInfo *gi)
{
}
void UnmapGadget(struct GadgetInfo *gi)
{
+ if (gi == NULL)
+ return;
+
gi->mapped = FALSE;
}
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;
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);
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->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)
DrawGadget(gi, FALSE, TRUE);
if (gi->event_mask & GD_EVENT_RELEASED)