Commit Graph

371 Commits (252db3b8cfad6aa3c9cf22f51eb2a585ae69c791)

Author SHA1 Message Date
Oliver Graff 252db3b8cf Don't refocus a workspace cleaned up by `workspace_show` during rename
When moving a workspace to the current output by way of a rename, if the
current workspace is empty, it will be removed by `workspace_show`.
Attempting to restore focus to this removed workspace causes a crash.
Follow the pattern in workspace.c:996 to only restore the original focus if the
original workspace still exists.

Add a test to ensure that the renamed workspace moves to its appropriate
output and that a crash does not occur.

Fixes #3228
2018-05-01 11:25:13 +03:00
Orestis Floros 2f2053284e
cmd_shmlog: use parse_long() 2018-04-26 23:47:45 +03:00
Ingo Bürk 5a0f02b7ff
Merge pull request #3230 from hwangcc23/fix-3227
Make "scratchpad show" return correct info
2018-04-21 17:57:54 +02: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
hwangcc23 4869becfee Make "scratchpad show" return correct info
Fix the issue #3227(https://github.com/i3/i3/issues/3227).

1).Make cmd_scratchpad_show() use the information coming from scratchpad_show().
2).Add a test case 298-scratchpad-show.t.
2018-04-20 22:30:41 +08:00
Oliver Graff e4a184e77e
Workspace renaming: Interpret outputs as nondirectional
Currently when renaming outputs, an output assignment of "left" will
cause the workspace to move left. Treat this assignment as a proper name
instead (even though it is unlikely an output will be named "left").

Move logic for determining output to move to out of
`workspace_move_to_output`

Add test for ignoring direcionality during rename.

Fixes #3208.
2018-04-04 13:37:59 -04:00
Orestis Floros 0b5799412a
Introduce get_existing_workspace_by_num 2018-03-28 15:18:43 +03:00
Orestis Floros 6a2728ba79
Introduce get_existing_workspace_by_name 2018-03-28 15:18:43 +03:00
Orestis Floros e424a31307
cmd_append_layout: resolve_tilde already allocates memory
Fixes a small memory leak with all append_layout commands.
2018-03-27 03:37:57 +03:00
Orestis Floros 5e8a3f3f0c cmd_move_window_to_position: improve error message 2018-03-20 16:59:06 +02: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
Ingo Bürk 9610dc29b8
Merge pull request #3080 from orestisf1993/cmd_move_con_to_workspace
Reduce repetition in cmd_move_con_to_workspace*
2018-01-17 21:26:09 +01:00
Ingo Bürk 17fd50999f
Merge pull request #3102 from jolange/fix3071
tiling resize: remove minimum size (was 5%)
2018-01-17 21:24:52 +01:00
Michael Stapelberg fe95ac56bb
Merge pull request #2998 from orestisf1993/issue-2990
Don't raise floating windows when focused because of focus_follows_mouse
2018-01-14 18:22:44 +01:00
Orestis Floros 0c2fbeedc2 Don't raise floating windows when focused because of focus_follows_mouse
Fixes #2990.
2018-01-14 15:45:33 +02:00
livanh 7b59da8a4f Implement 'resize set <width> ppt <height> ppt' command for tiling windows (#3036) 2018-01-08 23:25:08 +01:00
Ingo Bürk 1a04608796 Send success response for nop. (#3113)
fixes #3112
2018-01-06 23:24:33 +01:00
livanh c0378f737b Improve resize_find_tiling_participants() and simplify cmd_resize_tiling_width_height() (#3111) 2018-01-06 17:59:27 +01:00
Orestis Floros e0f1579669 cmd_move_con_to_workspace_number: rename workspace->ws
For consistency with other cmd_move_con_to_workspace* functions.
2017-12-27 20:56:37 +02:00
Orestis Floros a2e9b1461f Reduce repetition in cmd_move_con_to_workspace* 2017-12-27 20:55:22 +02:00
Johannes Lange 8f30a04425 tiling resize: remove minimum size (was 5%)
fixes #3071
2017-12-26 12:02:00 +01:00
Orestis Floros 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
Orestis Floros 2592c63603 Add error reply to cmd_focus_window_mode 2017-12-11 19:14:33 +02:00
Orestis Floros e3f8939a58 Skip internal workspaces with 'move workspace to output'
Fixes #3064.
2017-12-01 17:11:32 +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
Orestis Floros e2bacc7df8 Add con_move_to_output_name function 2017-09-17 15:37:17 +03:00
Michael Stapelberg c45c002bad validate JSON before loading
This commit also introduces slurp() which reads a file in its entirety. Using
this function instead of doing IO in the functions in load_layout.c again and
again makes the code cleaner (fixing at least two memory leaks) and avoids
re-reading the same file 3 times.

related to #2755
2017-09-13 17:41:05 +02:00
Orestis 66f2148236 Check if con_id exists in cmd_swap (#2898)
Also adds some testcases for swap using con_id.

Fixes #2895
2017-09-06 07:34:14 +02:00
Ingo Bürk 85eb097677 Invert condition to log debug message in correct situation (#2896) 2017-09-05 09:01:53 +02:00
Ingo Bürk 5f9a5e8d7d Implement 'swap' command.
This patch introduces a new command 'swap' that swaps two containers so
that they assume each other's position and geometry.

fixes #917
2017-05-15 21:06:38 +02:00
Ingo Bürk c474ddd782 Merge pull request #2649 from s3rb31/next
layout toggle: take any combination of layouts as arguments (continuation of #2476)
2017-02-24 00:58:19 +01:00
s3rb31 3410cb256d Implement mapping from string to layout as extra function 2017-02-23 21:49:48 +01:00
Tony Crisci 04dcf42397 Add the ipc shutdown event (#2652)
This event is triggered when the connection to the ipc is about to
shutdown because of a user action such as with a `restart` or `exit`
command. The `change` field indicates why the ipc is shutting down. It
can be either "restart" or "exit".

fixes #2318
2017-01-22 14:08:32 -08:00
mihaicmn da5fe3b934 fix incorrect reply to ipc command (#2567) 2016-11-15 09:26:53 -08:00
Michael Stapelberg fff3f79da9 switch to clang-format-3.8 (#2547)
https://llvm.org/bugs/show_bug.cgi?id=30353 was filed for the unintended
line break between in e.g. “TAILQ_ENTRY(foo)\nbar;”.

Until that’s fixed or a workaround is known, we’ll live with line
breaks. To make it a bit easier for readers to see what’s going on, I
added extra line breaks around each such struct member/variable
definition, so that they at least visually are a single unit.

fixes #2174
2016-11-08 13:46:43 -08:00
Michael Stapelberg f354f53435 Ensure all *.[ch] files include config.h
Including config.h is necessary to get e.g. the _GNU_SOURCE define and
any other definitions that autoconf declares. Hence, config.h needs to
be included as the first header in each file.

This is done either via:
1. Including "common.h" (i3bar)
2. Including "libi3.h"
3. Including "all.h" (i3)
4. Including <config.h> directly

Also remove now-unused I3__FILE__, add copyright/license statement
where missing and switch include/all.h to #pragma once.
2016-10-23 21:09:24 +02:00
Ingo Bürk c71f6f8f7c Implement special value 'current' for output. (#2483)
This commit introduces the special 'current' value for outputs in both of

* move con to output current
* move workspace to output current

fixes #2357
2016-09-30 08:28:02 -07:00
Tony Crisci e690e3d483 Cast con id as uintptr_t (#2298)
Use `uintptr_t` to cast the con id to int instead of `long int`. This
type is guaranteed to hold the pointer as an int regardless of platform.

fixes #2283
2016-04-15 00:27:43 -07:00
Eric Engeström 66d9c983e4 Fix spelling mistakes 2016-04-04 09:33:59 +02:00
Michael Stapelberg f63701ed09 Allow workspace renames which change case
fixes #2211
2016-02-15 08:34:03 +01:00
Ingo Bürk 6cbff6bfd4 Ensure that the "border" command uses logical pixels.
Until now, only the config directive for borders (new_window,
new_float) respected the DPI setting (using logical_px). This
patch makes sure we also do so for runtime "border" commands.

fixes #2202
2016-02-09 21:03:44 +01:00
Michael Stapelberg fbfbdb8e12 travis: check spelling of binaries and manpages, use docker
We now build a docker base container based on debian sid (where the very
latest packages are available). That base container is updated once a
month, or whenever travis-build.Dockerfile or debian/control change, but
re-used for subsequent travis runs. While the initial build might take
up to 15 minutes, subsequent builds typically run in a minute or two.

All the different steps that we run on travis are now factored into
separate scripts in the travis/ directory.

Switching to docker should also help with issue #2174.
2016-02-06 10:36:43 +01:00
David Coppa 1041572769 Remove commented-out code. 2016-01-26 09:55:24 +01:00
Ingo Bürk 328035fb7e Handle the EWMH atom _NET_WM_DESKTOP.
We already claim _NET_WM_DESKTOP support in _NET_SUPPORTED since around 2009,
but haven't actually done anything with it. However, especially pagers like
gnome-panel rely on this property to be updated and many tools, like GTK, want
to use the corresponding client messages to make a window sticky, move it
around etc.

This patch implements full support according to the EWMH spec. This means:

* We set the property on all windows when managing it.
* We keep the property updated on all windows at all times.
* We read and respect the property upon managing a window if it was set before
  mapping the window.
* We react to client messages for it.
* We remove the property on withdrawn windows.

Note that the special value 0xFFFFFFFF, according to the spec, means that the
window shall be shown on all workspaces. We do this by making it sticky and
float it. This shows it on all workspaces at least on the output it is on.

Furthermore, the spec gives us the freedom to ignore _NET_WM_DESKTOP when
managing a window if we have good reason to. In our case, we give window
swallowing a higher priority since the user would likely expect that and we
want to keep placeholder windows only around for as long as we have to.
However, we do prioritize this property over, for example, startup
notifications.

fixes #2153
fixes #1507
fixes #938
2016-01-18 12:13:36 +01:00
Michael Stapelberg cb3cdb602a ASAN: trigger leak before exiting
This disables the default leak-check-on-exit behavior which reports a
bunch of leaks that are only leaks while exiting, at which point they
don’t matter, because the operating system will clean up the memory our
process used.
2016-01-09 17:18:05 +01:00
Michael Stapelberg 79594398e2 commands.c: fix memory leak 2016-01-09 13:39:00 +01:00
Michael Stapelberg 0d1aad0af4 rename workspace: fix heap-use-after-free 2016-01-08 20:21:54 +01:00
Ingo Bürk 1f660a4cc4 Move title_format from window to container.
This patch moves the title_format information from windows to containers.
Furthermore, it allows correctly setting it on window-less containers and
displays the title accordingly for split containers.

We now also dump and read title_format in GET_TREE / during restarts.

fixes #2120
2016-01-05 12:22:27 -05:00
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