Commit Graph

423 Commits (f63a4bef5471d73428808ecc5b8dd76ff04a23f4)

Author SHA1 Message Date
Johannes Lange 8bfd06c3dd added "toggle" option to "split" command
as requested in #1814
2016-01-04 17:31:47 +01:00
Ingo Bürk 19c273a2ad Validate matched containers for "kill" command correctly.
We now execute the validations when "kill" is executed even if match
criteria are used. This prevents users from killing workspace containers,
which instead kills all clients (as before when not using criteria).

fixes #1761
2015-12-28 02:35:25 -05:00
Ingo Bürk 0dd71674de Rename tree_close() to tree_close_internal().
It should be clear for callers of this function that this is an internal
function that skips certain validations which might be important. Therefore
we make it clear that this is an internal function by renaming it.

relates to #1761
2015-12-27 20:58:35 -05:00
Ingo Bürk bba18453af Match on all criteria even if con_id or con_mark are given.
Previously, if a match specification contained the con_id or con_mark criterion,
all other criteria were ignored. However, a user may want to specify one of
those two unique identifiers and still specify others as well, for example to
match the currently focused window, but only if it has a certain WM_CLASS:

    [con_id=__focused__ class=special] kill

We now check all specified criteria.

fixes #2111
2015-12-17 08:56:05 -05:00
Ingo Bürk 8d36f78b8e Reject invalid match criteria with an error.
Previously, using a command like

  [con_id=foo] kill

would kill the currently focused window because while an error for
not being able to parse the con_id was logged, no further action
was taken, which caused the criterion to be ignored. In this case,
the fallback behavior of using the focused window took over.

For con_id, id and window_type we now reject incorrect values with
an error and abort the command.

fixes #2091
2015-12-09 14:00:53 +01:00
Ingo Bürk caeb193a6c Allow "move position center" to operate on matched windows
Moving windows to the center previously did not consider command criteria.
We now operate on matched windows as for other commands.

fixes #2090
2015-12-03 13:24:39 +01:00
Michael Stapelberg 2451551f63 Merge pull request #2040 from Airblader/bug-2034
Fix crash when trying to split and float a dock container.
2015-10-27 10:07:25 +01:00
Ingo Bürk 57a7ff301f Add --no-auto-back-and-forth for moving windows.
This patch extends the previously introduced flag --no-auto-back-and-forth
to also apply to

    move window to workspace <name>
    move window to workspace number <number>

relates to #2028
2015-10-26 22:40:06 +01:00
Ingo Bürk 3d6c76eb93 Fix crash when trying to split and float a dock container.
Since splitting a docking container was allowed and successful, the check
to prevent floating it fails to work. This causes a crash because the
workspace of the container cannot be determined as the dockarea is higher
up in the tree than the workspace it belongs to.

This patch extends to sanity check to nested dock containers when trying to
float a container and also disallows manually splitting a docked container
or changing its layout.

fixes #2034
2015-10-26 22:14:14 +01:00
Michael Stapelberg 30c3729a24 Merge pull request #2036 from Airblader/bug-2015
Make resize grow|shrink width|height work for a nested split in the s…
2015-10-26 09:14:28 +01:00
Ingo Bürk 10b1b39478 Make resize grow|shrink width|height work for a nested split in the same direction.
Suppose a horizontally oriented workspace has two windows open. Issuing "split h" on
the right window creates a nested horizontal container. If we now resize in "width"
direction, the resize doesn't work because it will only operate on the current parent,
which is a container with only one child, so the resize command exits.

This is unexpected behavior from a user point of view. Hence, with this patch, we
ensure that we don't just go up the tree until we find a parent with the correct
orientation, but also keep going if that parent has only a single child.

fixes #2015
2015-10-25 13:03:56 +01:00
Ingo Bürk 7270206e24 Added --no-auto-back-and-forth to workspace commands.
This patch introduces the --no-auto-back-and-forth flag to both of

    workspace --no-auto-back-and-forth <name>
    workspace --no-auto-back-and-forth number <number>

This flag will only have an effect if the back_and_forth feature is
enabled. If passed, the feature will be ignored for this particular
call only.

fixes #2028
2015-10-24 00:12:03 +02:00
Ingo Bürk 9537ada5ad Make 'unmark' aware of matched windows.
This patch allows using 'unmark' on matched windows. The old behavior
of applying it to all windows if no criteria were specified is kept.

relates to #2014
2015-10-22 15:32:18 +02:00
Ingo Bürk 7a77c5f0bb Introduce "--add" for marking windows.
In order to keep compatibility to before allowing multiple marks on a window,
we introduce a flag "--add" that must be set to put more than one mark on a
window. The default, which is also available as "--replace", keeps the old
behavior of overwriting a mark when setting a new one.

fixes #2014
2015-10-22 15:32:15 +02:00
Ingo Bürk 9bb2f038ab Allow multiple marks on windows.
This patch allows multiple marks to be set on a single window. The restriction that a mark may
only be on one window at a time is still upheld as this is necessary for commands like
"move window to mark" to make sense.

relates to #2014
2015-10-22 15:29:42 +02:00
Ingo Bürk b744c5e6c6 Refactor parsing of matches to avoid code duplication. 2015-10-04 17:40:25 +02:00
Ingo Bürk 6cd6f43d09 Turn "char *" into "const char *" for all command parser functions. 2015-09-28 14:24:08 +02:00
Ingo Bürk c7ca6e1b41 Migrate the move command to use typed numbers. 2015-09-28 14:21:44 +02:00
Ingo Bürk 0ae9cddc98 Migrate the resize command to use typed numbers. 2015-09-28 14:21:44 +02:00
Michael Stapelberg 71afed725a Merge pull request #1962 from Airblader/bug-move-to-output-criteria
Correctly handle command criteria for "move window to output".
2015-09-28 08:22:09 +02:00
Michael Stapelberg 3830aa891e Merge pull request #1960 from Airblader/bug-restore-mark
Fix duplicated marks on append_layout
2015-09-28 08:19:04 +02:00
Ingo Bürk 852a2853e3 Correctly handle command criteria for "move window to output". 2015-09-26 21:31:28 +02:00
Ingo Bürk dd7a532160 When appending a layout containing a marked container, make sure that any other containers with the same mark
are unmarked during insertion of the new container.

fixes #1956
2015-09-25 19:26:41 +02:00
Ingo Bürk 922afe1919 Keep a sticky window focused if it was the focused window on the source workspace.
fixes #1924
2015-09-24 22:10:17 +02:00
Ingo Bürk b490f67925 Use the focused container to determine the target window_mode when using floating mode_toggle.
This fixes mode_toggle in case the workspace is focused and only a floating sticky window is open.

fixes #1927
2015-09-16 19:52:08 +02:00
Ingo Bürk 1c4c3f06fa Make sure sticky windows pop to the front if they get sticky while not being on a visible workspace.
This commit also reworks the way focusing sticky windows is prevented by not focusing them temporarily at all, but preventing the focus in the first place.
2015-09-13 20:40:20 +02:00
Ingo Bürk 9866b00802 Implement new 'sticky' command to manually set, remove or toggle the sticky state on a window. 2015-09-13 20:40:20 +02:00
Michael Stapelberg ef6f2f4365 Merge pull request #1893 from rr-/resize
Added cmd_size
2015-09-11 14:31:33 -07:00
rr- 23d16e1332 Support "resize set W H" 2015-09-11 23:12:07 +02:00
Ingo Bürk f31e476b28 Let "focus" report success depending on whether a window was matched.
fixes #1809
2015-09-11 08:26:33 +02:00
Michael Stapelberg ee2983c791 Merge pull request #1880 from Airblader/feature-665
Move data from Con to Window
2015-09-03 20:35:43 +02:00
Ingo Bürk 344514bca5 Move aspect_ratio from Con to Window.
relates to #665
2015-08-31 21:27:13 +02:00
Ingo Bürk f43a15acde Move width_increment and height_increment from Con to Window.
relates to #665
2015-08-31 21:27:10 +02:00
Ingo Bürk f44c87685b Support _NET_WM_VISIBLE_NAME. As per specification this is necessary since we can display custom titles with title_format.
fixes #1872
2015-08-30 22:42:14 +02:00
Michael Stapelberg 6be1b28813 Merge pull request #1771 from Airblader/feature-1769
Implement new criterion 'workspace'.
2015-06-30 13:52:54 -07:00
Ingo Bürk be406d036d Implement new criterion 'workspace'.
If the match expression is a plain number (e.g., '99'), the number of a workspace will be compared strictly. Otherwise, the match expression is taken as a regular expression and compared against the workspace's name.
This allows all of the following:

for_window [workspace=5] ...
for_window [workspace="5:foo"] ...
for_window [workspace="foo"] ...

fixes #1769
2015-06-30 20:53:52 +02:00
Ingo Bürk 94a09b3cac Added missing newlines in log statements. 2015-06-30 20:48:35 +02:00
Ingo Bürk 5a8d66a1d5 Parse the title_format and display the customized window title if a format was set.
The format string set with "title_format" can contain the placeholder "%title" which will be replaced with the actual window title.

By not overwriting window->name itself, we make sure that assignment matching still works as expected.

fixes #1723
2015-06-29 09:13:31 +02:00
Ingo Bürk 55e8d06ee4 Added command directive 'title_format'.
This directive will be used to customize the window title.
2015-06-29 09:13:31 +02:00
Ingo Bürk 9940571069 Fix documentation for border styles. 2015-06-12 17:54:54 +02:00
Michael Stapelberg da064cc08f Merge pull request #1698 from Airblader/feature-1696
Added 'move position mouse'
2015-05-17 15:02:50 +02:00
Ingo Bürk 4a585748a4 Implemented new command 'move [window|container] [to] position mouse|cursor|pointer
fixes #1696
2015-05-12 17:46:06 -04:00
Tony Crisci a74662052a Detect base 16 in cmd criteria
Try to detect base 16 numbers given to `con_id` and `id` for command criteria
by setting the base of strtol to 0. This should also detect octal.

This is necessary because mouse bindings now may be serialized as hex as of
5c32de4.
2015-05-12 17:04:01 -04:00
Michael Stapelberg 67ec2333ee Merge pull request #1665 from Airblader/feature-1658
Added criterion 'window_type'
2015-04-21 08:42:16 +02:00
Deiz 884214f14f Update copyright notices and get rid of ranges
The script used to make these changes can be found at:

   https://gist.github.com/Deiz/32322020f76d23e2bf8f
2015-04-20 17:50:21 -04:00
Ingo Bürk 550c0ec318 Implement new criterion 'window_type = normal|dialog|utility|toolbar|splash|menu|dropdown_menu|popup_menu|tooltip'
fixes #1658
2015-04-20 19:27:39 +02:00
Ingo Bürk 94bbdc9159 Implement the command 'move container to mark <mark>' using 'con_move_to_mark'. 2015-04-19 20:57:49 +02:00
Ingo Bürk 475671ae2a Added 'con_move_to_mark' to move a container to the container holding a certain mark. 2015-04-19 20:57:49 +02:00
Ingo Bürk 9613a0744d Added configuration directive for 'move [container|window] [to] mark <str>' 2015-04-19 20:57:44 +02:00
Ingo Bürk 2e4fac61d2 Only mark a window if only one window is matched
We only support unique marks, so looping over all matched windows must be prevented.
If more than one window is matched, we reject it with an error message.

fixes #1614
2015-04-01 13:51:48 +02:00
Ingo Bürk 6036d4e506 Changed the default for show_marks from "no" to "yes" 2015-03-30 23:11:50 +02:00
Ingo Bürk 2af1a80028 Introduce a cached boolean for changes to the mark of a window.
This is necessary to correctly redraw window decorations when the mark of
a window is added or removed.
2015-03-30 23:08:25 +02:00
Deiz c6581a5fd6 Handle floating centering in one function and test for consistency 2015-03-30 16:03:35 -04:00
Michael Stapelberg 2759a308a2 Merge pull request #1608 from mh21/renaming-empty-ws-startup
Update old_name when renaming current workspace
2015-03-30 22:01:18 +02:00
Michael Stapelberg 9718640622 Merge pull request #1589 from Deiz/fix-center
Make center coordinates relative to current workspace
2015-03-30 08:47:04 +02:00
Michael Hofmann f76e6c2bb1 Get workspace name when renaming current workspace.
- fixes #1607
2015-03-30 08:28:36 +02:00
Ingo Bürk 7a75cb7e0b Added test cases for 'mark --toggle' (#1463) 2015-03-29 21:21:50 +02:00
Ingo Bürk d51d6d730e Added a --toggle switch to "mark [--toggle] <mark>"
This option allows toggling marks on a window without knowing whether the mark is already set or not.
It behaves as follows:
1) If the matched window has no mark, the new mark is set.
2) If the matched window has another mark, the old mark is removed and the new mark is set.
3) If the matched window already has the mark, the mark is removed.

The behavior that all non-matched windows have this mark removed is kept.

fixes #1463
2015-03-29 21:21:50 +02:00
Deiz 24f0ea2f24 Make center coordinates relative to current workspace
Fixes #1211
2015-03-25 22:40:59 -04:00
Michael Stapelberg 822cd3bf1b Revert "Workspace command number selection"
This reverts commit cbd51ce664.

If you’ve started using this feature, I’m very sorry, but I think it’s
better to revert it entirely, as it will only cause more problems in the
future as more and more people upgrade and get bitten by this if we
didn’t revert it…

fixes #1536
2015-03-24 09:28:30 +01:00
Tony Crisci 6b150b1ac2 bugfix: workspace rename focus mismatch
When renaming a workspace on another output that moves the workspace to
the current output, the renamed workspace would be shown even though it
does not contain the focused container.

Explicitly show the focused workspace after the move. This is necessary
because `workspace_move_to_output` will show the workspace that is
moved.
2015-03-15 23:30:00 -04:00
Michael Stapelberg 513510de69 clang-format src/commands.c 2015-03-14 22:32:23 +01:00
Michael Stapelberg 56f420c3dd Merge pull request #1539 from mh21/wsrename-1527
Rename workspaces in startup sequences
2015-03-14 04:56:19 -07:00
Michael Hofmann 44f748a663 Rename workspaces in startup sequences.
When renaming workspaces, any workspace names in pending startup
sequences also need to be renamed.
2015-03-13 10:35:20 +01:00
Michael Stapelberg c263bb3d2a Merge pull request #1521 from Airblader/feature-use-refactored-function
Use the already existing function to get rid of some code duplication
2015-03-13 00:54:52 -07:00
Michael Stapelberg a5939f3edc Merge pull request #1513 from Airblader/defect-1473
Move workspace to assigned output when renaming it
2015-03-13 00:52:52 -07:00
Ingo Bürk 9ebf17c39d Properly error out when the layout file cannot be read.
This will result in an actual error message for the user.
fixes #1499
2015-03-07 15:57:05 +01:00
Ingo Bürk 6c675cc3f6 Glob filepath when calling append_layout
fixes #1500
2015-03-07 15:56:59 +01:00
Ingo Bürk 58df5aa6c4 Improve error messages on failing commands 2015-03-07 15:53:35 +01:00
Ingo Bürk c572176429 Use the already existing function to get rid of some code duplication 2015-03-05 14:00:24 +01:00
Michael Stapelberg 1b69ddacbe Merge pull request #1515 from Airblader/feature-commands-error-messages
Improve error messages on failing commands
2015-03-04 10:20:21 -08:00
Ingo Bürk acb79bd02f Improve error messages on failing commands 2015-03-04 14:01:42 +01:00
Ingo Bürk eb73059c61 Refactor functions for easy reuse 2015-03-04 09:22:25 +01:00
Ingo Bürk bcc1314a2d When renaming a workspace, look for assignments and move the renamed workspace to the appropriate output. 2015-03-04 09:06:44 +01:00
Ingo Bürk 9e739de5d3 Glob filepath when calling append_layout
fixes #1500
2015-03-01 16:51:58 +01:00
Tony Crisci 823b46a544 Include workspace con in workspace event
Send the affected workspace in the "current" property for each workspace
event for any type of workspace event that affects a particular
workspace.

fixes #1411
2014-12-22 09:47:31 +01:00
Mats e59a76e456 Extend the fullscreen command
Rather than just toggling the fullscreen modes, allow to set them
directly with:

    fullscreen enable|toggle [global]
    fullscreen disable

For compatibility, retain the previous command and its toggling behavior:

    fullscreen [global]

fixes #1120
2014-12-10 20:42:52 +01:00
Mats dc351fb291 Prevent workspace change during global fullscreen
While in global fullscreen, the workspace could be changed leaving the
fullscreen container still visible on top but losing its focus.
2014-12-10 20:24:32 +01:00
Michael Stapelberg ee75821699 Merge branch 'master' into next 2014-07-15 10:28:51 +02:00
Michael Stapelberg 679a5de8cf Bugfix: properly restore workspace containers (Thanks vals)
fixes #1306
2014-07-15 10:27:42 +02:00
Tony Crisci 7381b50587 Make absolute floating move work with criteria
Make commands of type `move [window|container] [to] [absolute] position
<px> [px] <px> [px]` work with command selection criteria.

fixes #1301
2014-07-02 19:07:08 +02:00
Michael Stapelberg 01a2c5a3f1 Merge branch 'master' into next 2014-06-27 09:05:32 +02:00
Michael Stapelberg c159fc4197 Bugfix: create the directory for storing the restart state (Thanks hjem)
fixes #1303
2014-06-27 09:04:51 +02:00
Tony Crisci a9c094b731 Implement EWMH desktop names
Maintain the _NET_DESKTOP_NAMES property on the root window.

http://standards.freedesktop.org/wm-spec/latest/ar01s03.html#idm140251368131760

> _NET_DESKTOP_NAMES
>
> _NET_DESKTOP_NAMES, UTF8_STRING[]
>
> The names of all virtual desktops. This is a list of NULL-terminated
> strings in UTF-8 encoding [UTF8]. This property MAY be changed by a
> Pager or the Window Manager at any time.
2014-06-24 09:04:05 +02:00
Tony Crisci cbd51ce664 Workspace command number selection
If a `workspace {N}` or `move to workspace {N}` command is given with N
as a plain number, the workspace of this number is selected for the
context of the command if one exists and there is no workspace with a
name that exactly matches N.
2014-06-23 21:30:07 +02:00
Michael Stapelberg d1e59a204e fix src/commands.c with clang-format 2014-06-23 21:29:42 +02:00
Tony Crisci c2b6b06da7 Make command `move [direction]` work with criteria
A container selected with criteria should be moved with the `move
[direction]` command, instead of this command always acting on the
focused container.
2014-06-23 21:17:27 +02:00
Tony Crisci c936232545 Consistently parse workspace numbers
Use ws_name_to_number() to parse workspace numbers where this
transformation takes place.
2014-06-23 21:16:18 +02:00
Michael Stapelberg 4c06e7a573 clang-format-3.5 **/*.h **/*.c
This should be the last commit that formats a big bunch of files. From
here on, whenever I merge patches, I’ll run clang-format like described
in the title.
2014-06-19 11:20:32 +02:00
Michael Stapelberg 9200094203 format **/*.c with clang-format-3.5
This has multiple effects:

1) The i3 codebase is now consistently formatted. clang-format uncovered
   plenty of places where inconsistent code made it into our code base.

2) When writing code, you don’t need to think or worry about our coding
   style. Write it in yours, then run clang-format-3.5

3) When submitting patches, we don’t need to argue about coding style.

The basic idea is that we don’t want to care about _how_ we write the
code, but _what_ it does :). The coding style that we use is defined in
the .clang-format config file and is based on the google style, but
adapted in such a way that the number of modifications to the i3 code
base is minimal.
2014-06-15 19:07:02 +02:00
Michael Stapelberg 94574db6f6 cleanup temporary directory when restarting and not using XDG_RUNTIME_DIR
fixes #1253
2014-06-11 09:17:43 +02:00
Michael Stapelberg 26460c091a delete ipc socket when exiting, cleanup tmpdir
fixes #1253
2014-06-08 22:13:43 +02:00
Michael Stapelberg 617afc67a2 replace remaining printf()s with D?LOG
fixes #1252
2014-06-08 21:56:14 +02:00
Tony Crisci c7aae56030 Refactor parse_command
parse_command returns a struct that contains useful information about
the result of a command as a whole (instead of the intermediate
representation used during parsing).

parse_command now requires the caller to allocate the yajl_gen used for
generating a json reply. This is passed as the second parameter to
parse_command. If NULL is passed, no json reply will be generated.
2014-05-31 14:59:35 +02:00
Tony Crisci 45fa4b7d23 Change the names of parser result structs
Change the name of structs CommandResult and ConfigResult to
CommandResultIR and ConfigResultIR to show they are an intermediate
representation used during parsing.
2014-05-20 19:59:01 +02:00
Michael Stapelberg ff94d28b85 improve error messages for i3-internal workspace names 2014-05-03 15:02:51 +02:00
Alexander Berntsen bc79884a9e Make all workspaces starting with "__" internal
Workspaces won't work properly if they start with "__", so reserve that
namespace altogether. Disallow renaming workspaces to reserved namespace
and using reserved namespace in configuration.

Fixes #1209.
2014-05-03 15:00:15 +02:00
Tony Crisci ea551e4d99 Bugfix: resize window check should check for null
When checking the window type for a resize command, first check to see
if the window property is null before checking whether or not it is a
dock window. The window may be null in the case it is a branch
container.

fixes #1220
2014-04-26 12:10:05 +02:00
Michael Stapelberg 524f20b8a0 layout restoring: append at the nearest split container (or workspace) (Thanks chris)
Before this commit, leaf containers (such as terminal emulators) would
get children appended, which is not intended.

fixes #1223
2014-04-18 20:30:27 +02:00
Tony Crisci 0c3735fc23 Free owindow when no con_id match or window
This memory leak is related to matching on con_id or matching when the
container has a null window. In that case, windows that do not match
would leak the owindow struct.
2014-03-21 19:26:13 +01:00
Tony Crisci 587273505c Free match after criteria initialization
This memory leak is associated with matching by a criteria that uses a
regular expression. Without freeing a regex before calling match_init,
it will definitely be lost.
2014-03-21 19:23:05 +01:00
Michael Stapelberg c23db20cb5 Merge branch 'master' into next 2014-03-15 18:05:45 +01:00
Tony Crisci a6a6c9b6d9 Bugfix: don't try to resize docks by command
cmd_resize does not implement a method to resize dock clients.

A command like `[instance=".*"] resize grow width 160 px or 16 ppt`
when a dock client matched would crash i3.

fixes #1201
2014-03-15 18:05:42 +01:00
Michael Stapelberg 58b3c730e2 return parse errors via IPC for append_layout 2014-01-04 21:39:13 +01:00
Michael Stapelberg 076636a835 display swallows criteria in placeholder windows 2013-12-22 21:52:49 +01:00
Michael Stapelberg 3a4ad9b330 layout restore: create and render placeholder windows
This is not entirely done yet, but TODO entries are placed in the code
where appropriate.
2013-12-22 21:52:49 +01:00
jj b6100dd727 Fix output retrieval for floating cons
When focusing/moving to outputs, the method of getting the correct
output for a given container fails if the container in question is
floating and only partially mapped on an output screen. This patch
introduces a fail-safe retrieval of the output for any container.
2013-10-23 23:26:06 +02:00
jj dbec5eb905 Fix keyboard and mouse resize in nested containers
fixes #1084
fixes #1085
2013-09-26 19:30:07 +02:00
Vivien Didelot 5baada6532 reduce some yajl boilerplate
This patch introduces a yerror() macro in src/commands.c and also
removes some unused yajl helper macros from src/config_directives.c.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
2013-09-26 19:09:39 +02:00
Leo Gaspard c9611b320b Remove debug message when debugging is disabled
More precisely, switch from printf to DLOG a "matching: * / *" message, like all
the other "matching: * / *" messages.
2013-08-20 19:06:03 +02:00
Bas Pape a5ee699d36 Initialize variables to prevent (false) warnings. 2013-08-20 19:05:48 +02:00
Franck Michea 69d7adcf49 Add missing return after error reporting. 2013-08-08 22:44:23 +02:00
koebi 88671986f4 implement unmark command 2013-07-17 23:02:31 +02:00
Alexander Berntsen 023594909e Implement debuglog command
Add debuglog command that takes toggle|on|off. Add get_debug_logging()
to be able to toggle. Make t/187-commands-parser.t expect 'debuglog'.
Document the debuglog command in userguide.
2013-07-07 15:33:42 +02:00
Alexander Berntsen f9d93d75b3 Implement shmlog command
Add shmlog command that takes <size>|toggle|on|off. Separate logbuffer
management into open_logbuffer() and close_logbuffer(). Make
t/187-commands-parser.t expect 'shmlog'. Add update_shmlog_atom() to
update the SHMLOG_PATH. Document the shmlog command in userguide.
2013-06-23 21:48:02 +02:00
haptix@web.de e3913093b6 introduced i3 command for changing the hidden state and the mode of i3bar
The hidden_state and mode of each i3bar instance can now be controlled from within i3.
Therefore, two new i3 command were introduced:
    _
    bar hidden_state show|hide|toggle [<bar_id>]

    show: always show the bar
    hide: normal hide mode
    toggle: toggle between show and hide (individually for each bar)
    _
    bar mode dock|hide|invisible|toggle [<bar_id>]

    hide,dock: like before
    invisible: always keep the bar hidden
    toggle: toggle between dock and hide (individually for each bar)

This patch introduces a hidden_state ("hidden_state hide|show") in the
barconfig, which indicates the current hidden_state of each i3bar
instance. It only affects the bar when in hide mode. Additionally, a new
invisible mode was introduced. In order to change the hidden_state or
mode of the bar from i3, a barconfig-update event was introduced, for
which a bar can subscribe and the bar then gets notified about the
currently set hidden_state and mode in its barconfig.

For convenience, an id field ("id <bar_id>") was added to the barconfig, where one can
set the desired id for the corresponding bar. If the id is not specified, i3 will
deterministically choose an id; otherwise, with the previous random approach for finding
a new id, which is actually not shared with i3bar, as it would determine its id on
startup, the event-subscription would be destroyed on reload. Still, this issue remains
when manually changing the bar_id in the config and then reloading.

fixes #833, #651
2013-05-25 23:00:36 +02:00
Diego Ongaro 96575e14a0 Give layout enum a name: layout_t 2013-05-22 19:35:07 +02:00
oblique a93e1e5c59 Ensure that resize will take place even if pixel is smaller than size increments.
fixes #1011
2013-04-15 20:59:51 +02:00
Sebastian Ullrich 49979c9d15 Always auto center on 'scratchpad show' if window hasn't been repositioned by the user
This change ensures a scratchpad window is still centered on the screen
if it has first been shown on another screen of a different
resolution. Moving or resizing the scratchpad manually disables this
behavior.
2013-02-18 10:38:28 +01:00
oblique e92dd1acc6 Obey WM_SIZE_HINTS's resize increments in floating 2013-02-14 19:38:26 +01:00
Francesco Mazzoli f13d8ed06f wrap when moving things to outputs with direction 2013-01-26 19:27:58 +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 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 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
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 29b19a7468 spelling error: s/implementaiton/implementation/g 2012-10-24 07:58:03 +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
Michael Stapelberg 2738f13798 move owindow definition into the command parser 2012-10-08 13:26:24 +02:00
Deiz e89a25f81f Implement moving workspaces as if they're regular containers 2012-09-29 00:17:36 +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 5d8e3f58f6 Fix 'border toggle' (it "skipped" 1px border) (Thanks joepd)
fixes #818
2012-09-28 19:29:14 +02:00
Yaroslav Molochko 04c58c7325 Implement variable border widths for pixel/normal
fixes #325
2012-09-24 22:20:29 +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
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
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
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
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 a7569e6a98 implement error messages when moving to another ws fails (Thanks eeemsi)
fixes #769
2012-08-13 01:57:39 +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
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 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