rem: if (tPtr->flags.enabled)
add: if (tPtr->flags.enabled && tPtr->flags.focused)
context: handleTextFieldActionEvents(XEvent *event, void *data){    TextField *tPtr = (TextField*)data;        CHECK_CLASS(data, WC_TextField);    switch (event->type) {     case KeyPress:	if (tPtr->flags.enabled)	    handleTextFieldKeyPress(tPtr, event);	break;     case MotionNotify:	if (tPtr->flags.enabled && (event->xmotion.state & Button1Mask)) {	    if (!tPtr->selection.count) {		tPtr->selection.position = tPtr->cursorPosition;	    }	    tPtr->cursorPosition = pointToCursorPosition(tPtr,							 event->xmotion.x);	    tPtr->selection.count = tPtr->cursorPosition 		- tPtr->selection.position;	    paintTextField(tPtr);	}	break;     case ButtonPress:	if (tPtr->flags.enabled && !tPtr->flags.focused) {	    WMSetFocusToWidget(tPtr);	    tPtr->cursorPosition = pointToCursorPosition(tPtr, 							 event->xbutton.x);	    paintTextField(tPtr);	} else if (tPtr->flags.focused) {	    tPtr->cursorPosition = pointToCursorPosition(tPtr, 							 event->xbutton.x);	    tPtr->selection.count = 0;	    paintTextField(tPtr);	}	if (event->xbutton.button == Button2 && tPtr->flags.enabled) {	    char *text;	    text = W_GetTextSelection(tPtr->view->screen,				      tPtr->view->screen->clipboardAtom);	    if (!text) {		text = W_GetTextSelection(tPtr->view->screen, XA_CUT_BUFFER0);	    }	    if (text) {		WMInsertTextFieldText(tPtr, text, tPtr->cursorPosition);		XFree(text);		WMPostNotificationName(WMTextDidChangeNotification, tPtr, 				       NULL);	    }	}	break;     case ButtonRelease:	break;    }}