25 DLOG(
"border = %d, con = %p\n", border, con);
37 search_direction =
D_UP;
43 ELOG(
"BUG: invalid border value %d\n", border);
49 DLOG(
"No second container in this direction found.\n");
57 assert(first != second);
61 if (search_direction ==
D_UP || search_direction ==
D_LEFT) {
71 DLOG(
"After resize handler, rendering\n");
88 int to_right = con->
rect.
width -
event->event_x,
89 to_left =
event->event_x,
90 to_top =
event->event_y,
93 DLOG(
"click was %d px to the right, %d px to the left, %d px to top, %d px to bottom\n",
94 to_right, to_left, to_top, to_bottom);
96 if (to_right < to_left &&
101 if (to_left < to_right &&
106 if (to_top < to_right &&
111 if (to_bottom < to_right &&
112 to_bottom < to_left &&
126 DLOG(
"BORDER x = %d, y = %d for con %p, window 0x%08x\n",
127 event->event_x, event->event_y, con, event->event);
132 if (event->event_y >= 0 && event->event_y <= (int32_t)bsr.
y &&
133 event->event_x >= (int32_t)bsr.
x && event->event_x <= (int32_t)(con->
rect.
width + bsr.
width))
136 if (event->event_x >= 0 && event->event_x <= (int32_t)bsr.
x &&
137 event->event_y >= (int32_t)bsr.
y && event->event_y <= (int32_t)(con->
rect.
height + bsr.
height))
141 event->event_y >= (int32_t)bsr.
y && event->event_y <= (int32_t)(con->
rect.
height + bsr.
height))
151 xcb_allow_events(
conn, XCB_ALLOW_REPLAY_POINTER, time);
162 DLOG(
"--> click properties: mod = %d, destination = %d\n", mod_pressed, dest);
163 DLOG(
"--> OUTCOME = %p\n", con);
181 xcb_allow_events(
conn, XCB_ALLOW_ASYNC_POINTER, event->time);
189 if (event->response_type == XCB_BUTTON_RELEASE) {
210 const bool proportional = (
event->state & XCB_KEY_BUT_MASK_SHIFT) == XCB_KEY_BUT_MASK_SHIFT;
212 const bool was_focused =
focused == con;
215 const bool is_left_or_right_click = (is_left_click || is_right_click);
223 DLOG(
"Scrolling on a window decoration\n");
240 if (mod_pressed && is_left_click && !floatingcon &&
244 const bool use_threshold = !mod_pressed;
251 Con *con_to_focus = con;
258 while (!
TAILQ_EMPTY(&(con_to_focus->focus_head))) {
259 con_to_focus =
TAILQ_FIRST(&(con_to_focus->focus_head));
263 if (ws != focused_workspace) {
271 if (floatingcon != NULL && fs != con) {
273 if (mod_pressed && is_left_click) {
281 if (mod_pressed && is_right_click) {
282 DLOG(
"floating resize due to floatingmodifier\n");
288 is_left_or_right_click) {
290 DLOG(
"tiling resize with fallback\n");
298 DLOG(
"floating resize due to decoration right click\n");
304 DLOG(
"floating resize due to border click\n");
327 const bool use_threshold = !mod_pressed;
333 if (dest ==
CLICK_INSIDE && mod_pressed && is_right_click) {
339 xcb_allow_events(
conn, XCB_ALLOW_ASYNC_POINTER, event->time);
345 is_left_or_right_click) {
346 DLOG(
"Trying to resize (tiling)\n");
363 DLOG(
"Button %d (state %d) %s on window 0x%08x (child 0x%08x) at (%d, %d) (root %d, %d)\n",
364 event->detail, event->state, (event->response_type == XCB_BUTTON_PRESS ?
"press" :
"release"),
365 event->event, event->child, event->event_x, event->event_y, event->root_x,
371 const bool mod_pressed = (mod != 0 && (
event->state & mod) == mod);
372 DLOG(
"floating_mod = %d, detail = %d\n", mod_pressed, event->detail);
382 if (event->event ==
root) {
392 if (event->event ==
root && event->response_type == XCB_BUTTON_PRESS) {
409 ELOG(
"Clicked into unknown window?!\n");
410 xcb_allow_events(
conn, XCB_ALLOW_REPLAY_POINTER, event->time);
416 if (con->
window != NULL) {
432 if (event->child != XCB_NONE) {
433 DLOG(
"event->child not XCB_NONE, so this is an event which originated from a click into the application, but the application did not handle it.\n");