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

add herbstluftwm on linux? #24

Open
tlambert03 opened this issue Dec 24, 2024 · 0 comments · May be fixed by #25
Open

add herbstluftwm on linux? #24

tlambert03 opened this issue Dec 24, 2024 · 0 comments · May be fixed by #25

Comments

@tlambert03
Copy link
Contributor

Saw a timeout recently in napari a test that actually manages window focus, when running the test in a different repo that uses this setup instead: https://github.com/pyapp-kit/superqt/actions/runs/12485275920/job/34843848003?pr=268

here is the test
    @skip_local_focus
    @skip_on_mac_ci
    @pytest.mark.key_bindings
    @pytest.mark.parametrize(
        'confirm_key',
        ['enter', 'return', 'tab'],
    )
    def test_preferences_dialog_not_dismissed_by_keybind_confirm(
        qtbot, pref, confirm_key
    ):
        """This test ensures that when confirming a keybinding change, the dialog is not dismissed.
    
        Notes:
            * Skipped on macOS CI due to accessibility permissions not being
              settable on macOS GitHub Actions runners.
            * For this test to pass locally, you need to give the Terminal/iTerm/VSCode
              application accessibility permissions:
                  `System Settings > Privacy & Security > Accessibility`
    
            See https://github.com/asweigart/pyautogui/issues/247 and
            https://github.com/asweigart/pyautogui/issues/247#issuecomment-437668855
        """
        shortcut_widget = (
            pref._stack.widget(3).widget().widget.widgets['shortcuts']
        )
        pref._stack.setCurrentIndex(3)
        # ensure the dialog is showing
        pref.show()
        qtbot.waitExposed(pref)
        assert pref.isVisible()
    
        shortcut = shortcut_widget._table.item(
            0, shortcut_widget._shortcut_col
        ).text()
        assert shortcut == 'U'
    
        x = shortcut_widget._table.columnViewportPosition(
            shortcut_widget._shortcut_col
        )
        y = shortcut_widget._table.rowViewportPosition(0)
    
        item_pos = QPoint(x, y)
        qtbot.mouseClick(
            shortcut_widget._table.viewport(),
            Qt.MouseButton.LeftButton,
            pos=item_pos,
        )
        qtbot.mouseDClick(
            shortcut_widget._table.viewport(),
            Qt.MouseButton.LeftButton,
            pos=item_pos,
        )
>       qtbot.waitUntil(lambda: QApplication.focusWidget() is not None)
E       pytestqt.exceptions.TimeoutError: waitUntil timed out in 5000 milliseconds

the only difference I can see is that their headless setup action https://github.com/aganders3/headless-gui uses herbstluftwm in addition to xvfb. (as suggested in pytestqt docs). Would you consider a PR that adds that here?

@tlambert03 tlambert03 linked a pull request Dec 24, 2024 that will close this issue
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.

1 participant