30 DLOG(
"new x = %d, y = %d\n", new_x, new_y);
38 xcb_warp_pointer(
conn, XCB_NONE, event->root, 0, 0, 0, 0,
42 xcb_warp_pointer(
conn, XCB_NONE, event->root, 0, 0, 0, 0,
71 DLOG(
"Find two participants for resizing container=%p in direction=%i\n", other, direction);
72 Con *first = *current;
75 DLOG(
"Current container is NULL, aborting.\n");
81 const bool dir_backwards = (direction ==
D_UP || direction ==
D_LEFT);
82 while (first->
type != CT_WORKSPACE &&
83 first->
type != CT_FLOATING_CON &&
97 if (second == NULL && both_sides ==
true) {
102 if (second == NULL && both_sides ==
true) {
103 second =
TAILQ_PREV(first, nodes_head, nodes);
107 if (second == NULL) {
108 DLOG(
"No second container in this direction found, trying to look further up in the tree...\n");
113 DLOG(
"Found participants: first=%p and second=%p.\n", first, second);
116 if (first == NULL || second == NULL) {
117 DLOG(
"Could not find two participants for this resize request.\n");
133 return ((
double)min_size / (double)parent_size);
145 assert(px * ppt == 0);
148 double new_first_percent;
149 double new_second_percent;
151 new_first_percent = first->
percent + ((double)ppt / 100.0);
152 new_second_percent = second->
percent - ((double)ppt / 100.0);
156 new_first_percent = first->
percent + pct;
157 new_second_percent = second->
percent - pct;
165 first->
percent = new_first_percent;
166 second->
percent = new_second_percent;
172 const xcb_button_press_event_t *event,
173 bool use_threshold) {
183 mask = XCB_CW_OVERRIDE_REDIRECT;
198 helprect.
x = second->
rect.
x;
199 helprect.
y = second->
rect.
y;
203 initial_position = second->
rect.
x;
207 initial_position = second->
rect.
y;
210 mask = XCB_CW_BACK_PIXEL;
213 mask |= XCB_CW_OVERRIDE_REDIRECT;
219 if (!use_threshold) {
222 xcb_warp_pointer(
conn, XCB_NONE, event->root, 0, 0, 0, 0,
223 second->
rect.
x, event->root_y);
225 xcb_warp_pointer(
conn, XCB_NONE, event->root, 0, 0, 0, 0,
226 event->root_x, second->
rect.
y);
230 xcb_circulate_window(
conn, XCB_CIRCULATE_RAISE_LOWEST,
helpwin);
249 xcb_destroy_window(
conn, grabwin);
258 DLOG(
"Done, pixels = %d\n", pixels);
269 DLOG(
"Graphical resize %s: first->percent = %f, second->percent = %f.\n",
270 result ?
"successful" :
"failed", first->
percent, second->
percent);