Commit Graph

2312 Commits (419b73be9e6e502760878f8372a7d51975c0cdce)

Author SHA1 Message Date
Sascha Kruse bbede97966 scratchpad_show focus unfocused scratchpad window
When there's an unfocused scratchpad window on the current workspace
scratchpad_show will focus that scratchpad window.
2013-01-30 13:33:55 +01:00
Marius Muja b1cc4d5166 Fix decoration rect size for windows without border 2013-01-26 19:31:15 +01:00
Francesco Mazzoli f13d8ed06f wrap when moving things to outputs with direction 2013-01-26 19:27:58 +01:00
Michael Stapelberg 62b0df0640 Make i3-nagbar use the same font as configured for i3 2013-01-26 09:55:38 +01:00
Adrien Schildknecht 76ef3a4ab8 remove the urgency indicator when a window is closed 2013-01-25 18:53:59 +01:00
Michael Stapelberg 74558bb33d Call scratchpad_show() when focusing scratchpad windows via criteria
fixes #931
2013-01-25 16:11:20 +01:00
Michael Stapelberg 2ea94420d3 Merge branch 'master' into next 2013-01-25 15:48:38 +01:00
Michael Stapelberg 7be5ece663 Bugfix: fix coordinates of scratchpad windows on output changes (Thanks badboy)
Previously, after reconfiguring monitors, scratchpad windows could still
be focused but might be out of bounds for you to see.

fixes #929
2013-01-25 15:47:43 +01:00
Michael Stapelberg a32d2d5d61 scratchpad: fix crash when moving last window of an invisible workspace (+test) (Thanks bafain)
It looks like the code which was removed with this commit was not
necessary anyways since con_move_to_workspace() by now checks on its own
whether it moves to the scratchpad.

fixes #913
2013-01-25 15:28:58 +01:00
Michael Stapelberg f767ac30b3 fix two more crashes when disabling an empty output 2013-01-25 14:53:15 +01:00
Michael Stapelberg e0cfe1f8c0 Bugfix: fix crash when disabling output without any windows (Thanks xeen, knopwob)
fixes #919
2013-01-25 14:14:06 +01:00
Michael Stapelberg a5c9b0dedb Merge branch 'master' into next 2013-01-24 14:45:14 +01:00
Michael Stapelberg 2eb4ed95bc Bugfix: fix “overlapping” --release key bindings (Thanks phlux)
We eagerly marked all KeyRelease bindings as eligible to match without
checking modifiers, while this should only be allowed for the key
binding which actually was pressed.

fixes #915
2013-01-24 14:44:01 +01:00
Marius Muja bfd150872d Fixing continuous resize bug in floating mode
fixes #910
2013-01-24 12:42:13 +01:00
David Edmondson 3365b52384 Allow servers which do not support the XKB extension.
If we can open the X display but the XKB extension is not available,
continue without it.
2013-01-23 20:27:27 +01:00
Michael Stapelberg 2478d0a2e0 ipc: use ipc_recv_message instead of duplicate code
This should fix the situation where i3 would read only the header and
not the payload of the message.
2013-01-23 18:59:36 +01:00
Michael Stapelberg dcb8ac84f8 ipc_recv_message: store message_type, don’t compare. add distinct EOF retval
Also use ELOG, which requires i3-msg to provide logging functions.
2013-01-23 18:51:39 +01:00
Michael Stapelberg 2c249b6949 Merge branch 'master' into next 2013-01-01 16:31:27 +01:00
Michael Stapelberg 138e04fd4d Bugfix: Fix for_window moving of assigned windows (Thanks bafain)
fixes #909
2013-01-01 16:31:08 +01:00
Michael Stapelberg d8e27dd5aa ignore MotionNotify events generated while warping the pointer 2012-12-27 17:04:13 +01:00
Michael Stapelberg 9edbcc4790 debug message for window focus: include window ID 2012-12-27 16:58:46 +01:00
Michael Stapelberg 54fd3d3480 unregister as window manager before restarting (fixes a race condition) 2012-12-27 16:54:54 +01:00
Michael Stapelberg cde82eafa6 use xcb_aux_sync to make sure our changes reach the X server, flushing is not enough 2012-12-27 16:54:36 +01:00
Simon Elsbrock 0045cfa637 move visible scratchpad window to focused workspace
If there is a visible scratchpad on another (non-internal) workspace,
bring it to the focused workspace instead of doing nothing.

closes #784
2012-12-24 19:20:47 +01:00
Michael Stapelberg b3d7531947 refactor both i3-nagbar starts into src/util.c
With this change, libev >= 4 is a hard dependency. It should be present
in all major linux distributions (even the latest ubuntu LTS).
2012-12-24 16:53:20 +01:00
Michael Stapelberg c127ac3855 remove all references to the old cfgparse 2012-12-24 15:57:02 +01:00
Michael Stapelberg b304e6ad34 remove old cfgparse.{l,y} 2012-12-24 15:46:57 +01:00
Sascha Kruse 5d4a934864 render_con: initialize int sizes[children]
This fixes a clang-analyzer warning
2012-12-24 15:28:17 +01:00
Michael Stapelberg 4f2922de62 Revert "initialize array to fix clang-analyze warning"
This reverts commit 56e0ceb44e.
2012-12-24 15:28:08 +01:00
Michael Stapelberg 56e0ceb44e initialize array to fix clang-analyze warning 2012-12-24 15:19:20 +01:00
Michael Stapelberg 9ae73b7a2a fix possibly uninitialized variable (Thanks knopwob) 2012-12-24 15:13:47 +01:00
Michael Stapelberg 1a6bddad55 Merge branch 'master' into next 2012-12-24 14:50:15 +01:00
Michael Stapelberg 625401d162 Bugfix: handle MapRequests sent between i3 registering as a wm and handling events
This fixes the problem where i3-nagbar does not come up because its
MapRequest is ignored.

fixes #892
2012-12-24 14:49:19 +01:00
Michael Stapelberg 24aa857a89 Bugfix: Correctly close floating windows (Thanks eeemsi) 2012-12-23 18:51:17 +01:00
Michael Stapelberg 3a78d489e6 Render tree before destroying X11 containers upon unmap (Thanks Merovius)
When an X11 window is closed (say, urxvt), i3 gets an UnmapNotify event
and destroys (DestroyWindow) the window decorations. Before this commit,
the DestroyWindow call was sent immediately.

This lead to a situation where — due to the DestroyNotify — EnterNotify
events were generated that would cause the focus to be set to the
underlying window.

With this commit, i3 first renders the tree and pushes changes to X11
before calling DestroyWindow. Therefore, the surrounding containers will
take up any space that was freed by the window which was closed and no
EnterNotify will be generated.

fixes #660
2012-12-23 15:54:49 +01:00
Joep van Delft 79bd2aede5 Draw 1px tab separators left/right instead of 2px on the right only
fixes #894
2012-12-22 16:15:11 +01:00
Michael Stapelberg a1ccca22e6 Merge branch 'master' into next 2012-12-22 14:08:14 +01:00
Michael Stapelberg 36b106a9d3 Bugfix: Ignore ConfigureRequests for scratchpad windows (Thanks MeanEYE)
fixes #898
2012-12-22 14:08:11 +01:00
Michael Stapelberg bb3ae9f960 Merge branch 'master' into next 2012-12-19 21:40:53 +01:00
Michael Stapelberg 721fa7bdad Fix scrolling on a tabbed titlebar which contains split cons (Thanks f8l)
fixes #708
2012-12-19 21:40:26 +01:00
Michael Stapelberg 895f8e05c8 Merge branch 'master' into next 2012-12-19 21:13:12 +01:00
Michael Stapelberg ae605bdd39 Also draw right tab border for split containers (Thanks alex)
fixes #696
2012-12-19 21:12:38 +01:00
Michael Stapelberg 73ec3dd3b0 Merge branch 'master' into next 2012-12-14 21:50:15 +01:00
Michael Stapelberg 7658109309 Bugfix: remove superfluous #include <xcb/xcb_atom.h> (Thanks pnutzh4x0r)
This fixes the build on CentOS 6.

fixes #889
2012-12-14 21:49:31 +01:00
Michael Stapelberg 61a5b9ddd4 Revert "don't use con_is_internal"
This reverts commit c6948c59f5.

Given that master and next now both contain con_is_internal, we can use
it again.
2012-12-14 21:44:20 +01:00
Michael Stapelberg 2bf7793d4d Merge branch 'next' 2012-12-12 00:18:23 +01:00
Michael Stapelberg 18e46ffae5 install i3-dmenu-desktop 2012-12-11 22:31:44 +01:00
Michael Stapelberg 1ae08b196a Bugfix: Don’t move floating windows when their size constraints forbid resizing (Thanks aksr)
fixes #883
2012-11-27 09:26:31 +01:00
Michael Stapelberg 19cbd3cbec code style fixes for the previous commit
• our function names use underscores
• rewrote the function’s comment
• function comments must be in the source _and_ in the header
• no blank lines after function signatures
2012-11-25 20:55:49 +01:00
Adrien \"schischi\" Schildknecht f41fa1baa1 The command to resize a floating window now checks the minimum and maximum size. 2012-11-25 20:52:56 +01:00
Emil Mikulic d2b533328d Fix memory leaks in config_parser.
push_token() doesn't take ownership of its str argument.
2012-11-24 17:39:52 +01:00
Michael Stapelberg 3cb909fa62 config parser: recover after invalid input
This is done by ignoring the rest of the current line and jumping to the
nearest <error> token.

fixes #879
2012-11-20 17:10:29 +01:00
Michael Stapelberg 305b6ddf2f set LC_NUMERIC=C when dumping nodes in the workspace event
Otherwise the resulting JSON might be invalid because it uses the
locale-specific comma separator, e.g. "16,666" instead of "16.666".
2012-11-13 09:49:08 +01:00
Francesco Mazzoli 1055973f66 refactor, name changes
We need to send the workspace event earlier, because otherwise 'old'
might already be destroyed (if it was empty).
2012-11-13 09:40:06 +01:00
Francesco Mazzoli 464d387044 take care of non-existant old workspaces 2012-11-13 09:33:03 +01:00
Francesco Mazzoli 74d596e0fc more informative `workspace' events
Add a `current' and `old' properties to the `focus' change type,
containing the current and old workspace respectively.  These additions
are not necessary anywhere else because `focus' is always triggered when
changing ws.
2012-11-13 09:33:00 +01:00
Francesco Mazzoli b67eedf71a simplify yajl related code
Specifically, put the version dependent code in some macros, and put
that plus the `y' and `ystr' macros in a separate file, `yajl_utils.h'.
2012-11-13 09:32:55 +01:00
Simon Elsbrock c6948c59f5 bugfix: don't use con_is_internal
fixes #872
2012-11-12 19:49:01 +01:00
Michael Stapelberg dece12bf18 Merge branch 'master' into next 2012-11-10 09:01:24 +01:00
Michael Stapelberg 81393c93c2 bugfix: fix workspace back_and_forth after displaying a scratchpad window
fixes #868
2012-11-10 09:01:04 +01:00
Michael Walle ae14fe9141 introduce new command to rename focused workspace
The corresponding command is 'rename workspace to <name>'. As a side-effect
this fixes the command 'rename workspace 1 to to'.

Signed-off-by: Michael Walle <michael@walle.cc>
2012-10-31 09:09:56 +01:00
Michael Stapelberg 71ccb4bef2 Merge branch 'master' into next 2012-10-29 16:42:11 +01:00
Michael Stapelberg e7a4580c5f Bugfix: force rendering when the parent’s orientation changed
Otherwise, the split indicator might not be refreshed even though it
should be.

fixes #858
2012-10-29 16:41:16 +01:00
Michael Stapelberg 9b87b2c8ec Implement smart popup_during_fullscreen mode
With this commit, the default behavior is to display popups while there
is a fullscreen application only if the popup belongs to that
application (as determined by the WM_TRANSIENT_FOR hint which
applications have to set properly).

fixes #663
2012-10-24 20:54:28 +02:00
Michael Stapelberg 29b19a7468 spelling error: s/implementaiton/implementation/g 2012-10-24 07:58:03 +02:00
Deiz aefcb0b668 Skip floating windows in the focus stack when moving through the tree
Includes a test for the new behaviour
2012-10-16 20:03:40 +02:00
Deiz fdfbc53c0b Focus windows when middle-clicking (X paste)
As with most click-based focusing, this only has an effect when
focus_follows_mouse is disabled.
2012-10-16 20:03:08 +02:00
Deiz c406b4c2fe Skip floating cons in focus (child|parent) and stop them from being split
Focusing child from a workspace should now skip over the floating con and
go directly to its child. Focusing parent from that grandchild should leave
the workspace focused again.
2012-10-16 20:01:36 +02:00
Michael Stapelberg 34a5bbb7e9 exit with a proper error message when there are no outputs available (Thanks flo)
fixes #842
2012-10-14 20:56:13 +02:00
Michael Stapelberg 39ba955919 Bugfix: Actually set border width in config_directives.c (Thanks strcat) 2012-10-09 22:06:36 +02:00
Deiz 47de7375dd Allow 'focus $dir' to move out of non-global fullscreen containers 2012-10-09 21:26:49 +02:00
Deiz ca77c12dde Allow workspace contents to be moved if there are only floating children 2012-10-09 21:25:13 +02:00
Deiz e07803999f Fix fullscreen focus bug and corresponding test flaw
As the workspace might be reached via recursion (e.g. moving from the edge
of a fullscreen split container), it's necessary to check for a fullscreen
container whenever a workspace is reached.
2012-10-09 21:24:04 +02:00
Deiz 7a280f5691 Grab keys with all permutations of lock and numlock
This should prevent all cases of caps lock (or shift lock, on some
keyboards) from interfering with i3 key bindings.
2012-10-09 21:15:06 +02:00
Michael Stapelberg 00ac2c4c9c accept ctrl as synonym of control (Thanks SardemFF7) 2012-10-09 14:09:12 +02:00
Michael Stapelberg 80492c8304 error out instead of accepting invalid key bindings (Thanks SardemFF7) 2012-10-09 14:09:08 +02:00
Michael Stapelberg ee36c8507e bugfix: config-parser: bind is a synonym for bindcode 2012-10-08 13:40:44 +02:00
Michael Stapelberg 040a441101 fix warning about printf() field length 2012-10-08 13:30:14 +02:00
Michael Stapelberg 20c0fa7cfb use the new parser by default
you can force the old parser with the command line flag
--force-old-config-parser-v4.4-only (which will be present in v4.4 only,
as the name suggests)
2012-10-08 13:26:42 +02:00
Michael Stapelberg 2738f13798 move owindow definition into the command parser 2012-10-08 13:26:24 +02:00
Michael Stapelberg 68e3e58232 link the parser test binaries with -g 2012-10-08 13:25:57 +02:00
Michael Stapelberg c2b699f3dc change the commands_parser prefix to 'command' for consistency 2012-10-08 13:25:32 +02:00
Michael Stapelberg 40c624e1c4 port the entire old config parser to the new one 2012-10-08 13:23:48 +02:00
Michael Stapelberg 6f9e6c16c8 config_parser: implement <number>s, proper error handling 2012-10-08 13:23:06 +02:00
Michael Stapelberg 00fca2dabd add first bits of a (custom) config parser 2012-10-08 13:17:46 +02:00
Michael Stapelberg d36264e403 generate-command-parser: make input/output configurable 2012-10-07 16:31:35 +02:00
Michael Stapelberg a6e1b75b18 allow floating cons to be reached using 'focus parent'
I suppose this was just an oversight. Let’s see if it causes any issues.

fixes #831
2012-10-04 18:50:33 +02:00
Deiz cae6fb627f Improve startup sequence termination conditions
If a window with _NET_STARTUP_ID set is moved to another workspace, it
will delete any associated startup sequence immediately. This will also
occur if a window has a leader with _NET_STARTUP_ID set, if the leader
has no container (never been mapped).

A startup sequence may also be deleted if it's matched by
startup_workspace_for_window() and its 30-second timeout has elapsed.
2012-10-04 17:48:51 +02:00
Deiz fdcba7b91a Replace the discrete 'split' Con property with a simple function. 2012-10-04 17:48:08 +02:00
Deiz d7e5da8b39 Un-fullscreen as needed when moving fullscreen containers
This avoids a case where a fullscreen container could be moved onto a
workspace that already had its own fullscreen container, leading to
two fullscreen containers on top of each other.
2012-10-04 17:46:54 +02:00
Michael Stapelberg 2eeb2a1067 shmlog: Remove O_TRUNC flag for shm_open, we truncate ourselves 2012-10-04 17:05:08 +02:00
Michael Stapelberg 13147978c5 Merge branch 'master' into next 2012-10-03 15:08:31 +02:00
Sascha Kruse 507898484f set workspace_layout in create_workspace_on_output
fixes #835
2012-10-03 15:08:21 +02:00
Deiz f89bbe0746 Focus the relevant workspace when clicking any container. 2012-10-03 00:15:55 +02:00
Deiz f4b09862fc Maintain relative positioning when moving floating windows between outputs. 2012-10-03 00:14:57 +02:00
Deiz a9d859f84e Only re-focus the workspace when moving a con if the target ws is hidden. 2012-10-03 00:03:24 +02:00
Deiz e89a25f81f Implement moving workspaces as if they're regular containers 2012-09-29 00:17:36 +02:00
Michael Stapelberg 72c66a2091 Merge branch 'master' into next 2012-09-29 00:03:42 +02:00
Michael Stapelberg 31e8d7f2f8 Bugfix: Correctly move floating windows to invisible workspaces cross-output (Thanks swh) 2012-09-29 00:02:41 +02:00
Michael Stapelberg 43d486441d Bugfix: with one ws per output, don’t crash on cross-output moves (Thanks moju)
fixes #827
2012-09-28 23:04:37 +02:00
Michael Stapelberg 66b389cba1 Make the resize command honor criteria (Thanks Tblue)
fixes #816
2012-09-28 20:36:25 +02:00
Michael Stapelberg 2252b4f5b9 Merge branch 'master' into next 2012-09-28 19:47:16 +02:00
Michael Stapelberg a082cf8c65 Bugfix: Draw h-split indicator at the right position
fixes #817
2012-09-28 19:46:50 +02:00
Michael Stapelberg 5d8e3f58f6 Fix 'border toggle' (it "skipped" 1px border) (Thanks joepd)
fixes #818
2012-09-28 19:29:14 +02:00
Michael Stapelberg cd2a1267c8 Merge branch 'master' into next 2012-09-28 18:24:04 +02:00
Michael Stapelberg 8480b4cb58 Bugfix: don’t crash when dragged floating window closes (Thanks darkraven)
Previously, while the loop would not be executed anymore, the callback
(for actually repositioning the window after a MotionNotify) would still
get called once. This commit avoids that, thus fixing the crash.

fixes #819
2012-09-28 18:23:01 +02:00
Simon Elsbrock da2b47c1e5 fix crash: send non-floating window with floating parent to scratchpad (thanks pkordy)
Fix a crash that occured when moving a window to the scratchpad that is
seemingly floating to the user, but actually a descendant of a floating
parent con (and itself non-floating). If that is the case, move the
floating parent container to scratchpad instead of the window.

fixes #740
2012-09-28 17:58:58 +02:00
Michael Stapelberg 584a6b6b59 Revert "raise floating windows when focusing (Thanks Marcos)"
This commit breaks floating window keyboard focus order
(t/135-floating-focus.t) when you have > 2 floating windows. Since
keyboard focus is more important than saving one click to raise floating
windows, I revert the commit.

Note that we cannot implement this without keeping a third list (beneath
floating_windows and focus) for the z coordinate of a floating window.
This seems not worth it.

This reverts commit 064be457e5.
2012-09-28 17:57:17 +02:00
Michael Stapelberg 064be457e5 raise floating windows when focusing (Thanks Marcos) 2012-09-27 12:41:38 +02:00
Michael Stapelberg 1cbf665581 remove async-unsafe functions from signal handler 2012-09-27 12:37:27 +02:00
Michael Stapelberg 9c01bdeef7 Revert "Use ev_signal to avoid async-unsafe functions (Thanks Markus)"
This makes our signal handler useless and leads to infinite SIGSEGV
loops because the ev callback handler gets called only from within the
event loop, and control doesn’t necessary get to the event loop…

This reverts commit 514265b529.
2012-09-27 12:34:09 +02:00
Simon Elsbrock 87525ad2d6 fix crash: urgent floating con on separate workspace (thanks Piotr)
If there is a single floating con on a separate workspace that is not
focused, and this con becomes urgent, switching back to that workspace
may result in a crash of i3. This is because while setting the urgency
of parent containers, 'parent' may become NULL in case of floating
containers. This commit checks the validity of parent.

fixes #821
2012-09-27 12:21:18 +02:00
Michael Stapelberg dcf95fd312 Merge branch 'master' into next 2012-09-27 12:10:14 +02:00
Michael Stapelberg a3f3d5670c Bugfix: properly react to windows being unmapped before we can reparent (Thanks xeen, darkraven)
We need to verify that setting the event mask works, and we need to
include StructureNotify to get unmap events at any point in time.
Thanks darkraven for the pointer.

fixes #718
2012-09-27 12:09:06 +02:00
Michael Stapelberg c31b3b296a Bugfix: Correctly clear the urgency hint when the window is underneath a split-con (+test)
Previously, when you had an urgent container in a stack on some
invisible workspace (say urxvt) and you switched to it, the urgency hint
was not properly cleared.
2012-09-25 15:40:08 +02:00
Michael Stapelberg 0aa306890b Merge branch 'master' into next 2012-09-24 23:59:30 +02:00
Michael Stapelberg 372d47842e Bugfix: Render workspaces created by assignments to use correct coordinates (Thanks meaneye)
Previously, i3 would send width=0, height=0 to windows which were put on
workspaces created by an assignment (that is, invisible workspaces,
which do not get rendered normally).

fixes #653
2012-09-24 23:57:58 +02:00
noxxun 14e6fc77ad rendering: fix bottom line of tabbed borders decoration not continuous
fixes #814

Signed-off-by: noxxun <noxxun@gmail.com>
2012-09-24 23:17:29 +02:00
Yaroslav Molochko 04c58c7325 Implement variable border widths for pixel/normal
fixes #325
2012-09-24 22:20:29 +02:00
Deiz b235c469c1 Display appropriate cursors when resizing or moving floating windows. 2012-09-23 22:05:19 +02:00
Deiz e582e19ffd Clicking the root window should try to focus the relevant workspace. 2012-09-23 16:39:35 +02:00
Deiz a080794e59 Replace duplicate "__" workspace prefix checks with a single function. 2012-09-23 15:47:35 +02:00
Sascha Kruse 2a7359e449 draw empty title if WM_NAME is empty
fixes #811
2012-09-23 12:00:45 +02:00
Sascha Kruse 1806c9802e add descriptive titles to split containers 2012-09-22 20:09:39 +02:00
Sascha Kruse d8a036d776 mark parents of urgent container also as urgent 2012-09-22 19:31:34 +02:00
Michael Stapelberg 1e143feab1 Close empty workspaces after cross-output move (+test) (Thanks chrysn)
fixes #795
2012-09-22 19:03:19 +02:00
darkraven 9aff503a55 remove unnecessary code in render_con().
The removed code was add by commit 61b8a62 to fix #564. That bug is cause
by rendering the mplayer window again as a floating window (even if it
has been rendered before as a fullscreen window, at line 202). So simply
checking for fullscreen window is enough to solve this problem. Treating
floating/tiling fullscreen window differently is not needed.
2012-09-22 18:13:47 +02:00
Deiz eb4a7f725d In get_output_next(), avoid an off-by-one for adjacent outputs and || mutually-exclusive failure conditions. 2012-09-22 18:12:49 +02:00
Michael Stapelberg 19883108a9 Make get_output_next() work with non-aligned RandR setups (+test) (Thanks Feh, swh, Moritz)
A good visualization of the new algorithm is this:

           +--------+
           |        |
+--------+=|   S1   |========================
|        | |        |
|   S0   | +--------+
|        |         +--------+
+--------+=========|        |================
                   |   S2   | +--------+
                   |        | |        |
                   +--------+ |   S3   |
                              |        |
                              +--------+

When focus is on S0, 'focus output right' will first match S1 (the
closest output which overlaps in the highlighted area), then S2, but not
S3 (since S3 does not overlap into the highlighted area).

fixes #669
fixes #771
2012-09-22 16:54:59 +02:00
Sebastian Ullrich 236f9f45e3 Make "[move] workspace number" accept a default ws name after the ws number 2012-09-22 14:34:05 +02:00
Michael Stapelberg c69fba3662 cfgparse: be forgiving about a missing "ms" after a duration
While it’s certainly better and clearer to specify it, we should do the
right thing when the unit is missing, just like CSS for example
(margin: 0; is okay, margin: 0px; too).
2012-09-22 14:21:35 +02:00
Simon Elsbrock 28104a480c implement delayed urgency hint reset
If there is a client with an urgency hint on another workspace and
switching to this workspace would cause the urgency to be reset (by
moving the focusing to the client), delay the reset by some time. This
gives the user the chance to see it.

This commit adds the possibility to configure the urgency delay timer
duration using the 'force_display_urgency_hint' directive. Also,
documentation and a testcase was added to allow for automated checks of
the intended behavior.

fixes #482
2012-09-22 14:12:09 +02:00
chrysn e15e37f922 fixes #776
this implements both the "move container to workspace back_and_forth" command
and movements to the same workspace when auto_back_and_forth is set.

it includes documentation and test suite additions by michael.

it also simplifies the workspace_show_by_name function (making use of
workspace_get accepting NULL pointers).
2012-09-22 13:35:31 +02:00
Pavel Löbl 7cffd79140 Add new subscribe event 'mode' for binding mode changes
Introducing a new event to subscribe called mode. It's fired up
when i3 changes binding mode (like switching from default to resize).
IPC guide adjusted also.
2012-09-22 12:52:49 +02:00
Michael Stapelberg 8c8fce82e5 add proper error handling for in-place restarts (Thanks Markus)
fixes #806
2012-09-21 16:47:43 +02:00
Michael Stapelberg 514265b529 Use ev_signal to avoid async-unsafe functions (Thanks Markus)
Functions such as fprintf() might be unsafe to use in a signal handler,
see http://stackoverflow.com/questions/3941271/#answer-3941563

By using ev_signal, libev will use a tiny signal handler which just
passes on the information and then calls (outside of the signal handler)
our callback function which can use fprintf() and other unsafe
functions.

fixes #803
2012-09-21 16:35:25 +02:00
Michael Stapelberg 7104780558 spelling fix: s/succesfully/successfully/ 2012-09-20 10:55:03 +02:00
Michael Stapelberg b9fde552d0 fix make clean targets 2012-09-19 18:05:51 +02:00
Michael Stapelberg 99e91c8049 --help: note that nVidia’s driver supports RandR from 302.17 on 2012-09-19 17:52:56 +02:00
Michael Stapelberg cd4dd365e8 Allow changing the layout of workspaces by storing it (Thanks mhcerri)
Before commit 4976fa3350, setting the
layout of workspaces to something else than the default would just mess
up the parent container of the workspace (the content container).

After that commit, it would create an unnecessary split container when
you change the layout _before_ opening any containers. To avoid this, we
now store the layout (similar to how the 'workspace_layout'
configuration directive works) and apply it when the first container is
attached to the workspace.

Fixes #796
2012-09-16 22:53:41 +02:00
Michael Stapelberg d660c4bcff Merge branch 'master' into next 2012-09-16 17:59:55 +02:00
Simon Elsbrock fe6e1f496a toggle fullscreen on 'scratchpad show'
If the focused application is in fullscreen mode and 'scratchpad show'
is executed, toggle the fullscreen mode before showing the scratchpad
application. Otherwise, the scratchpad app would not be visible anyways
but focus would be stolen.

fixes #613
2012-09-16 17:59:35 +02:00
Michael Stapelberg 794783defb Merge branch 'master' into next 2012-09-14 13:18:04 +02:00
Michael Stapelberg 15499bf8e7 Bugfix: Don’t focus the wrong workspace when moving to scratchpad (+test) (Thanks loblik)
The problem was that scratchpad_move() didn’t check whether the source
workspace was focused. Therefore, 'move scratchpad' only worked reliably
interactively , but not when used with criteria.
2012-09-14 13:17:32 +02:00
Michael Stapelberg 8abd1c48f7 Only launch i3-nagbar for parse errors 2012-09-11 13:17:36 +02:00
Michael Stapelberg 40b12c0a4d Remove support for resize increment size hints for tiling windows
As discussed on the mailing list and the bugtracker.

fixes #540
2012-09-11 13:11:47 +02:00
Michael Stapelberg 0db93d9072 sighandler: use non-existing backtrace filenames ($TMPDIR/i3-backtrace.%pid.%idx.txt) 2012-09-11 13:07:20 +02:00
Michael Stapelberg e713283605 sasprintf() already handles errors, we don’t need to do that twice 2012-09-11 13:02:59 +02:00
Michael Stapelberg 9d8a4ebc61 sighandler: provide gdb with pipe stdin/stdout fds (necessary for gdb < 7.5) 2012-09-11 12:57:53 +02:00
Bas Pape 38869004fe Replace exit with backtrace in crash dialog
When the user hits 'b', attach gdb and dump a backtrace to the tmpdir
2012-09-11 12:46:03 +02:00
Michael Stapelberg b4afd20d21 use pwd -P instead of readlink -f (Thanks Marcus Crestani)
readlink -f does not work on Mac OS X
2012-09-09 15:39:49 +02:00
Michael Stapelberg 02ce246caf build fix: remove src/cmdparse.* in make clean
This was removed in commit 8853334bbe
2012-09-09 15:30:37 +02:00
Michael Stapelberg a1823e59ff don’t errnously detect --release bindings as duplicates 2012-09-06 18:11:16 +02:00
Michael Stapelberg 548d74015c ignore modifiers for KeyRelease bindings
For the following binding:

    # Simulate ctrl+v upon pressing $mod+x
    bindsym --release $mod+x exec --no-startup-id xdotool key --clearmodifiers ctrl+v

you can now use either:
1. press $mod, press x, release x, release $mod
2. press $mod, press x, release $mod, release x

fixes #485
2012-09-06 17:24:30 +02:00
Michael Stapelberg c6c6d3a952 naive implementation of 'bindsym --release' (and bindcode)
The implementation is naive because the user has to generate exactly the
event he specified. That is, if you use this binding:

    bindsym --release $mod+x exec import /tmp/latest-screenshot.png

Then it will only be triggered if you hit $mod, hit x, release x,
release $mod. It will not be triggered if you hit $mod, hit x, release
$mod, release x. The reason is that the KeyRelease event in the latter
case will not have the modifier in its flags, so it doesn’t match the
configured binding.
2012-09-06 17:04:31 +02:00
Michael Stapelberg f44d4ce4b3 re-indent src/config.c 2012-09-06 15:55:38 +02:00
Michael Stapelberg 1e3e6997f4 rendering: ceil() instead of truncating for tabbed deco_rect width (Thanks szalik)
In tabbed mode, the available width (say 1280) is divided by the amount
of child containers (say 3). Before this commit, we just truncated the
result and would end up with 426 + 426 + 426 = 1278 pixels that we
render to. Now we render a bit too much, but that’ll at least not give
us graphics corruption on any side :).

fixes #791
2012-09-05 23:54:56 +02:00
Michael Stapelberg 34391ae885 fix format string warnings 2012-09-05 22:26:59 +02:00
Michael Stapelberg d644dbff64 bugfix: forgot to mark split containers as split = true (+test) (Thanks szalik)
When the workspace layout (formerly orientation) was forced to change
due to a move command, the split container we created was not marked as
split = true, which caused tree_flatten() to errnously kill the contents
of it and thus one window ended up unmanaged.

Also, the logic in tree_flatten() was inverted due to commit de94f6da.

fixes #790
2012-09-05 22:26:52 +02:00
Michael Stapelberg 32d4dbf70f startup-notifications: keep sequence around for 30s after completion
This changes the fact that Firefox would not be launched on the correct
workspace because it marked the startup sequence as completed *before*
actually mapping all of its windows.

To test this, go to workspace 3 and run this command in a terminal:
    i3-msg 'exec iceweasel; workspace 4'
That will make i3 start iceweasel (and create a proper startup
notification context for it), then immediately switch to workspace 4
(before iceweasel could possibly start).

The iceweasel window(s) should appear on workspace 3.
2012-09-05 21:02:52 +02:00
Michael Stapelberg 8d2799c251 Merge branch 'master' into next 2012-09-05 17:09:43 +02:00
Michael Stapelberg f5a7492a11 Bugfix: Use _exit() instead of exit to avoid calling atexit functions (Thanks f8l)
Basically, this is the same fix as commit 914ca6cf :-/. Once again, we
called exit() instead of _exit(), but this time it lead to a kill(0,
SIGTERM), effectively killing all processes in the i3 process group,
including i3 itself. The cause for the kill(0) is that nagbar_pid is set
to 0 by fork(), signaling we’re in the child process. The cleanup
handler only checks for nagbar_pid being -1 as a special value, however.
2012-09-05 17:09:23 +02:00
Michael Stapelberg 4976fa3350 con_set_layout: always use the parent container, handle workspaces properly
Previously, in case 'layout stacked' (for example) had been called
interactively, con_set_layout would be called with focused->parent,
while with for_window, it’d be called on the actual matching container.

This difference in behavior was the cause for the inability to use
'for_window [class="XTerm"] layout tabbed', which now works \o/, but
more on that below.

The change also allows us to handle the case of the user selecting a
CT_WORKSPACE container properly, that is, by using the special case and
creating a new split container on the workspace which gets all the
contents, but a new layout.

Now, before you are enthusiastic about the change and try to use
for_window magic in your config file, keep in mind: The 'layout' command
acts on the parent split container. That is, when using a line such as
this one:

    for_window [class="XTerm"] layout tabbed

…and opening an XTerm when on a workspace with one single other window,
the whole workspace will be set tabbed (just as previously when you
opened an XTerm and sent 'layout tabbed' manually).

Therefore, to open XTerm in its own tabbed split container, you need to
split before:

    for_window [class="XTerm"] split v, layout tabbed

The comma here is important! It says that the second command should not
be treated as an entirely unrelated command, but it should also relate
the matching window (while it does work with a ';', that is prone to
race-conditions and should be avoided).

fixes #358
2012-09-05 00:22:38 +02:00
Michael Stapelberg 2a37089ad1 Merge branch 'master' into next 2012-09-04 22:49:16 +02:00
Michael Stapelberg 8176b55b7b Bugfix: fix flickering with 1pixel border tabbed layouts (Thanks julien)
When you have a tabbed container which has had more than one container
but currently has precisely one container, there was a bit of flickering
when switching workspaces occasionally. This commit fixes it by properly
setting the height of the deco_rect (and thus the X11 window) to not
make the old window contents show up for a minimum period of time.

fixes #777
2012-09-04 22:47:12 +02:00
Michael Stapelberg 65e5bcfdf4 Merge branch 'master' into next 2012-09-04 20:21:31 +02:00
Michael Stapelberg 5b95e20a62 Bugfix: Don’t allow ConfigureRequests while in fullscreen (Thanks Piotr)
This fixes a compatibility issue with gnome-terminal and xfce’s
terminal, where fullscreening would lead to moving the window and not
displaying the contents properly.

fixes #788
2012-09-04 20:21:07 +02:00
Michael Stapelberg 73d5dcbbaf x: grab server and process pending events before managing existing windows
fixes #782
2012-09-04 18:02:37 +02:00
Michael Stapelberg 4636eb840d fix compilation with older xcb-util with -DXCB_COMPAT (Thanks okraits) 2012-09-03 14:55:27 +02:00
Michael Stapelberg 6d8f61205d accept slashes in RandR output names (+test) (Thanks dbp)
fixes #785
2012-08-28 13:26:12 +02:00
Sebastian Ullrich d29b62f24f Remove dead code in cmd_workspace_number
If a ws doesn't exist, maybe_back_and_forth
will never return true for it.
2012-08-22 17:58:08 +02:00
Sebastian Ullrich eadf1e306f Fix 'back and forth' in 'workspace number' for named ws 2012-08-22 17:57:32 +02:00
Sebastian Ullrich bb853660cf Create ws in "move workspace number n" if not existing
fixes #729
2012-08-22 17:08:02 +02:00
Michael Stapelberg 4622cde7b7 Merge branch 'master' into next 2012-08-22 16:02:02 +02:00
Joel Stemmer 1089b0b201 fix resizing floating windows by height
When resizing floating windows, changing the height was not correctly
handled. This commit fixes that and adds testcases for shrinking and
growing the width and height of floating windows.
2012-08-22 16:01:40 +02:00
Michael Stapelberg 5257a1268f Bugfix: don’t change tabbed/stacked cons to splitv/splith layout (Thanks Merovius)
To automagically do the right thing when rotating monitors with regards
to splith/splitv layout (depending on width/height of the monitor), we
change the orientation of existing workspaces and the first child.

If that first child happens to be a stacked/tabbed con, we cannot change
the layout unconditionally (previously, the orientation was not in the
layout, so we never noticed this problem).

fixes #768
2012-08-17 01:55:31 +02:00
Michael Stapelberg d7b11bde28 i3 --moreversion: use readlink /proc/$pid/exe instead of realpath(argv[0])
The latter is actually wrong. For example, when running i3
--moreversion, it will print $(pwd)/i3 instead of $(which i3). In my
previous tests, this coincidentally was the same.
2012-08-13 13:38:04 +02:00
Fernando Tarlá Cardoso Lemos 6ff3f7abad libi3: Implement Pango rendering 2012-08-13 11:39:30 +02:00
Fernando Tarlá Cardoso Lemos ec17a26b0e libi3: Rework font to support multiple backends 2012-08-13 11:39:29 +02:00
Quentin Glidic 210fc6dfed libi3: Rework predict_text_width
predict_text_width now takes an i3String as argument
2012-08-13 11:37:23 +02:00
Quentin Glidic 53365fa887 libi3: Rework draw_text
We now have two versions of draw_text
draw_text: Now takes an i3String
draw_text_ascii: Designed for static strings in plain ASCII
2012-08-13 11:37:21 +02:00
Quentin Glidic bf177da17d i3/sighandler: Pre-compute i3Strings for text 2012-08-13 11:30:08 +02:00
Quentin Glidic b6c705a1a4 i3/window: Port window names to i3String 2012-08-13 11:30:08 +02:00
Quentin Glidic b01545b131 Makefile: Always link libi3 first 2012-08-13 02:00:01 +02:00
Michael Stapelberg a7569e6a98 implement error messages when moving to another ws fails (Thanks eeemsi)
fixes #769
2012-08-13 01:57:39 +02:00
Michael Stapelberg 4eff386439 remove obsolete branch reference "(tree)" from starting line 2012-08-13 01:57:23 +02:00
Michael Stapelberg e68a8dd86c shm-logging: implement i3-dump-log -f (follow)
This changes the SHM log format, it doesn’t use 0-bytes to separate
entries anymore. Instead of using lots of printf() calls in i3-dump-log,
we now do precisely one big write().

So, to be clear: i3-dump-log and i3 both need to be upgraded.
Mismatching versions will lead to garbage output (no crashes of i3, just
garbage output).

The -f flag uses an inter-process pthread_cond_t in the shared memory
header to broadcast the arrival of new messages to all i3-dump-log
processes. This internally uses futexes and thus doesn’t even mean a
kernel call in most cases. inter-process pthread_cond_ts require NPTL
(the Native Posix Thread Library, introduce in Linux 2.6).
2012-08-13 01:06:09 +02:00
Michael Stapelberg dbe406641f use errx() instead of err() for custom error message 2012-08-12 18:34:03 +02:00
Michael Stapelberg 68a23b9577 Bugfix: only honor _NET_ACTIVE_WINDOW for visible windows (+test) (Thanks Tucos)
fixes #774
2012-08-12 16:08:53 +02:00
Michael Stapelberg 1e49f1b08a Implement i3 --moreversion
From the code:

    Connects to i3 to find out the currently running version. Useful since it
    might be different from the version compiled into this binary (maybe the
    user didn’t correctly install i3 or forgot te restart it).

Here is an example output:

    $ ./i3 --moreversion
    Binary i3 version:  4.2-202-gb8e782c (2012-08-12, branch "next") © 2009-2012 Michael Stapelberg and contributors
    Running i3 version: 4.2-202-gb8e782c (2012-08-12, branch "next") (pid 14804)

    The i3 binary you just called: /home/michael/i3/i3
    RUNNING BINARY DIFFERENT FROM BINARY ON DISK!
    The i3 binary you are running: /home/michael/i3/i3

    $ i3 restart
    2012-08-12 15:05:28 - Additional arguments passed. Sending them as a command to i3.
    IPC: received EOF instead of reply

    $ ./i3 --moreversion
    Binary i3 version:  4.2-202-gb8e782c (2012-08-12, branch "next") © 2009-2012 Michael Stapelberg and contributors
    Running i3 version: 4.2-202-gb8e782c (2012-08-12, branch "next") (pid 14804)

    The i3 binary you just called: /home/michael/i3/i3
    The i3 binary you are running: /home/michael/i3/i3
2012-08-12 15:10:13 +02:00
Michael Stapelberg 394b395455 set I3_PID atom on the root window 2012-08-12 13:51:47 +02:00
Michael Stapelberg 884627ef20 use I3__FILE__ for DLOG, leave __FILE__ as is
See also commit 0e752070ac, which broke
source code listings in gdb unless you cd into i3/src. This should give
us best of both :-).
2012-08-12 12:19:47 +02:00
Philipp Middendorf 6225a8983d Bugfix: Properly resize transient floating windows with a decoration
fixes #770
2012-08-12 00:36:26 +02:00
Michael Stapelberg 91786c3801 typo: s/transiert/transient/ 2012-08-11 22:53:40 +02:00
Julius Plenz 70ec3867fe clean up zero-byte logfile on immediate exit
Otherwise, a zero-byte log file stays behind after every call to `i3
--get-socketpath`. Also, replace "return" calls with more explicit "exit"
calls.

Before:

$ ls -ld /tmp/i3* | wc -l; \
  repeat 10 i3 --get-socketpath >/dev/null; \
  ls -ld /tmp/i3* | wc -l
1
11

Now:

$ ls -ld /tmp/i3* | wc -l; \
  repeat 10 i3 --get-socketpath >/dev/null; \
  ls -ld /tmp/i3* | wc -l
1
1

Signed-off-by: Julius Plenz <julius@plenz.com>
2012-08-11 02:23:03 +02:00
Michael Stapelberg 6ba0944430 scratchpad: fix moving scratchpad window
From the source:

    When starting i3 initially (and after each change to the connected
    outputs), this function fixes the resolution of the __i3
    pseudo-output. When that resolution is not set to a function which
    shares a common divisor with every active output’s resolution,
    floating point calculation errors will lead to the scratchpad window
    moving when shown repeatedly.

fixes #632
2012-08-08 18:45:40 +02:00
Michael Stapelberg 95cdfe5cb6 makefile: remove the old loglevels.tmp and loglevels.h on 'make clean' 2012-08-07 10:03:10 +02:00
Michael Stapelberg 0e752070ac explicitly set filenames to $(basename __FILE__)
This makes the debug log a bit more readable, especially since commit
48f1e383ca
2012-08-07 09:55:52 +02:00
Michael Stapelberg fa4894fbaa Support _NET_ACTIVE_WINDOW ClientMessages
Since we advertise _NET_ACTIVE_WINDOW support (but only set the
corresponding atom currently), it makes sense to also support the
ClientMessage. Apps such as Gajim use it to set focus to the roster
window when clicking on the tray icon for example.

fixes #767
2012-08-07 09:50:47 +02:00
Michael Stapelberg 122130d868 handlers.c: don’t call x_push_changes(croot), tree_render() already does 2012-08-07 09:50:25 +02:00
Michael Stapelberg 1a62c398ac Bugfix: Attach con to nc before calling con_border_style_rect() 2012-08-07 01:13:37 +02:00
Philipp Middendorf 9d9a1d9d29 Bugfix: Add deco_height only when in "normal" border mode.
Also, use con_border_style_rect instead of hard-coded values to
determine the border size.
2012-08-07 01:05:16 +02:00
Michael Stapelberg 506b7f4004 Bugfix for previous commit: Don’t crash with dock windows 2012-08-06 03:11:11 +02:00
Axel Wagner 57effd65b2 Make horizontal edge-borders hidable too 2012-08-06 03:03:00 +02:00
Michael Stapelberg 1b2d222449 Properly report errors in 'focus parent' (Thanks eeemsi)
Also, make X11 errors debug log level only. They are harmless usually.

fixes #762
2012-08-05 20:57:20 +02:00
Michael Stapelberg afc16953b9 correctly store last_split_layout when we are dealing with a workspace-level layout change (Thanks aksr)
fixes #763
2012-08-05 20:52:42 +02:00
Iakov Davydov f27735f620 create hide_edge_borders option 2012-08-05 20:26:15 +02:00
Michael Stapelberg 48f1e383ca makefile: canonicalize path when compiling
Compilers store the path with which they were called in the debug
symbols. Therefore, this will make backtraces show something like
../i3-4.2/src/main.c instead of src/main.c.

See also http://stackoverflow.com/questions/6473561/
2012-08-05 17:00:24 +02:00
Michael Stapelberg 952e5b6059 pre-compile all.h, saves quite some build time
before:

$ time CC=clang make -j16
CC=clang make -j16  6,04s user 0,86s system 468% cpu 1,471 total
CC=clang make -j16  6,05s user 0,87s system 468% cpu 1,477 total
CC=clang make -j16  6,15s user 0,86s system 464% cpu 1,510 total
CC=clang make -j16  6,05s user 0,93s system 467% cpu 1,493 total
CC=clang make -j16  6,10s user 0,84s system 461% cpu 1,507 total

$ time CC=gcc make -j16
CC=gcc make -j16  9,91s user 1,43s system 508% cpu 2,231 total
CC=gcc make -j16  10,02s user 1,37s system 500% cpu 2,275 total
CC=gcc make -j16  9,80s user 1,60s system 507% cpu 2,245 total
CC=gcc make -j16  10,02s user 1,44s system 506% cpu 2,264 total
CC=gcc make -j16  9,99s user 1,45s system 505% cpu 2,261 total

after:

$ time CC=clang make -j16
CC=clang make -j16  3,41s user 0,83s system 375% cpu 1,131 total
CC=clang make -j16  3,29s user 0,90s system 373% cpu 1,122 total
CC=clang make -j16  3,35s user 0,77s system 369% cpu 1,116 total
CC=clang make -j16  3,36s user 0,78s system 374% cpu 1,105 total
CC=clang make -j16  3,46s user 0,75s system 373% cpu 1,126 total

$ time CC=gcc make -j16
CC=gcc make -j16  10,74s user 1,44s system 494% cpu 2,462 total
CC=gcc make -j16  10,68s user 1,54s system 497% cpu 2,453 total
CC=gcc make -j16  10,60s user 1,60s system 488% cpu 2,499 total
CC=gcc make -j16  10,63s user 1,51s system 485% cpu 2,502 total
CC=gcc make -j16  10,70s user 1,51s system 497% cpu 2,453 total

Therefore, we enable pre-compiled headers only when CC=clang.
2012-08-05 16:44:11 +02:00
Michael Stapelberg 8a1c8115ca fix a few warnings/places where the clang static analyzer complains 2012-08-05 16:34:38 +02:00
Michael Stapelberg 78f5f2204d ipc: implement GET_VERSION to find out the i3 version
This is useful for third-party scripts which require certain features
and want to error out cleanly when they are run with an old i3 version.

Additionally, i3 --version might be different from what’s actually
running (an old version of the binary), so i3-msg -t get_version will be
the best way to figure out the i3 version you are actually running from
this commit on.
2012-08-05 14:30:05 +02:00
Michael Stapelberg ac8b2f637f cleanup i3 sync protocol messages 2012-08-04 16:34:57 +02:00
Michael Stapelberg 1d95d296a5 parser: remove debug messages
The new parser is proven by now (v4.2 was released 4 months ago), so
removing these messages will make the logfile more readable.
2012-08-04 16:31:57 +02:00
Michael Stapelberg fb4ee17b05 Merge branch 'master' into next 2012-08-04 16:10:37 +02:00
Michael Stapelberg 74510c59c7 floating_fix_coordinates: properly deal with negative positions 2012-08-04 16:09:16 +02:00
Michael Stapelberg d57d51da6d Bugfix: Properly fix floating coordinates when disabling outputs (Thanks Tucos)
Since the content containers are not yet updated (they will be when
rendering), we need to use the output containers’s rects instead.
2012-08-04 16:09:16 +02:00
Michael Stapelberg e867fd8105 Bugfix: fix floating coordinates when moving assigned workspaces 2012-08-04 16:09:10 +02:00
Michael Stapelberg e36674c5b8 Fix a crash when the current output cannot be determined (Thanks Tucos)
This is only a cosmetical change though, the fix for the root cause can
be found in the commits following this one.
2012-08-04 15:19:11 +02:00
Michael Stapelberg 79083f3b34 ensure the layout is not L_DEFAULT anymore, even if last_split_layout is not initialized (Thanks eeemsi) 2012-08-04 03:43:12 +02:00
Michael Stapelberg de94f6da1a Introduce splith/splitv layouts, remove orientation
With this commit, the "default" layout is replaced by the splith and
splitv layouts. splith is equivalent to default with orientation
horizontal and splitv is equivalent to default with orientation
vertical.

The "split h" and "split v" commands continue to work as before, they
split the current container and you will end up in a split container
with layout splith (after "split h") or splitv (after "split v").

To change a splith container into a splitv container, use either "layout
splitv" or "layout toggle split". The latter command is used in the
default config as mod+l (previously "layout default"). In case you have
"layout default" in your config file, it is recommended to just replace
it by "layout toggle split", which will work as "layout default" did
before when pressing it once, but toggle between horizontal/vertical
when pressing it repeatedly.

The rationale behind this commit is that it’s cleaner to have all
parameters that influence how windows are rendered in the layout itself
rather than having a special parameter in combination with only one
layout. This enables us to change existing split containers in all cases
without breaking existing features (see ticket #464). Also, users should
feel more confident about whether they are actually splitting or just
changing an existing split container now.

As a nice side-effect, this commit brings back the "layout toggle"
feature we once had in i3 version 3 (see the userguide).

AFAIK, it is safe to use in-place restart to upgrade into versions
after this commit (switching to an older version will break your layout,
though).

Fixes #464
2012-08-04 03:13:24 +02:00
Michael Stapelberg 1b3435807a add missing \n in debug message 2012-08-04 03:12:06 +02:00
Michael Stapelberg cc7f16007a Display i3-nagbar when commands lead to an error
e.g. pressing Mod1+x when having the following in your configfile:

    bindsym Mod1+x some invalid command

will lead to an i3-nagbar instance popping up, offering you to view the
error log (which will contain parser errors from this commit on).
2012-08-02 17:45:09 +02:00
Michael Stapelberg 9f05354c1f cfgparse: Write custom scripts for i3-sensible-terminal
This workaround is necessary for terminal emulators which parse -e in a
different way: some accept a list of arguments (-e command arg1 arg2 …),
some accept only one argument (-e "command arg1 arg2 …"). Therefore, we
just create a script and pass that as the one and only argument.
2012-08-02 15:17:10 +02:00
Quentin Glidic 0b4ee7a1da common.mk: Split XCB common flags 2012-07-23 00:12:55 +02:00
Quentin Glidic 5e0cd52f10 common.mk: Split XCB keyboard flags 2012-07-23 00:06:37 +02:00
Quentin Glidic 51a0f312f2 common.mk: Split WM XCB flags 2012-07-23 00:04:01 +02:00
Quentin Glidic fde8c0dd85 common.mk: Split Xlib flags 2012-07-23 00:04:01 +02:00
Quentin Glidic 5cf3751482 common.mk: Move -lm to i3_LIBS 2012-07-22 23:53:51 +02:00
Quentin Glidic 60bc6b0400 common.mk: Split Xcursor flags 2012-07-22 23:53:51 +02:00
Quentin Glidic 85b261c162 common.mk: Split yajl flags 2012-07-22 23:53:51 +02:00
Quentin Glidic 30934ea316 common.mk: Split libev flags 2012-07-22 23:53:51 +02:00
Quentin Glidic 79fc8462c0 common.mk: Split libpcre flags 2012-07-22 23:53:51 +02:00
Quentin Glidic e232c06885 common.mk: Split libstartup-notification flags 2012-07-22 23:53:51 +02:00
Quentin Glidic c7029a5e21 common.mk: Introduce I3_*FLAGS
CPPFLGES, CFLAGS and LDFLAGS should be user variables
We now provide default flags but use I3_*FLAGS flags for our own needed
flags

Also reoder lib flags a bit
2012-07-22 23:53:49 +02:00
Quentin Glidic 3b1b72ecbb *.mk: Support passing specific CFLAGS/LIBS 2012-07-22 23:53:13 +02:00
Michael Stapelberg ac7278eb1a resizing: traverse containers up properly (+test) (Thanks oblique)
In certain situations (when you have a h-split within a h-split) you
couldn’t properly resize previously. This commit makes the resize
command properly traverse up the containers.

fixes #754
2012-07-22 21:37:26 +02:00
Michael Stapelberg a97e70d483 Merge branch 'master' into next 2012-07-22 21:26:00 +02:00
Michael Stapelberg 83dc5d5cb6 Bugfix: Fix duplicate return value for 'resize' command 2012-07-22 21:25:38 +02:00
Quentin Glidic e452acb30e Add stub Makefiles to allow subdir make calls 2012-07-22 19:57:48 +02:00
Quentin Glidic e3b9ffe381 Move libi3 to the new Makefile layout 2012-07-22 19:57:21 +02:00
Quentin Glidic 8853334bbe New Makefile layout, move i3 to it 2012-07-22 19:57:18 +02:00
Quentin Glidic bdc078914b i3: Replace loglevels by a global debug logging
File-limited were not used nor really useful
Besides, they are painful to maintain in Makefile rules compared to the
benefit
2012-07-22 18:41:12 +02:00
Michael Stapelberg c5d0472158 Explicitly disconnect in the 'exit' command
This fixes a race condition when running the tests. I think that the X11
server has more time to clean up the resources when we do an explicit
disconnect. The symptom I was seeing was that sometimes, i3 couldn’t
become the window manager on one of the Xdummy instances.
2012-06-29 23:13:25 +02:00
Michael Stapelberg 072daa94b3 Merge branch 'master' into next 2012-06-27 17:49:36 +02:00
Michael Stapelberg 6e9bbe67ce Bugfix: fix reload crashes in rare cases (Thanks Tucos)
Depending on the memory layout, it could happen that bind->command was
exchanged with something else while the parser still accessed it.

Therefore, we now copy the command and let the parser use that copy.
2012-06-27 17:48:22 +02:00
Michael Stapelberg 7afb33d8f8 Merge branch 'master' into next 2012-06-25 21:44:20 +02:00
Michael Stapelberg 6146f39b8a when using i3 -C, don’t send remaining arguments via IPC (Thanks Somelauw) 2012-06-25 21:43:41 +02:00
Michael Stapelberg ecd238b65e ignore "current" when searching for named workspaces 2012-06-03 19:44:42 +02:00
Pavel Löbl 2afecaf355 Add a new command 'move to workspace current'
Added a new command 'move to workspace current' which can be used
with criteria to move a window to the current workspace.
2012-06-03 19:42:56 +02:00
Pavel Löbl 51173baf28 Fix 'move to workspace' when used with criteria
When moving window from other (not current) workspace to another
workspace with criteria we should stay on current workspace.

And we should exit early when criteria was specified but didn't
match any window.
2012-06-03 19:41:45 +02:00
Pavel Löbl 4611f875ff Fix a mistake in comment 2012-06-03 19:38:43 +02:00
Fernando Tarlá Cardoso Lemos fffc53c246 Restrict "move to workspace" commands in fullscreen. 2012-06-03 16:24:53 +02:00
Fernando Tarlá Cardoso Lemos 4452bfb942 Prevent moving out of fullscreen containers. 2012-06-03 16:24:53 +02:00
Fernando Tarlá Cardoso Lemos 8bf4e9e059 Restrict directional focus in fullscreen.
This reuses the same fullscreen focus logic to ensure that focus
doesn't escape a fullscreen container.
2012-06-03 16:24:53 +02:00
Fernando Tarlá Cardoso Lemos 250c260eaa Allow focus child/parent when in fullscreen.
This is now restricted according to the already defined fullscreen
focus constraints. Test case 157 was removed, as we don't prevent
level up/down in fullscreen anymore. Those commands are properly
tested in fullscreen by test case 156.

Fixes: #612
2012-06-03 16:24:53 +02:00
Fernando Tarlá Cardoso Lemos da1e232757 Refined the fullscreen focus constraints.
Basically, a focus change can't escape a fullscreen container. The
only exception is per-output fullscreen containers, as you should
be able to focus a container in a different workspace in this case.

This is an improvement on 4eab046e, now considering the difference
between global and per-output fullscreen and taking the tree
structure into account to determine what escaping the fullscreen
container means. It only affects targeted focus commands in the
form "for_window [...] focus", but it lays the foundation for
forthcoming fixes to all other focus commands.
2012-06-03 16:24:53 +02:00
Michael Stapelberg e969ed502b Merge branch 'master' into next 2012-05-16 06:24:53 +02:00
Michael Stapelberg ec4e6d1cdf Fix stray workspaces "number 1" being created when having workspace number 1 in your config 2012-05-16 06:24:16 +02:00
Michael Stapelberg ed957d60a7 Merge branch 'master' into next 2012-05-09 21:08:28 +02:00
Fernando Tarlá Cardoso Lemos 4eab046e8f Allow focus w/ target when in fs in some cases.
If the target is in a different workspace, there's no reason why
we wouldn't allow the user to focus it. We already allow this when
focusing a workspace, for example.
2012-05-09 21:08:19 +02:00
Michael Stapelberg eab9f46c33 Merge branch 'master' into next 2012-05-09 20:39:26 +02:00
Ondrej Grover edae08a4d9 maybe_back_and_forth now sets render_tree 2012-05-09 20:38:41 +02:00
Michael Stapelberg 42dcb4e8c4 make maybe_back_and_forth static 2012-05-09 20:34:40 +02:00
Ondrej Grover b88ab981fd bugfix: less differentiation between named and numbered workspaces
calling workspace by number now also checks for switching back and forth
and creates a new workspace if no workspace starting with that number is
found

also removed the obsolete tree_render() in favor of setting
cmd_output->needs_tree_render to true
2012-05-09 20:33:59 +02:00
Michael Stapelberg 1c0b542c07 Merge branch 'master' into next 2012-05-09 20:06:45 +02:00
Michael Stapelberg 62d3329906 remove dead code
This was a left-over of commit 9d68d780e2
2012-05-09 20:00:46 +02:00
Michael Stapelberg a9b57a44a9 Remove set but never read variable
This was due to the changes in commit d25e77ce75
2012-05-09 19:56:21 +02:00
Michael Stapelberg 2a0fb1db69 Merge branch 'master' into next 2012-05-09 19:47:19 +02:00
Michael Stapelberg eeb6ff9237 Move is_debug_build() to libi3/ 2012-05-09 19:12:20 +02:00
Pavel Löbl d13ba7ca53 Fix floating precision bug
When calculating coordinates we should multiply at first otherwise
we lose precision when i3 is compiled without sse2 support.

The following code prints "Res1: 348 Res2: 349" when compiled with
-O0 -mno-sse2 and "Res1: 349 Res2: 349" with -O0 -msee2.

Note that -msse2 is default flag on 64bit OSes.

int main() {
  double a = 349.0 / 768;
  double b = 349.0 * 768;
  int res1 = a * 768;
  int res2 = b / 768;
  printf("Res1: %d Res2: %d\n", res1, res2);
  return 0;
}

Thanks guys for helping me to hunt down this one.
2012-05-06 14:13:59 +02:00
Michael Stapelberg bbe607899c Send proper error messages upon parser failures, use yajl for generating command replies
Fixes: #693
2012-05-02 22:01:50 +02:00
Michael Stapelberg 5a29eb20e0 Fix spelling of success
Fixes: #695
2012-05-02 20:20:45 +02:00
Michael Stapelberg 280a35717b log.c: len is always positive, remove useless check (Thanks Marcus) 2012-05-02 20:07:59 +02:00
Michael Stapelberg eedd1a64d7 Make log.c figure out the physical amount of memory on Mac OS X (Thanks Marcus) 2012-05-02 20:05:07 +02:00
Michael Stapelberg cc9f0ab353 bump copyright in --version (Thanks joepd) 2012-04-22 13:04:24 +02:00
Michael Stapelberg 2c23eb4c75 cfgparse: accept force-xinerama as a synonym of force_xinerama 2012-04-21 12:48:34 +02:00
Michael Stapelberg 1bb165a29a tests: warp the pointer to in multi-monitor tests to avoid flaky tests 2012-04-09 14:48:57 +02:00
Michael Stapelberg 0f10ccdf12 Implement fake-outputs option (cmdline, cfg) for multi-monitor testing
This kills the dependency on xdmx and makes the testsuite simpler
and more flexible (in the output sizes / configurations).
2012-04-09 14:28:36 +02:00
Michael Stapelberg fa6a3d57d2 Only resize when the left/right mouse button is used, not when scrolling (Thanks eeemsi) 2012-04-08 21:04:21 +02:00
Michael Stapelberg eec41d1276 Fix warning: properly initialize 'workspace' variable 2012-04-08 20:45:49 +02:00
Michael Stapelberg 373b4ad74a Implement 'rename workspace <old_name> to <new_name>' 2012-04-08 20:40:00 +02:00
Michael Stapelberg ad513b4799 Implement 'move [container|window] to workspace number <number>' 2012-04-08 20:33:46 +02:00
Michael Stapelberg 72078c704e Implement 'workspace number <number>' to switch to named workspaces 2012-04-08 19:17:46 +02:00
Michael Stapelberg 42bbdbdfc1 Prevent changing focus outside a container when scrolling on the decorations
Fixes: #557
2012-04-08 18:33:45 +02:00
Michael Stapelberg 849e06f21e Replace the old fullscreen container when requesting fullscreen
Fixes: #510
2012-04-08 17:53:37 +02:00
Michael Stapelberg 2d110c90e6 Implement resize <grow|shrink> <width|height>, use it in the default config
Fixes: #576
2012-04-08 16:00:15 +02:00
Michael Stapelberg 250577da36 Force WM_TAKE_FOCUS event to be sent when clicking
This fixes more problems with Eclipse.
See also commit 1962c30dfb
2012-04-07 16:24:53 +02:00
Peter Bui a29eece9dc Bug 676: if scratchpad window is active on a non-visible workspace, then "scratchpad show" should move it to the current visible workspace. 2012-04-05 18:10:45 +02:00
Jose Pereira 9a58c1fcaa Added option to select primary display on tray_output 2012-04-05 14:42:07 +02:00
Michael Stapelberg 206b96202c Use (void) instead of () for functions without args (Thanks fernandotcl)
See also:
http://article.gmane.org/gmane.linux.kernel/1268792

The C compiler will handle (void) as "no arguments" and () as "variadic
function" (equivalent to (...)) which might lead to subtle errors, such
as the one which was fixed with commit 0ea64ae4.
2012-03-31 10:53:04 +02:00
Michael Stapelberg e19c7b7bae A few style fixes for the previous commit 2012-03-26 17:00:35 +02:00
darkraven 9d68d780e2 Use 32bit visual only when needed. Thus we could drop the --enable-32bit-visual option. 2012-03-26 16:50:44 +02:00
Pavel Löbl f78f137ed0 Extends move command for floating windows 2012-03-25 11:06:49 +02:00
Michael Stapelberg d4523de6c8 Merge branch 'master' into next 2012-03-21 22:30:08 +01:00
Michael Stapelberg 1962c30dfb Force WM_TAKE_FOCUS event to be sent again upon EnterNotify
This fixes focus problems with Eclipse. Apparently, Eclipse waits for getting
notified about the focus, and since it used non-managed windows, i3 didn’t care
to update the focus.

Fixes: #621, #675
2012-03-21 22:27:31 +01:00
Michael Stapelberg 36fdab7b6a Merge branch 'master' into next 2012-03-21 21:41:13 +01:00
Michael Stapelberg 1f6fbaf240 cfgparse: leave EAT_WHITESPACE and BINDSYM_COND states on EOL (Thanks dothebart)
Fixes: #642
2012-03-21 21:40:44 +01:00
Michael Stapelberg 4172e43c9c debugging trick: keep a symbol pointing to I3_VERSION around
This way, gdb will include the i3 version in backtraces.
2012-03-21 20:48:00 +01:00
Michael Stapelberg e09e077b76 Merge branch 'master' into next 2012-03-21 20:24:29 +01:00
Michael Stapelberg afed6da0e5 Bugfix: Fix restart with for_window floating configuration (Thanks garga)
Fixes: #668

Calling tree_close with dont_kill_parent=true will avoid it from closing the
workspace if it’s empty (and it’s temporarily empty, because 'floating disable'
detaches, then re-attaches the window).
2012-03-21 20:14:50 +01:00
Michael Stapelberg 2abfb5a88b Bugfix: Also clear the command parser’s stack upon invalid commands (Thanks helgikrs)
Fixes: #652
2012-03-21 17:20:07 +01:00
Michael Stapelberg ab9ba6fcf9 Use gettimeofday() and struct timevals instead of time()
Initially I thought using the second precision time() function is good enough,
but to make t/113-urgent.t considerably faster (>2s vs. 0.08s), we put in a
little more effort and use gettimeofday. Otherwise, this test blocks the whole
testsuite from completing much faster on modern machines :).
2012-02-21 13:38:49 +01:00
Michael Stapelberg d78da44ad1 cfgparse: also accept negative numbers 2012-02-16 18:41:48 +00:00
D Thompson 82146fcebf Implement support for user configuration of constraints on floating window dimensions. 2012-02-16 18:31:28 +00:00
Michael Stapelberg 5edacf4943 Merge branch 'master' into next 2012-02-15 22:05:28 +00:00
Simon Kämpe 51e6e48992 Highlight i3bar ws when changing output w/ mouse. 2012-02-15 22:05:01 +00:00
Michael Stapelberg 3827d3758c Render only once for all matching assignments (Thanks rami)
Fixes: #608
2012-02-15 21:02:40 +00:00
Michael Stapelberg e114b3dba2 Refactor the interface of commands.c
This change has two implications:

1) tree_render() will now be called precisely once for input which consists of
   multiple commands (like "focus left; focus right"). Also, the caller of
   parse_command() has to call it. This makes us able to fix tickets such as
   ticket #608 (where multiple tree_render() calls are noticable).

2) The output of a command is now a JSON array of return values of the
   individual subcommands. In the case of "focus left; focus right", this is:

   [{"success":true}, {"success":true}]

   While this is incompatible with what i3 returned before, the return value of
   commands was undocumented and therefore not subject to our API stability.
2012-02-15 20:57:25 +00:00
Michael Stapelberg 58ecd14900 Implement support for chosing a 32 bit visual (necessary for pseudo-transparency) (Thanks darkraven)
You need to specify the --enable-32bit-visual flag when starting i3. This is
done because everything feels sluggish on my system when using a 32 bit visual
instead of a 24 bit visual. Fast > fancy.
2012-02-15 18:56:07 +00:00
Fernando Tarlá Cardoso Lemos 36a1a8282f Fix the coords of floating cons when moving workspaces.
Fixes floating containers seemingly showing up in the wrong
workspace after moving workspaces containing floating containers.

We must *always* fix the coordinates of floating containers when
moving workspaces across outputs. That's because the coordinates
of floating containers are *not* relative to the workspaces.
2012-02-15 18:03:37 +00:00
Fernando Tarlá Cardoso Lemos a22f161ab5 If moving the last ws, create a new one in its place.
This seems better than refusing to move the last workspace.
2012-02-15 17:59:33 +00:00
Jeremy O'Brien 53541817ef Implement urgency flag matcher
Currently it supports the following options:
"oldest": match the first window that triggered an urgent event
"latest": match the last window that triggered an urgent event
2012-02-14 22:47:10 +00:00
Michael Stapelberg 82247fd0ab Bugfix: Correctly handle missing ending double quotes (+test) (Thanks mxf) 2012-02-10 19:49:38 +00:00
Michael Stapelberg 2f8d3d3390 Bugfix: Properly handle workspace names with double quotes (+test) (Thanks kvapen) 2012-02-07 22:50:27 +00:00
Michael Stapelberg ed2bcc15e3 Merge branch 'master' into next 2012-02-07 17:42:58 -05:00
Michael Stapelberg 0fc459892e Bugfix: Properly split when the current container is alone within a stacked/tabbed con (+test) (Thanks aksr)
Fixes: #630
2012-02-07 17:42:35 -05:00
Michael Stapelberg 4fe974408d Merge branch 'master' into next 2012-02-07 17:41:36 -05:00
Michael Stapelberg 4f98bbf5ff Bugfix: Obey workspace_layout when re-inserting floating containers (+test) (Thanks aksr)
The code wasn’t using con_attach and therefore didn’t obey workspace_layout.

Fixes: #631
2012-02-07 17:41:00 -05:00
Michael Stapelberg e04628e581 Error message was missing a slash 2012-02-07 17:38:45 -05:00
Michael Stapelberg c1e0c38b27 randr: Skip workspaces which are assigned to a different output when creating a new workspace
If you had workspace 1, 2, 3, 4 on LVDS1 and you enabled HDMI2 (where workspace
1 to workspace 5 are assigned to HDMI2), i3 would look for a new workspace for
LVDS1 (since all workspaces were moved), create workspace 5, move that over due
to assignment and then create workspace 6. Effectively, you would end up with
an empty workspace 5.
2012-02-07 21:10:16 +00:00
Fernando Tarlá Cardoso Lemos 8cffde232f Don't migrate unfocused empty workspaces when disabling output.
This is more similar to what happens when you close the last client
of an unfocused workspace (the workspace gets reaped).
2012-02-07 20:45:14 +00:00
Michael Stapelberg 36464c7a54 Merge branch 'master' into next 2012-01-29 18:02:48 +00:00
Fernando Tarlá Cardoso Lemos 55525015cc Fix coords of floating containers when the output is disabled.
This prevents floating containers from "disappearing" when their
associated output is disabled. Thanks Michael for the advice.
2012-01-29 18:02:27 +00:00
Michael Stapelberg 29aa28b623 commands_parser: use safewrapper functions 2012-01-28 10:35:18 +00:00
Michael Stapelberg 7cdddc6524 add comments to src/commands.c 2012-01-27 22:32:40 +00:00
Michael Stapelberg 3229f7677f Rip out the old command parser, remove migration code 2012-01-27 22:11:03 +00:00
Michael Stapelberg 76ad5dac63 Bugfix: Free old criteria matching window list (Thanks piroko) 2012-01-27 21:47:55 +00:00
Michael Stapelberg 19dc92a9a5 new parser: correctly handle leading/trailing newlines (+test) (Thanks helgikrs) 2012-01-25 22:00:32 +00:00
Fernando Tarlá Cardoso Lemos d579992528 Force redrawing the indicators after a move.
Fixes a bug where splitting then moving in the other orientation
(e.g. v-splitting and moving right) would result in the old
indicators not disappearing.
2012-01-22 17:25:08 +00:00
Michael Stapelberg ae049449af force rendering in more cases 2012-01-22 17:24:55 +00:00
Michael Stapelberg ef522b4dc1 Force re-rendering after changing the orientation of a split container 2012-01-22 13:19:37 +00:00
Michael Stapelberg f9bc434e2a Implement highlighting right/bottom borders of splitted windows
Fixes #299
2012-01-22 11:22:15 +00:00
Michael Stapelberg 318d4fdeef make in-place restarts use socket activation, too (for faster/less flaky tests) 2012-01-21 23:03:09 +00:00
Michael Stapelberg 3b7f4d428e Correctly restore focus after in-place restarts
Note: This change requires two in-place restarts when you are upgrading
in-place from an old version.

Fixes #611
2012-01-21 18:35:15 +00:00
Michael Stapelberg fabcd7d911 Merge branch 'master' into next 2012-01-21 15:08:36 +00:00
Michael Stapelberg 077d2433a7 Bugfix: Fix coordinates when the rect of an output changes (Thanks Paul)
Fixes #623
2012-01-21 15:07:53 +00:00
Michael Stapelberg fc27c19761 Merge branch 'master' into next
Conflicts:
	testcases/t/005-floating.t
2012-01-21 14:22:29 +00:00
Michael Stapelberg cb4c9b9d27 Bugfix: Position floating windows exactly where their geometry specified (Thanks B-Con)
Fixes #619
2012-01-21 14:20:55 +00:00
Michael Stapelberg 6ffc0f94cb Ignore aspect ratio during fullscreen mode (fixes MPlayer subtitles) (Thanks mxf, alexander)
Fixes: #594
2012-01-21 13:29:06 +00:00
Michael Stapelberg 8d72a77c7a Merge branch 'master' into next
Conflicts:
	src/handlers.c
2012-01-21 11:50:22 +00:00
Michael Stapelberg 7a4d8ed6ed Bugfix: Force a new sequence number after UnmapNotify
This should fix the problem where (legitimate) EnterNotifys arrived with the
same sequence as the UnmapNotify and was ignored.

Fixes: #609
2012-01-21 11:49:46 +00:00
Michael Stapelberg 27b089e430 Fix prototype 2012-01-21 11:49:35 +00:00
Michael Stapelberg 47fd15649a Bugfix: Only ignore EnterNotify events after UnmapNotifies from managed windows
This should fix (some?) focus follows mouse problems.

Conflicts:

	src/handlers.c
2012-01-21 11:46:23 +00:00
Michael Stapelberg fa83b46dfa Draw a separator line after each tab (doesn’t use extra space) (by Aaron Small) 2012-01-21 11:07:10 +00:00
Michael Stapelberg 1784b3858d Bugfix: Redraw right border after rendering the window title (Thanks fernandotcl)
Fixes #368
2012-01-21 11:03:57 +00:00
Michael Stapelberg 45b4d71a0b handle the old bar color config syntax in a backwards-compatible way 2012-01-20 22:26:17 +00:00
Michael Stapelberg 31b7ec29fd Re-implement bar borders (by Angelo Haller)
This re-introduces borders around the workspace buttons in i3bar.
No additional pixels will be consumed (you will not lose any space for your
windows).
2012-01-20 21:36:50 +00:00
Michael Stapelberg 759ed0b6e3 Merge branch 'master' into next 2012-01-20 18:10:52 +00:00
Michael Stapelberg 4f26d6f2a1 Bugfix: Setup the _NET_SUPPORTING_WM_CHECK atom in a standards-compliant way
This makes chrome (and probably other apps, too) receive changes of the
_NET_ACTIVE_WINDOW and thus show its bookmark dialog properly.

Fixes: #544
2012-01-20 18:09:53 +00:00
Michael Stapelberg a2823d3aeb Bugfix: Don’t increment 'walk' before checking it (Thanks MasterofJOKers) 2012-01-19 19:01:47 +00:00
Michael Stapelberg fd8e1c98c9 Merge branch 'master' into next
Conflicts:
	src/handlers.c
2012-01-18 19:18:22 +00:00
Michael Stapelberg 2d14ced024 Bugfix: Respect WM_HINTS.input for WM_TAKE_FOCUS clients
This fixes problems with Qt apps (like Quassel) and apparently Eclipse since
the last commit.
2012-01-18 19:16:57 +00:00
Michael Stapelberg f32cc6f4ae Merge branch 'master' into next 2012-01-17 23:39:04 +00:00
Michael Stapelberg 21a2971b24 Bugfix: Either use SetInputFocus *or* send WM_TAKE_FOCUS, not both
This fixes problems with the Oracle JRE7, which checks the current focus after
receiving WM_TAKE_FOCUS and just does nothing when the focus is on one of its
windows. Hopefully it doesn’t introduce any regressions :).
2012-01-17 23:33:33 +00:00
Michael Stapelberg 62cde927a5 Bugfix: Only ignore EnterNotify events after UnmapNotifies from managed windows
This should fix (some?) focus follows mouse problems.
2012-01-17 20:37:36 +00:00
Michael Stapelberg a532f5ac39 Implement a new parser for commands. (+test)
On the rationale of using a custom parser instead of a lex/yacc one, see this
quote from src/commands_parser.c:
     We use a hand-written parser instead of lex/yacc because our commands are
     easy for humans, not for computers. Thus, it’s quite hard to specify a
     context-free grammar for the commands. A PEG grammar would be easier, but
     there’s downsides to every PEG parser generator I have come accross so far.

     This parser is basically a state machine which looks for literals or strings
     and can push either on a stack. After identifying a literal or string, it
     will either transition to the current state, to a different state, or call a
     function (like cmd_move()).

     Special care has been taken that error messages are useful and the code is
     well testable (when compiled with -DTEST_PARSER it will output to stdout
     instead of actually calling any function).

During the migration phase (I plan to completely switch to this parser before
4.2 will be released), the new parser will parse every command you send to
i3 and save the resulting call stack. Then, the old parser will parse your
input and actually execute the commands. Afterwards, both call stacks will be
compared and any differences will be logged.

The new parser works with 100% of the test suite and produces identical call
stacks.
2012-01-14 21:29:57 +00:00
Michael Stapelberg f81c89ac28 Refactor the code out of src/cmdparse.y to src/commands.c
This is the first step towards our new parser.
2012-01-14 16:59:52 +00:00
Michael Stapelberg 608def6c6e cmdparse.l: [^t] is enough (Thanks f8l) 2012-01-10 23:09:00 +00:00
Michael Stapelberg 814695d8bb Implement 'move workspace to output <output>'
Fixes: #541
2012-01-10 22:16:50 +00:00
Michael Stapelberg df9b338175 Introduce synonyms: 'move to workspace' and 'move container to workspace' and 'move window to workspace'
This makes the new 'move workspace to output' command much more clear
2012-01-10 22:16:09 +00:00
Michael Stapelberg 6df971d5d5 Ignore next_on_output/prev_on_output when looking for the first workspace 2012-01-08 16:31:07 +00:00
Max Alexander Busse fba2582b2e Switch and Move to next workspace on the same Output. As requested in \#554 2012-01-08 16:24:21 +00:00
dbp a3081c488a Allow different modifier keys for showing hidden i3bar. 2012-01-08 12:47:41 +00:00
Michael Stapelberg f88c779457 Merge branch 'master' into next 2012-01-08 12:30:41 +00:00
Michael Stapelberg 96c491a488 Bugfix: Fix assignments of floating windows to (yet) unused workspaces (Thanks zeus)
The problem was that the workspace was considered empty for a brief period of
time when entering floating mode. This happened when you assigned Gimp to a
workspace which is not in use yet.
2012-01-08 12:28:49 +00:00
Michael Stapelberg 47a25aa883 bump copyright 2012-01-08 12:00:19 +00:00
Michael Stapelberg 5c3077bc78 wrap 'focus output': when on the right-most output and focusing right, it will focus the left-most output 2012-01-08 11:58:45 +00:00
Michael Stapelberg e3051629d1 remove trailing whitespace and empty lines 2012-01-08 11:44:01 +00:00
Max Alexander Busse d0b3a943f0 Feature: focus the output right/left/above/below 2012-01-08 11:43:31 +00:00
Michael Stapelberg 470ee00012 Merge branch 'master' into next 2012-01-07 18:50:46 +00:00
Michael Stapelberg d4238c778a Bugfix: Open new windows in the correct place when assignments match (+test) (Thanks Don) 2012-01-07 18:50:00 +00:00
Michael Stapelberg 6345124049 Merge branch 'master' into next
Conflicts:
	src/con.c
2012-01-07 18:21:12 +00:00
Michael Stapelberg f78caf8c58 Bugfix: Don’t lose focus on fullscreen windows when another window gets moved to that workspace (+test) (Thanks rami)
Fixes: #606
2012-01-07 18:18:36 +00:00
Michael Stapelberg 0e1b1dd984 Bugfix: Correctly handle 'move scratchpad' on workspace level (+test) (Thanks mseed)
Fixes: #597
2012-01-07 17:36:30 +00:00
Michael Stapelberg 3254188cda Bugfix: Show scratchpad on the correct output (+test)
Fixes: #596
2012-01-07 16:53:37 +00:00
Michael Stapelberg dee7c07ad2 shmlog: store meta information in the buffer itself, store path as X11 atom
This makes i3-dump-log completely independent of a running i3 instance.
2012-01-06 23:40:07 +00:00
Michael Stapelberg 91499ed2c7 properly serialize floating/scratchpad state when restarting 2012-01-05 21:41:20 +00:00
Michael Stapelberg fca57ed077 Change prototype of handlers to static void, remove a bit of old code 2011-12-30 11:30:56 +01:00
Michael Stapelberg 68544a519e Handle vsnprintf overflows (Thanks Han) 2011-12-30 01:26:36 +01:00
Michael Stapelberg a2031a8894 Log the configfile name in verbose log, not only debug log (Thanks Han) 2011-12-29 00:04:48 +01:00
Michael Stapelberg 8a67f15ef4 add missing scratchpad.{c,h} 2011-12-21 23:17:52 +00:00
Michael Stapelberg 08986a1798 Implement scratchpad functionality (see userguide) 2011-12-21 23:15:32 +00:00
Michael Stapelberg 622b94f176 Merge branch 'master' into next 2011-12-20 18:44:26 +00:00
Michael Stapelberg d963018990 Bugfix: Don’t close workspace when there are still floating windows on it (Thanks noxxun) (+test)
Fixes: #595
2011-12-20 18:44:15 +00:00
Michael Stapelberg 1f2c9306a2 Merge branch 'master' into next
Conflicts:
	testcases/t/159-socketpaths.t
2011-12-18 18:02:08 +00:00
Michael Stapelberg c21172a6f6 Create a secure temp path instead of a predictable one (Thanks Han)
With this commit, i3 will now use either $XDG_RUNTIME_DIR/i3 (XDG_RUNTIME_DIR
is only writable by the user, so this is not a problem) or a secure temporary
location in /tmp, following the pattern /tmp/i3-<user>.XXXXXX
2011-12-18 17:59:31 +00:00
Michael Stapelberg c4298b9311 Merge branch 'master' into next 2011-12-18 17:25:15 +00:00
Michael Stapelberg 4fba2d5f91 Bugfix: Correctly check boundaries and reassign floating windows when moving (Thanks xpt)
Fixes: #592
2011-12-18 17:24:27 +00:00
Fernando Tarlá Cardoso Lemos fbf6d20e05 Fix the signal handler popup text.
Thanks to Michael for the heads-up.
2011-12-18 15:43:00 +00:00
Michael Stapelberg 2ba09f5419 Merge branch 'master' into next 2011-12-18 15:19:09 +00:00
Michael Stapelberg ec28f3b982 Bugfix: Fix floating resize for floating split containers (+test)
Fixes: #588
2011-12-18 15:18:20 +00:00
Michael Stapelberg 4412ccbe5a Merge branch 'master' into next 2011-12-17 22:35:13 +00:00
Michael Stapelberg 7a80d903a5 keygrabbing: only look in the appropriate columns when resolving keysyms
Fixes: #585

This commit fixes the problem of i3 wrongly grabbing/interpreting (!) some key
bindings. Basically, when you have, say, "bindsym Mod1+4 workspace 4", but you
also have "bindsym Mod1+semicolon focus right" (both are default), and your
keyboard layout has semicolon on Mode_switch + 4, the "workspace 4" keybinding
was shadowed by the "focus right" keybinding, because that also resolves to
semicolon.

So, from now on, i3 will only consider column 0 and 1 for normal bindings and
column 2 and 3 for bindings using Mode_switch (columns as seen in xmodmap
-pke).
2011-12-17 22:31:21 +00:00
Michael Stapelberg 76202a824d re-indent translate_keysyms() 2011-12-17 22:28:28 +00:00
Michael Stapelberg 0d210277f0 x: Handle expose-events by only copying the requested region from our pixmap
This is faster than always updating the whole pixmap and should be safe.
2011-12-17 20:08:56 +00:00
Michael Stapelberg 6f8b284586 Merge branch 'master' into next 2011-12-17 18:48:14 +00:00
Michael Stapelberg 664e30903c Bugfix: Don’t change focus after (graphical) resizing 2011-12-17 18:47:29 +00:00
Michael Stapelberg a930994dc9 Merge branch 'master' into next 2011-12-17 17:16:39 +00:00
Michael Stapelberg 75c57c4eef Bugfix: Ignore ConfigureRequests with out-of-bound coordinates (+test)
JDownloader seems to use these for its captcha popups when focus is not on the
same workspace, for some weird reason.
2011-12-17 17:15:52 +00:00
Michael Stapelberg db174234ce Merge branch 'master' into next
Conflicts:
	debian/changelog
2011-12-17 15:28:51 +00:00
Michael Stapelberg 1ff321bc3f Bugfix: Disallow focusing other windows when in fullscreen mode (Thanks aksr)
Fixes: #579
2011-12-17 15:28:17 +00:00
Michael Stapelberg ef224cdb98 Merge branch 'master' into next
Conflicts:
	testcases/t/173-get-marks.t
2011-12-17 14:22:57 +00:00
Michael Stapelberg b46ab649f5 Bugfix: Fix setting the same mark repeatedly on different windows (+test)
Fixes: #582
2011-12-17 14:22:23 +00:00
Michael Stapelberg 5a345db18b Merge branch 'master' into next 2011-12-17 13:55:45 +00:00
Michael Stapelberg 87b6bf7a54 Bugfix: Make resizing work when pressing floating_modifier + right mouse button on window decorations
Fixes: #583
2011-12-17 13:55:16 +00:00
Michael Stapelberg 9e688a2277 Merge branch 'master' into next 2011-12-17 12:21:13 +00:00
Michael Stapelberg f6c0a1e161 Bugfix: Make resizing of tiling windows with floating_modifier use absolute coordinates
Fixes: #580
2011-12-17 12:20:27 +00:00
Michael Stapelberg 9cec9e09ed Merge branch 'master' into next 2011-12-17 11:18:35 +00:00
Michael Stapelberg acb3bdd05e Bugfix: Skip leading whitespace in variable assignments (Thanks ben)
Fixes: #577
2011-12-17 11:16:34 +00:00
Michael Stapelberg 966c654112 implement the GET_LOG_MARKERS IPC request/reply 2011-12-10 11:16:32 +00:00
Michael Stapelberg f7a73f4a68 fix the SHM log size 2011-12-10 11:15:57 +00:00
Michael Stapelberg d034248de0 sighandler: handle all "Core" signals 2011-12-10 11:05:37 +00:00
Michael Stapelberg aa82adb5c0 Introduce --shmlog-size flag, unlink SHM log when exiting 2011-12-10 10:51:55 +00:00
Michael Stapelberg e65ee63763 Implement logging to a SHM ringbuffer
This feature is automatically enabled when running a debug version of i3.
The logfile will use 1% of your physical RAM size, but at max 25 MiB.
2011-12-10 10:50:33 +00:00
Michael Stapelberg 6c112f2a9a Merge branch 'master' into next 2011-11-30 20:34:54 +00:00
Michael Stapelberg d25e77ce75 Don’t set the _NET_WM_WORKAREA hint at all (Thanks cg)
Fixes: #539
2011-11-30 20:33:07 +00:00
Michael Stapelberg fb90a556c8 Merge branch 'master' into next 2011-11-30 20:10:45 +00:00
Michael Stapelberg fb0ad1e8f9 display i3 version in errors, make conversion message an error 2011-11-30 20:09:32 +00:00
Michael Stapelberg 0f9fbcbd25 Merge branch 'master' into next 2011-11-29 22:37:11 +00:00
Michael Stapelberg 626e3efb48 Bugfix: Fix 'resize' command in nested containers (Thanks mseed)
Fixes: #559
2011-11-29 22:36:40 +00:00
Michael Stapelberg f2b73b64be Merge branch 'master' into next 2011-11-29 21:24:05 +00:00
Michael Stapelberg 0e56fcb971 add a few more keywords to make i3 recognize configs as v4 2011-11-29 21:20:42 +00:00
Michael Stapelberg df2236c5ee Merge branch 'master' into next 2011-11-29 20:50:11 +00:00
Michael Stapelberg 59283cce93 Bugfix: Fix resizing for (e.g.) v-split containers in h-split containers
Fixes: #562
2011-11-29 20:48:59 +00:00
Michael Stapelberg 752b101916 Merge branch 'master' into next 2011-11-28 23:28:03 +00:00
Michael Stapelberg bd4b240d56 Bugfix: Ignore EnterNotify events to prevent wrong focus in complex tabbed/stacked layouts (Thanks Phlogistique)
Fixes #560

Finally we have a good explanation and example for why we need to ignore
EnterNotify events which were caused by an Unmap :).
2011-11-28 23:26:45 +00:00
Jan-Erik Rediger f23d675de9 Implement new "i3bar_command" option for bar.
This allows you to specify an alternate path to the i3bar binary.
The userguide docu is included.
2011-11-27 21:40:57 +00:00
Michael Stapelberg 1a3b82eb02 Merge branch 'master' into next 2011-11-26 22:25:06 +00:00
Michael Stapelberg d686f2f873 Bugfix: Don’t create a workspace named "back_and_forth" on startup
Fixes #565
2011-11-26 22:24:30 +00:00
Michael Stapelberg f5dce848b8 Merge branch 'master' into next 2011-11-26 22:18:01 +00:00
Michael Stapelberg 31acb91d90 Bugfix: Fix crash on '[class="i3bar"] focus' (+test) (Thanks f8l)
Fixes #575
2011-11-26 22:17:34 +00:00
Fernando Tarlá Cardoso Lemos 340592a532 Invalidate cached pixmaps on reload and redraw.
After a reload, the drawing parameters for the decorations might
have changed, so we need to invalidate the cache and force a redraw
of the currently visible decorations. Also, don't leak the previous
font when reloading by freeing it before parsing the config.
2011-11-26 21:51:49 +00:00
Michael Stapelberg 67c2c03f76 Merge branch 'master' into next 2011-11-26 21:30:44 +00:00
Michael Stapelberg eeab1f0659 Fix comment for the previous commit 2011-11-26 21:30:26 +00:00
Michael Stapelberg 555dd48f09 Merge branch 'master' into next 2011-11-26 21:19:30 +00:00
Michael Stapelberg 970d11709e Bugfix: Retain absolute window position and size when changing floating borders (Thanks binzter)
Fixes: #561
2011-11-26 21:18:23 +00:00
Michael Stapelberg d805d1bbea Merge branch 'master' into next 2011-11-24 23:50:11 +00:00
Michael Stapelberg 227a58b0c3 Bugfix: Fix startup when RandR is not present 2011-11-24 23:49:35 +00:00
Michael Stapelberg af810df8da Merge branch 'master' into next 2011-11-21 23:10:09 +00:00
Michael Stapelberg 61b8a62132 Bugfix: fix fullscreen with floating windows
Fixes: #564
2011-11-21 23:04:49 +00:00
Michael Stapelberg 561cf3719f little style fixes 2011-11-21 21:48:24 +00:00
Fernando Tarlá Cardoso Lemos 344c04af12 Implement set_font_colors.
This paves the way for other font rendering backends. Fonts and
colors shouldn't be specified manually from now on.
2011-11-21 20:52:32 +00:00
Fernando Tarlá Cardoso Lemos eafc7af606 Make all programs use draw_text. 2011-11-21 20:52:29 +00:00
Fernando Tarlá Cardoso Lemos 5c2088c87e Enhance libi3 and use it in i3bar.
Abstracted draw_text and predict_text_width into libi3. Use
predict_text_width from libi3 in i3 too. This required tracking
xcb_connection in a xcb_connection_t *conn variable that libi3
expects to be available in i3bar.
2011-11-21 20:52:26 +00:00
Michael Stapelberg 70151ea238 Merge branch 'master' into next 2011-11-21 19:56:03 +00:00
Michael Stapelberg 5f8d719835 Bugfix: Skip dock clients when handling FocusIn events (Thanks cradle) 2011-11-21 19:55:41 +00:00
Michael Stapelberg b6e859787e clarify comments about socket activation (Thanks mxf) 2011-11-16 23:14:57 +00:00
Michael Stapelberg 84cf3ec3cb ipc: set CLOEXEC on client file descriptors (Thanks biiter) 2011-11-16 21:42:48 +00:00
Fernando Tarlá Cardoso Lemos fb11cc2d14 Consolidate all convert_* functions into libi3.
Some minor fixes along the way as well. Very minor stuff, unlikely
to ever be visible to the user.
2011-11-16 20:54:30 +00:00
Michael Stapelberg 7498ddd12f ipc: set CLOEXEC on client file descriptors (Thanks biiter) 2011-11-15 23:39:43 +00:00
Michael Stapelberg 1e5cd4b769 Bugfix: Only go to the parent container in resizing if that is actually a split container
(as opposed to a workspace)

This fixes a regression in resizing. We do need testcases for these things.
2011-11-11 19:19:14 +00:00
Michael Stapelberg 60bfc3a600 Bugfix: Correctly handle --no-startup-id with quoted exec commands (Thanks aksr)
Parser changes shortly before a release. What could possibly go wrong.
2011-11-11 00:28:04 +00:00
Michael Stapelberg b808cc5d18 Bugfix: Render floating windows after rendering all outputs (Thanks mw)
Fixes #548

See the comment on why this is necessary.
2011-11-10 20:30:51 +00:00
Michael Stapelberg df095f9d68 Bugfix: Fix tabbed container resizing check (Thanks julien)
Fixes: #534

Turns out that my check was wrong. We actually just need to make sure we are
dealing with the split container.
2011-11-10 19:35:36 +00:00
Michael Stapelberg ed66a30410 mark parameters const 2011-11-10 19:17:36 +00:00
Michael Stapelberg bebd2fceb6 Bugfix: Correctly return to initial state after prev/next/back_and_forth (Thanks Brian)
Fixes: #552
2011-11-10 18:42:24 +00:00
Michael Stapelberg 62f0a9e21d s/1/true 2011-11-10 18:38:29 +00:00
Michael Stapelberg 6bdd12a584 Bugfix: Correctly fill the buffer with zeros 2011-11-09 22:23:33 +00:00
Michael Stapelberg 332dbfe9c1 Enable (unlimited) core dumps when running i3 development versions
Also prints out useful stuff:

    CORE DUMPS: You are running a development version of i3, so coredumps were
    automatically enabled (ulimit -c unlimited).
    CORE DUMPS: Your current working directory is "/home/michael/i3".
    CORE DUMPS: Your core_pattern is: /tmp/%e.core.%p
    i3 (tree) version 4.0.2-479-g26ab2ac (2011-11-08, branch "next") starting

This does not affect child processes of i3.

The intention of this change is to make debugging easier – it’s one less thing
users of the development version have to worry about when trying to help with
debugging.
2011-11-08 22:49:25 +00:00
Michael Stapelberg 26ab2ac008 Bugfix: Insert container at the correct position on workspace-level when workspace_layout == default
Fixes #533

The problem was that the code was always executed. While it *attaches* the new
container to the workspace container, it also sets current = NULL and thus
always appends the container instead of inserting it after the currently
focused child. So now, we just don’t execute that code at all for
workspace_layout == default.
2011-11-08 20:37:24 +00:00
Michael Stapelberg 2a78a5f2b6 ipc: fix memory leaks when clients disconnect 2011-11-07 21:34:39 +00:00
Fernando Tarlá Cardoso Lemos d5613905c8 Plug minor leaks in string conversion routines. 2011-11-07 19:57:11 +00:00
Michael Stapelberg 2b6504d310 Bugfix: RandR: Correctly keep focus on the focused workspace when an output disappears (Thanks AlexanderB, xeen) 2011-10-31 12:11:34 +00:00
Michael Stapelberg 8e3cef33d9 Error out early if there is nothing to move
Fixes: #532
2011-10-27 23:27:33 +01:00
Michael Stapelberg 5227b29b0f Make named workspace assignments work again
Please note that you need a quoted string for the workspace name.
Example:
    workspace "1: www" output HDMI2

Fixes: #456
2011-10-27 22:43:53 +01:00
Michael Stapelberg a4cb4a64d4 Bugfix: warp pointer during the EnterNotify-disabled phase
Following bug:
1) Assign workspace 9 to output HDMI2
2) On HDMI2, be on workspace 1
3) Focus a different output, say LVDS1
4) Execute i3 'workspace 9'
5) Something happens, but you end up back on ws 1

(this is due to an EnterNotify being generated when warping)
2011-10-27 22:29:47 +01:00
Michael Stapelberg df980bffa4 Make 'move' handle floating windows properly
This means you can now specify an amount of pixels for the move command. The
default is 10. Note that this of course only works for floating windows.

Example:
  move left 20 px
2011-10-27 21:46:15 +01:00
Michael Stapelberg e25991f538 Bugfix: Don’t invoke resizing when clicking on the decoration in a > 1 child split con (Thanks julien)
Fixes: #534
2011-10-27 20:36:55 +01:00
Michael Stapelberg af1871e414 Bugfix: Only fallback on the font if it’s actually set (Thanks phnom) 2011-10-26 21:21:55 +01:00
Michael Stapelberg ee804a0635 Also call workspace_show() when moving cursor to an empty output (Thanks mw) 2011-10-25 23:41:52 +01:00
Michael Stapelberg 38447c4b47 Bugfix: Correctly use workspace_show() when focus changes to a different output via EnterNotify or FocusIn (Thanks pnutzh4x0r)
This makes i3bar show the correct workspace when you move your mouse from one
output to another.
2011-10-25 23:04:10 +01:00
Michael Stapelberg e710477a07 Bugfix: properly handle comments in colors {} blocks of bar config (+test) (Thanks fernandotcl) 2011-10-25 22:31:57 +01:00
Michael Stapelberg bbfbd28dfa Add a --no-startup-id flag for exec (command), exec (config), exec_always (config) 2011-10-25 22:18:17 +01:00
Michael Stapelberg 726f2a1e5a normalize file headers across **/*.{h,c} 2011-10-25 21:19:38 +01:00
Michael Stapelberg 8660ae4e12 bar config: fall back to the i3 font (Thanks pl) 2011-10-25 20:50:57 +01:00
Fernando Tarlá Cardoso Lemos d490bae8a2 Close empty workspaces if they're not visible.
Previously, we'd only close an empty workspace when we moved away
from it. Now we also close it when the last client exits, as long
as that workspace is not visible anymore.
2011-10-24 00:12:14 +01:00
Michael Stapelberg a58018cf66 Add libi3/load_font, use it everywhere
…except for i3bar, which needs slightly more information about the font
2011-10-23 22:37:11 +01:00
Michael Stapelberg 6d01d37b03 remove unused cached_fonts TAILQ 2011-10-23 22:03:20 +01:00
Michael Stapelberg 8da6049ca9 Actually make load_font only fallback if 'fallback' is true 2011-10-23 22:02:11 +01:00
Michael Stapelberg 3e7f941b83 Fix comment in run_assignments (Thanks xeen) 2011-10-23 21:45:12 +01:00
Michael Stapelberg 91134f75c0 Move get_mod_mask to libi3, use it in i3 and i3-config-wizard
Also, the API changed a bit. There are two functions now, both assume you
already got the keysyms (which is the case for i3 and i3-config-wizard),
one gets the modifier mapping for you (aio_get_mod_mask_for) while the other
assumes you also got that. No roundtrips are required for the latter.
2011-10-23 21:26:15 +01:00
Michael Stapelberg a512b99a51 Introduce --get_socketpath and --force_xinerama as synonyms for --get-socketpath and --force-xinerama 2011-10-23 19:41:40 +01:00
Michael Stapelberg 6dc6ba11fc Eliminate xcb_change_gc_single everywhere with C99 2011-10-23 18:06:25 +01:00
Michael Stapelberg 9eda7fb6fb move strndup to libi3 2011-10-23 18:02:01 +01:00
Michael Stapelberg ada4857ad2 Fix colors in i3bar (Thanks julien)
i3bar previously used get_colorpixel on strings without the leading # (ff0000
instead of #ff0000). Since it uses libi3’s get_colorpixel now we needed to
update a few places.
2011-10-23 17:48:44 +01:00
Michael Stapelberg cb9bbcfccf Move get_colorpixel to libi3, use it everywhere else 2011-10-23 17:38:21 +01:00
Michael Stapelberg 31cb3dda8d cfgparse: use different literal strings for ambiguous keywords in bar context 2011-10-23 16:41:23 +01:00
Michael Stapelberg 9d15a00ba8 introduce sasprintf() in libi3, use it everywhere 2011-10-23 13:16:56 +01:00
Michael Stapelberg 10d3281b0f remove/shorten a lot of debugging messages
Some of them are useless nowadays, others very unlikely to be a problem.
Those which might still be interesting somewhen in the future are just
commented out.
2011-10-23 00:15:13 +01:00
Michael Stapelberg 42d355f2b7 normalize modelines/headers across src/*.c 2011-10-22 23:40:02 +01:00
Michael Stapelberg 753d67fb64 migration from exec i3bar to bar config: i3 substitutes exec with a bar block, shows nagbar 2011-10-22 16:33:00 +01:00
Michael Stapelberg 9b84348201 Bugfix: fix off by one when copying the hex colorcode (Thanks fernandotcl) 2011-10-21 23:22:48 +01:00
Michael Stapelberg 77961ad9c8 cfgparse: Don’t use asprintf when parsing hex colors 2011-10-21 23:09:57 +01:00
Michael Stapelberg 3baeeb1834 Bugfix: properly transition in and out of the COLOR_COND state (Thanks fernandotcl) 2011-10-21 22:58:53 +01:00
Michael Stapelberg caee0a0fda cfgparse: eliminate absolute states, use yy_push_state/yy_pop_state
This fixes a problem with workspace assignments.
I tested i3 -C with three user configs (Thanks SardemFF7, julien, xeen)
and did not notice any problems.
2011-10-20 22:38:46 +01:00
Michael Stapelberg 12d866e4f6 Don’t start i3-nagbar when using -C to validate the config 2011-10-20 22:25:59 +01:00
Michael Stapelberg 230b238870 Actually start i3bar instances for each configured bar 2011-10-20 19:03:40 +01:00
Michael Stapelberg ad0f13a0a9 Clean bars before reloading the config (+test)
While the configuration gets updated in i3, the i3bar processes will not pick
up these changes. We have to think about a good way to do that.
2011-10-20 18:47:09 +01:00
Michael Stapelberg 15bface10d Create different IDs for each bar (+test) 2011-10-19 19:57:39 +01:00
Michael Stapelberg 063b124e35 Implement parsing bar {} config blocks 2011-10-18 22:16:04 +01:00