Commit Graph

2733 Commits (6c3533b61552ae299c8a6c2b47bd4ee11abe16c7)

Author SHA1 Message Date
Orestis Floros 37106aa84b
Prefer fullscreen floating containers when on directional focus
Fixes #3201
2018-03-25 14:47:45 +03:00
Ingo Bürk b849fe3e44
Merge pull request #3196 from orestisf1993/_con_move_to_con
_con_move_to_con cleanup
2018-03-24 18:49:26 +01:00
Orestis Floros 9e3b48dd22 con_activate -> con_focus when it is used as a building block 2018-03-24 15:21:11 +02:00
Orestis Floros 9a1fcff4e0 _con_move_to_con: remove outdated comment 2018-03-24 15:21:11 +02:00
Orestis Floros 037b1c3710 _con_move_to_con: showing target_ws is useless
The current_ws is shown latter anyway:
    if (!ignore_focus) {
        workspace_show(current_ws);
        ...

This also causes the following bug:
- Open a window in an empty workspace
- Switch to another workspace
- seturgent to the first window
- Move another window to the first workspace
- Urgent flag is now reset
2018-03-24 15:19:49 +02:00
Orestis Floros f46bb0396e workspace_show: remove redundant if 2018-03-24 15:15:02 +02:00
Orestis Floros 4097769105 _workspace_show -> workspace_show
a9b57a44a9 removed the extra parameter of
workspace_show.
2018-03-24 14:26:11 +02:00
Ingo Bürk 83ac1c0e72
Merge pull request #3184 from orestisf1993/issue-1341
floating_enable & floating_maybe_reassign_ws changes
2018-03-23 19:17:12 +01:00
Orestis Floros 8e9b26fc90 floating_maybe_reassign_ws: use get_output_from_rect
This significantly reduces the number of ELOGs while dragging floating
containers. The behaviour is improved since floating containers in the
edge of the screen will still get reassigned to their closest workspace.

For example, consider this setup:
fake-outputs 500x500+0+0,500x500+500+0

Now, open a window in the right output and run:
i3-msg floating enable, move position 0 px 450 px
The window is on the bottom edge of the left workspace but if you run:
i3-msg focus mode_toggle
focus will go to the right workspace since floating_maybe_reassign_ws
didn't change the assigned workspace of the floating container.
2018-03-23 17:42:39 +02:00
Orestis Floros 128122e766 floating_enable: change reassign logic
This allows the floating container's top left corner to be mapped
outside any output as long as they are contained partially by one. This,
for example, will allow:
mpv --geometry +1+1 video.mp4

For windows mapped to (0, 0) see comment in floating.c:270-273:
/* Some clients (like GIMP’s color picker window) get mapped
 * to (0, 0), so we push them to a reasonable position
 * (centered over their leader) */

 The floating_reassign_ws call is removed since we try to place the new
 floating container in the current output:
 /* Sanity check: Are the coordinates on the appropriate output? If not, we
  * need to change them */

Fixes #1341
2018-03-23 17:42:39 +02:00
Orestis Floros 8a3ef3a81b Introduce get_output_from_rect 2018-03-23 17:42:39 +02:00
Orestis Floros e09861f73f contained_by_output: return output and rename to output_containing_rect 2018-03-23 17:40:03 +02:00
Ingo Bürk 8e198a2105
Merge pull request #3195 from orestisf1993/issue-2993
Improve directional moving of fullscreen containers
2018-03-23 14:52:48 +01:00
Ingo Bürk 9f273f3356
Merge pull request #3178 from orestisf1993/pr-2314
Support _NET_WM_STATE_FOCUSED
2018-03-23 14:50:46 +01:00
Orestis Floros 3ccaf11eab Improve directional moving of fullscreen containers
Fixes #2993.
2018-03-23 15:46:40 +02:00
Tony Crisci c42de09b1b Support _NET_WM_STATE_FOCUSED
_NET_WM_STATE_FOCUSED is set on _NET_WM_STATE to indicate that the
window is focused. It must be set when the window is newly focused and
removed once the window no longer has focus.

> _NET_WM_STATE_FOCUSED indicates whether the window's decorations are
> drawn in an active state. Clients MUST regard it as a read-only hint.
> It cannot be set at map time or changed via a _NET_WM_STATE client
> message.

For example, this is used by GTK applications to show the decoration in
an active or inactive state. This change can be tested by opening a GTK
application (like evince), focusing the window and unfocusing the
window, and observing a change in the window decorations.

Fixes #2273
2018-03-23 14:30:57 +02:00
Orestis Floros 5e8a3f3f0c cmd_move_window_to_position: improve error message 2018-03-20 16:59:06 +02:00
Orestis Floros 174dc389ff Remove 'method' from cmd_move_window_to_position
For command:
move window to [absolute] position X px Y px
if the optional keyword 'absolute' is provided the end result is the
same even though it is implemented differently. Only difference is that
with absolute the floating window can move completely outside of any
output.

This commit removes the 'method' argument and only keeps the sane
implementation.
2018-03-20 16:59:06 +02:00
Ingo Bürk 670dfa0bba
Merge pull request #3189 from orestisf1993/run_assignments
run_assignments: check for A_COMMAND early
2018-03-19 14:32:54 +01:00
Ingo Bürk b4e24a6d5f
Merge pull request #3188 from orestisf1993/free_ran_assignments
Free ran_assignments
2018-03-19 07:04:45 +01:00
Orestis Floros 6306acdb65 run_assignments: check for A_COMMAND early 2018-03-19 03:17:32 +02:00
Orestis Floros 98df2e21fa Free ran_assignments
When we run 'reload' all the assignments are freed:
e3e09119bf/src/config.c (L99-L109)

Assignments are saved to each window after they are executed:
e3e09119bf/src/assignments.c (L41-L46)

This means that the pointers stored in window->ran_assignments are
invalid (shouldn't be dangerous currently but could lead to a segfault
if the code is modified) after a 'reload'.
2018-03-19 03:00:35 +02:00
Orestis Floros 1fe4e635b5 Fix memleak: FREE(assign->dest.output) 2018-03-19 02:02:59 +02:00
Orestis Floros d66fa51f33 Don't call con_focus in tree_move
Fixes:
- Issue where moving an urgent (unfocused) window resets it's urgency
hint.
- Moving an unfocused container to a new parent should not move it to
the top of the focus stack.
2018-03-15 19:57:30 +02:00
Orestis Floros 6222ab1084 Correct insert_con_into's focus handling
Change from always putting con on the head of the new parent. Important
for moving unfocused containers.
2018-03-15 19:49:17 +02:00
Ingo Bürk dfc330fcb8
Merge pull request #3167 from hwangcc23/fix-3163
Add strip_workspace_name
2018-03-11 16:33:10 +01:00
hwangcc23 2269b2e795 Add strip_workspace_name
See the issue #3163 (https://github.com/i3/i3/issues/3163).

Add strip_workspace_name to strip off the workspace name.
2018-03-11 12:17:42 +08:00
Ingo Bürk 69eec7e5b2 Refocus focused window for FOCUS_IN events on the root window. (#3097)
This deals with (admittedly somewhat misbehaving) clients which
use XSetInputFocus to take focus, but then don't properly restore
focus. This has been observed with TK apps, but also, e.g., Steam.

fixes #2722
fixes #3096
2018-03-10 19:18:44 +01:00
Ingo Bürk 4b4fba0e74
Merge pull request #3087 from orestisf1993/focus_order
Fix focus order issues when encapsulating workspaces
2018-02-27 07:59:37 +01:00
Orestis Floros cb73fd5e31 Fix focus order issues when encapsulating workspaces
See new tests for an explanation of the problem.
2018-02-26 23:08:57 +02:00
Orestis Floros dc2363a665 Introduce *focus_order functions 2018-02-26 23:06:04 +02:00
Orestis Floros 60200b1d3c Don't raise floating windows when workspace is shown
From comment:
https://github.com/i3/i3/issues/2990#issuecomment-368345169

To easily reproduce:
1. Open 2 floating windows
2. Focus (with `focus_follows_mouse`) the one behind
3. Move the mouse to the other workspace
4. Move the mouse inside the previous workspace (without it even
touching a window)
2018-02-26 03:26:05 +02:00
Ingo Bürk 2cffb978f0
Merge pull request #3138 from clawoflight/default-border
[WIP] Add default_{,floating_}border
2018-02-19 07:03:03 +01:00
Bennett Piater f8d6c10d7c
Add default_{,floating_}border to config
userguide: document default_{,floating_}border

201-config-parser.t: add new tokens to $expected_all_tokens

201-config-parser-t: fix whitespace

closes i3/i3#2702
2018-02-15 16:25:56 +01:00
Alex Lu 147d3c354a Update EWMH atoms when closing a workspace container
fix #3126
2018-02-13 12:00:56 +08:00
Ingo Bürk 9610dc29b8
Merge pull request #3080 from orestisf1993/cmd_move_con_to_workspace
Reduce repetition in cmd_move_con_to_workspace*
2018-01-17 21:26:09 +01:00
Ingo Bürk 17fd50999f
Merge pull request #3102 from jolange/fix3071
tiling resize: remove minimum size (was 5%)
2018-01-17 21:24:52 +01:00
Michael Stapelberg fe95ac56bb
Merge pull request #2998 from orestisf1993/issue-2990
Don't raise floating windows when focused because of focus_follows_mouse
2018-01-14 18:22:44 +01: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
livanh 7b59da8a4f Implement 'resize set <width> ppt <height> ppt' command for tiling windows (#3036) 2018-01-08 23:25:08 +01:00
Ingo Bürk 1a04608796 Send success response for nop. (#3113)
fixes #3112
2018-01-06 23:24:33 +01:00
livanh c0378f737b Improve resize_find_tiling_participants() and simplify cmd_resize_tiling_width_height() (#3111) 2018-01-06 17:59:27 +01:00
Orestis Floros e0f1579669 cmd_move_con_to_workspace_number: rename workspace->ws
For consistency with other cmd_move_con_to_workspace* functions.
2017-12-27 20:56:37 +02:00
Orestis Floros a2e9b1461f Reduce repetition in cmd_move_con_to_workspace* 2017-12-27 20:55:22 +02:00
Johannes Lange 8f30a04425 tiling resize: remove minimum size (was 5%)
fixes #3071
2017-12-26 12:02:00 +01:00
Johannes Lange 0b25259370 free last_motion_notify before returning
fixes #3086
2017-12-24 09:44:52 +01:00
Orestis Floros 2403c43f7b Make 'focus' disable blocking fullscreen windows
The problem here is that con_fullscreen_permits_focusing() does not
check if there is a blocking fullscreen container in the workspace that
the container to be focused belongs. This makes it possible to focus a
container behind a fullscreen window if it's in an unfocused workspace.

This commit introduces a change in the 'focus' command behaviour. When
focusing a container blocked by a fullscreen container, either CF_OUTPUT
or CF_GLOBAL, the blocking container loses its fullscreen mode and the
target container is focused like normal.

This should not affect directional focus commands: left, right, up,
down, parent, child.

Fixes issue #1819.
2017-12-11 19:14:33 +02:00
Orestis Floros 2592c63603 Add error reply to cmd_focus_window_mode 2017-12-11 19:14:33 +02:00
Orestis Floros df437aa87e Use con_has_parent in con_fullscreen_permits_focusing 2017-12-11 14:00:14 +02:00
Ingo Bürk 57ee66ad25
Merge pull request #3078 from orestisf1993/issue-3075
Fix sticky-related crash (#3075)
2017-12-10 22:02:10 +01:00