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

Reload swaybar/swaybg on config reload. #358

Merged
merged 2 commits into from
Dec 18, 2015

Conversation

mikkeloscar
Copy link
Collaborator

This works by tracking the pids of the child processes in the related
output container and terminating the processes and spawning new ones on
a config reload.

Should solve: #347

This works by tracking the pids of the child processes in the related
output container and terminating the processes and spawning new ones on
a config reload.

Should solve: swaywm#347
@mikkeloscar mikkeloscar force-pushed the reload-swaybg-swaybar branch from f140789 to 90ff36c Compare December 18, 2015 17:29
@mikkeloscar
Copy link
Collaborator Author

This has one problem where the windows will cover the bar after a reload until you do something to rearrange them, i.e. spawn a new window. I suspect this also happens on startup but since you don't have any windows open at that point you won't see it.

Any ideas how to update the layout correctly when spawning the bar after a reload?

@ddevault
Copy link
Contributor

@mikkeloscar just run arrange_windows(&root_container, -1, -1) to force a rearrange of the entire compositor.

@mikkeloscar
Copy link
Collaborator Author

Hmm, that is called in cmd_reload after a new bar is spawned.

I just tried on the master branch and if you spawn a window and then spawn a swaybar manually the same thing happens (it spawns behind the window).

I did a bisect of master and I think this issue was introduced in ed730db

@mikkeloscar
Copy link
Collaborator Author

Yes, this problem doesn't happen if I revert ed730db

@sce thoughts?

@sce
Copy link
Contributor

sce commented Dec 18, 2015

Hmm... I'm looking in to it now.

// processes.
list_t *bar_pids;
pid_t bg_pid;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This struct is getting kind of out of control. Half of the properties only apply to a certain kind of swayc (i.e. C_OUTPUT, in this case). Can we figure out a good way of splitting these up?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if this is the best approach, but what about adding a void* field to swayc_t which can be used for whatever, in this case it would point to:

struct swayc_output {
    list_t *bar_pids;
    pid_t bg_pid;
    // other fields unique to a swayc_t of type C_OUTPUT
};

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about a union of pointers to type-specific data?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that's probably better so we don't need to cast all over the place.

ddevault added a commit that referenced this pull request Dec 18, 2015
Reload swaybar/swaybg on config reload.
@ddevault ddevault merged commit 6555aad into swaywm:master Dec 18, 2015
@sce sce mentioned this pull request Dec 18, 2015
@mikkeloscar mikkeloscar deleted the reload-swaybg-swaybar branch December 19, 2015 00:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants