diff options
author | Orestis Floros <orestisflo@gmail.com> | 2022-07-28 12:03:16 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-28 12:03:16 +0200 |
commit | ebcd1d43ea9fd08a1dbb1212fb61e42f05a22684 (patch) | |
tree | 5c4cb25d3b3b022501c05d6416398b08075004b7 /include | |
parent | 807e972330b011de6afd227283cd49ebcf0ce1e7 (diff) | |
download | i3-ebcd1d43ea9fd08a1dbb1212fb61e42f05a22684.tar.gz i3-ebcd1d43ea9fd08a1dbb1212fb61e42f05a22684.zip |
Allow dragging tiled windows with the mouse. (#3085)
Fixes #2643
Inner drop region behaves like move to mark.
The outer region is close to the edge (currently 30px from the edge).
This will place the container as a sibling in the given direction within
the parent container. If the move direction goes against the orientation
of the parent container, tree_move() is called.
Contributors:
Co-authored-by: Orestis Floros <orestisflo@gmail.com>
See #3085
- Inner drop region behaves like move to mark
- Handle workspaces
- Fix crash when target closes
- Initiate tiling drag from titlebar
- Hide indicator until container is dragged outside of original position
- Calculate outer_threshold using percentages instead of fixed pixel
values
- Emit 'move' event properly
- Don't focus previously unfocused containers
- Use tree_split() on different orientation
- Fix redundant split containers
- DT_PARENT
- Readability & optimizations
- Limit parent threshold by render_deco_height()
- Tests
- Fullscreen container handling
- Initiate drag from title bar
- Fix issue of EnterNotify events still triggering after drag_callback
is called
- Include decorations for drop target calculation
Co-authored-by: Michael Forster <email@michael-forster.de>
See #2178
- Original implementation of tiling drag + indicator window
> A container can be dragged by the title bar to one of the four sides
> of another container. That container will then be split either
> horizontally or vertically.
Co-authored-by: Tony Crisci <tony@dubstepdish.com>
See #2653
- Original implementation of outer/inner drop region indicator:
> There are two drop regions per direction.
>
> The inner region is closer to the center of the window. Dropping on
> this region will split the target container and put the container
> within the split at the given direction beside the target container.
>
> The outer region is close to the edge (currently 30px from the edge).
> This will place the container as a sibling in the given direction within
> the parent container.
>
> Dropping into the outer region moves the con beside the target. If the
> move direction goes against the orientation of the parent container, the
> con moves out of the row.
- Fix crash: Ignore containers without a managed window (eg i3bar)
Diffstat (limited to 'include')
-rw-r--r-- | include/all.h | 1 | ||||
-rw-r--r-- | include/con.h | 1 | ||||
-rw-r--r-- | include/tiling_drag.h | 16 | ||||
-rw-r--r-- | include/util.h | 12 |
4 files changed, 30 insertions, 0 deletions
diff --git a/include/all.h b/include/all.h index b9a1a7a9..5941b5e6 100644 --- a/include/all.h +++ b/include/all.h @@ -58,6 +58,7 @@ #include "match.h" #include "xcursor.h" #include "resize.h" +#include "tiling_drag.h" #include "sighandler.h" #include "move.h" #include "output.h" diff --git a/include/con.h b/include/con.h index 3cea6780..b8bff080 100644 --- a/include/con.h +++ b/include/con.h @@ -371,6 +371,7 @@ void con_move_to_output(Con *con, Output *output, bool fix_coordinates); */ bool con_move_to_output_name(Con *con, const char *name, bool fix_coordinates); +bool con_move_to_target(Con *con, Con *target); /** * Moves the given container to the given mark. * diff --git a/include/tiling_drag.h b/include/tiling_drag.h new file mode 100644 index 00000000..ab002d43 --- /dev/null +++ b/include/tiling_drag.h @@ -0,0 +1,16 @@ +/* + * vim:ts=4:sw=4:expandtab + * + * i3 - an improved dynamic tiling window manager + * © 2009 Michael Stapelberg and contributors (see also: LICENSE) + * + * tiling_drag.h: Reposition tiled windows by dragging. + * + */ +#pragma once + +/** + * Initiates a mouse drag operation on a tiled window. + * + */ +void tiling_drag(Con *con, xcb_button_press_event_t *event); diff --git a/include/util.h b/include/util.h index 09ad941f..8525b6d9 100644 --- a/include/util.h +++ b/include/util.h @@ -183,3 +183,15 @@ position_t position_from_direction(direction_t direction); * */ direction_t direction_from_orientation_position(orientation_t orientation, position_t position); + +/** + * Converts direction to a string representation. + * + */ +const char *direction_to_string(direction_t direction); + +/** + * Converts position to a string representation. + * + */ +const char *position_to_string(position_t position); |