Commit Graph

6707 Commits

Author SHA1 Message Date
Nguyễn Thái Ngọc Duy 6462cf1ca3
Remove \n from errx and die messages
errx() already appends \n internally. "\n" in the error message will
result in a blank line after the message. die() is just a wrapper around
errx() so it receives the same treatment.
2019-01-02 14:23:56 +02:00
Ingo Bürk 3e3257af18
Merge pull request #3563 from CyberShadow/doc-mark-todo
userguide: Un-hide a TODO block completed in 2011
2018-12-16 09:36:02 +01:00
Ingo Bürk 982ede5901
Merge pull request #3568 from orestisf1993/floating_reposition-render_con
Fix: render_con shows floating containers on wrong workspace
2018-12-16 09:33:25 +01:00
Orestis Floros 318528e3fc
Fix: render_con shows floating containers on wrong workspace
After 204eefc. Alternative fix:
    diff --git a/src/floating.c b/src/floating.c
    index f5c61782..6dd79668 100644
    --- a/src/floating.c
    +++ b/src/floating.c
    @@ -954,7 +954,7 @@ bool floating_reposition(Con *con, Rect newrect) {
             con->scratchpad_state = SCRATCHPAD_CHANGED;

         /* Workspace change will already result in a tree_render. */
    -    if (!reassigned) {
    +    if (!reassigned && workspace_is_visible(con_get_workspace(con))) {
             render_con(con);
             x_push_node(con);
         }
but I don't think that the extra complexity is worth it.

Change in handlers.c because of d2d6d6e0 where the bug also appears.

Fixes #3567
2018-12-16 03:49:21 +02:00
Ingo Bürk a68542c8f7
Merge pull request #3566 from orestisf1993/focus-events
Focus events
2018-12-15 18:29:46 +01:00
Orestis Floros fb1ae61d1c
Invalidate last_focused when focusing the EWMH support window
Fixes #3562
2018-12-14 23:47:48 +02:00
Orestis Floros dd708199ea
Fix: killing unfocused window shouldn't produce focus event 2018-12-14 23:46:21 +02:00
Orestis Floros f70c3b168d
Update tree_close_internal documentation in tree.h
After f90840337
2018-12-14 23:46:21 +02:00
Vladimir Panteleev 7d89e90137
userguide: Un-hide a TODO block completed in 2011
The userguide contained a commented-out section for marks, which
included the line:

> TODO: make i3-input replace %s

The line was added in a26a11c609 (May
2011), at which point i3-input did not have a -F switch. The switch
was added only in 1737a78fcd (September
2011), but the documentation was never updated to enable the
commented-out examples.
2018-12-14 13:16:11 +00:00
Orestis e6be6fea74
Merge pull request #3560 from CyberShadow/doc-mark-replace
userguide: Document mark --replace flag
2018-12-14 10:39:49 +02:00
Vladimir Panteleev fdda9763b7
userguide: Document mark --replace flag
- Explicitly document --replace, which was previously only mentioned
  in the command syntax.

- Improve wording: "a window can only have one mark" is slightly
  misleading because it appears to describe the limitation as a
  property of the model, whereas this actually pertains the mark
  command.
2018-12-14 08:33:42 +00:00
Ingo Bürk be6619ff11
Merge pull request #3557 from orestisf1993/regress-float-move
attach_to_workspace: set new parent before tree_render
2018-12-12 21:02:41 +01:00
Orestis Floros 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
Orestis 376833db45
Merge pull request #3510 from orestisf1993/tree.t
Introduce cmp_tree test function
2018-12-12 13:19:43 +02:00
Orestis Floros 90c08a52f0
Introduce cmp_tree test function
Related to #3503
2018-12-12 13:09:15 +02:00
Ingo Bürk 32188d7b2c
Merge pull request #3551 from xzfc/baf-restart
Preserve back_and_forth during restart
2018-12-11 20:53:08 +01:00
Albert Safin 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
Ingo Bürk 6a4d41c5c2
Merge pull request #3553 from stapelberg/hidpi
userguide: add a section about hidpi displays
2018-12-10 18:34:51 +01:00
Michael Stapelberg d3e954befd userguide: add a section about hidpi displays
This is a continuation of #3438.
2018-12-10 18:18:23 +01:00
Ingo Bürk f08119298e
Merge pull request #3549 from xzfc/small-fixes
Small fixes
2018-12-09 18:13:13 +01:00
Ingo Bürk b35c56687d
Merge pull request #3550 from tlercher/3535-display-check
Fix #3535 - Check for DISPLAY when requesting version information
2018-12-09 18:10:42 +01:00
TAL b479dc1a0f Fix #3535 - Check for DISPLAY when requesting version information 2018-12-09 02:20:47 +01:00
Albert Safin 27030c8566 Code style: fix misaligned and misindented comments 2018-12-09 08:04:55 +07:00
Albert Safin 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
Albert Safin 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
Albert Safin 9a1eb7a783 commands.c: Add missing error replies 2018-12-09 07:41:19 +07:00
Orestis b192bf4bd2
Merge pull request #3547 from stapelberg/conn
Bugfix: use restore_conn, not conn
2018-12-08 14:49:04 +02:00
Michael Stapelberg 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
Orestis 620e90bed8
Merge pull request #3541 from orestisf1993/title_align
Apply title_align to non-leaf containers
2018-12-05 13:09:09 +02:00
Orestis Floros 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
Ingo Bürk 52d785fb37
Merge pull request #3514 from xzfc/2742-shape
Add input and bounding shapes support (#2742)
2018-12-03 20:16:47 +01:00
Albert Safin 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
Albert Safin 9273f67734 Log window id in state_for_frame() 2018-12-01 10:31:11 +07:00
Michael Stapelberg 7ade46c61f
switch to clang-format-6.0 (#3533) 2018-11-28 17:38:16 +01:00
Ingo Bürk a080551f26
Merge pull request #3432 from orestisf1993/aspect-ratio
Fix aspect ratio bugs
2018-11-17 16:08:22 +01:00
Ingo Bürk 8ad84f06c9
Merge pull request #3524 from orestisf1993/regress-randr
randr.c: Fix regression with focusing NULL container
2018-11-15 12:57:59 +01:00
Orestis Floros 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
Ingo Bürk 299e9b9fdd
Merge pull request #3521 from c-edw/feature/StripWorkspaceDocs
Update userguide docs for strip_workspace_*.
2018-11-13 10:24:11 +01:00
Connor E 3463406df7 Update userguide docs for strip_workspace_*. 2018-11-13 08:46:16 +00:00
Orestis Floros d2d6d6e0a8
Re-render floating cons alone when possible 2018-11-12 19:05:51 +02:00
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
Orestis Floros 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
Orestis Floros f397698d43
floating_resize: Use uint32_t 2018-11-12 18:45:00 +02:00
Orestis Floros 01960f956f
floating_check_size: Use window variable 2018-11-12 18:44:45 +02:00
Ingo Bürk 90c39a4bf6
Merge pull request #3484 from xzfc/3476-export-i3sock
Export I3SOCK
2018-11-10 22:12:01 +01:00
Ingo Bürk 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
Ingo Bürk cf553ce31e
Merge pull request #3516 from orestisf1993/truncate-utf8
Truncate wm_name utf8 strings to first zero byte
2018-11-09 21:01:57 +01:00
Orestis Floros 11bc25b70b
Truncate wm_name utf8 strings to first zero byte
Fixes #3515
2018-11-09 19:42:32 +02:00
Orestis 665b16807f
Merge pull request #3511 from aksel/247-gaps-resize-fix
For resizing, convert pixel diff to percentage, based on parent.
2018-11-09 00:31:06 +02:00
aksel 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