Commit Graph

91 Commits

Author SHA1 Message Date
Michael Stapelberg 05e39c1c48 Ignore X11 errors caused by ReparentWindow / ChangeProperty on already destroyed windows
These errors can happen because a DestroyWindow request by a client will
trigger an UnmapNotify, then a DestroyNotify. We cannot distinguish this
UnmapNotify from an UnmapNotify not followed by a DestroyNotify, so we just try
to send the ReparentWindow / ChangeProperty and ignore the errors, if any.
2011-07-10 23:44:13 +02:00
Michael Stapelberg d641e1da3b Don’t force wrapping when focusing in a direction would work (+test)
Think of the following layout:

 -------------
 | tab |     |
 | con | win |
 |     |     |
 -------------

The tabbed container on the left has two children. Assume you have focused the
second/right child in the tabbed container. i3 used to focus the first/left
container of the tabbed container when using 'focus right' (it wrapped focus).

With this commit, the default behaviour is to instead focus the window on the
right of the screen.

The intention is to make focus switching more intuitive, especially with tabbed
containers supporting 'focus left'/'focus right' in tree. You should end up
using less 'focus parent' :).

You can force the old behaviour with 'force_focus_wrapping true' in your
config.

Code coverage is 62.5% with this commit.
2011-06-12 12:56:50 +02:00
Michael Stapelberg fb9d77305e Implement 'fullscreen global' 2011-06-10 18:27:20 +02:00
Michael Stapelberg 1585d942ea Make workspace_layout handle all cons at workspace level, not only the first one (+test)
This makes opening new windows on workspace level and moving windows to the
right/left more like in the old i3.
2011-06-02 17:21:38 +02:00
Michael Stapelberg aea445b690 Bugfix: Attach new cons at the correct place when a floating con is focused (+test) (Thanks fernandotcl)
New containers were previously attached directly to the workspace instead of to
the previously focused place in the workspace (for example a stacked con).

Fixes: #376
2011-05-13 21:30:37 +02:00
Michael Stapelberg 167bdd26b7 Argument for 'kill' for killing a specific window (now default) or the whole client (+test)
Use 'kill window' to kill a specific window (for example only one specific
popup), use 'kill client' to kill the whole application (or X11 connection to
be specific).
2011-05-13 20:41:03 +02:00
Michael Stapelberg 836a3ad615 Bugfix: set WM_STATE to WITHDRAWN when an app unmaps their window(s) (+test)
Fixes: #362
2011-05-13 17:04:55 +02:00
Michael Stapelberg eb8ad348b2 Bugfix: Don’t run into an endless loop when killing con with children (Thanks mseed)
When a tabbed container had more than one child and at least the first one
supported WM_DELETE, i3 entered an endless loop when killing that tabbed
container. This was due to tree_close only sending WM_DELETE without actually
removing the child, while the loop in tree_close assumed that with every call
of tree_close one child would be removed.
2011-05-11 20:22:47 +02:00
Michael Stapelberg b25477b15e Re-implement rendering to pixmaps (double-buffering) and caching decorations 2011-03-20 14:25:09 +01:00
Michael Stapelberg 86637d2e07 Bugfix: Make level up a noop during fullscreen mode (+testcase) (Thanks dothebart)
Fixes #341
2011-03-09 18:37:05 +01:00
Michael Stapelberg 74b90cd83f Bugfix: Send WM_DELETE / kill window the right way (Thanks dothebart)
Fixes #336
2011-03-09 18:08:26 +01:00
Michael Stapelberg 287d7f9527 Bugfix: Don’t focus new cons when there is a fullscreen con (Thanks dothebart)
Also, remove the focus_it parameter from tree_open_con, it makes more sense to
call con_focus outside of the function.
2011-03-06 23:26:02 +01:00
Michael Stapelberg a038d2674b Bugfix: 'level up' needs to stop at the workspace con + testcase (Thanks mseed) 2011-03-03 14:30:13 +01:00
Michael Stapelberg 77640da9e7 Bugfix: don’t focus the dockarea when closing a dock client 2011-03-03 14:03:06 +01:00
Michael Stapelberg 7f89c71689 Implement dock mode, update testsuite
Currently, dock clients are only possible at the top.
2011-02-20 23:43:03 +01:00
Michael Stapelberg 86500c5b88 Skip containers which got only one child when looking for the next/previous one to focus 2011-02-19 19:50:09 +01:00
Michael Stapelberg 26a416e016 refactor tree_move() into src/move.c, change config (!), change testcase
Due to lots of cases which were added and added to tree_move(), the function
was not really easy to understand. For this refactoring, I wrote tree_move()
from scratch, thinking about (hopefully) all cases. The testsuite still passes.

The move command also has different parameters now. Instead of the hard to
understand 'before v' stuff, we use 'move [left|right|up|down]'.
2011-02-14 23:05:20 +01:00
Michael Stapelberg 28dd226259 refactor code for removing children from a con
Let’s see how this callback stuff will work out. If it doesn’t work out well,
we will remove it.
2011-02-14 18:08:36 +01:00
Michael Stapelberg 4d0106b00f bugfix: don’t crash when moving windows out of a floating con (Thanks mseed) 2011-02-01 17:53:15 +01:00
Michael Stapelberg 9b01b1a7a6 Bugfix: When the container which was just closed is focused, we *do* need to focus another one (Thanks mseed) 2011-02-01 16:42:59 +01:00
Michael Stapelberg dad7c0da00 Don’t create a split container if no other cons are on a workspace (Thanks mseed)
This fixes #306.
2011-02-01 16:08:47 +01:00
Fernando Tarlá Cardoso Lemos 8be40932f2 Fix assertion when moving out of a floating container. 2011-01-28 01:25:06 +01:00
Fernando Tarlá Cardoso Lemos f465b3c11d Don't mess with the focus if we're not killing.
If we're not killing the mapped window and we're not killing the
parent window either in tree_close, then there's no reason to try
to change the focus. This fixes focus issues when moving a
container around another container (move up, left, bottom, right).
2011-01-28 01:25:03 +01:00
Fernando Tarlá Cardoso Lemos b29af954f6 Don't mess with the percentages in tree_flatten. 2011-01-28 00:12:26 +01:00
Fernando Tarlá Cardoso Lemos 5f4123f842 Fix some resizing issues (thanks mseed). 2011-01-27 23:42:37 +01:00
Michael Stapelberg 676afce540 bugfix: correctly move cons out of floating cons when the workspace has no other tiling cons (Thanks mseed) 2011-01-27 16:51:41 +01:00
Michael Stapelberg 334e41daa4 bugfix: don’t assume a workspace always has tiling cons when focusing (Thanks mseed) 2011-01-27 16:51:16 +01:00
Michael Stapelberg 3383437705 refactor some places to use con_descend_focused instead of duplicating code 2011-01-27 16:09:14 +01:00
Fernando Tarlá Cardoso Lemos 432563d6e7 Fix the percentages when moving containers. 2011-01-27 13:00:14 +01:00
Fernando Tarlá Cardoso Lemos bc82fc7e9f This parameter is no longer needed.
The algorithm is now always the same, doesn't matter if we're
adding or removing a container to/from its parent.
2011-01-27 13:00:14 +01:00
Fernando Tarlá Cardoso Lemos a93f4643ec Only fix the percentages after we insert the container.
This is what floating.c does and it allows us to unify the logic that
calculates those percentages.
2011-01-27 13:00:14 +01:00
Michael Stapelberg 3fe4146e24 Bugfix: fix crash in tree_flatten (Thanks mseed) 2011-01-19 09:31:31 +01:00
Michael Stapelberg d6d4c962f4 Bugfix: Call mark_unmapped() on floating nodes aswell (Thanks mseed)
This fixes #292.
2011-01-17 14:11:56 +01:00
Michael Stapelberg 83f6e445a0 Bugfix: Don’t use ->old_parent for floating cons (Thanks eelvex)
Instead, we attach them to their workspace when toggling back to tiling. This
makes more sense; afterall, floating clients are always directly below a
CT_WORKSPACE container.
2011-01-08 00:44:03 +01:00
Michael Stapelberg 54b9549713 Bugfix: Look for cons to focus *starting* at the ws, not beneath the ws (Thanks mseed)
This should fix #286.
2011-01-08 00:10:49 +01:00
Michael Stapelberg 115462f103 Implement tree flattening to automatically solve situations of redundant chains of split containers
This should fix the move problems. See comment of tree_flatten() for a little
example.
2011-01-07 22:21:41 +01:00
Michael Stapelberg 228b5c51ff change many LOG/printf messages to use DLOG 2011-01-07 20:58:58 +01:00
Michael Stapelberg 5098e45f23 Re-Implement support for RandR changes 2011-01-05 00:16:10 +01:00
Michael Stapelberg 1fb9b7c431 Bugfix: Correctly change focus after closing floating containers (Thanks litemotiv!) 2011-01-04 22:40:05 +01:00
Michael Stapelberg 0416be18df fix memleak: free struct Window members 2011-01-04 22:39:45 +01:00
Michael Stapelberg 80ecd157f6 fix memleak: free con->name before overwriting it 2011-01-04 22:38:33 +01:00
Michael Stapelberg 9713419327 Bugfix: Also change focus when the killed container was focused (Thanks fernandotcl) 2011-01-02 18:08:45 +01:00
Michael Stapelberg 50914e0483 Bugfix: Correctly change focus when closing a split-container
The problem was i3 leaving an invalid focus pointer valid (after killing the
container) because the container itself is not mapped (if it has no x11 window,
for example split containers).
2010-12-30 23:01:58 +01:00
Michael Stapelberg f65e4f5b16 Bugfix: Don’t redistribute resize percentage values when closing floating (!) windows (Thanks Merovius) (+testcase) 2010-12-30 02:39:14 +01:00
Michael Stapelberg d184587959 Bugfix: Don’t focus next window if the window was not mapped at the moment (on a different ws) 2010-12-28 02:27:11 +01:00
Fernando Tarlá Cardoso Lemos c88c3e3ab2 Default to a file in /tmp for the restart state.
The file is now created in /tmp using the process PID and the
username of the user running i3. The restart state file is only
loaded when restarting (the --restart option is appended to the
command line prior to the restart). That means that renaming the
old state file with the ".old" extension is no longer needed.

This "--restart" switch is supposed to be only used by i3. The
"-L" switch can be used to load a layout (and not delete it
afterwards). We unlink the state file after we load it so that
we don't keep cruft in /tmp or try to restart from an old config
file if restart_state is set.
2010-12-27 13:33:03 +01:00
Michael Stapelberg b0068de3d7 Bugfix: Transfer 'percent' factor when splitting, add testcase for resizing 2010-11-29 11:24:12 +01:00
Michael Stapelberg 2dba7ec1ec Bugfix for the last commit (broke some moving situations), update testcase 2010-11-28 20:15:47 +01:00
Michael Stapelberg 780b0ddbbc look & feel: when moving, descend if the container in target direction is a split-container 2010-11-28 18:35:11 +01:00
Michael Stapelberg 4fcd2f6e7e Bugfix: Fix focus when moving Cons
When having two v-splits on a horizontal desktop:
----------------
|  t1   |  t3  |
|-------|------|
|  t2   |  t4  |
----------------
…focus is on t2, and you move it into the right v-split (move after h), the
focus was not properly updated. That is, inside the right v-split, focus was
correct, but the workspace focus was still pointing to the left v-split.
2010-11-28 18:05:53 +01:00