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)
This commit is contained in:
@@ -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"
|
||||
|
@@ -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.
|
||||
*
|
||||
|
16
include/tiling_drag.h
Normal file
16
include/tiling_drag.h
Normal file
@@ -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);
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user