|
i3
|
#include "tree.h"

Go to the source code of this file.
Macros | |
| #define | DRAGGING_CB(name) |
| Macro to create a callback function for dragging. More... | |
Typedefs | |
| typedef void(* | callback_t )(Con *, Rect *, uint32_t, uint32_t, const void *) |
| Callback for dragging. More... | |
Enumerations | |
| enum | border_t { BORDER_LEFT = (1 << 0), BORDER_RIGHT = (1 << 1), BORDER_TOP = (1 << 2), BORDER_BOTTOM = (1 << 3) } |
| On which border was the dragging initiated? More... | |
| enum | drag_result_t { DRAGGING = 0, DRAG_SUCCESS, DRAG_REVERT, DRAG_ABORT } |
| This is the return value of a drag operation like drag_pointer. More... | |
Functions | |
| void | floating_enable (Con *con, bool automatic) |
| Enables floating mode for the given container by detaching it from its parent, creating a new container around it and storing this container in the floating_windows list of the workspace. More... | |
| void | floating_disable (Con *con, bool automatic) |
| Disables floating mode for the given container by re-attaching the container to its old parent. More... | |
| void | toggle_floating_mode (Con *con, bool automatic) |
| Calls floating_enable() for tiling containers and floating_disable() for floating containers. More... | |
| void | floating_raise_con (Con *con) |
| Raises the given container in the list of floating containers. More... | |
| bool | floating_maybe_reassign_ws (Con *con) |
| Checks if con’s coordinates are within its workspace and re-assigns it to the actual workspace if not. More... | |
| void | floating_center (Con *con, Rect rect) |
| Centers a floating con above the specified rect. More... | |
| void | floating_move_to_pointer (Con *con) |
| Moves the given floating con to the current pointer position. More... | |
| void | floating_drag_window (Con *con, const xcb_button_press_event_t *event) |
| Called when the user clicked on the titlebar of a floating window. More... | |
| void | floating_resize_window (Con *con, const bool proportional, const xcb_button_press_event_t *event) |
| Called when the user clicked on a floating window while holding the floating_modifier and the right mouse button. More... | |
| void | floating_check_size (Con *floating_con) |
| Called when a floating window is created or resized. More... | |
| drag_result_t | drag_pointer (Con *con, const xcb_button_press_event_t *event, xcb_window_t confine_to, border_t border, int cursor, callback_t callback, const void *extra) |
| This function grabs your pointer and keyboard and lets you drag stuff around (borders). More... | |
| void | floating_reposition (Con *con, Rect newrect) |
| Repositions the CT_FLOATING_CON to have the coordinates specified by newrect, but only if the coordinates are not out-of-bounds. More... | |
| void | floating_resize (Con *floating_con, int x, int y) |
| Sets size of the CT_FLOATING_CON to specified dimensions. More... | |
| void | floating_fix_coordinates (Con *con, Rect *old_rect, Rect *new_rect) |
| Fixes the coordinates of the floating window whenever the window gets reassigned to a different output (or when the output’s rect changes). More... | |
| #define DRAGGING_CB | ( | name | ) |
Macro to create a callback function for dragging.
Definition at line 18 of file floating.h.
Callback for dragging.
Definition at line 15 of file floating.h.
| enum border_t |
On which border was the dragging initiated?
| Enumerator | |
|---|---|
| BORDER_LEFT | |
| BORDER_RIGHT | |
| BORDER_TOP | |
| BORDER_BOTTOM | |
Definition at line 23 of file floating.h.
| enum drag_result_t |
This is the return value of a drag operation like drag_pointer.
DRAGGING will indicate the drag action is still in progress and can be continued or resolved.
DRAG_SUCCESS will indicate the intention of the drag action should be carried out.
DRAG_REVERT will indicate an attempt should be made to restore the state of the involved windows to their condition before the drag.
DRAG_ABORT will indicate that the intention of the drag action cannot be carried out (e.g. because the window has been unmapped).
| Enumerator | |
|---|---|
| DRAGGING | |
| DRAG_SUCCESS | |
| DRAG_REVERT | |
| DRAG_ABORT | |
Definition at line 163 of file floating.h.
| drag_result_t drag_pointer | ( | Con * | con, |
| const xcb_button_press_event_t * | event, | ||
| xcb_window_t | confine_to, | ||
| border_t | border, | ||
| int | cursor, | ||
| callback_t | callback, | ||
| const void * | extra | ||
| ) |
This function grabs your pointer and keyboard and lets you drag stuff around (borders).
Every time you move your mouse, an XCB_MOTION_NOTIFY event will be received and the given callback will be called with the parameters specified (client, border on which the click originally was), the original rect of the client, the event and the new coordinates (x, y).
Definition at line 725 of file floating.c.
References drag_x11_cb::callback, drag_x11_cb::check, drag_x11_cb::con, conn, DRAG_ABORT, DRAGGING, ELOG, drag_x11_cb::extra, main_loop, main_set_x11_cb(), drag_x11_cb::old_rect, Con::rect, drag_x11_cb::result, root, xcb_drag_check_cb(), xcursor_get_cursor(), and xcursor_supported.
Referenced by floating_drag_window(), floating_resize_window(), and resize_graphical_handler().

Centers a floating con above the specified rect.
Definition at line 422 of file floating.c.
References Rect::height, Con::rect, Rect::width, Rect::x, and Rect::y.
Referenced by cmd_move_window_to_center(), floating_enable(), and scratchpad_show().
| void floating_check_size | ( | Con * | floating_con | ) |
Called when a floating window is created or resized.
This function resizes the window if its size is higher or lower than the configured maximum/minimum size, respectively.
Definition at line 66 of file floating.c.
References Window::base_height, Window::base_width, Con::border_width, BS_NORMAL, con_border_style(), con_border_style_rect(), con_descend_focused(), config, Config::floating_maximum_height, Config::floating_maximum_width, Config::floating_minimum_height, Config::floating_minimum_width, Rect::height, Window::height_increment, max(), min(), Con::rect, render_deco_height(), total_outputs_dimensions(), Rect::width, Window::width_increment, and Con::window.
Referenced by cmd_resize_floating(), DRAGGING_CB(), floating_enable(), floating_resize(), json_end_map(), and scratchpad_show().

| void floating_disable | ( | Con * | con, |
| bool | automatic | ||
| ) |
Disables floating mode for the given container by re-attaching the container to its old parent.
Definition at line 307 of file floating.c.
References con_attach(), con_descend_tiling_focused(), con_fix_percent(), con_focus(), con_get_workspace(), con_is_floating(), DONT_KILL_WINDOW, Con::floating, floating_set_hint_atom(), focused, ipc_send_window_event(), LOG, Con::parent, Con::percent, TAILQ_REMOVE, tree_close_internal(), and Con::type.
Referenced by cmd_floating(), toggle_floating_mode(), and tree_move().

| void floating_drag_window | ( | Con * | con, |
| const xcb_button_press_event_t * | event | ||
| ) |
Called when the user clicked on the titlebar of a floating window.
Calls the drag_pointer function with the drag_window callback
Definition at line 487 of file floating.c.
References BORDER_TOP, DLOG, drag_pointer(), DRAG_REVERT, floating_reposition(), Con::rect, Con::scratchpad_state, tree_render(), and XCURSOR_CURSOR_MOVE.
Referenced by handle_client_message(), and route_click().

| void floating_enable | ( | Con * | con, |
| bool | automatic | ||
| ) |
Enables floating mode for the given container by detaching it from its parent, creating a new container around it and storing this container in the floating_windows list of the workspace.
Definition at line 134 of file floating.c.
References Con::border_style, Con::border_width, BS_NORMAL, xoutput::con, con_border_style(), con_border_style_rect(), con_by_window_id(), con_fix_percent(), con_focus(), con_get_output(), con_get_workspace(), con_is_docked(), con_is_floating(), con_new(), con_num_children(), config, Config::default_floating_border, DLOG, DONT_KILL_WINDOW, ELOG, Con::floating, floating_center(), floating_check_size(), floating_fix_coordinates(), floating_maybe_reassign_ws(), floating_set_hint_atom(), focused, Con::geometry, get_output_containing(), Rect::height, ipc_send_window_event(), L_SPLITH, Con::layout, Window::leader, LOG, max(), Con::parent, Con::percent, Con::rect, render_con(), render_deco_height(), sasprintf(), TAILQ_FOREACH, TAILQ_INSERT_TAIL, TAILQ_REMOVE, tree_close_internal(), Con::type, Rect::width, Con::window, Rect::x, x_set_name(), and Rect::y.
Referenced by cmd_floating(), handle_client_message(), manage_window(), scratchpad_move(), and toggle_floating_mode().

Fixes the coordinates of the floating window whenever the window gets reassigned to a different output (or when the output’s rect changes).
Definition at line 862 of file floating.c.
References DLOG, Rect::height, Con::rect, Rect::width, Rect::x, and Rect::y.
Referenced by _con_move_to_con(), floating_enable(), init_ws_for_output(), output_change_mode(), randr_query_outputs(), scratchpad_fix_resolution(), and workspace_move_to_output().
| bool floating_maybe_reassign_ws | ( | Con * | con | ) |
Checks if con’s coordinates are within its workspace and re-assigns it to the actual workspace if not.
Definition at line 393 of file floating.c.
References xoutput::con, con_descend_focused(), con_focus(), con_get_output(), con_move_to_workspace(), DLOG, ELOG, get_output_containing(), Rect::height, Con::name, output_get_content(), Con::rect, TAILQ_FIRST, Rect::width, Rect::x, and Rect::y.
Referenced by cmd_move_window_to_center(), cmd_move_window_to_position(), DRAGGING_CB(), floating_enable(), and floating_reposition().

| void floating_move_to_pointer | ( | Con * | con | ) |
Moves the given floating con to the current pointer position.
Definition at line 431 of file floating.c.
References conn, ELOG, floating_reposition(), FREE, get_output_containing(), Rect::height, xoutput::rect, Con::rect, root, Con::type, Rect::width, x, Rect::x, y, and Rect::y.
Referenced by cmd_move_window_to_mouse().

| void floating_raise_con | ( | Con * | con | ) |
Raises the given container in the list of floating containers.
Definition at line 382 of file floating.c.
References DLOG, Con::name, Con::parent, TAILQ_INSERT_TAIL, and TAILQ_REMOVE.
Referenced by route_click().
Repositions the CT_FLOATING_CON to have the coordinates specified by newrect, but only if the coordinates are not out-of-bounds.
Also reassigns the floating con to a different workspace if this move was across different outputs.
Definition at line 807 of file floating.c.
References contained_by_output(), ELOG, floating_maybe_reassign_ws(), Con::rect, Con::scratchpad_state, and tree_render().
Referenced by cmd_move_direction(), cmd_move_window_to_position(), floating_drag_window(), floating_move_to_pointer(), floating_resize_window(), and handle_configure_request().

| void floating_resize | ( | Con * | floating_con, |
| int | x, | ||
| int | y | ||
| ) |
Sets size of the CT_FLOATING_CON to specified dimensions.
Might limit the actual size with regard to size constraints taken from user settings. Additionally, the dimensions may be upscaled until they're divisible by the window's size hints.
Definition at line 833 of file floating.c.
References con_descend_focused(), DLOG, floating_check_size(), Rect::height, Window::height_increment, Con::rect, Con::scratchpad_state, Rect::width, Window::width_increment, Con::window, x, and y.
Referenced by cmd_resize_set().

| void floating_resize_window | ( | Con * | con, |
| const bool | proportional, | ||
| const xcb_button_press_event_t * | event | ||
| ) |
Called when the user clicked on a floating window while holding the floating_modifier and the right mouse button.
Calls the drag_pointer function with the resize_window callback
Definition at line 582 of file floating.c.
References BORDER_BOTTOM, BORDER_LEFT, BORDER_RIGHT, BORDER_TOP, resize_window_callback_params::corner, DLOG, drag_pointer(), DRAG_REVERT, floating_reposition(), Rect::height, resize_window_callback_params::proportional, Con::rect, Con::scratchpad_state, Rect::width, XCURSOR_CURSOR_BOTTOM_LEFT_CORNER, XCURSOR_CURSOR_BOTTOM_RIGHT_CORNER, XCURSOR_CURSOR_TOP_LEFT_CORNER, and XCURSOR_CURSOR_TOP_RIGHT_CORNER.
Referenced by handle_client_message(), and route_click().

| void toggle_floating_mode | ( | Con * | con, |
| bool | automatic | ||
| ) |
Calls floating_enable() for tiling containers and floating_disable() for floating containers.
If the automatic flag is set to true, this was an automatic update by a change of the window class from the application which can be overwritten by the user.
Definition at line 360 of file floating.c.
References con_is_floating(), ELOG, floating_disable(), floating_enable(), LOG, and Con::type.
Referenced by cmd_floating().

1.8.5