Commit Graph

6762 Commits

Author SHA1 Message Date
Ingo Bürk 4cba9fcbda
Merge pull request #3368 from orestisf1993/render_root
(floating) global fullscreen bugs & others
2018-08-24 09:49:41 +02:00
Ingo Bürk 9a53d65e18
Merge pull request #3372 from orestisf1993/direction
Resize tile px
2018-08-24 09:43:20 +02:00
Orestis Floros 096cff0aad
Make resize set ppt more accurate
See the testcase for the usecase.
2018-08-24 04:13:25 +03:00
Orestis Floros 51d230ad4c
Make resize set px work with tiling containers 2018-08-24 04:13:25 +03:00
Orestis Floros f28c50b631
541-resize-set-tiling.t: fix "my" variable mask warnings 2018-08-24 04:13:25 +03:00
Orestis Floros 423e20b960
cmd_resize* statics: remove useless 'way' argument 2018-08-24 04:13:25 +03:00
Orestis Floros 26bbaf6237
Make cmd_resize_tiling_width_height work with pixels 2018-08-24 04:13:25 +03:00
Orestis Floros 2ead7745d6
Make cmd_resize_tiling_direction work with pixels
Introduces resize_neighboring_cons in resize.c which is also used by
resize_graphical_handler.

Co-authored-by: Andrew Laucius <andrewla@gmail.com>
Authored original code and tests in #3240. I rewrote most of the
resizing code and fixed the failing tests.
2018-08-24 04:13:03 +03:00
Orestis Floros ea43507bed
precalculate_sizes: don't malloc needlessly 2018-08-24 04:12:24 +03:00
Orestis Floros 7b9318a541
precalculate_sizes: round sizes instead of flooring them
This will lead to more accurate and consistent container sizes.

Needed to fix the failing test of #3240.
2018-08-24 04:12:14 +03:00
Orestis Floros db294f4505
Improve resize_graphical_handler code style
- int return type is not useful
- Consistent comment style
2018-08-23 22:04:22 +03:00
Orestis Floros 9522b46f1b
Introduce parse_direction
Also fixes the following bug: in the fix for #1011 in
cmd_resize_floating direction "width" is not considered.

Influenced by #3240.
2018-08-23 15:45:24 +03:00
Orestis Floros 6e1b79e057
Introduce orientation_from_direction 2018-08-23 15:36:23 +03:00
Ingo Bürk 72cc719c5d
Merge pull request #3369 from orestisf1993/clang-format
Apply compatible changes from clang-format 6.0.1
2018-08-22 20:29:32 +02:00
Orestis Floros e6202d43f5
Apply compatible changes from clang-format 6.0.1
These are the changes that clang-format 6.0.1 makes to the codebase that
clang-format-3.8 doesn't change back.

Useful for those that use a more recent version of clang-format in their
local machines.
2018-08-22 14:51:17 +03:00
Orestis Floros e1a83d057f
handle_configure_request: check for scratchpad once 2018-08-22 14:23:01 +03:00
Orestis Floros 9190a9ab70
handle_configure_request: use 'goto out' 2018-08-22 14:11:26 +03:00
Orestis Floros 9ae84593ba
handle_configure_request: reuse 'workspace' variable 2018-08-22 14:10:42 +03:00
Orestis Floros 0ac75bea5a
con_border_style: check con->fullscreen_mode directly 2018-08-22 14:09:05 +03:00
Orestis Floros efc78de4ee
Introduce con_get_fullscreen_covering_ws
This commit will also fix the following bugs:
1. click.c: Users could drag global fullscreen floating containers.
2. render.c: Floating containers would get rendered with a global fullscreen container in another
workspace.
2018-08-22 14:05:50 +03:00
Orestis Floros b3e69ed12a
render_root: fix popup_during_fullscreen logic
The first issue is that there seems to be a typo: fullscreen->window
should have been child->window. The corrected check is redundant since
the while loop checks if the transient_con has a window.

The second issue is that popup_during_fullscreen is never checked even
though the behaviour should be exclusive to the "smart" option.
2018-08-22 03:45:35 +03:00
Ingo Bürk 2f3c8b6484
Merge pull request #3365 from orestisf1993/DRAG_REVERT
floating_drag_window: return on DRAG_REVERT
2018-08-21 20:39:26 +02:00
Ingo Bürk e906cdad66
Merge pull request #3366 from orestisf1993/NUM_HANDLERS
property_notify: use NUM_HANDLERS
2018-08-21 20:38:31 +02:00
Ingo Bürk 6d3fc089f9
Merge pull request #3367 from orestisf1993/dragloop_callback
Call dragloop callback on DRAG_SUCCESS
2018-08-21 20:37:56 +02:00
Orestis Floros 2c78f2458c
Call dragloop callback on DRAG_SUCCESS
A race condition is possible. For example, if we first receive a
XCB_MOTION_NOTIFY event and then, while drain_drag_events is still
running, a XCB_BUTTON_RELEASE event the first event is never handled
because we return.

This fixes the flakiness of the tests in #3085.
2018-08-21 21:19:57 +03:00
Orestis Floros 5d89bd344f
floating_drag_window: return on DRAG_REVERT
Right now tree_render() is called twice on DRAG_REVERT since
floating_reposition calls it.
Also, on DRAG_REVERT the scratchpad state shouldn't change since the
user canceled the action.
2018-08-21 21:06:00 +03:00
Orestis Floros b1aa2fb1c4
property_notify: use NUM_HANDLERS 2018-08-21 21:04:46 +03:00
Ingo Bürk e8dee4308a
Merge pull request #3364 from orestisf1993/warp-randr_query
randr_query_outputs: con_activate -> workspace_show
2018-08-17 11:55:15 +02:00
Orestis Floros 789a09a6e7
Use con_focus instead of con_activate for workspace 2018-08-17 12:49:34 +03:00
Orestis Floros ba29290123
Typo: output -> content 2018-08-17 12:49:34 +03:00
Orestis Floros 7010644964
randr_query_outputs: con_activate -> workspace_show
workspace_show will call x_set_warp_to if needed.

Fixes #3333
2018-08-17 12:49:15 +03:00
Ingo Bürk 2d3c2f0615
Merge pull request #3363 from orestisf1993/regress-scratchpad-focus
Call con_activate after moving scratchpad window to current ws
2018-08-17 11:42:29 +02:00
Orestis Floros cac28b69d4
Call con_activate after moving scratchpad window to current ws
Fixes #3361
2018-08-17 12:34:20 +03:00
Ingo Bürk 4b3ff9cdd4
Merge pull request #3353 from orestisf1993/free_ws_assignments
Free ws_assignments on reload
2018-08-09 16:49:21 +02:00
Orestis Floros 01e971b51e
Free ws_assignments on reload
This fixes an unreported bug where deleting a workspace assignment and
reloading the config file would keep the assignment.
2018-08-09 17:28:05 +03:00
Michael Stapelberg 5a54a1ab04
Merge pull request #3263 from orestisf1993/misbehaving-ipc-queue-2999
Kill misbehaving subscribed clients instead of hanging
2018-08-08 19:14:15 +02:00
Orestis Floros 37d0105c83
Kill misbehaving subscribed clients instead of hanging
This change only affects clients that are subscribed to events, which
should be the main cause of our problems.

In the common case (no buffered data) the behaviour doesn't change at
all: the message is sent directly, no ev_io / ev_timeout callback is
enabled. Once a write to a client's socket is not completed fully
(returns with EAGAIN error), we put the message in the tail of a queue
and init an ev_io callback and a corresponding timer. If the timer is
triggered first, the socket is closed and the client connection is
removed. If the socket becomes writeable before the timeout we either
reset the timer if we couldn't push all the buffered data or completely
remove it if everything was pushed.

We could also replace ipc_send_message() for all client connections in
i3, not just those subscribed to events.

Furthermore, we could limit the amount of messages stored and increase
the timeout (or use multiple timeouts): eg it's ok if a client is not
reading for 10 seconds and we are only holding 5KB of messages for them
but it is not ok if they are inactive for 5 seconds and we have 30MB of
messages held.

Closes #2999
Closes #2539
2018-08-08 19:14:56 +03:00
Harry Lawrence 3ea3935e6a Added libiconv to search libs for OpenBSD patch (#3336) 2018-08-04 18:27:25 +01:00
Ingo Bürk 65eb54c0ba
Merge pull request #3319 from Stunkymonkey/format_placholders-case_sensitive
make format_placeholders case-sensitive
2018-08-04 09:23:11 +02:00
Ingo Bürk d47b841f1a
Merge pull request #3344 from downzer0/chore/i3-sensible-terminal--hyper
enhancement: adds hyper as a sensible terminal option
2018-08-02 17:05:29 +02:00
downzer0 42c5feb22f enhancement: adds hyper as a sensible terminal option
- hyper.is
2018-08-01 08:21:44 -05:00
Orestis Floros b0bbe53d04
Introduce free_ipc_client 2018-07-31 14:39:07 +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
Ingo Bürk 715cea61af
Merge pull request #3340 from PandorasFox/next
fix height offset calculation in pango text drawing
2018-07-29 12:10:26 +02:00
Cassandra Fox ad236dbaec fix height offset calculation in pango text drawing 2018-07-28 19:31:32 -07:00
Ingo Bürk d7022c7011
Merge pull request #3329 from lasers/next
docs/i3bar-protocol: fix typo
2018-07-16 16:11:04 +02:00
lasers 809eea2630 docs/i3bar-protocol: fix typo 2018-07-16 08:54:08 -05:00
Ingo Bürk a1351138d1
Merge pull request #3254 from orestisf1993/issue-555
Multiple assignments of workspaces to outputs (#555)
2018-07-12 16:18:13 +02:00
Orestis Floros bce088679a
Allow multiple assignments of workspaces to outputs
Also makes get_assigned_output work with the primary output:
    workspace X output primary
will now work.

Fixes #555.
2018-07-12 17:07:01 +03:00
Ingo Bürk dbf4e1b95d
Merge pull request #3327 from orestisf1993/rename-mouse-bug
cmd_rename_workspace: always call con_focus
2018-07-12 06:27:56 +02:00