Re: prevent UIAgent with floating NSPanel stealing focus?

2015-03-16 Thread has

On 16/03/2015 22:02, Ken Thomases wrote:

On Mar 16, 2015, at 4:50 PM, has  wrote:


Quick question as I'm guessing the answer is "no", but I've a UIAgent that 
floats an NSPanel above other apps and I'm wondering if there's any way to avoid 1. 
having to click not once but twice to put the cursor in a text field when the panel isn't 
already active, and 2. prevent the next app - in this case Adobe Illustrator - losing all 
focus which causes all of its own panels to vanish?

For issue 2, include NSNonactivatingPanelMask in the panel's style mask or, in 
IB, enable Non Activating in the Attributes inspector for the panel.


Issue 2 fixed. Woot!


That may also fix issue 1, but I'm not sure.


It doesn't, but it's definitely a start. Just having AI stay in focus 
throughout makes the click-and-click-again window hopping a lot less 
disconcerting.



You may also want to experiment with setting the panel's becomesKeyOnlyIfNeeded 
property, although that's more for panels which don't have many text fields.

Another possible fix for issue 1 is to use a custom subclass of NSTextField 
which overrides -acceptsFirstMouse:, calls through to super (just in case it 
does something important), and then returns YES regardless of what the super 
implementation returned.



Thanks, I'll give it a poke later and see what happens.

has
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: prevent UIAgent with floating NSPanel stealing focus?

2015-03-16 Thread Ken Thomases
On Mar 16, 2015, at 4:50 PM, has  wrote:

> Quick question as I'm guessing the answer is "no", but I've a UIAgent that 
> floats an NSPanel above other apps and I'm wondering if there's any way to 
> avoid 1. having to click not once but twice to put the cursor in a text field 
> when the panel isn't already active, and 2. prevent the next app - in this 
> case Adobe Illustrator - losing all focus which causes all of its own panels 
> to vanish?

For issue 2, include NSNonactivatingPanelMask in the panel's style mask or, in 
IB, enable Non Activating in the Attributes inspector for the panel.

That may also fix issue 1, but I'm not sure.

You may also want to experiment with setting the panel's becomesKeyOnlyIfNeeded 
property, although that's more for panels which don't have many text fields.

Another possible fix for issue 1 is to use a custom subclass of NSTextField 
which overrides -acceptsFirstMouse:, calls through to super (just in case it 
does something important), and then returns YES regardless of what the super 
implementation returned.

Regards,
Ken


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

prevent UIAgent with floating NSPanel stealing focus?

2015-03-16 Thread has

Hi all,

Quick question as I'm guessing the answer is "no", but I've a UIAgent 
that floats an NSPanel above other apps and I'm wondering if there's any 
way to avoid 1. having to click not once but twice to put the cursor in 
a text field when the panel isn't already active, and 2. prevent the 
next app - in this case Adobe Illustrator - losing all focus which 
causes all of its own panels to vanish? [1]


(I realize I could probably implement my NSPanel as a ObjC++ plugin 
which runs within the Illustrator process, but I'd rather not inject my 
own code into AI if possible as it's crashy enough without my shoddy C* 
code destabilizing it further.)


Thanks,

has

[1] Screen recording if it helps illustrate the problem: 
 (22MB)

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com