Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get window owner's (application) name with kCGWindowOwnerName in case kCGWindowName fails #8

Closed
wants to merge 2 commits into from

Conversation

omerdn1
Copy link

@omerdn1 omerdn1 commented Aug 9, 2022

Hey, so you might've noticed while testing kCGWindowName, that it doesn't provide the window's name for some applications.
I did some digging and apparently, it's a common thing in MacOS applications because they have to set this field directly in XQuartz for it to be available.

I fixed this problem by resulting to using the window owner's name when kCGWindowName fails.

A question that arises, since I'm exclusively on mac, is what is the actual title field referring to in your implementation on linux and windows. If it's referring to the application name rather than the window name, then you might just want to remove the use of kCGWindowName altogether.

@dimusic
Copy link
Owner

dimusic commented Aug 11, 2022

Hey, thanks for your input!

I'm not sure if you've seen the comment I left in #6 as I didn't tag you directly, I mentioned I want to output both kCGWindowName and kCGWindowOwnerName eventually.
The current implementation for windows and linux returns window title the same way as the kCGWindowName does.

I've made a few more changes to the branch it's been working fine for me during testing. I'm going to merge it without your change right now but I will add kCGWindowOwnerName next so this is still useful.

Thanks!

@dimusic dimusic closed this Aug 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants