Skip to content

kill subscriber process when desktop is removed#36

Closed
no3m wants to merge 1 commit intophenax:masterfrom
no3m:master
Closed

kill subscriber process when desktop is removed#36
no3m wants to merge 1 commit intophenax:masterfrom
no3m:master

Conversation

@no3m
Copy link
Copy Markdown

@no3m no3m commented Oct 19, 2021

change the way kill_layout gets called... desktop options in remove_listener have to be cleared before calling kill_layout, otherwise if remove_listener is called by the subscriber process on desktop_remove event, it will kill itself before the options are cleared.

added 'did' (desktop id) option... once desktop_remove event is triggered, get_desktop_name_from_id is useless since desktop doesn't exist anymore.

Copy link
Copy Markdown
Owner

@phenax phenax left a comment

Choose a reason for hiding this comment

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

Sorry for the delay. There's some changes needed here. Let me know if you'll be able to make those changes, if not I'll pick this up when I can and merge it in later

local old_pid="$(get_desktop_options "$selected_desktop" | valueof pid)";
kill_layout $old_pid;

desktop_id=$(bspc query -D -d "$selected_desktop");
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

nit: this can be a function inside desktop.sh

@@ -14,19 +14,22 @@ BSP_DEFAULT_LAYOUTS="tiled\nmonocle";

# Kill old layout process
kill_layout() {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

kill_layout's purpose is to kill the layout of a desktop. It doesn't make sense for it to accept a pid. Maybe we can have 2 functions kill_layout and kill_process

@amtoine
Copy link
Copy Markdown
Collaborator

amtoine commented Jun 16, 2022

@phenax, in case @no3m does not respond, would you like me to try to fix the requests you made on the commit? 😋

not sure how that can be done though as i won't be able to push to no3m:master 🤔

@amtoine amtoine added the stale When an issue or a PR hasn't been udating for a while label Jun 21, 2022
@amtoine
Copy link
Copy Markdown
Collaborator

amtoine commented Jul 9, 2022

Hi @no3m 👋 😋

as this PR has ben stale for almost 8 months now, we've decided with @phenax to move the changes to a2n-s/kill-subscriber-process-when-desktop-is-removed and apply the requested changes there 👍

hope you'll understand 😉

@amtoine amtoine closed this Jul 9, 2022
amtoine added a commit to amtoine/bsp-layout that referenced this pull request Aug 12, 2022
Addresses the original review requested changes from phenax#36
amtoine added a commit to amtoine/bsp-layout that referenced this pull request Aug 12, 2022
Addresses requested changes from the original stale phenax#36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale When an issue or a PR hasn't been udating for a while

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants