New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Different kinds of clicking #558
Comments
This behaviour should be configurable. Another use case (from #570): It would be great if you could configure the bindings for the mouse (such as $mod+button1 to drag and $mod+button2 to resize floating windows) in a similar way as the bindings for the keyboard. |
I agree that we want to have this, but it’s not important, so unsetting version. |
[Original comment by p.staszewski@…] I would like to say that I would very much like this feature too! My original idea can be best described by sample config entries: The bindings defined above should work only for clicks on title bars. Thank you for your work on i3! |
[Original comment by anonymous] For those with multiple mouse buttons, this would be useful for switching workspaces quickly, for example.
|
[Original comment by cyd@…] A workaround: Bind Mousebutton 9"i3-msg -t command "workspace next"" |
See also #1104 for what this feature request should cover. |
[Original comment by josh] Replying to comment 6 @…:
@…. #1104 is a clean feature request. Maybe (since #1104 has been merged) we can implement #558 in stages. tldr; myself and others wold really like to see the features requested in #1104 implemented soon. |
Replying to comment 7 by josh:
|
[Original comment by tony@…] I can start looking at this, but I'm not sure I have a clear idea how this can be implemented in a way that also implements the features in #1104. Can someone summarize the consensus on what exactly implementing this would require and provide example config directives that would implement each part of #1104? |
[Original comment by anonymous] Replying to comment 8 @…:
|
[Original comment by TonyC] Replying to comment 10 by anonymous: This is beginning to go through now. There is a lot of activity going on with i3bar that is higher priority than this, so I'm going to put off the proper solution for a bit. If you really want something now though, apply this patch which allows you to do something like:
and that will disable all clicking on the bar (except tray icons I think). As for the other feature which was requested in #1104, disabling the scrolling and clicking on tabbed window decorations, I'm doubting right now whether we can do that cleanly because of how specific it is. On the one hand, disabling mouse interaction with i3 completely is not a feature I think people want because drag resize/move and click to focus are kind of essential. On the other hand, I don't think a config directive like So if you can think of a rule somewhere in between along with a way to explain it to people in the docs that we can agree on, I will implement it. |
[Original comment by TonyC] I'll summarize the current state of this feature as I see it now. Replying to comment 3 by p.staszewski@…: I think this is the best implementation that has been suggested so far. The command will look like this:
With the following behavior:
This should allow the user to no-op any default mouse behavior they do not like (implementing #1104). It also allows for the user to easily configure the most obvious use for this feature, that is, right/middle click/scroll wheel on the title bars, without interfering with an application's own handling of click events. A problem I can see with this is that there would be no way to reproduce the default "scroll" mouse wheel feature (perhaps in the opposite direction). Maybe a How does that sound? |
[Original comment by p.staszewski@…] Replying to comment 12 by TonyC:
Points 1. and 2. - exactly.
Honestly I did not consider scroll wheel at that time... I would introduce it as a command though:
So that to get the currently default behaviour:
I haven't looked at the implementation, but form the user's point-of-view the current mouse scrolling of windows behaves differently from As for the
Thanks to all for discussion and interest in this feature. |
Replying to comment 13 by p.staszewski@…:
|
[Original comment by p.staszewski@…] (I'll try to avoid superfluous nesting.) Replying to comment 14 @…:
A flag, later on - I'm all for it; but later on. Disregarding the fact that most apps already have mouse bindings inside their 'space', my idea here was to 'compensate' for the lack of the close/max|min buttons commonly found on most title bars - with the 'twist' that there are no icons, just mouse button bindings, and that they are fully-configurable. I have probably expressed that on the IRC channel already, but: I personally have two distinct modes of WM interaction: keyboard driven, and mouse driven. While the keyboard gives me (extreme) flexibility the mouse gives me simplicity and one-hand operation. As of now I can focus any window with the mouse. My main real problem is that I can't close every window with the mouse (only those that have, obviously, a button or a menu option for that). Given the above I would be satisfied with the simple default binding that right-click on a title bar means kill that window. Given the fact that I do like the flexibility I was looking for a more configurable approach.
I agree focus (and click context) should be obvious - but then the scroll wheel cycling (as it works now) may make it a little blurry, so I confirmed the approach. And yes, I do realize that scroll wheel is just a click. Funny thing though is that I didn't think about it that way intuitively when I was first posting my request. I guess the physical acts of clicking and scrolling with a wheel are distinct enough to enforce a mental notion that these are handled differently.
I agree. I assume the above then necessitates something like a
I believe the answer to that is two-fold. First - mouse wheel scrolling right now works whenever the mouse pointer is on any title bar - it just cycles from whatever the currently focused window is, in direction appropriate to the scroll direction. Given the premise 'command is executed for the window the title bar we click' this may seem to break the logic a bit - for mouse wheel cycle we should cycle left|right relative to the currently focused window, i.e. not do 'first focus the window for which the mouse pointer is over the title bar' (hope this makes sense). The second part is that cycling as it works now is distinct from the I hope I've managed to clarify. |
[Original comment by TonyC] I didn't mean to imply that the container would automatically be focused by the activation of a bindmouse command. Let me amend my specification of behavior 2:
Of course, when I say "a title bar was clicked" I mean a If we were to automatically focus a container, we could not meet the requirements of #1104, because it would not be possible to truly no-op the mouse wheel (or any other button) over title bars. To illustrate how this works, consider the directive:
and suppose the binding is activated with
If some command requires the container to be focused to act on the container (e.g.,
which will work as expected. However, these commands should implement criteria matching eventually. To get the scroll wheel functionality we would need two additional commands which act on the focused container within the parent of the leaf container selected by the criteria:
Here is a complete example:
|
Replying to comment 16 by TonyC:
Also, it would be good if you could add a bindmouse for i3bar in this example — I assume we want to have a very similar concept for i3bar, right? |
[Original comment by TonyC] Replying to comment 17 @…:
The name could use some work. It's difficult to think of something simple to describe this that doesn't use specialist vocabulary. Using
Yes, i3bar should have a similar feature. Since it is not a managed window, it will have to be implemented separately. The details of this implementation is still an open issue. |
[Original comment by Tony Crisci] This ticket was fixed in commit http://c.i3wm.org/54012719:
|
[Original comment by TonyC] For the i3bar implementation, we could either do this within i3bar or i3 itself. Here are the advantages/disadvantages to each. If we implemented it in i3 itself, a
However, this may break compatibility unless there is some way to eat the event before i3bar can get it whenever a binding runs. To implement this is i3bar, the
|
Replying to comment 20 by TonyC:
|
[Original comment by jandry] I think a great deal of complication could be avoided if i3 could simply bind a command to various mousebinds; this would easily allow users to use xdotool to set mouse actions to already existing keybinds: bindmouse $mod+Button2 command; xdotool key Alt+Shift+q In this way, you wouldnt even have to have a container or titlebar for an app. It could be "context" driven (similar to how Openbox has "desktop" and "frame" context options). That said, I think having configurable mouseactions for titlebar clicks is a unique and very good idea for those that use them. As for the bar I have no idea... |
[Original comment by TonyC] Replying to comment 22 by jandry: I think that is an excellent idea feature-wise. I'm working on a more general way to intercept commands for custom scripting in #1210 which I think would pair very well with the new mouse binding feature and let you accomplish what you are after in a cleaner way. As for the status of this feature itself, most of the refactoring required for implementing the feature is complete and I plan to put most of my i3-development effort into this next week. |
[Original comment by TonyC] Bindmouse is done. It will be merged soon. Here is how it turned out:
I'm not going to do mouse bindings over i3bar because it's too complicated. |
[Original comment by Tony Crisci] This ticket was fixed in commit http://c.i3wm.org/0df172fd:
|
A configured mouse binding (for example `bindsym button3 kill`) runs its command when the mouse button is pressed over parts of a container. If the binding has no modifer, it will only run when the button is clicked on the window titlebar. Otherwise if the binding has a modifier, it will run over the titlebar or any part of the contained window. fixes #558
Bah. Wanted to catch button event without modifier as well |
@Radivarig You can. The comments in here aren't up to date. |
I'm trying to bind the scroll buttons with |
[Originally reported by julien]
(Hello Michael,
As discussed on bug #534, different kinds of clicking can be usefull for the user to get different results (focus, resizing tool, etc.).
As we said, they are many possible ideas, like for example :
1°) click (1 sec) on a tab makes the tab to be focused ; click (more than 1sec) on a tab calls the resizing tool ;
2°) click on a tab makes the tab to be focused ; click+Mod1 on a tab calls the resizing tool.
Thanks a lot for i3 !
Best regards,
Julien
The text was updated successfully, but these errors were encountered: