Commit Graph

2962 Commits

Author SHA1 Message Date
dd708199ea Fix: killing unfocused window shouldn't produce focus event 2018-12-14 23:46:21 +02:00
605b6ba00f attach_to_workspace: set new parent before tree_render
on_remove_child calls tree_close_internal which calls tree_render and
the tree is in an invalid state if con->parent still points to the old
parent.

Fixes #3556
2018-12-12 19:12:01 +02:00
64ab1f42b7 Preserve back_and_forth during restart
Add new key "previous_workspace_name" to the json dump of the root container.
2018-12-11 20:46:06 +07:00
f08119298e Merge pull request #3549 from xzfc/small-fixes
Small fixes
2018-12-09 18:13:13 +01:00
TAL
b479dc1a0f Fix #3535 - Check for DISPLAY when requesting version information 2018-12-09 02:20:47 +01:00
27030c8566 Code style: fix misaligned and misindented comments 2018-12-09 08:04:55 +07:00
b6282b47bc Remove unused con_get_next()
This function has unused for a long time since the commit
8f4b9ddaa4.
2018-12-09 08:04:41 +07:00
0eb07dea5c Remove unnecessary code in route_click()
This case is handled by resize_find_tiling_participants() anyway which
is introduced in the commit dbec5eb905.
2018-12-09 07:48:40 +07:00
9a1eb7a783 commands.c: Add missing error replies 2018-12-09 07:41:19 +07:00
01c1b5dec2 Bugfix: use restore_conn, not conn
Using the wrong X11 connection breaks the libev event handling model:
xcb_flush() must be called immediately before handing control to libev.

Before this fix:

1. xcb_prepare_cb would read and flush conn
2. restore_xcb_prepare_cb would read and flush restore_conn,
   BUT also inadvertantly call xcb_flush(conn), resulting in new
   events being filled into the XCB event queue
3. libev waits for new events
4. after 1 minute, libev times out and the events are processed

Diagnosed using strace on testcases/complete-run.pl.

related to commit 0d8b6714e3

related to #3510
2018-12-08 13:31:53 +01:00
a81e22a277 Apply title_align to non-leaf containers
Additionally, marks will now display for non-leaf containers.

Fixes #3540.
2018-12-04 20:50:32 +02:00
1a85619498 Add input and bounding shapes support (#2742)
Basic idea: if the window has a shape, set the parent container shape as
the union of the window shape and the shape of the frame borders.

Co-authored-by: Uli Schlachter <psychon@znc.in>
2018-12-01 11:52:41 +07:00
9273f67734 Log window id in state_for_frame() 2018-12-01 10:31:11 +07:00
7ade46c61f switch to clang-format-6.0 (#3533) 2018-11-28 17:38:16 +01:00
a080551f26 Merge pull request #3432 from orestisf1993/aspect-ratio
Fix aspect ratio bugs
2018-11-17 16:08:22 +01:00
a84b30f8a9 randr.c: Fix regression with focusing NULL container
This was introduced in db3b9e4187 which
removed the NULL check for next.

Fixes #3523.
2018-11-15 13:49:26 +02:00
d2d6d6e0a8 Re-render floating cons alone when possible 2018-11-12 19:05:51 +02:00
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
29f2510fa9 Fix aspect ratio bugs
- ICCCM says: > If a base size is not provided, the minimum size is to
be used in its place and vice versa.
i3 didn't obey the "vice versa" part. Min size and base size are both
saved without replacements in window_update_normal_hints,
floating_check_size makes the needed replacements if either was not
provided.
- Aspect ratio is now saved correctly in manage_window because
window_update_normal_hints is called.
- i3 didn't save the aspect ratio if the window conformed the given
aspect ratio range when handle_normal_hints was called. If the window
was resized to a size outside of the given bounds, i3 didn't correct it.
- Aspect ratio now affects only tiling windows, like the rest of the
normal size hints
- The aspect ratio calculation is now done without a loop

A real life example of how these changes affect the workflow:
An mpv window, when playing a video, sets its min == max aspect ratio
during mapping. i3 ignored these hints. When resized, the window's
aspect ratio was not preserved. With this commit, resizing floating mpv
windows will always preserve the aspect ratio.
2018-11-12 18:45:00 +02:00
f397698d43 floating_resize: Use uint32_t 2018-11-12 18:45:00 +02:00
01960f956f floating_check_size: Use window variable 2018-11-12 18:44:45 +02:00
90c39a4bf6 Merge pull request #3484 from xzfc/3476-export-i3sock
Export I3SOCK
2018-11-10 22:12:01 +01:00
56bb806b52 Merge pull request #3397 from orestisf1993/randr-enable-disable
Fix bugs in enabling & disabling randr outputs
2018-11-10 21:56:34 +01:00
11bc25b70b Truncate wm_name utf8 strings to first zero byte
Fixes #3515
2018-11-09 19:42:32 +02:00
bbfa140c0f For resizing, convert pixel diff to percentage, based on parent.
Previously, it first calculated one of the containers' next percentage, and then subtracted the previous percentage to find the actual change.

Now it directly calculates the change, and subtracts and adds the change to the two affected containers.

Added util function con_rect_size_in_orientation.

Removed px_resize_to_percent; inlined, using con_rect_size_in_orientation.

Also, prematurely return when pixel diff is 0, as no action is necessary.

This is related to [this issue on i3-gaps](https://github.com/Airblader/i3/issues/247).
2018-11-08 23:15:23 +01:00
44e8fddc28 Merge pull request #2954 from orestisf1993/swap-for-floating
Rewrite con_swap to work only with queue operations
2018-11-07 13:13:41 +00:00
eb53ec83b9 load_layout: Correctly mark non-leaf containers
Example problematic layout:
    {
        "layout": "splith",
        "marks": ["H1"],
        "nodes": [
            {
                "swallows": [
                    {
                        "class": "^a$"
                    }
                ]
            }
        ]
    }

Since the marks were added to the json_node during end_map, the
container that ended up getting the "H1" mark was the child instead of
the parent.
2018-11-07 02:32:12 +02:00
7926c817a2 Draw outer header borders for all layouts 2018-11-05 20:17:01 +07:00
dc16df439e Update ewmh focused only when new focus is different (#3496)
Fixes #3495.
2018-11-03 13:39:49 +01:00
eedb257655 switch to clang-format-4.0
clang-format-3.8 is old enough to have vanished from Debian testing, which we
use for our CI.
2018-11-03 09:16:16 +01:00
64c493ef1f Fix regression with moving floating windows
This fixes a regression introduced in 6d983b5. Consider 2 outputs:
fake-0: workspace '1'
fake-1: workspaces '2','3'
Workspace 1 focused, workspace 2 visible.
Open a floating window in 1 and move it to 3. Now, the floating window
appears in workspace 2 and disappears once focus is switched to
that workspace.

Instead of focusing 'old_focus' which might refer to a container in a
different output, we should restore focus by focusing the previously
focused workspace of the output.
2018-10-29 15:46:28 +02:00
aa20358620 Export I3SOCK (#3476) 2018-10-26 15:40:59 +07:00
64e7646c7e Merge pull request #3452 from orestisf1993/title_align
Add title_align config directive
2018-10-23 16:41:54 +02:00
0ed29f5678 Merge pull request #3448 from orestisf1993/sticky
Fix sticky focus when switching to workspace on different output
2018-10-23 15:31:57 +02:00
74a7bf31a5 Merge pull request #3444 from orestisf1993/move
Some move.c fixes
2018-10-23 15:29:48 +02:00
07dfb8450b Fix typo: childs -> children 2018-10-13 21:10:11 +03:00
204eefc679 floating_reposition: avoid extra tree_render 2018-10-13 21:10:11 +03:00
8c17e4e38d manage_window: cleaner variable declarations 2018-10-13 21:10:10 +03:00
966915cfb2 borders_to_hide doesn't need to be initialized 2018-10-13 21:10:10 +03:00
4219eb213b root is externally declared 2018-10-13 21:10:10 +03:00
e4d2b38552 Make comment style more consistent 2018-10-13 21:10:10 +03:00
a65914f338 Fix missing prototypes
i3 will now compile with no warnings when -Wmissing-prototypes is used.
2018-10-13 21:10:10 +03:00
2a9522dda4 Enforce strict prototypes
i3 will now compile with no warnings when -Wstrict-prototypes is used.
2018-10-13 21:10:09 +03:00
a15fff2370 Use path_exists 2018-10-13 21:10:09 +03:00
50880db2c5 Reduce some code around frees 2018-10-13 21:10:09 +03:00
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
b09090fa7d Fix sticky focus when switching to workspace on different output
See the testcase for the exact steps to reproduce the problem.
2018-10-11 12:27:57 +03:00
6728696ec8 output_push_sticky_windows: Make a bit easier to understand 2018-10-11 12:27:56 +03:00
8e1687a317 Rewrite con_swap to work only with queue operations
Benefits are that we don't open a fake container and don't call many
complicated functions that can lead to redraws (x_push_changes calls) as
discussed in #2954.

Fixes #2810:
Windows exchange floating mode & window rects.
Swap will still not work with CT_FLOATING_CONs but this doesn't make
much sense.

Fixes #3280:
The behaviour is not very user friendly but swap behaves exactly as it
should. The rest is a tree_flatten issue. Attached pictures in #2954.
2018-10-10 17:09:26 +03:00
11dd2dbc66 tree_move: Don't change focus order when swapping containers
The call to ewmh_update_wm_desktop is removed since the change happens
under the same parent.
2018-10-09 22:39:38 +03:00