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

Snap command do not work since December 2024 #1684

Closed
ekuiter opened this issue Jan 15, 2025 · 3 comments · Fixed by #1685
Closed

Snap command do not work since December 2024 #1684

ekuiter opened this issue Jan 15, 2025 · 3 comments · Fixed by #1685

Comments

@ekuiter
Copy link

ekuiter commented Jan 15, 2025

windows_snap.py contains the following updated logic to snap a window to a position:

        if position_name in _snap_positions:
            position = _snap_positions[position_name]
        else:
            # Previously this function took a spoken form, but we now have constant identifiers in `_snap_positions`.
            # If the user passed a previous spoken form instead, see if we can convert it to the new identifier.
            new_key = actions.user.formatted_text(position_name, "ALL_CAPS,SNAKE_CASE")
            if new_key in _snap_positions:
                actions.user.deprecate_action(
                    "2024-12-02",
                    f"snap_window_to_position('{position_name}')",
                    f"snap_window_to_position('{new_key}')",
                )
                position = _snap_positions[new_key]
                actions.user.snap_window(position, window)
            else:
                raise KeyError(position_name)

Unfortunately, this code does nothing since the old snap positions have been deprecated (snap_ window is only called in the else case).

@ekuiter
Copy link
Author

ekuiter commented Jan 15, 2025

(Workaround is to still use the old snap positions, and ignore the deprecation warning)

@jaresty
Copy link
Contributor

jaresty commented Jan 15, 2025

FWIW, this is fixed in #1578

@jaresty
Copy link
Contributor

jaresty commented Jan 15, 2025

I opened a pull request for just this fix: #1685

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 a pull request may close this issue.

2 participants