i3
floating.h
Go to the documentation of this file.
1 /*
2  * vim:ts=4:sw=4:expandtab
3  *
4  * i3 - an improved dynamic tiling window manager
5  * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
6  *
7  * floating.c: Floating windows.
8  *
9  */
10 #pragma once
11 
12 #include <config.h>
13 
14 #include "tree.h"
15 
17 typedef enum { BORDER_LEFT = (1 << 0),
18  BORDER_RIGHT = (1 << 1),
19  BORDER_TOP = (1 << 2),
20  BORDER_BOTTOM = (1 << 3) } border_t;
21 
28 bool floating_enable(Con *con, bool automatic);
29 
35 void floating_disable(Con *con);
36 
46 void toggle_floating_mode(Con *con, bool automatic);
47 
52 void floating_raise_con(Con *con);
53 
60 
65 void floating_center(Con *con, Rect rect);
66 
71 void floating_move_to_pointer(Con *con);
72 
78 void floating_drag_window(Con *con, const xcb_button_press_event_t *event, bool use_threshold);
79 
86 void floating_resize_window(Con *con, const bool proportional, const xcb_button_press_event_t *event);
87 
99 void floating_check_size(Con *floating_con, bool prefer_height);
100 
108 bool floating_reposition(Con *con, Rect newrect);
109 
117 void floating_resize(Con *floating_con, uint32_t x, uint32_t y);
118 
124 void floating_fix_coordinates(Con *con, Rect *old_rect, Rect *new_rect);
#define y(x,...)
Definition: commands.c:18
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 m...
Definition: floating.c:697
void floating_check_size(Con *floating_con, bool prefer_height)
Called when a floating window is created or resized.
Definition: floating.c:75
void floating_disable(Con *con)
Disables floating mode for the given container by re-attaching the container to its old parent.
Definition: floating.c:427
void floating_center(Con *con, Rect rect)
Centers a floating con above the specified rect.
Definition: floating.c:536
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.
Definition: floating.c:599
void floating_raise_con(Con *con)
Raises the given container in the list of floating containers.
Definition: floating.c:486
void toggle_floating_mode(Con *con, bool automatic)
Calls floating_enable() for tiling containers and floating_disable() for floating containers.
Definition: floating.c:464
border_t
On which border was the dragging initiated?
Definition: floating.h:17
@ BORDER_BOTTOM
Definition: floating.h:20
@ BORDER_TOP
Definition: floating.h:19
@ BORDER_RIGHT
Definition: floating.h:18
@ BORDER_LEFT
Definition: floating.h:17
void floating_resize(Con *floating_con, uint32_t x, uint32_t y)
Sets size of the CT_FLOATING_CON to specified dimensions.
Definition: floating.c:774
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: floating.c:497
void floating_move_to_pointer(Con *con)
Moves the given floating con to the current pointer position.
Definition: floating.c:545
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 outpu...
Definition: floating.c:804
bool floating_enable(Con *con, bool automatic)
Enables floating mode for the given container by detaching it from its parent, creating a new contain...
Definition: floating.c:226
bool floating_reposition(Con *con, Rect newrect)
Repositions the CT_FLOATING_CON to have the coordinates specified by newrect, but only if the coordin...
Definition: floating.c:747
Stores a rectangle, for example the size of a window, the child window etc.
Definition: data.h:156
A 'Con' represents everything from the X11 root window down to a single X11 window.
Definition: data.h:613