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

Enhancement: save ran_assignments (for_window) after a reload #3190

Open
orestisf1993 opened this Issue Mar 19, 2018 · 4 comments

Comments

Projects
None yet
3 participants
@orestisf1993
Member

orestisf1993 commented Mar 19, 2018

Also see #3188.

Example:

  1. Have rule for_window [class="URxvt"] border pixel 10
  2. Change the border of a urxvt window manually.
  3. Run reload
  4. Type a command or something in urxvt (assuming your shell changes the title of the terminal, eg)
  5. handle_windowname_change leads to run_assignments which reapplies the rule from (1.)

Possible solution: cache the assignments in plain text, when parsing for_window rules reuse the old Assignment *.
When done, free the rest. The tail queue will have to be reconstructed too. Probably here:

i3/src/config_directives.c

Lines 160 to 164 in e3e0911

Assignment *assignment = scalloc(1, sizeof(Assignment));
assignment->type = A_COMMAND;
match_copy(&(assignment->match), current_match);
assignment->dest.command = sstrdup(command);
TAILQ_INSERT_TAIL(&assignments, assignment, assignments);

Original discussion: https://www.reddit.com/r/i3wm/comments/85ctji/when_windows_are_floating_by_default_how_do_i/

@orestisf1993

This comment has been minimized.

Member

orestisf1993 commented Mar 27, 2018

I have a draft version (no new tests but it passes the old ones) here: https://github.com/orestisf1993/i3/tree/issue-3190. It doesn't cache the assignments in plain text.

The most complex/ugly part is freeing the old window->ran_assignments like in #3188.

@Airblader

This comment has been minimized.

Member

Airblader commented Mar 28, 2018

I don't like that much, to be honest. And I'm not sure this is really worth changing.

@orestisf1993

This comment has been minimized.

Member

orestisf1993 commented Mar 28, 2018

I've seen two people so far that are affected. I can PR my commit & close it so that it is saved here and then wait for discussion in this issue?

@Airblader

This comment has been minimized.

Member

Airblader commented Mar 29, 2018

Sounds good!

orestisf1993 added a commit to orestisf1993/i3 that referenced this issue Apr 28, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment