29 DLOG(
"new x = %d, y = %d\n", new_x, new_y);
51 DLOG(
"Find two participants for resizing container=%p in direction=%i\n", other, direction);
52 Con *first = *current;
55 DLOG(
"Current container is NULL, aborting.\n");
61 const bool dir_backwards = (direction ==
D_UP || direction ==
D_LEFT);
62 while (first->
type != CT_WORKSPACE &&
63 first->
type != CT_FLOATING_CON &&
77 if (second == NULL && both_sides ==
true) {
82 if (second == NULL && both_sides ==
true) {
88 DLOG(
"No second container in this direction found, trying to look further up in the tree...\n");
93 DLOG(
"Found participants: first=%p and second=%p.\n", first, second);
96 if (first == NULL || second == NULL) {
97 DLOG(
"Could not find two participants for this resize request.\n");
113 return ((
double)min_size / (double)parent_size);
125 assert(px * ppt == 0);
128 double new_first_percent;
129 double new_second_percent;
131 new_first_percent = first->
percent + ((double)ppt / 100.0);
132 new_second_percent = second->
percent - ((double)ppt / 100.0);
136 new_first_percent = first->
percent + pct;
137 new_second_percent = second->
percent - pct;
145 first->
percent = new_first_percent;
146 second->
percent = new_second_percent;
161 mask = XCB_CW_OVERRIDE_REDIRECT;
176 helprect.
x = second->
rect.
x;
177 helprect.
y = second->
rect.
y;
181 initial_position = second->
rect.
x;
182 xcb_warp_pointer(
conn, XCB_NONE, event->root, 0, 0, 0, 0,
183 second->
rect.
x, event->root_y);
187 initial_position = second->
rect.
y;
188 xcb_warp_pointer(
conn, XCB_NONE, event->root, 0, 0, 0, 0,
189 event->root_x, second->
rect.
y);
192 mask = XCB_CW_BACK_PIXEL;
195 mask |= XCB_CW_OVERRIDE_REDIRECT;
201 xcb_circulate_window(
conn, XCB_CIRCULATE_RAISE_LOWEST,
helpwin);
214 xcb_destroy_window(
conn, grabwin);
223 DLOG(
"Done, pixels = %d\n", pixels);
234 DLOG(
"Graphical resize %s: first->percent = %f, second->percent = %f.\n",
235 result ?
"successful" :
"failed", first->
percent, second->
percent);