|
From: | Andreas Höschler |
Subject: | Re: GUI incompatibility |
Date: | Wed, 13 May 2020 23:52:56 +0200 |
Hi Fred, thanks for pointing me into the right direction. I got this figured out in the meanwhile. You do - (void) sendEvent: (NSEvent*)theEvent { ... if (_lastLeftMouseDownView) { DESTROY(_lastLeftMouseDownView); } // Don't make buttons first responder otherwise they cannot // send actions to the current first responder. // TODO: First responder status update would more cleanly // handled by -mouseDown in each control subclass (Mac OS X // seems to do that). if (_firstResponder != v && ![v isKindOfClass: [NSButton class]]) { // Only try to set first responder, when the view wants it. if ([v acceptsFirstResponder] && ![self makeFirstResponder: v]) { NSLog(@"Leaving early"); return; } } if (wasKey == YES || [v acceptsFirstMouse: theEvent] == YES) { if ([NSHelpManager isContextHelpModeActive]) { [v helpRequested: theEvent]; } else { ASSIGN(_lastLeftMouseDownView, v); if (toolTipVisible != nil) { /* Inform the tooltips system that we have had * a mouse down so it should stop displaying. */ [toolTipVisible mouseDown: theEvent]; } [v mouseDown: theEvent]; } } else { [self mouseDown: theEvent]; } } else { NSDebugLLog(@"NSEvent", @"Discard (window closed) %@", theEvent); } _lastPoint = [theEvent locationInWindow]; ... } I understand the idea behind this part if (_firstResponder != v && ![v isKindOfClass: [NSButton class]]) { // Only try to set first responder, when the view wants it. if ([v acceptsFirstResponder] && ![self makeFirstResponder: v]) { NSLog(@"Leaving early"); return; } } but would suggest that this is not entirely correct. My FormTextField refuses to become first responder on purpose but nevertheless relies on seeing a mouseDown: call. I use that to activate an inspector. At another place in the code this mouseDown: is needed to initiate a drag operation to drag the gui element around. Cocoa does this correctly IMHO (sends the mouseDown:). I could fix the problem under GNUstep by simply commenting out /* if (_firstResponder != v && ![v isKindOfClass: [NSButton class]]) { // Only try to set first responder, when the view wants it. if ([v acceptsFirstResponder] && ![self makeFirstResponder: v]) { return; } } */ Does anything speak against submitting this change into the public tree? Thanks, Andreas
|
[Prev in Thread] | Current Thread | [Next in Thread] |