Mercurial > minori
comparison dep/animone/src/win/quartz.cc @ 337:a7d4e5107531
dep/animone: REFACTOR ALL THE THINGS
1: animone now has its own syntax divergent from anisthesia,
making different platforms actually have their own sections
2: process names in animone are now called `comm' (this will
probably break things). this is what its called in bsd/linux
so I'm just going to use it everywhere
3: the X11 code now checks for the existence of a UTF-8 window title
and passes it if available
4: ANYTHING THATS NOT LINUX IS 100% UNTESTED AND CAN AND WILL BREAK!
I still actually need to test the bsd code. to be honest I'm probably
going to move all of the bsds into separate files because they're
all essentially different operating systems at this point
author | Paper <paper@paper.us.eu.org> |
---|---|
date | Wed, 19 Jun 2024 12:51:15 -0400 |
parents | 246017a7907a |
children | adb79bdde329 |
comparison
equal
deleted
inserted
replaced
336:d260549151d6 | 337:a7d4e5107531 |
---|---|
263 CFDictionaryRef window = reinterpret_cast<CFDictionaryRef>(CFArrayGetValueAtIndex(windows, i)); | 263 CFDictionaryRef window = reinterpret_cast<CFDictionaryRef>(CFArrayGetValueAtIndex(windows, i)); |
264 if (!window) | 264 if (!window) |
265 continue; | 265 continue; |
266 | 266 |
267 Process proc; | 267 Process proc; |
268 { | 268 proc.platform = ExecutablePlatform::Xnu; |
269 CFDictionaryGetValue(window, CFSTR("kCGWindowOwnerPID"), proc.pid); | 269 CFDictionaryGetValue(window, CFSTR("kCGWindowOwnerPID"), proc.pid); |
270 if (!CFDictionaryGetValue(window, CFSTR("kCGWindowOwnerName"), proc.name)) | 270 if (!CFDictionaryGetValue(window, CFSTR("kCGWindowOwnerName"), proc.comm)) |
271 fd::GetProcessName(proc.pid, proc.name); | 271 fd::GetProcessName(proc.pid, proc.comm); |
272 } | |
273 | 272 |
274 Window win; | 273 Window win; |
275 { | 274 win.platform = WindowPlatform::Quartz; |
276 CFDictionaryGetValue(window, CFSTR("kCGWindowNumber"), win.id); | 275 CFDictionaryGetValue(window, CFSTR("kCGWindowNumber"), win.id); |
277 | 276 |
278 if (!GetProcessBundleIdentifier(proc.pid, win.class_name)) | 277 GetProcessBundleIdentifier(proc.pid, win.class_name); |
279 /* XXX is this right? */ | 278 GetWindowTitle(win.id, proc.pid, win.text); |
280 CFDictionaryGetValue(window, CFSTR("kCGWindowName"), win.class_name); | |
281 | |
282 GetWindowTitle(win.id, proc.pid, win.text); | |
283 } | |
284 | 279 |
285 if (!window_proc(proc, win)) { | 280 if (!window_proc(proc, win)) { |
286 CFRelease(windows); | 281 CFRelease(windows); |
287 return false; | 282 return false; |
288 } | 283 } |