i3
|
Go to the source code of this file.
Data Structures | |
struct | resize_window_callback_params |
Macros | |
#define | MAX(x, y) |
Functions | |
static Rect | total_outputs_dimensions (void) |
static void | floating_set_hint_atom (Con *con, bool floating) |
void | floating_check_size (Con *floating_con, bool prefer_height) |
Called when a floating window is created or resized. | |
bool | 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. | |
void | floating_disable (Con *con) |
Disables floating mode for the given container by re-attaching the container to its old parent. | |
void | toggle_floating_mode (Con *con, bool automatic) |
Calls floating_enable() for tiling containers and floating_disable() for floating containers. | |
void | floating_raise_con (Con *con) |
Raises the given container in the list of floating containers. | |
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. | |
void | floating_center (Con *con, Rect rect) |
Centers a floating con above the specified rect. | |
void | floating_move_to_pointer (Con *con) |
Moves the given floating con to the current pointer position. | |
DRAGGING_CB (drag_window_callback) | |
void | floating_drag_window (Con *con, const xcb_button_press_event_t *event, bool use_threshold) |
Called when the user clicked on the titlebar of a floating window. | |
DRAGGING_CB (resize_window_callback) | |
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. | |
bool | 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. | |
void | floating_resize (Con *floating_con, uint32_t x, uint32_t y) |
Sets size of the CT_FLOATING_CON to specified dimensions. | |
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). | |
#define MAX | ( | x, | |
y ) |
DRAGGING_CB | ( | drag_window_callback | ) |
Definition at line 572 of file floating.c.
References conn, floating_maybe_reassign_ws(), render_con(), tree_render(), x_push_node(), and x_set_warp_to().
DRAGGING_CB | ( | resize_window_callback | ) |
Definition at line 639 of file floating.c.
References BORDER_LEFT, BORDER_TOP, resize_window_callback_params::corner, croot, floating_check_size(), max(), resize_window_callback_params::proportional, render_con(), and x_push_changes().
Centers a floating con above the specified rect.
Definition at line 529 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, |
bool | prefer_height ) |
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 or when adjustments are needed to conform to the configured size increments or aspect ratio limits.
When prefer_height is true and the window needs to be resized because of the configured aspect ratio, the width is adjusted first, preserving the previous height.
Definition at line 76 of file floating.c.
References Window::base_height, Window::base_width, Con::border_width, CF_NONE, con_border_style_rect(), con_descend_focused(), config, Con::deco_rect, DLOG, Config::floating_maximum_height, Config::floating_maximum_width, Config::floating_minimum_height, Config::floating_minimum_width, Con::fullscreen_mode, Rect::height, Window::height_increment, max(), Window::max_aspect_ratio, Window::max_height, Window::max_width, min(), Window::min_aspect_ratio, Window::min_height, Window::min_width, Con::rect, total_outputs_dimensions(), Rect::width, Window::width_increment, and Con::window.
Referenced by cmd_resize_floating(), DRAGGING_CB(), floating_enable(), floating_resize(), handle_normal_hints(), json_end_map(), and scratchpad_show().
void floating_disable | ( | Con * | con | ) |
Disables floating mode for the given container by re-attaching the container to its old parent.
Definition at line 420 of file floating.c.
References AFTER, con_attach(), con_descend_tiling_focused(), con_detach(), con_fix_percent(), con_get_workspace(), con_is_floating(), con_is_internal(), DONT_KILL_WINDOW, Con::floating, floating_set_hint_atom(), insert_con_into(), ipc_send_window_event(), LOG, Con::parent, Con::percent, 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, | ||
bool | use_threshold ) |
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 595 of file floating.c.
References con_exists(), 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().
bool 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 233 of file floating.c.
References Con::border_style, Con::border_width, xoutput::con, con_activate(), con_border_style_rect(), con_by_window_id(), con_detach(), con_fix_percent(), 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, Con::floating, floating_center(), floating_check_size(), floating_fix_coordinates(), floating_set_hint_atom(), focused, Con::geometry, get_output_from_rect(), Rect::height, Window::id, ipc_send_window_event(), L_SPLITH, Con::layout, Window::leader, LOG, max(), Con::max_user_border_style, Con::parent, Con::percent, Con::rect, rect_equals(), render_con(), sasprintf(), TAILQ_FIRST, TAILQ_FOREACH, TAILQ_INSERT_AFTER, TAILQ_INSERT_BEFORE, TAILQ_INSERT_HEAD, TAILQ_INSERT_TAIL, TAILQ_NEXT, TAILQ_PREV, tree_close_internal(), Con::type, Rect::width, Con::window, Rect::x, x_set_name(), and Rect::y.
Referenced by cmd_floating(), handle_client_message(), json_end_map(), 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 816 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(), move_content(), output_change_mode(), 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 490 of file floating.c.
References xoutput::con, con_activate(), con_descend_focused(), con_get_output(), con_get_workspace(), con_inside_focused(), con_is_internal(), con_move_to_workspace(), DLOG, ELOG, get_output_from_rect(), Con::name, output_get_content(), Con::rect, TAILQ_FIRST, and workspace_show().
Referenced by cmd_move_window_to_center(), DRAGGING_CB(), and floating_reposition().
void floating_move_to_pointer | ( | Con * | con | ) |
Moves the given floating con to the current pointer position.
Definition at line 538 of file floating.c.
References conn, ELOG, floating_reposition(), FREE, get_output_containing(), Rect::height, MAX, Con::rect, xoutput::rect, root, Con::type, Rect::width, Rect::x, Rect::y, and 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 479 of file floating.c.
References DLOG, Con::name, Con::parent, TAILQ_INSERT_TAIL, and TAILQ_REMOVE.
Referenced by con_raise().
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 755 of file floating.c.
References ELOG, floating_maybe_reassign_ws(), output_containing_rect(), 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, |
uint32_t | x, | ||
uint32_t | 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 783 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, 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 698 of file floating.c.
References BORDER_BOTTOM, BORDER_LEFT, BORDER_RIGHT, BORDER_TOP, con_exists(), resize_window_callback_params::corner, DLOG, drag_pointer(), DRAG_REVERT, floating_reposition(), Rect::height, resize_window_callback_params::proportional, Con::rect, Con::scratchpad_state, tree_render(), 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().
|
static |
Definition at line 42 of file floating.c.
References con_is_leaf(), conn, floating_set_hint_atom(), Window::id, TAILQ_FOREACH, and Con::window.
Referenced by floating_disable(), floating_enable(), and floating_set_hint_atom().
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 457 of file floating.c.
References con_is_floating(), ELOG, floating_disable(), floating_enable(), LOG, and Con::type.
Referenced by cmd_floating().
|
static |
Definition at line 22 of file floating.c.
References Rect::height, outputs, xoutput::rect, root_screen, TAILQ_EMPTY, TAILQ_FOREACH, and Rect::width.
Referenced by floating_check_size().