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

how to disable alt + mouse click actions in JWM #311

Closed
abrasmelin opened this Issue Apr 28, 2016 · 7 comments

Comments

Projects
None yet
3 participants
@abrasmelin

abrasmelin commented Apr 28, 2016

Is it possible to disable alt + left and right mouse click actions? Right now the defaults are;

alt + left mouse : window dragging

alt + right mouse : window scale

I cant find a way to disable this behaviour.

This is very annoying. I am a 3D Artist and i cant use my main 3d software (Autodesk Maya) because of this. Because the program is using alt + mouse click navigation. (and there are lots of other programs that uses the same behaviour) Please Joe help me. I really like your work and dont want to skip JWM because of this. Thanks in advance.

@joewing

This comment has been minimized.

Show comment
Hide comment
@joewing

joewing Apr 28, 2016

Owner

Unfortunately that's not configurable right now. A long standing issue is to make mouse bindings configurable. Some behaviors, such as this, are more important than others though (who really wants left click on the title bar to do something other than move?). So I think I'll probably try to work in a near-term solution that will attempt to work like a more generic solution.

In the mean time, if you want to disable this, it can be done with a fairly minor code change. In event.c in the DispatchBorderButtonEvent function (around line 1537), comment out the special case around the MoveClient call. Something like this:

   /* Middle click starts a move unless it's over the maximize button. */
   action = GetBorderActionType(np, event->x, event->y);
/*
   if(event->button == Button2 && action != BA_MAXIMIZE) {
      MoveClient(np, event->x, event->y);
      return;
   }
*/
Owner

joewing commented Apr 28, 2016

Unfortunately that's not configurable right now. A long standing issue is to make mouse bindings configurable. Some behaviors, such as this, are more important than others though (who really wants left click on the title bar to do something other than move?). So I think I'll probably try to work in a near-term solution that will attempt to work like a more generic solution.

In the mean time, if you want to disable this, it can be done with a fairly minor code change. In event.c in the DispatchBorderButtonEvent function (around line 1537), comment out the special case around the MoveClient call. Something like this:

   /* Middle click starts a move unless it's over the maximize button. */
   action = GetBorderActionType(np, event->x, event->y);
/*
   if(event->button == Button2 && action != BA_MAXIMIZE) {
      MoveClient(np, event->x, event->y);
      return;
   }
*/
@joewing

This comment has been minimized.

Show comment
Hide comment
@joewing

joewing Apr 29, 2016

Owner

In trying to come up with a fix for this, I realized that the code that you want to remove is actually in event.c in the HandleButtonEvent function (around line 399):

         switch(event->button) {
         case Button1:
         case Button2:
            FocusClient(np);
            RaiseClient(np);
            if(move_resize) {
/*
               GetBorderSize(&np->state, &north, &south, &east, &west);
               MoveClient(np, event->x + west, event->y + north);
*/
            }
            break;
Owner

joewing commented Apr 29, 2016

In trying to come up with a fix for this, I realized that the code that you want to remove is actually in event.c in the HandleButtonEvent function (around line 399):

         switch(event->button) {
         case Button1:
         case Button2:
            FocusClient(np);
            RaiseClient(np);
            if(move_resize) {
/*
               GetBorderSize(&np->state, &north, &south, &east, &west);
               MoveClient(np, event->x + west, event->y + north);
*/
            }
            break;
@joewing

This comment has been minimized.

Show comment
Hide comment
@joewing

joewing Apr 29, 2016

Owner

I was going to do something more extreme, but I ended up just adding a "nodrag" group option. So, as of snapshot 1517, you can disable this binding with:

<Group>
    <Option>nodrag</Option>
</Group>

This is a little bit of a hack since complete control over key bindings is the ultimate goal, but it's a quick fix that avoids breaking existing configurations.

Please let me know if that does what you need.

Owner

joewing commented Apr 29, 2016

I was going to do something more extreme, but I ended up just adding a "nodrag" group option. So, as of snapshot 1517, you can disable this binding with:

<Group>
    <Option>nodrag</Option>
</Group>

This is a little bit of a hack since complete control over key bindings is the ultimate goal, but it's a quick fix that avoids breaking existing configurations.

Please let me know if that does what you need.

@joewing joewing added the enhancement label Apr 29, 2016

@joewing joewing added this to the Version 2.3.6 milestone Apr 29, 2016

@abrasmelin

This comment has been minimized.

Show comment
Hide comment
@abrasmelin

abrasmelin Apr 29, 2016

I added this to groups conf file and specified an application but no it does not work. I am still getting window dragging with alt + left mouse click and window scaling with alt + right mouse click

abrasmelin commented Apr 29, 2016

I added this to groups conf file and specified an application but no it does not work. I am still getting window dragging with alt + left mouse click and window scaling with alt + right mouse click

@holmeslinux

This comment has been minimized.

Show comment
Hide comment
@holmeslinux

holmeslinux Apr 29, 2016

thank you Joe, i tried to help the @abrasmelin , but i could not!

vlw fwi, Holmes :)

thank you Joe, i tried to help the @abrasmelin , but i could not!

vlw fwi, Holmes :)

@abrasmelin

This comment has been minimized.

Show comment
Hide comment
@abrasmelin

abrasmelin Apr 29, 2016

Ah so in order to this work i need to update jwm? Can you also add noscaling to groups? Because alt left mouse drags the window okay but also alt right click scales the window. Also holmes will you add this updated version?

Ah so in order to this work i need to update jwm? Can you also add noscaling to groups? Because alt left mouse drags the window okay but also alt right click scales the window. Also holmes will you add this updated version?

@joewing

This comment has been minimized.

Show comment
Hide comment
@joewing

joewing Apr 29, 2016

Owner

You do need to update JWM (and be sure to exit the old version; restart won't pull in the new code). The nodrag option should disable both left and right click over the window content.

Owner

joewing commented Apr 29, 2016

You do need to update JWM (and be sure to exit the old version; restart won't pull in the new code). The nodrag option should disable both left and right click over the window content.

@joewing joewing closed this May 21, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment