Skip to content

macro recording#59

Open
jchilds0 wants to merge 1 commit intopwmt:developfrom
jchilds0:record-keys
Open

macro recording#59
jchilds0 wants to merge 1 commit intopwmt:developfrom
jchilds0:record-keys

Conversation

@jchilds0
Copy link
Contributor

@jchilds0 jchilds0 commented Jan 4, 2026

I would like to automate testing UI interactions to avoid regressions when changing core components like the document widget. The following adds shortcuts to record and playback a macro, which contains keystrokes, assertions and breakpoints. There'll be more documentation and an example of using this in the Zathura PR. This could also form the basis for a macro system in Zathura similar to Vim macros.

Something I found while testing was in simulate_key_press from the feedkeys shortcut, gtk wouldn't always finish "processing" an event (e.g. more events remaining) before starting the next one leading to improper behaviour. Using

do {
    g_main_context_iteration(NULL, FALSE);
  } while (g_main_context_pending(NULL));

instead of gtk_main_iteration_do(FALSE) seems to help this, since it'll wait until there are not more events before moving on to the next key event.

@sebastinas
Copy link
Member

Just to give an update here: I am thinking of moving all the gtk bits to zathura proper. At this point, the split is mostly historical.

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 this pull request may close these issues.

2 participants