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

FreeBSD compatibility patch #639

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions normcap/screengrab/permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,9 @@ def has_screenshot_permission() -> bool:
logger.debug("Checking screenshot permission")
if sys.platform == "darwin":
return _macos_has_screenshot_permission()
if sys.platform == "linux" and not system_info.has_wayland_display_manager():
if (sys.platform == "linux" or sys.platform.startswith("freebsd")) and not system_info.has_wayland_display_manager():
dynobo marked this conversation as resolved.
Show resolved Hide resolved
return True
if sys.platform == "linux" and system_info.has_wayland_display_manager():
if (sys.platform == "linux" or sys.platform.startswith("freebsd")) and system_info.has_wayland_display_manager():
return _dbus_portal_has_screenshot_permission()
if sys.platform == "win32":
return True
Expand All @@ -242,14 +242,14 @@ def request_screenshot_permission(
)
return

if sys.platform == "linux" and not system_info.has_wayland_display_manager():
if (sys.platform == "linux" or sys.platform.startswith("freebsd")) and not system_info.has_wayland_display_manager():
logger.debug(
"Not necessary to request screenshot permission on Linux, if the "
"display manager is not Wayland. Skipping."
)
return

if sys.platform == "linux" and system_info.has_wayland_display_manager():
if (sys.platform == "linux" or sys.platform.startswith("freebsd")) and system_info.has_wayland_display_manager():
logger.debug("Show request permission dialog.")
dbus_portal_show_request_permission_dialog(
title=dialog_title, text=linux_dialog_text
Expand Down