0
votes

I'm looking for a way how to detect click on NSWindow title bar using Accessibility.

I've implemented observer to get clicks, I'm able to get clicked window, it's origin, size or role + subrole. But is there any way how to be sure I clicked on the title bar, the one used to drag windows?

Cheers

enter image description here

1
Is the window title bar something like a view, a group or a toolbar in the Accessibility Inspector? Do you want to detect window dragging?Willeke
I want to detect just a click on title bar any of the windows. I was checking role (using kAXRoleAttribute) and subrole. And sometimes the title bar contains toolbar (e.g. Finder), or groups (e.g. AppStore), but not "covering" the whole titleMartin Pilch

1 Answers

0
votes

In case anyone is interested I found solution good enough for me.

I check if user clicked within 40 pixels from top of the window and if the role of clicked element is one of the following: AXToolbar, AXSplitGroup, AXGroup, AXScrollArea, AXWindow