Commit Graph

6282 Commits

Author SHA1 Message Date
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
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
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
Ingo Bürk 4808334b66
Merge pull request #3328 from orestisf1993/next
Fix ISSUE_TEMPLATE typo
2018-07-12 06:27:13 +02:00
Orestis Floros 4cd223f80a
Fix ISSUE_TEMPLATE typo 2018-07-12 03:49:07 +03:00
Orestis Floros d1652ca7cd
cmd_rename_workspace: always call con_focus
This was introduced in 252db3b8c (#3245). That commit moved the
con_activate line inside the loop, meaning it wouldn't always be called.

When the mouse moved after a rename with focus_follows_mouse enabled,
check_crossing_screen_boundary (src/handlers.c:111) called
con_descend_focused that used the wrong focus order.

I also change con_activate to con_focus since we don't really want to
raise floating containers there.

Fixes #3325
2018-07-12 03:42:38 +03:00
Felix Buehler 37ea56c221 make format_placeholders case-sensitive 2018-07-10 23:24:50 +02:00
Ingo Bürk b8505bb611
Merge pull request #3324 from orestisf1993/xdg_config
Correct XDG paths precedence for config files
2018-07-10 08:23:32 +02:00
Orestis Floros fd70ea6b31
Correct XDG paths precedence for config files
Fixes #3323
2018-07-10 05:04:34 +03:00
Orestis Floros d525eb80ae
Use get_assigned_output for numbers
This prohibits the usage of workspaces assigned to other outputs in
create_workspace_on_output.

Eg, with config:
    workspace 1 output fake-0
    workspace 2 output fake-0
and 2 screens workspace 2 would be used for the second screen even
though it is assigned to the first one.

Also introduces a test for workspace assignments that includes the case
described above and some tests that don't fail in the next branch.
2018-06-27 14:56:50 +03:00
Orestis Floros 1d5b43c18f
Move get_output_for_workspace() to i3test 2018-06-27 14:56:50 +03:00
Orestis Floros bc439de755
Introduce get_assigned_output
This also replaces code in create_workspace_on_output() that is
theoretically more efficient but:
1. It isn't a huge difference since it depends on the number of outputs,
that shouldn't be high.
2. get_assigned_output will be modified and used for #555, then its
logic should be followed in create_workspace_on_output() too.

Another note for create_workspace_on_output: if assigned is not NULL the
condition (assigned != output->con) should never be false, ie if there
is an assigned output to this name, it isn't the current one. This
happens because the current callers check for assignments before calling
create_workspace_on_output().
2018-06-27 14:56:31 +03:00
Ingo Bürk 6339427f01
Merge pull request #3179 from orestisf1993/issue-2733
Correctly handle bindings for the same key with and without --release
2018-06-22 14:39:02 +02:00
Ingo Bürk d8bb8273da
Merge pull request #3313 from czak/fix-border-artifacts
Border artifacts when moving window
2018-06-22 13:48:15 +02:00
Łukasz Adamczak 606050a700 Consider rect changed when its position changes 2018-06-22 12:34:11 +02:00
Ingo Bürk 6c34063f95
Merge pull request #3309 from orestisf1993/detectable-autorepeat
Enable detectable autorepeat
2018-06-20 08:38:46 +02:00
Ingo Bürk 8bd31842e1
Merge pull request #3310 from KJoke70/patch-1
Update i3-msg.man: added get_config and send_tick
2018-06-15 14:55:49 +02:00
Martin 5debba0d1c
Update i3-msg.man: added get_config and send_tick
Added get_config and send_tick which are mentioned [here](https://i3wm.org/docs/ipc.html).
2018-06-15 14:37:14 +02:00
Orestis Floros b87bc70cd6
Enable detectable autorepeat
https://www.x.org/releases/current/doc/kbproto/xkbproto.html#Detectable_Autorepeat

Detectable autorepeat should only affect --release bindings. Currently,
when a user keeps a key pressed, we get multiple KeyPress and KeyRelease
events. With this change, we still get multiple KeyPress events, which
means that you can still keep a key pressed to repeatedly execute a
normal binding, but only one KeyRelease event when the key is physically
released.

Unfortunately, this change is not currently testable because detectable
autorepeat doesn't seem to work under Xephyr. AwesomeWM experienced the
same problem:
6f2424e901

Fixes #3306
2018-06-15 13:56:31 +03:00