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

Killing workspaces does not work #591

Closed
i3bot opened this issue Dec 17, 2011 · 4 comments
Closed

Killing workspaces does not work #591

i3bot opened this issue Dec 17, 2011 · 4 comments
Assignees

Comments

@i3bot
Copy link

i3bot commented Dec 17, 2011

[Originally reported by eeemsi]
(1. open n terminals
2. put them to stacked/tabbed mode
3. move one window to the left/right
4. focus the parrent container
5. close selected windows via mod+shift+q

the windows still remain non-closed…

seems to happen if the mouse is over the non-stacked/tabbed window.

version: i3 version 4.1-151-g5a345db
using new_window 1pixel

@stapelberg
Copy link
Member

Killing whole workspaces (which is what’s focused when you focus parent in that situation) is currently not implemented. We could make that kill all windows on that workspace .

@i3bot
Copy link
Author

i3bot commented Jan 9, 2013

[Original comment by layus]

It does not work because it is hard-coded in src/tree.c

 /*
  * Closes the current container using tree_close().
  *
  */
 void tree_close_con(kill_window_t kill_window) {
     assert(focused != NULL);
     if (focused->type == CT_WORKSPACE) {
         LOG("Cannot close workspace\n");
         return;
     }

     /* There *should* be no possibility to focus outputs / root container */
     assert(focused->type != CT_OUTPUT);
     assert(focused->type != CT_ROOT);

     /* Kill con */
     tree_close(focused, kill_window, false, false);
 }

So one solution would be to simply drop the if block (solution1.diff), which seems to work according to my tests.

Another one consists in

     if (focused->type == CT_WORKSPACE) {
-        LOG("Cannot close workspace\n");
+        tree_close(focused, kill_window, true, false);
         return
     }

where we set the third argument of tree_close to true, to prevent it from killing the parent container (solution2.diff).
This also works according to my tests.


So, what is the best solution, and is a patch needed ?
(too trivial to require one I think)

And also, would some tests in the test-suite be appropriate here ?

Layus.

@stapelberg
Copy link
Member

I think removing the check is the way to go. Please add a test to the testsuite. Once you are done, please submit your patch at http://cr.i3wm.org/. Thanks!

@i3bot
Copy link
Author

i3bot commented Sep 24, 2013

[Original comment by jj]

This ticket was fixed in commit http://c.i3wm.org/97b086ef:

Close all children when closing a workspace

fixes #591

This issue was closed.
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

No branches or pull requests

2 participants