-
Notifications
You must be signed in to change notification settings - Fork 0
Extract multiple windows + dock and menu accessibilities #1
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A lot of redundancy. Fix and request review once more
for w in wins: | ||
if int(w.get("kCGWindowLayer", 0)) != 0: | ||
continue | ||
owner = (w.get("kCGWindowOwnerName") or "").strip() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
w.get("kCGWindowOwnerName") or "" -> w.get("kCGWindowOwnerName", "")
screenshot_tmp_file.close() | ||
|
||
|
||
import macapptree.screenshot_app_window as screenshot_app_window |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be in the top
# "window_info": win, | ||
# "tree": tree.to_dict() | ||
# }) | ||
# return trees |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete redundant comments
|
||
|
||
|
||
if __name__ == "__main__": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is it here?
except Exception: | ||
pass | ||
|
||
import subprocess, AppKit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To the top again
return pid_to_bundle, bundle_to_app | ||
|
||
|
||
def get_visible_windows_for_bundles(bundle_ids: List[str]) -> List[Dict]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is it in this module?
self.visible = False | ||
if self.visible_bbox: | ||
vx1, vy1, vx2, vy2 = self.visible_bbox | ||
self.visible = (vx2 > vx1) and (vy2 > vy1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is already checked in the _set_bboxes
if not vb: | ||
return False | ||
x1, y1, x2, y2 = vb | ||
return (x2 > x1) and (y2 > y1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
again?
return segment_image_path | ||
|
||
|
||
def _is_visible(elem) -> bool: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better make it a property of an object
# open the image and create a drawer | ||
draw = image_drawer | ||
image = image | ||
img = image |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why?
Also, add in readme how to use your feature |
Example of screen with dock + upper menu accessibility:
