Commit Graph

6225 Commits

Author SHA1 Message Date
0600b11d2b Add workspace vars to support DRY when customizing
Relabeling the workspaces required the user to update the labels at least in two places of the i3 config file (switch to workspace + move focused container to workspace) to keep a consistent state.

This got even worse when the user started to reference the workspaces elsewhere, e.g. for assigning containers to specific workspaces.

This change supports the DRY principle for users. Relabeling the workspaces is now merely a matter of changing the respective variable ($ws1, $ws2, … $ws10).
2017-12-23 12:28:03 +01:00
2f1fc7f610 Merge pull request #3095 from pallavagarwal07/next
Add support for relative coordinates in i3bar click events
2017-12-20 18:33:21 +01:00
161db6f17d Add relative coordinates in JSON for i3bar click events (fixes #2767)
Add support for relative coordinates in i3bar click events

Rename {x,y}_rel to relative_{x,y}

Update i3bar-protocol doc to mention the added fields in click events
2017-12-20 22:51:14 +05:30
eb227c2332 Merge pull request #2969 from orestisf1993/issue-1819
Make 'focus' disable blocking fullscreen windows
2017-12-18 08:54:45 +01:00
36449ba22d Merge pull request #3079 from orestisf1993/generate-command-parser
generate-command-parser.pl: remove trailing characters
2017-12-12 16:49:48 +01:00
2403c43f7b Make 'focus' disable blocking fullscreen windows
The problem here is that con_fullscreen_permits_focusing() does not
check if there is a blocking fullscreen container in the workspace that
the container to be focused belongs. This makes it possible to focus a
container behind a fullscreen window if it's in an unfocused workspace.

This commit introduces a change in the 'focus' command behaviour. When
focusing a container blocked by a fullscreen container, either CF_OUTPUT
or CF_GLOBAL, the blocking container loses its fullscreen mode and the
target container is focused like normal.

This should not affect directional focus commands: left, right, up,
down, parent, child.

Fixes issue #1819.
2017-12-11 19:14:33 +02:00
994a479558 userguide: mention <criteria> in focus 2017-12-11 19:14:33 +02:00
759e051374 Move is_num_fullscreen to Test.pm 2017-12-11 19:14:33 +02:00
2592c63603 Add error reply to cmd_focus_window_mode 2017-12-11 19:14:33 +02:00
df437aa87e Use con_has_parent in con_fullscreen_permits_focusing 2017-12-11 14:00:14 +02:00
5225e34b9d generate-command-parser.pl: remove trailing whitespace 2017-12-11 00:41:52 +02:00
de3c122337 generate-command-parser.pl: remove trailing comma 2017-12-11 00:41:52 +02:00
57ee66ad25 Merge pull request #3078 from orestisf1993/issue-3075
Fix sticky-related crash (#3075)
2017-12-10 22:02:10 +01:00
d134745c4f Prevent access of freed workspace in _workspace_show
The bug triggers when _workspace_show calls tree_close_internal and
old == old_focus. Ie, when the old workspace was empty and needs to be
closed but then is accessed as output_push_sticky_windows's argument:
Breakpoint 1, output_push_sticky_windows (to_focus=0x55555589c8a0) at ../../i3/src/output.c:102
102	                    con_move_to_workspace(current, visible_ws, true, false, current != to_focus->parent);
(gdb) print con_exists(to_focus)
$1 = false

The access violation can also be prevented by checking if
con_exists(old_focus) but it shouldn't be necessary: the old_focus
container can only be killed when it is an empty workspace.

With --enable-sanitizers this causes i3 to exit but with
--disable-sanitizers the access violation doesn't reliably cause a crash
and the con_move_to_workspace call continues with:
(gdb) print current != to_focus->parent
$2 = 1

Since current->type is CT_FLOATING_CON and to_focus->type is
CT_WORKSPACE, in this specific case ignore_focus would always be true.
So, in this case, passing NULL instead of old_focus to
output_push_sticky_windows doesn't change the behaviour of i3.

Fixes #3075.
2017-12-10 21:37:43 +02:00
8cbe705674 Merge pull request #3076 from orestisf1993/v3-to-v4-issue
minor V3 to v4 issues
2017-12-09 19:42:30 +01:00
1890517f96 migrate_config: scalloc converted config
Prevents a false-positive error eg with config file:
set $mod Mod4
bindsym $mod+h split h
bindsym $mod+v split v

ERROR: CONFIG: Expected one of these tokens: <end>, '#', 'set ', ...
ERROR: CONFIG: Line   8:     status_command i3status
ERROR: CONFIG: Line   9: }
ERROR: CONFIG: Line  10: <BE><BE><BE><BE><BE><BE>
2017-12-09 20:07:58 +02:00
ed22785909 Fix v3 to v4 crash with a variable with longer name than value 2017-12-09 19:50:43 +02:00
9d2d602d60 Merge pull request #3074 from orestisf1993/issue-2921
Fix workspace_show-related issues
2017-12-09 15:52:01 +01:00
cf28147c5e Show workspace in _tree_next
Fixes a regression introduced by #2980.
2017-12-09 16:39:33 +02:00
9ced77384b Remove useless check in _tree_next
con_descend_focused on an empty workspace should return the workspace.
2017-12-09 16:39:33 +02:00
87ed8df4fa floating_maybe_reassign_ws: show workspace before focusing
With this change i3 will correctly switch to the focused workspace.
This fixes bug with moving floating windows with 'move <direction>' or by dragging like _NET_CURRENT_DESKTOP not getting updated or 'workspace back_and_forth' not working.

Fixes #2921.
2017-12-09 16:39:33 +02:00
23cfbc54c5 Merge pull request #3073 from veselov/i3-3072
Fixes #3072, Xft.dpi can be floating point
2017-12-09 15:34:13 +01:00
d2b35388b4 Fixes #3072, Xft.dpi can be floating point 2017-12-09 15:12:25 +01:00
90dd84ee62 Merge pull request #3070 from orestisf1993/issue-3068
Add '--release' flag for bindsym in the bar block
2017-12-08 14:29:17 +01:00
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
ee0c016091 Merge pull request #3066 from orestisf1993/xvfb-opt
complete-run.pl: accept the xvfb option from command line
2017-12-05 07:29:10 +01:00
b6bbb91479 complete-run.pl: accept the xvfb option from command line 2017-12-05 00:22:14 +02:00
458e2a2e46 Merge pull request #3022 from orestisf1993/i3bar-leaks
Fix i3bar leaks
2017-12-03 19:51:25 +01:00
54c79e4b2f i3bar: free output data structures 2017-12-03 20:25:34 +02:00
730264d9b2 Merge pull request #3065 from orestisf1993/issue-3064
Skip internal workspaces with 'move workspace to output'
2017-12-03 18:46:34 +01:00
e3f8939a58 Skip internal workspaces with 'move workspace to output'
Fixes #3064.
2017-12-01 17:11:32 +02:00
f6f198c3fe Merge pull request #3058 from d-e-s-o/fix-FREE
do not check for NULL in FREE macro
2017-11-29 08:33:27 +01:00
3e34122de4 Perform proper cleanup for signals with 'Term' action (#3057)
Issue #3049 describes a case where terminating i3 by means of SIGTERM
causes it to leak the runtime directory and all its contents. There are
multiple issues at play: first, any cleanup handlers registered via
atexit are never invoked when a signal terminates the program (see
atexit(3)). Hence, the log SHM log cleanup performed in i3_exit is not
invoked in that case. Second, compared to the shutdown path for the
'exit' command, we do not unlink the UNIX domain socket we create,
causing it to be leaked as well. Third, a handler for SIGTERM is not
registered at all despite handle_signal claiming to be the handler for
all 'Term' signals.
This change addresses all three problems and results in a graceful exit
including cleanup to happen when we receive a signal with the default
action 'Term'. It addresses issue #3049.
2017-11-28 23:29:47 -08:00
e4d6458cc3 Merge pull request #3052 from d-e-s-o/remove-magic-numbers
i3bar: replace magic numbers with more meaningful constructs
2017-11-29 08:22:51 +01:00
f9efc09b98 Merge pull request #3059 from stapelberg/debuglog
i3-dump-log: enable shmlog on demand
2017-11-26 23:34:10 -08:00
02b237b14d shmlog: remote atom when disabled 2017-11-26 18:07:13 +01:00
1facb450c0 i3-dump-log: enable shmlog on demand
fixes #3055
2017-11-26 18:07:02 +01:00
c07936d91b no-op refactoring: make ipc_connect find socket path 2017-11-26 16:41:59 +01:00
865bd462b4 do not check for NULL in FREE macro
free(3) is safe to invoke on a NULL pointer, in which case no action is
taken. This change adjusts the FREE macros to omit this unnecessary
check.
2017-11-23 15:41:33 -08:00
2eabfc88fe Merge pull request #3050 from d-e-s-o/fix-typo
fix typo in src/main.c
2017-11-18 19:19:25 +01:00
2481301dfc fix typo in src/main.c 2017-11-18 09:49:41 -08:00
222d8210ab i3bar: replace magic numbers with more meaningful constructs
In i3bar/src/config.c we compare string lengths agains magic numbers.
This change replaces those numbers with the lengths of the strings they
represent.
2017-11-17 06:58:12 -08:00
d1f8266df0 Merge pull request #3041 from d-e-s-o/update-userguide
docs/userguide: Correct mark/goto i3-input commands
2017-11-17 15:09:50 +01:00
a78c9ab82f Merge pull request #3040 from jchook/next
$mod+r toggles resize mode
2017-11-13 22:01:06 +01:00
0617b9f2a7 Merge pull request #3042 from Mayeu/kitty-terminal
add the kitty terminal in i3-sensible-terminal
2017-11-12 13:38:52 +01:00
22ba46e2a3 add the kitty terminal in i3-sensible-terminal 2017-11-12 16:48:21 +08:00
3a22c6e765 docs/userguide: Correct mark/goto i3-input commands
The userguide still mentions an old 'goto' command which no longer
exists and will be ignored silently (when used in the i3 config) or
causes an error to be reported (when invoked from the command line).
This change updates the userguide to correct this problem. In addition
to that it also updates the i3-input command shown to no longer use the
deprecated -p flag but -F instead.
2017-11-11 17:06:43 -08:00
103e78e04a Bugfix: avert endless loop on unexpected EOF at ipc messages (#3021)
Fix freeze on invalid ipc commands like

    echo -n $'i3-ipc\0\0\0\xa\0\0\0\0focus left' | socat - `i3 --get-socketpath`

Also, treat incomplete headers as IPC violation. Example of incomplete header:

    echo -n i3-ip | socat - `i3 --get-socketpath`
2017-11-09 11:18:23 -08:00
c207921949 Merge pull request #2980 from orestisf1993/issue-1160-pr
Use con_descend_focused for workspaces in _tree_next
2017-11-05 17:42:31 +01:00
b18f507b9b Merge pull request #3030 from tylerbrazier/next
config: use ascii single quote
2017-11-05 17:37:53 +01:00