The i3 FAQ has migrated to https://github.com/i3/i3/discussions. All content here is read-only.
Ask Your Question
2

Manipulating windows with the mouse

asked 2012-09-25 19:38:38 +0000

Tohwi gravatar image

updated 2012-09-25 19:39:03 +0000

Hi, I'm using i3 for several months and I still feel some things are missing : mainly the possibility to manipulate windows with the mouse. I mean :

    closing windows (e.g. with a little cross-button on the title bar like many other wm, or by clicking with some button on the titlebar)
    switching to full screen (e.g. with double-click on the titlebar)

So I would like to know whether options to handle this will be implemented in the future, or if there's some way to configure this by hand.

Thanks, and thanks for developing such a great wm.

edit retag flag offensive close merge delete

3 answers

Sort by ยป oldest newest most voted
0

answered 2012-09-25 19:46:55 +0000

Michael gravatar image

No, features like little close buttons will not be implemented. i3 does not have full mouse support (or traditional mouse support) as one of its goals.

What still has a chance of getting introduced is bindsym-like support for mouse-buttons, e.g. that you can bind what a click on a window title with each mouse button should do. But nothing apart from that is planned (or desirable IMO) with regards to mouse support.

edit flag offensive delete link more
2

answered 2013-02-23 01:41:02 +0000

Timbus gravatar image

Hi there. I added this to i3 quite some time ago and could not live without it:

diff --git a/src/click.c b/src/click.c
index 3022c24..e76a57c 100644
--- a/src/click.c
+++ b/src/click.c
@@ -229,6 +229,12 @@ static int route_click(Con *con, xcb_button_press_event_t *event, const bool mod
         goto done;
     }

+    if (dest == CLICK_DECORATION && event->detail == 2) {
+        DLOG("Closing window using middle click\n");
+        tree_close(con, KILL_WINDOW, false, false);
+        goto done;
+    }
+
     /* 2: focus this con. */
     con_focus(con);

It allows windows to be closed with middle-click. If you have the latest git pull of the 'next' branch you should be able to apply it.

If anyone finds it useful, I might work on adding more mouse support such as moving and swapping window positions..

edit flag offensive delete link more

Comments

It is definitely useful, although it should terminate the processing of the event: currently the middle-click is passed through to the window behind it (which is the case when closing a floating window).

dev-zero gravatar imagedev-zero ( 2014-07-01 08:57:43 +0000 )edit
1

answered 2015-03-05 18:06:54 +0000

hos gravatar image

updated 2015-03-13 16:28:04 +0000

Adaephon gravatar image

Apparently bindsym features for mouse buttons have been added in the 4.9 release.

# The middle button over a titlebar kills the window
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

# The right button toggles floating
bindsym button3 floating toggle
bindsym $mod+button3 floating toggle

# The side buttons move the window around
bindsym button9 move left
bindsym button8 move right

Visit mousebindings section in the User's Guide for the necessary configuration.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2012-09-25 19:38:38 +0000

Seen: 3,541 times

Last updated: Mar 13