i3
|
#include "all.h"
Go to the source code of this file.
Data Structures | |
struct | resize_window_callback_params |
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. | |
void | floating_disable (Con *con, bool automatic) |
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. | |
DRAGGING_CB (drag_window_callback) | |
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. | |
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. | |
void | drag_pointer (Con *con, const xcb_button_press_event_t *event, xcb_window_t confine_to, border_t border, callback_t callback, const void *extra) |
This function grabs your pointer and lets you drag stuff around (borders). | |
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. | |
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). | |
Variables | |
xcb_connection_t * | conn |
void drag_pointer | ( | Con * | con, |
const xcb_button_press_event_t * | event, | ||
xcb_window_t | confine_to, | ||
border_t | border, | ||
callback_t | callback, | ||
const void * | extra | ||
) |
This function grabs your pointer 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 441 of file floating.c.
References conn, DLOG, ELOG, FREE, handle_event(), Con::rect, and root.
Referenced by floating_drag_window(), floating_resize_window(), and resize_graphical_handler().
DRAGGING_CB | ( | drag_window_callback | ) |
Definition at line 310 of file floating.c.
References conn, floating_maybe_reassign_ws(), render_con(), tree_render(), and x_push_node().
DRAGGING_CB | ( | resize_window_callback | ) |
Definition at line 357 of file floating.c.
References BORDER_LEFT, BORDER_TOP, con_minimum_size(), resize_window_callback_params::corner, croot, resize_window_callback_params::event, Rect::height, max(), resize_window_callback_params::proportional, tree_render(), Rect::width, and x_push_changes().
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 211 of file floating.c.
References con_descend_tiling_focused(), con_fix_percent(), con_focus(), con_get_workspace(), con_is_floating(), DONT_KILL_WINDOW, Con::floating, focused, LOG, Con::parent, Con::percent, TAILQ_INSERT_TAIL, TAILQ_REMOVE, tree_close(), and Con::type.
Referenced by 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 332 of file floating.c.
References BORDER_TOP, DLOG, drag_pointer(), and tree_render().
Referenced by 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 14 of file floating.c.
References Con::border_style, Con::border_width, BS_NORMAL, xoutput::con, con_attach(), con_by_window_id(), con_detach(), con_fix_percent(), con_focus(), con_get_output(), con_get_workspace(), con_is_floating(), con_new(), con_num_children(), config, Config::default_floating_border, DLOG, DONT_KILL_WINDOW, ELOG, Con::floating, floating_maybe_reassign_ws(), focused, Config::font, Con::geometry, get_output_containing(), Font::height, Rect::height, Window::leader, LOG, max(), Mode::name, NO_ORIENTATION, Con::orientation, Con::parent, Con::percent, Con::rect, render_con(), sasprintf(), TAILQ_EMPTY, TAILQ_END, TAILQ_FIRST, TAILQ_FOREACH, TAILQ_INSERT_TAIL, TAILQ_REMOVE, tree_close(), Con::type, Rect::width, Con::window, Rect::x, x_set_name(), and Rect::y.
Referenced by manage_window(), and toggle_floating_mode().
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).
Definition at line 559 of file floating.c.
References DLOG, Rect::height, Con::rect, Rect::width, Rect::x, and Rect::y.
Referenced by con_move_to_workspace(), and output_change_mode().
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 285 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 DRAGGING_CB(), floating_enable(), and floating_reposition().
void floating_raise_con | ( | Con * | con | ) |
Raises the given container in the list of floating containers.
Definition at line 274 of file floating.c.
References DLOG, Con::name, Con::parent, TAILQ_INSERT_TAIL, and TAILQ_REMOVE.
Referenced by route_click().
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.
Also reassigns the floating con to a different workspace if this move was across different outputs.
Definition at line 536 of file floating.c.
References ELOG, floating_maybe_reassign_ws(), get_output_containing(), Rect::height, Con::rect, tree_render(), Rect::width, Rect::x, and Rect::y.
Referenced by handle_configure_request().
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 412 of file floating.c.
References BORDER_BOTTOM, BORDER_LEFT, BORDER_RIGHT, BORDER_TOP, resize_window_callback_params::corner, DLOG, drag_pointer(), Rect::height, resize_window_callback_params::proportional, Con::rect, and Rect::width.
Referenced by 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 258 of file floating.c.
References con_is_floating(), floating_disable(), floating_enable(), and LOG.
Referenced by handle_transient_for().
xcb_connection_t* conn |
Definition at line 34 of file main.c.
Referenced by con_toggle_fullscreen(), drag_pointer(), DRAGGING_CB(), ewmh_setup_hints(), ewmh_update_active_window(), ewmh_update_client_list_stacking(), ewmh_update_current_desktop(), ewmh_update_workarea(), fake_absolute_configure_notify(), handle_button_press(), handle_configure_request(), handle_map_request(), handle_mapping_notify(), handle_signal(), handle_unmap_notify_event(), main(), manage_existing_windows(), manage_window(), predict_text_width(), randr_init(), randr_query_outputs(), resize_graphical_handler(), restore_geometry(), route_click(), send_take_focus(), sig_draw_window(), startup_workspace_for_window(), switch_mode(), translate_keysyms(), tree_close(), window_supports_protocol(), x_con_init(), x_con_kill(), x_deco_recurse(), x_draw_decoration(), x_mask_event_mask(), x_push_changes(), x_push_node(), x_push_node_unmaps(), x_set_i3_atoms(), x_window_kill(), xcb_check_cb(), xcb_prepare_cb(), xcb_set_root_cursor(), xinerama_init(), and xkb_got_event().