libs-gui icon indicating copy to clipboard operation
libs-gui copied to clipboard

NSImageView acceptsFirstResponder while it should not

Open rmottola opened this issue 3 years ago • 3 comments

I found out that a custom NSImageView inside a scrollview "eats" copy&paste events because it accepts the first responder instead of the window/document containing it. On Mac instead it works. A first way to proof that is on GNUstep to override in the custom view acceptsFirstResponder and return NO.

Further analysis shows that this comes actually from the NSControl getting the responder property from the cell. So, the workaround can be reduced to [[self selectedCell] setRefusesFirstResponder:YES];

Now I think that either the initialization of NSCell is itself wrong or GORM is instantiating it wrong (where wrong means different from Mac).

rmottola avatar Mar 15 '22 23:03 rmottola

an NSImageCell instantiated on Mac returns refusesFirstResponder YES while on GNUstep it is NO. On Mac this happens for both an code instantiated NSImageCell as well as one inside an NSImageView instantiated with IB. So, I think this is a hint for a wrong GUI default value, not an IB vs. GORM initialization thing.

Now the question is at which level of the NSImageCell hiearchy the value is wrong?

rmottola avatar Mar 18 '22 00:03 rmottola

Furthermore I checked on Mac acceptsFirstResponder: NSCell : NO NSActionCell: NO NSTextFieldCell: NO NSButtonCell: NO NSImageCell: YES

rmottola avatar Mar 18 '22 21:03 rmottola

I made further tests on initWithImageCell. NSImageCell initWithImageCell : acceptsFirstResponder YES NSCell initWithImageCell : acceptsFirstResponder NO

I will rework on this.

rmottola avatar Mar 21 '22 08:03 rmottola

Looks like this was fixed on 22th of May by yourself

fredkiefer avatar Sep 07 '22 19:09 fredkiefer