summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXMouseEvent.c
diff options
context:
space:
mode:
Diffstat (limited to 'macosx/tkMacOSXMouseEvent.c')
-rw-r--r--macosx/tkMacOSXMouseEvent.c35
1 files changed, 20 insertions, 15 deletions
diff --git a/macosx/tkMacOSXMouseEvent.c b/macosx/tkMacOSXMouseEvent.c
index 6a18426..150519c 100644
--- a/macosx/tkMacOSXMouseEvent.c
+++ b/macosx/tkMacOSXMouseEvent.c
@@ -156,12 +156,13 @@ TkMacOSXProcessMouseEvent(TkMacOSXEvent *eventPtr, MacEventStatus * statusPtr)
medPtr->state |= Mod2Mask; /* option key */
}
if (eventPtr->eKind == kEventMouseDown
- || eventPtr->eKind== kEventMouseDragged ) {
+ || eventPtr->eKind == kEventMouseDragged ) {
EventMouseButton mouseButton;
- if ((status=GetEventParameter(eventPtr->eventRef,
- kEventParamMouseButton,
- typeMouseButton, NULL,
- sizeof(mouseButton), NULL,&mouseButton)) != noErr ) {
+ status = GetEventParameter(eventPtr->eventRef,
+ kEventParamMouseButton,
+ typeMouseButton, NULL,
+ sizeof(mouseButton), NULL,&mouseButton);
+ if (status != noErr ) {
fprintf (stderr, "Failed to retrieve mouse button, %d\n", status);
statusPtr->err = 1;
return 0;
@@ -169,7 +170,7 @@ TkMacOSXProcessMouseEvent(TkMacOSXEvent *eventPtr, MacEventStatus * statusPtr)
medPtr->state |= 1 << ((mouseButton-1)+8);
}
- medPtr->windowPart= FindWindow(where, &medPtr->whichWin);
+ medPtr->windowPart = FindWindow(where, &medPtr->whichWin);
window = TkMacOSXGetXWindow(medPtr->whichWin);
if (medPtr->whichWin != NULL && window == None) {
return 0;
@@ -193,10 +194,11 @@ TkMacOSXProcessMouseEvent(TkMacOSXEvent *eventPtr, MacEventStatus * statusPtr)
window, medPtr->state);
}
if (eventPtr->eKind == kEventMouseWheelMoved) {
- if ((status=GetEventParameter(eventPtr->eventRef,
- kEventParamMouseWheelDelta,
- typeLongInteger, NULL,
- sizeof(medPtr->delta), NULL,&medPtr->delta)) != noErr ) {
+ status = GetEventParameter(eventPtr->eventRef,
+ kEventParamMouseWheelDelta,
+ typeLongInteger, NULL,
+ sizeof(medPtr->delta), NULL,&medPtr->delta);
+ if (status != noErr ) {
fprintf (stderr,
"Failed to retrieve mouse wheel delta, %d\n", status);
statusPtr->err = 1;
@@ -233,23 +235,26 @@ TkMacOSXProcessMouseEvent(TkMacOSXEvent *eventPtr, MacEventStatus * statusPtr)
}
}
- if (medPtr->whichWin && eventPtr->eKind==kEventMouseDown) {
+ if (medPtr->whichWin && eventPtr->eKind == kEventMouseDown) {
ProcessSerialNumber frontPsn, ourPsn;
Boolean flag;
- if ((err=GetFrontProcess(&frontPsn))!=noErr) {
+ err = GetFrontProcess(&frontPsn);
+ if (err != noErr) {
fprintf(stderr, "GetFrontProcess failed, %d\n", err);
statusPtr->err = 1;
return 1;
}
GetCurrentProcess(&ourPsn);
- if ((err=SameProcess(&frontPsn, &ourPsn, &flag))!=noErr) {
+ err = SameProcess(&frontPsn, &ourPsn, &flag);
+ if (err != noErr) {
fprintf(stderr, "SameProcess failed, %d\n", err);
statusPtr->err = 1;
return 1;
} else {
if (!flag) {
- if ((err=SetFrontProcess(&ourPsn)) != noErr) {
+ err = SetFrontProcess(&ourPsn);
+ if (err != noErr) {
fprintf(stderr,"SetFrontProcess failed,%d\n", err);
statusPtr->err = 1;
return 1;
@@ -484,7 +489,7 @@ HandleInCollapse(WindowRef win)
static int
GeneratePollingEvents(MouseEventData * medPtr)
{
- Tk_Window tkwin, rootwin, grabWin, topPtr;
+ Tk_Window tkwin, rootwin, grabWin;
Window window;
int local_x, local_y;
TkDisplay *dispPtr;