Commit Graph

152 Commits

Author SHA1 Message Date
Malix 4661e74b5e
Fix: remove "dynamic" TWM (#6193)
related to https://github.com/i3/i3.github.io/issues/137
2024-08-05 18:23:55 +02:00
Orestis Floros be840af45c
tiling_drag: Allow swapping containers (#6084)
This was originally mentioned in #3085 but left for a future PR.

One of the noticeable limitations is that pressing the modifier while
the drag is already initiated, will not swap the containers but instead
cancel the drag. This is because of how `drag_pointer()` is written and
would be quite an involved case to handle it.
2024-07-04 21:44:41 +02:00
Orestis Floros 1993b7e318
Add `popup_during_fullscreen all` option 2024-05-20 21:26:27 +02:00
Orestis Floros ba1f40f45f
i3bar: Add protocol for workspace buttons
Closes #3818 (parent issue)
Fixes #1808
Fixes #2333
Fixes #2617
Fixes #3548
2023-01-22 18:59:58 +01:00
Orestis Floros c52f13900d
Add focus workspace command 2023-01-22 18:33:23 +01:00
Orestis Floros a1e4b44955
command.spec: Put cmd_border stuff together (#5266) 2022-11-13 16:22:41 +01:00
Michael Stapelberg 1ba0eaca22
Make floating_from and tiling_from criterion work in commands, too (#5278)
Fixes https://github.com/i3/i3/issues/5258
2022-11-12 16:44:08 +01:00
Michael Stapelberg 9c9b110ed1 config.spec: add missing smart_gaps inverse_outer comment 2022-11-01 17:55:46 +01:00
Michael Stapelberg a5791b2e64 gaps: allow optional px suffix 2022-11-01 17:55:46 +01:00
Michael Stapelberg 5b0f848a40 Fix config.spec comment 2022-11-01 17:55:46 +01:00
Michael Stapelberg b825dc124a Merge gaps support as-is
This code was copied over unmodified from https://github.com/Airblader/i3-gaps.

I have split out the differences between i3-gaps and i3 into three areas:
1. Gaps
2. i3bar height
3. rgba colors
2022-11-01 17:55:46 +01:00
Michael Stapelberg 0b89d4b2a7 implement bar { padding } config directive
related to https://github.com/i3/i3/issues/3724
related to https://github.com/i3/i3/pull/4288
fixes https://github.com/i3/i3/issues/3721
2022-10-30 22:22:08 +01:00
Michael Stapelberg c45342e74f Merge support for the bar { height } option as-is from i3-gaps
related to https://github.com/i3/i3/issues/3724
related to https://github.com/i3/i3/issues/3721

In a follow-up commit, we can evolve this into the padding directive as
discussed on issue #3721.
2022-10-30 22:22:08 +01:00
Michael Stapelberg 55d400b17d make tiling drag configurable
fixes https://github.com/i3/i3/issues/5155
2022-10-16 18:21:08 +02:00
Michael Stapelberg ac368e7916
config_parser: prevent trailing whitespace in output (string → word) (#5117)
fixes https://github.com/i3/i3/issues/5064
2022-09-09 10:23:55 +02:00
zhiv-git ce2665ca96
Fix segfault when bindsym command is empty (#5001)
Remove end token from BINDCOMMAND

fixes i3/i3#5000: bindsym command cannot be empty, because NULL string
causes i3 to segfault when copied in configure_binding()
2022-06-08 22:38:21 +02:00
Peder Stray 813336e068
Implement title_window_icon toggle
A feature described in i3/i3#4709
2021-12-11 14:20:07 +01:00
Orestis Floros 93b2b44893
cmd_focus_output: Multiple outputs 2021-11-05 18:34:54 +01:00
Orestis Floros f36050b303
Add title tab color
Fixes #4575
2021-11-05 15:19:18 +01:00
Isaac Garzon 3a818c0f20 Implement 'all' matching criterion
This criterion matches all open windows, as a more readable (and
correct) version of the 'class=".*"' criterion (more correct because
it'll also match windows which don't have WM_CLASS set yet).
2021-07-24 22:18:58 +03:00
Michael Stapelberg abbf6a85d7
Implement showing window icons in titlebar (#4439)
This feature defaults to off, and can be turned on for individual windows,
or (with for_window) for all new windows. See the userguide change.

This commit is partially based on work by:

• Marius Muja
• mickael9
• Esteve Varela Colominas
• Bernardo Menicagli
2021-06-13 08:35:52 +02:00
Michael Stapelberg eaa5e636f9
Implement include config directive (#4420)
The implementation uses wordexp(3) just like sway:
https://github.com/i3/i3/issues/1197#issuecomment-226844106

Thanks to jajm for their implementation at
bb55709d0a

This required refactoring the config parser to be re-entrant
(no more global state) and to return an error instead of dying.

In case a file cannot be opened, i3 reports an error but proceeds with the
remaining configuration.

Key bindings can be overwritten or removed using the new --remove flag of the
bindsym/bindcode directive.

All files that were successfully included are displayed in i3 --moreversion.

One caveat is i3 config file variable expansion, see the note in the userguide.

fixes #4192
2021-06-02 21:01:43 +02:00
Orestis Floros 8ff8db3c36
Accept multiple outputs in `move container|workspace to output`
Fixes #4337
2021-02-06 11:00:16 +01:00
Albert Safin 32c10a19f2
Add "machine" criterion to match WM_CLIENT_MACHINE
Closes #3981

Add "%machine" title_format placeholder
Add "machine" to the IPC and layout saving/restoring
2021-01-28 12:52:10 +01:00
acheronfail fae10f6df7 allow ppt values in move direction and move position commands
make ppt values clear in userguide

chore: move is_ppt and DLOG out of TAILQ_FOREACH loop
2020-10-20 17:48:26 +11:00
Orestis Floros ae9613576f
Fix swapped cmd_bar_{mode,hidden_state}
Mentioned in
fb2677f5f4 (r39550195)
2020-05-30 16:46:14 +02:00
Orestis Floros fb2677f5f4
cmd_bar: Fix regression with invalid modes
This is another regression from #4014: multiple arrows in a row mean
optional values. Re-introduce new states to force matching & proper
parser errors.
2020-05-14 00:40:09 +02:00
Orestis Floros f63a4bef54
cmd_bar improvements (#4014)
- Split cmd_bar into 2 functions, improving errors and reducing strcmps
- Only update barconfig when something has changed
- Only update barconfig for the specific bar that has changed

Fixes #3958
2020-05-07 09:22:03 +02:00
Orestis Floros ae757c6848
Extend tiling/floating criteria with optional auto/user values (#4006)
The default `tiling` and `floating` behavior is preserved and matches
both cases.

Adds a new handler to `remanage_window` on A_I3_FLOATING_WINDOW change.

Mainly in order to `run_assignments`, this makes `for_window [floating]`
directives to work for windows which where initially opened as tiling.
Now, when floating is enabled, `for_window` will trigger correctly. Same
applies to `for_window [tiling]`.

The obvious solution of `run_assignments` after
`floating_{enable,disable}` doesn't work because `run_assignments`
modifies the parser state in src/assignments.c:51.

Fixes #3588

Co-Authored-By: Michael Stapelberg <michael@stapelberg.de>
2020-04-12 13:49:08 +02:00
Orestis Floros 24a58d2952
Implement focus_wrapping workspace
I had a dilemma about the behaviour here:
1. Prohibit focus leaving the workspace in any case unless if
get_tree_next's initial argument is a workspace. This is what this
commit does (also i3-cycle).
2. Leave the workspace if no warp is possible (eg workspace with single
container or `focus right` with `V[a b c*]`).

Fixes #2180
2019-10-14 13:02:33 +03:00
Orestis Floros bbc4c99c72
Refactor tree_next
- Makes `tree_next` not recursive.
- Adds `focus next|prev [sibling]` command. See (1.) and (2.) in
https://github.com/i3/i3/issues/2587#issuecomment-378505551 (Issue also
requests move command, not implemented here).
- Directional focus command now supports command criteria.

Wrapping is not implemented inside a floating container. This was also
true before the refactor so I am not changing it here.
2019-10-14 03:31:24 +03:00
Konst Mayer 94228fd902 Add setting for minimal width of workspace buttons 2019-06-25 13:10:01 +07:00
Orestis Floros 8ce99cdacb
cfg_workspace: Accept outputs with spaces again
This is a regression from bce088679.

An other way to fix this would be to concatenate strings inside the
strtok loop when an output starts with a double quote but I'd rather
let the parser do the word splitting.

Fixes #3646
2019-03-21 21:31:30 +02:00
Aestek 6d82753d53
Add title_align config directive
Controls the window titles alignment in title bars. Possible values are:
- left
- center
- right

Co-authored-by: Orestis Floros <orestisf1993@gmail.com>
- Made title_align a config directive instead of a command. Helps with
some tree_render() issues we had.
- Made title_max_width the same for all 3 cases.
- Modified title offset calculations and added explanations for each
case.
- Append title_padding to mark_width if a mark exists.

Fixes #1750
2018-10-12 19:58:48 +03:00
Orestis Floros 2ead7745d6
Make cmd_resize_tiling_direction work with pixels
Introduces resize_neighboring_cons in resize.c which is also used by
resize_graphical_handler.

Co-authored-by: Andrew Laucius <andrewla@gmail.com>
Authored original code and tests in #3240. I rewrote most of the
resizing code and fixed the failing tests.
2018-08-24 04:13:03 +03:00
Orestis Floros 37d0105c83
Kill misbehaving subscribed clients instead of hanging
This change only affects clients that are subscribed to events, which
should be the main cause of our problems.

In the common case (no buffered data) the behaviour doesn't change at
all: the message is sent directly, no ev_io / ev_timeout callback is
enabled. Once a write to a client's socket is not completed fully
(returns with EAGAIN error), we put the message in the tail of a queue
and init an ev_io callback and a corresponding timer. If the timer is
triggered first, the socket is closed and the client connection is
removed. If the socket becomes writeable before the timeout we either
reset the timer if we couldn't push all the buffered data or completely
remove it if everything was pushed.

We could also replace ipc_send_message() for all client connections in
i3, not just those subscribed to events.

Furthermore, we could limit the amount of messages stored and increase
the timeout (or use multiple timeouts): eg it's ok if a client is not
reading for 10 seconds and we are only holding 5KB of messages for them
but it is not ok if they are inactive for 5 seconds and we have 30MB of
messages held.

Closes #2999
Closes #2539
2018-08-08 19:14:56 +03:00
Orestis Floros bce088679a
Allow multiple assignments of workspaces to outputs
Also makes get_assigned_output work with the primary output:
    workspace X output primary
will now work.

Fixes #555.
2018-07-12 17:07:01 +03:00
Orestis Floros c50bf50f09
resize set: accept 'width' and 'height' keywords
Fixes #3275
2018-05-02 19:02:38 +03:00
Orestis Floros bd7a5ee48a
cmd_border: improve width selection
- 'border toggle' now accepts an optional pixel argument which will be
ignored when switching to BS_NONE.
- 'border pixel' now defaults to 1 pixel instead of 2.
- Calling 'border normal' or 'border pixel' will use the configured
default_border_width if one exists. Also applies to floating windows.
2018-04-21 16:50:57 +03:00
Orestis Floros fe6b3b7474
i3bar: make modifier behave like floating_modifier
Pressed modifiers are determined like in click.c:handle_button_press.

Fixes #3234.
2018-04-17 02:00:03 +03:00
Orestis Floros 174dc389ff Remove 'method' from cmd_move_window_to_position
For command:
move window to [absolute] position X px Y px
if the optional keyword 'absolute' is provided the end result is the
same even though it is implemented differently. Only difference is that
with absolute the floating window can move completely outside of any
output.

This commit removes the 'method' argument and only keeps the sane
implementation.
2018-03-20 16:59:06 +02:00
hwangcc23 2269b2e795 Add strip_workspace_name
See the issue #3163 (https://github.com/i3/i3/issues/3163).

Add strip_workspace_name to strip off the workspace name.
2018-03-11 12:17:42 +08:00
Bennett Piater f8d6c10d7c
Add default_{,floating_}border to config
userguide: document default_{,floating_}border

201-config-parser.t: add new tokens to $expected_all_tokens

201-config-parser-t: fix whitespace

closes i3/i3#2702
2018-02-15 16:25:56 +01:00
Orestis Floros 315ff17563 Add '--release' flag for bindsym in the bar block
i3bar's handle_button is modified to also handle XCB_BUTTON_RELEASE
events. During these button release events, only custom commands are
checked to avoid sending multiple workspace ipc messages.

The way this patch is implemented will allow to assign a custom command
for both the press and release of the same button:
bar {
  ...
  bindsym buttonX exec command1
  bindsym --release buttonX exec command2
}

Fixes #3068.
2017-12-08 12:16:22 +02:00
Orestis Floros b17e7b82c6 Add support to resize floating container in percentage
resize set is modified to accept both 'px' and 'ppt' height and width.

Fixes #2816.
2017-10-18 02:07:11 +03:00
Michael Stapelberg 54d61b510d Merge pull request #2953 from CyberShadow/focus_wrapping
Add "focus_wrapping" option
2017-09-27 09:31:39 -07:00
Vladimir Panteleev 50edf495aa
Merge "force_focus_wrapping" option into "focus_wrapping force"
Allow enabling forced focus wrapping by specifying "focus_wrapping
force" in i3's configuration. This syntax supersedes the previous
"force_focus_wrapping yes" one, which remains available for backwards
compatibility.
2017-09-25 18:58:12 +00:00
Vladimir Panteleev 28f7e14650
Add "focus_wrapping" option
Fixes #2352.
2017-09-22 23:40:41 +00:00
Orestis Floros a35854ddf4 Allow assign to output
Implements the "assign" part of issue #2764.
2017-09-17 15:37:17 +03:00
Orestis Floros eaf7a49e28 Allow assign to workspace by number
Makes "assign [<criteria>] workspace number <number>" work in the same
manner as "move to workspace number <number>" instead of assigning the
window to a workspace named "number <number>".

config.spec is modified to expect a 'number' string and an extra
argument is used in cfg_assign.

For workspaces that don't exist yet, workspace_get is used as a
fallback. This also allows the user to assign to "<number> <workspace>"
eg "2: work" and the full name will be used if workspace number 2
doesn't exist yet.

Fixes #2590.
2017-09-15 03:38:13 +03:00