*Syntax*:
----------------------------------
-bindsym [--whole-window] [Modifiers+]button[n] command
+bindsym [--release] [--whole-window] [Modifiers+]button[n] command
----------------------------------
By default, the binding will only run when you click on the titlebar of the
window. If the +--whole-window+ flag is given, it will run when any part of the
-window is clicked.
+window is clicked. If the +--release+ flag is given, it will run when the mouse
+button is released.
*Examples*:
--------------------------------
# The middle button over a titlebar kills the window
-bindsym button2 kill
+bindsym --release button2 kill
# The middle button and a modifer over any part of the window kills the window
bindsym --whole-window $mod+button2 kill
}
}
+ /* There is no default behavior for button release events so we are done. */
+ if (event->response_type == XCB_BUTTON_RELEASE) {
+ goto done;
+ }
+
/* Any click in a workspace should focus that workspace. If the
* workspace is on another output we need to do a workspace_show in
* order for i3bar (and others) to notice the change in workspace. */
*/
int handle_button_press(xcb_button_press_event_t *event) {
Con *con;
- DLOG("Button %d pressed on window 0x%08x (child 0x%08x) at (%d, %d) (root %d, %d)\n",
- event->state, event->event, event->child, event->event_x, event->event_y,
- event->root_x, event->root_y);
+ DLOG("Button %d %s on window 0x%08x (child 0x%08x) at (%d, %d) (root %d, %d)\n",
+ event->state, (event->response_type == XCB_BUTTON_PRESS ? "press" : "release"),
+ event->event, event->child, event->event_x, event->event_y, event->root_x,
+ event->root_y);
last_timestamp = event->time;
if (!(con = con_by_frame_id(event->event))) {
/* If the root window is clicked, find the relevant output from the
* click coordinates and focus the output's active workspace. */
- if (event->event == root) {
+ if (event->event == root && event->response_type == XCB_BUTTON_PRESS) {
Con *output, *ws;
TAILQ_FOREACH(output, &(croot->nodes_head), nodes) {
if (con_is_internal(output) ||