Commit Graph

181 Commits (100d05a2a662c339da616c6bdc3a1f7e3d95d355)

Author SHA1 Message Date
Orestis Floros 100d05a2a6
render_con: Get rid of render_fullscreen argument
Only true for the fullscreen container and doesn't affect any of its
children. Thus, we can get the same result by checking
->fullscreen_mode.
2018-11-12 19:05:50 +02:00
Ingo Bürk ede954128a
Merge pull request #3342 from orestisf1993/tree_close_internal
Simplify tree_close_internal
2018-09-14 12:24:54 +02:00
Orestis Floros a3dcee35f3
tree_restore: Check croot
Related to #2414, #3156.
2018-09-09 16:11:48 +03:00
Orestis Floros f908403376
Simplify tree_close_internal
This commit makes multiple changes in tree_close_internal. I didn't
split them because they are not completely independent.

- Remove force_set_focus parameter
This parameter was always set to `false` throughout the code base except
for one case where it was set to `(con == focused)`, when killing a
floating con's parent (the one with type CT_FLOATING_CON). But this case
is not needed anymore since the special handling of CT_FLOATING_CONs in
con_next_focused was removed in #2941.
- Assume that con_next_focused does not returned a container of type
CT_DOCKAREA. This is reasonable since con_next_focused uses the
focus_head stack and has special handling of CT_DOCKAREA containers.
- Remove is_mapped
This variable was only used in the if block towards the end of
tree_close_internal. Ignoring the, now removed, dockarea code and the
use of force_set_focus this block performed only one useful action:
focus the `next` container when `con == focused`. `con == focused` was a
necessary and sufficient condition for the con_activate call:
if `con != focused` we could reach the inner if blocks because of the
other conditions but would never focus another container. If `con ==
focused` then all other conditions would be irrelevant.
- Remove special handling of floating containers
Since the `next` focused container is calculated through the parent for
floating containers, I moved this code to con_next_focused.
Also, because of the removal of force_set_focus, it appears that we can
call con_on_remove_child for floating containers as well.
2018-07-30 19:41:24 +03:00
Orestis Floros 37106aa84b
Prefer fullscreen floating containers when on directional focus
Fixes #3201
2018-03-25 14:47:45 +03:00
Alex Lu 147d3c354a Update EWMH atoms when closing a workspace container
fix #3126
2018-02-13 12:00:56 +08: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
Orestis Floros cf28147c5e Show workspace in _tree_next
Fixes a regression introduced by #2980.
2017-12-09 16:39:33 +02:00
Orestis Floros 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
Orestis Floros af78331ee7 Use con_descend_focused for workspaces in _tree_next
This way, when changing focus between outputs, the directional focus
command will focus the focused window within the parent container that
is next in the given direction.

Previously, the next window of the given direction was focused which is
Inconsistent with changing focus inside the same output.

Fixes #1160.
2017-09-28 16:48:50 +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
Michael Stapelberg d968d39b27 Replace http:// with https:// where applicable
The testcases will be updated automatically in a separate commit.
2017-09-24 10:19:07 +02:00
Vladimir Panteleev 28f7e14650
Add "focus_wrapping" option
Fixes #2352.
2017-09-22 23:40:41 +00:00
Orestis Floros 205dd76096 Prevent freeing of uninitialized pointer
> variable 'buf' is used uninitialized whenever 'if' condition is true

Note: freeing a NULL pointer is fine.
2017-09-16 23:54:12 +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
Michael Stapelberg b23e1f644f Bugfix: free incomplete containers when JSON parsing fails
related to #2755
2017-09-13 16:39:13 +02:00
Vladimir Panteleev 30b1ab38b3
Introduce output_primary_name function
Currently simply returns output->name, but this will make it easier to
change how output names are stored in the following commits.

Also replace reading output->name with invocations of
output_primary_name. Code which writes output->name is unchanged. Done
using a mostly mechanical replacement of output->name to
output_primary_name(output).
2017-09-13 08:22:57 +00:00
Mihai Coman 52ce8c803d Fix changing of root workspace layout from stacked/tabbed 2017-04-27 17:50:55 +03:00
Michael Stapelberg 2f9bb7dd5a Fix memory leak: free marks when destroying containers (#2578) 2016-11-21 02:41:15 -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
Eric Engeström 66d9c983e4 Fix spelling mistakes 2016-04-04 09:33:59 +02:00
Michael Stapelberg f511cc61c1 fix memory leak when swallowing windows 2016-01-09 17:06:58 +01:00
Michael Stapelberg 436e4c17b3 free container matches when destroying containers 2016-01-09 17:06:58 +01:00
Michael Stapelberg 6f53dc01ef tree_restore(): fix memory leak 2016-01-09 12:50:38 +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
Michael Stapelberg 21d4b2319f Properly clear the urgency hint when set by i3.
fixes #1825
2015-08-02 20:50:14 +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
Michael Stapelberg 1546891e6a Bugfix: Remove windows from the save set when unmapping.
fixes #1617
2015-04-06 15:40:12 +02:00
Michael Stapelberg f790fedce3 Restore placeholder windows after restarting (Thanks Airblader).
fixes #1502
2015-03-25 20:50:25 +01:00
Michael Stapelberg 091f1db39a run clang-format (3.5.0)
Not quite sure why there are so many differences. Perhaps we’ve gotten
out of the habit of running clang-format after every change.

I guess it’d be best to have a travis hook that runs clang-format for us
and reports any problems on pull requests.
2015-03-01 17:16:03 +01:00
Michael Stapelberg fbe25297b7 Properly invalidate rendering cache when updating orientation (Thanks hercek)
fixes #1445
2015-02-11 21:13:55 +01:00
Tony Crisci 034c82c0ac Raise floating windows on `focus [direction]`
Raise a window when cycling focus between floating windows with `focus
[direction]` command so that newly focused windows are rendered on top
of other windows.

This is done by placing the window last in the floating nodes of the
parent and reordering the stack so the relative order is preserved.

fixes #1322
2014-08-08 12:19:35 +02:00
Michael Stapelberg 8e8afb2609 Remove TODO for cycling through the floating z-index.
I think this is not a good feature to have. It shouldn’t be necessary
for a tiling window manager that explicitly discourages the use of
floating windows.

fixes #1324
2014-07-20 23:49:08 +02:00
Tony Crisci 14ec68526b Cross-output focus focus floating exception
Focusing across outputs with `focus [direction]` should focus an
existing floating con when no tiling con exists on the output in
[direction].
2014-06-24 09:05:39 +02:00
Tony Crisci 25ca78bbba Implement the window::close event
The window::close event should be emitted when a window closes.
2014-06-19 12:59:25 +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 617afc67a2 replace remaining printf()s with D?LOG
fixes #1252
2014-06-08 21:56:14 +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 192b67df18 Free window ran_assignments on tree_close 2014-03-10 17:37:35 +01:00
Tony Crisci 81271887e2 Set con window to NULL on tree_close
Prevents invalid reads on the freed window struct.
2014-03-10 08:39:56 +01:00
Tony Crisci 6ae4ecb1de Bugfix: `tree_split` should not split floating cons
Use the more robust test of `con_is_floating` for testing a container
for being floating.

fixes #1177
2014-02-08 20:59:23 +01:00
Michael Stapelberg 58b3c730e2 return parse errors via IPC for append_layout 2014-01-04 21:39:13 +01:00
Michael Stapelberg 1c0554564a previous commit: extend test and code to also work with floating windows 2013-10-13 17:59:29 +02:00
jj eef9042713 Fix endless loop when trying to kill a visible workspace
This regression was introduced with commit
97b086efd9

fixes #1103
2013-10-13 17:58:38 +02:00
jj 97b086efd9 Close all children when closing a workspace
fixes #591
2013-09-24 06:45:52 +02:00
Michael Stapelberg 2481b9dcd7 Bugfix: don’t flatten tabbed/stacked containers
fixes #1053
2013-09-01 13:35:04 +02:00
Michael Stapelberg 62ef7834b0 Bugfix: Unmap windows before reparenting them to the root window (fixes Mathematica) (Thanks psychon)
Some apps such as Mathematica send a synthetic UnmapNotify event without
properly unmapping their window first. This change makes sure that
happens and fixes an annoying bug with Mathematica where some unmanaged
windows would stay around, but you couldn’t do anything with them.

Thanks to psychon (current awesome maintainer) for helping with the
diagnosis!

fixes #787
2013-05-28 19:52:01 +02:00