Commit Graph

991 Commits

Author SHA1 Message Date
Michael Stapelberg
b595ff05c5 Fix regression: Don’t add floating nodes twice when restoring layout (+testcase) 2011-02-28 20:44:23 +01:00
Michael Stapelberg
d80105103c Bugfix: Re-attach floating cons to the right container (Thanks mseed)
This fixes #315.
2011-02-28 17:23:50 +01:00
Fernando Tarlá Cardoso Lemos
beaa85ceb9 Don't leak this descriptor (thanks dothebart).
Note that fclose closes the file descriptor frees the stream.
2011-02-28 16:49:10 +01:00
Fernando Tarlá Cardoso Lemos
269d360f30 Some assertions to make the static analyzer happy.
Assertions give hints to the static analyzer about code paths
where we make assumptions. Used the Clang Static Analyzer.
2011-02-28 16:49:03 +01:00
Fernando Tarlá Cardoso Lemos
f4ec0bceff Very minor issues found with statical analysis.
The Clang Static Analyzer uncovered those issues:

- The variable "changed" in handlers.c is written to, but it's
  never read since that specific write, so the write is not
  necessary.

- In util.c, "tail" may be NULL. In that case, we shouldn't pass
  it to strlen because strlen's behavior is not defined when s is
  NULL.

- In util.c, "write_index" is incremented twice. It's never used
  anymore after being incremented once, so the second increment is
  not necessary.
2011-02-28 16:48:22 +01:00
Michael Stapelberg
ffc71859a3 Implement support for top/bottom dock clients (according to _NET_WM_STRUT_PARTIAL or requested position) 2011-02-21 14:27:32 +01:00
Michael Stapelberg
b6f81fe43c Bugfix: restore the original width/height with X11 border when restarting (Thanks Merovius) 2011-02-21 03:13:27 +01:00
Michael Stapelberg
f34b045619 Fix dock client handling for inplace restarts 2011-02-21 03:01:55 +01:00
Michael Stapelberg
3dfe5c8a9a bugfix: fix clicking on dock clients (Thanks mseed) 2011-02-21 01:58:57 +01:00
Michael Stapelberg
9719b21243 refactor some places to use output_get_content() 2011-02-21 01:55:36 +01:00
Michael Stapelberg
a92b9dca73 Bugfix: fix disabling RandR outputs 2011-02-21 01:43:39 +01:00
Michael Stapelberg
35e79c87c8 Place dock clients on the output corresponding to their geometry request 2011-02-21 01:28:29 +01:00
Michael Stapelberg
a33d869885 Bugfix: Correctly open workspaces on additional outputs 2011-02-21 01:12:22 +01:00
Michael Stapelberg
6b272fea55 Bugfix: in get_workspaces, only consider the CT_CON, not the CT_DOCKAREAs (Thanks fernandotcl) 2011-02-21 00:54:29 +01:00
Michael Stapelberg
272ab840c7 Fix fullscreen mode with dock clients 2011-02-21 00:40:35 +01:00
Michael Stapelberg
9a0bc77baf bugfix: dock clients cannot be floating 2011-02-21 00:23:07 +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
c5ab16c00d same fix, but for moving (search above the current con when moving is not possible in this direction) 2011-02-19 20:11:47 +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
6a6746b967 revert the replacement of a single h/v-split with its child container
Makes more problems than it creates. Will use a different fix suggested by
Merovius.
2011-02-19 18:30:26 +01:00
Michael Stapelberg
53d9072ca7 implement TAILQ_SWAP (only for consecutive elements, order relevant) and use it 2011-02-15 02:21:23 +01:00
Michael Stapelberg
834f4d7bc2 add missing function documentation 2011-02-14 23:17:30 +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
a5e075c154 Automatically close empty parent cons when making their last child floating (Thanks mseed)
This fixes #313
2011-02-14 16:43:41 +01:00
Michael Stapelberg
b800555161 Bugfix: check ->layout, not ->type for L_STACKED 2011-02-14 16:35:48 +01:00
Michael Stapelberg
305eac0e71 Bugfix: Correctly check asprintf() return value 2011-02-14 16:33:42 +01:00
Fernando Tarlá Cardoso Lemos
9cf48f17bb Fix libxcursor -> xcb cursors fallback. 2011-02-06 17:47:28 +01:00
Michael Stapelberg
07381ccb7b fix a rendering problem for split cons inside tabbed cons (Thanks julien)
This fixes #280.
2011-02-02 17:56:29 +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
d855bea215 Bugfix: Correctly focus con when moving to another workspace (Thanks mseed)
This fixes #310.
2011-02-01 17:17:50 +01:00
Michael Stapelberg
97ab44b3d8 disable workspace-level move operations (not yet implemented) (Thanks mseed) 2011-02-01 16:59:02 +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
Michael Stapelberg
0238ce3c73 fix some compiler warnings 2011-02-01 15:43:59 +01:00
Fernando Tarlá Cardoso Lemos
8f4b9ddaa4 Fix the choice of the right containers for resizing.
Also fixes #311, which was an assertion failure that uncovered
this problem. Thanks mseed, Merovius.
2011-01-30 18:52:32 +01:00
Fernando Tarlá Cardoso Lemos
ac8fb2399d Don't mess with sizes when moving to other ws. 2011-01-29 15:19:41 +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
Michael Stapelberg
5b6ef3e665 make the sighandler handle SIGABRT 2011-01-28 00:47:49 +01:00
Michael Stapelberg
f395c141c8 bugfix: initialize root variable earlier 2011-01-28 00:42:55 +01:00
Michael Stapelberg
7b01bc5eb7 Bugfix: use the global root variable, don’t get the first one (Thanks quaec)
The case of an X11 server having multiple displays is handled correctly by the
code in src/mainx.c. However, due to some functions not being correctly
refactored and still getting the first screen (and also the first root window)
from the XCB connection, i3 was operating on the wrong root window.
2011-01-28 00:41:53 +01:00
Michael Stapelberg
79bbde8766 add a flag to disable the signalhandler 2011-01-28 00:31:26 +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
3e08ceaff9 bugfix: resizing problem when resizing vertically on the top border (Thanks julien) 2011-01-27 16:26:19 +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
Michael Stapelberg
f462a9a215 re-insert floating cons next to the currently focused con of the appropriate workspace 2011-01-27 16:04:17 +01:00
Michael Stapelberg
2f5d111936 when re-inserting a floating con, start with a more fair percent value 2011-01-27 15:53:14 +01:00
Michael Stapelberg
fe851b85f0 RandR: respect primary output 2011-01-27 15:40:02 +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
07eb20851f Fix floating mode according to the new requirements.
At all times any given non-leaf container should have the sum of
the percentages of its children == 1.0, otherwise we'll crash on
an assertion failure.
2011-01-27 13:00:14 +01:00
Fernando Tarlá Cardoso Lemos
568cafd4ec Fix the resize algorithm I broke earlier.
The reason it was broken was that it was ok for the sum of the
percentages to be something other than 1.0. Now this is no longer
the case, the sum of the percentages must always be 1.0 or an
assertion will fail when we render the 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
45227fba54 A new logic to calculate the percentages.
It's slower, but this way we make sure that the resulting
percentages *ALWAYS* sum up to 1.0 (or as close to that as we get
with double math).
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
Fernando Tarlá Cardoso Lemos
89917976c7 Crash when we get the percentages wrong.
Better to crash with an assertion than to get into an infinite loop.
We cold work around this, but there's a bug here and it's not a
rounding bug, so it's better not to conceal it.
2011-01-27 13:00:14 +01:00
Fernando Tarlá Cardoso Lemos
485555ef72 Round up as well if needed (thanks Merovius). 2011-01-23 13:21:33 +01:00
Michael Stapelberg
d9bfd8843f Bugfix: fix restoring the orientation (Thanks Merovius/fernandotcl) 2011-01-21 22:58:22 +01:00
Michael Stapelberg
ad95d5bb1f bugfix: you can’t unfullscreen workspaces (Thanks Merovius) 2011-01-21 22:09:04 +01:00
Michael Stapelberg
cbf4fcb9b5 Bugfix: Fix focus problems when switching workspaces by pushing the window stack before mapping 2011-01-21 21:49:56 +01:00
Michael Stapelberg
81ff1f976d Bugfix: Don’t send fake configure notify with not yet rendered rect for floating windows
This fixes a bug where opening the Xpdf find dialog when Xpdf is in fullscreen
mode would crash Xpdf due to a zero-width and zero-height ConfigureNotify rect.
2011-01-21 21:01:02 +01:00
Michael Stapelberg
1fecbb3e5a Bugfix: also close empty split containers when the clients are moved away (Thanks mseed)
Also update the testcase (which used only 'kill' before).
2011-01-20 10:09:43 +01:00
Michael Stapelberg
3fe4146e24 Bugfix: fix crash in tree_flatten (Thanks mseed) 2011-01-19 09:31:31 +01:00
Michael Stapelberg
0eb5eb34cd When in stacking mode with only one child, respect border styles 1pixel and none (Thanks Merovius) 2011-01-17 14:38:16 +01:00
Michael Stapelberg
ae4331113e re-implement xkb support for detecting keyboard layout changes 2011-01-17 14:27:49 +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
Axel Wagner
92a038dd25 Save environment-variable AFTER reading the configfile 2011-01-12 10:16:11 +01:00
Axel Wagner
4caf85aa0b Use I3SOCK-environment-variable 2011-01-12 10:15:48 +01:00
Michael Stapelberg
cd2ee61ee8 fix some memory leaks when user passes command line arguments twice (Thanks Tiago) 2011-01-12 10:12:24 +01:00
Michael Stapelberg
a6f0dcd250 Fix switching to a workspace on a different output 2011-01-08 12:03:03 +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
0ea15ed962 fix a problem with workspace switching when the focus got to the target workspace
This could explain some strange effects where workspaces would just stay blank.
We’ll see.
2011-01-08 00:38:10 +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
e4bb6d859e Bugfix: Correctly maintain focus when setting a workspace to floating 2011-01-08 00:10:30 +01:00
Michael Stapelberg
b660769fe0 Bugfix: Correctly move to other workspaces when a floating window is focused on the target ws (Thanks mseed) 2011-01-07 23:56:32 +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
186d2c7bfa ipc: change 'orientation' to human readable string instead of raw integer value 2011-01-07 20:48:01 +01:00
Michael Stapelberg
5ccd7b01e7 Bugfix: fix fullscreen mode for floating windows 2011-01-07 02:50:35 +01:00
Michael Stapelberg
55b6d31e4a Bugfix: randr: Don’t close container if it was not initialized before 2011-01-06 14:35:04 +01:00
Michael Stapelberg
2312187439 RandR: use the next unused workspace instead of fixed counting 2011-01-05 00:26:23 +01:00
Michael Stapelberg
f73c02ce92 Also initialize output->con when using neither RandR nor Xinerama 2011-01-05 00:19:51 +01:00
Michael Stapelberg
5098e45f23 Re-Implement support for RandR changes 2011-01-05 00:16:10 +01:00
Michael Stapelberg
f54ce1ddda retab! randr.c 2011-01-04 22:51:42 +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
bf2c18cc33 fix memleak: free X state structure 2011-01-04 22:39:24 +01:00
Michael Stapelberg
545566e6ba use sstrdup() instead of strdup() 2011-01-04 22:39:13 +01:00
Michael Stapelberg
80ecd157f6 fix memleak: free con->name before overwriting it 2011-01-04 22:38:33 +01:00
Michael Stapelberg
bdbda20293 cmdparse: free strings 2011-01-04 22:37:50 +01:00
Michael Stapelberg
fa44383cc6 fix small memory leak (unused ->name) 2011-01-04 22:15:52 +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
Axel Wagner
aa422c07c4 Add forgetful restart to sighandler 2010-12-31 19:36:35 +01:00
Axel Wagner
6ec468ba1e Retab sighandler.c 2010-12-31 19:36:32 +01:00
Axel Wagner
fb6d117c42 Port sighandler to tree-branch 2010-12-31 19:36:29 +01:00
Michael Stapelberg
2d05c3a37d Fix dragging floating containers / click handling 2010-12-31 01:38:17 +01:00
Michael Stapelberg
daf00a932f For floating mode on workspace level, create a container around the content (Thanks Merovius)
Like when setting a workspace to stacked, we need to create a new container
around the content and set *that* to floating.
2010-12-30 23:09:18 +01:00