How can I disable alt+click window dragging?

40,148

Solution 1

In 14.04 (or 14.10, 15.04, 15.10, 16.04), to set the default key / value:

dconf write /org/gnome/desktop/wm/preferences/mouse-button-modifier  '"<Alt>"'

You can give it a (limited number of) other value(s), but DON'T set it to none like you could in the past. Nor should you set it to an empty string, Doing either will give you some trouble getting control over your mouse back, as I found out...

The practical value of this information is quite limited, since not many alternative keys are accepted. I found only Shift and Super to be working, which I doubt will give you the solution you'd like to have.

Of course you can use dconf-editor as well:

org>gnome>desktop>wm>preferences

enter image description here

Solution 2

Today I've learned that pressing key

Super

together with

Alt + Click

circumvents (deactivates) the dragging behavior. Solved my issues at least, as the application (Inkscape) I wanted to use Alt+Click with, seems to simply ignore the additional key (Super) been pressed.

sf. https://askubuntu.com/a/445254/618422

#edit

By the way, it's also documented officially at:

https://inkscape.org/en/doc/tutorials/basic/tutorial-basic.en.html#Selecting_under_and_dragging_selected

https://inkscape.org/doc/tutorials/basic/tutorial-basic.html

Solution 3

You can also do this through Compiz Settings Manager.
Just install it with sudo apt-get install compizconfig-settings-manager.
The addon is called 'Move' and is located in section called 'Window Management' I believe. You can go straight to its settings with ccsm -p move.

I really recommend this application. It gives access to massive amount of system customization options.

Solution 4

You can us CompizConfig Settings Manager (CCSM). This tool is essential if you want to tweak Linux for better efficiency, because it makes it easy to configure the desktop environment to be much more efficient then out-of-the-box Ubuntu. I used to use things like dconf-editor, and Ubuntu Tweak, but for tweaking anything related to desktop behavior, I have found CCSM to be much more powerful and easy to use.

  1. Install CompizConfig Settings Manager by typing this in a terminal:

    sudo apt install compizconfig-settings-manager compiz-plugins compiz-plugins-extra
    
  2. Open CCSM (CompizConfig Settings Manager), go to the Window Management section, and find the Move Windows icon.

  3. Make sure Move Window is enabled, and then Click it's button.

enter image description here

  1. Click the button to the right of the Initiate Move Window with the mouse icon next to it.

enter image description here

  1. In the Edit Initiate Window Move window, and then make sure to un-check the Enabled check-box. That will disable it. You can also easily set the Window Move to a different mouse/keyboard/screen-edge combination, if you would like, although binding it to a screen edge wouldn't work. This is where this tool, CCSM, outdoes dconf-editor and Ubuntu Tweak.

enter image description here

Solution 5

You can also use GNOME Tweak Tool (gnome-tweak-tool).

In 'Windows' section, change the 'Window Action Key' setting.

This tool is obviously for the GNOME Shell tweaking, but some properties are respected by Unity as well.

Share:
40,148

Related videos on Youtube

ruscur
Author by

ruscur

Updated on September 18, 2022

Comments

  • ruscur
    ruscur over 1 year

    In Ubuntu 14.04, when you hold Alt and click a window, you can drag it around. As I understand, you used to be able to disable it through gconf, but Unity doesn't read settings from here any more (hence not being able to change where the window buttons are any more).

    There's no setting for this by default, and I can't find anything in Unity Tweak Tool either. Is there anyway to disable Alt+click window movement in 14.04?

    • Elder Geek
      Elder Geek over 7 years
      Close voters! This post has answers that are superior to the called duplicate. Merge candidate? maybe. Close? never
    • Ciro Santilli OurBigBook.com
      Ciro Santilli OurBigBook.com over 4 years
  • mpen
    mpen about 9 years
    kcpr's solution lets you set it to something like <Shift><Control><Alt><Super>Button20 pretty easily. Will be hard to accidentally trigger that.
  • Vadorequest
    Vadorequest about 8 years
    Indeed, super easy this way.
  • John P Bloch
    John P Bloch over 7 years
    FYI, this still works in 16.04.
  • Jacob Vlijm
    Jacob Vlijm over 7 years
    @JohnPBloch ah, great, good to hear. Thanks for mentioning.
  • Jaime Hablutzel
    Jaime Hablutzel over 6 years
    Disabling the shortcut didn't work for me in Ubuntu 16.04, instead I had to change the default shortcut.
  • Shade
    Shade over 6 years
    This also works on 17.10.
  • shinobi
    shinobi about 6 years
    You will also need to do sudo apt-get install compiz-plugins to get the Window Management option
  • shinobi
    shinobi about 6 years
    You will also need to do sudo apt-get install compiz-plugins to get the Window Management option
  • SunnyDaze
    SunnyDaze about 6 years
    I never install compiz-plugins, because I assumed compiz-plugins was installed by default, and I still have the Windows Management feature. I do, however, install compiz-plugins-extra on all my Linux installations, so maybe that's where I get the Windows Management plugin. So I added both of them to the command line above.
  • Kristoffer Berg - EcodeAS
    Kristoffer Berg - EcodeAS almost 6 years
    THIS is by far the awesomest thing I've seen today! Thanks - this is why I was trying to disable the ALT -drag in the first place! Thanks buddy!
  • Oliver R.
    Oliver R. over 5 years
    I needed this for notepad++ square selection/column mode editing inside a windows vm. Very useful. Thank you!
  • dyesdyes
    dyesdyes over 5 years
    Changing the shortcut worked for 18.04
  • Krishnakumar
    Krishnakumar over 5 years
    Best solution which doesn't need us to over-write the system settings
  • Lukas Liesis
    Lukas Liesis about 5 years
    works perfectly ;) P.S DO NOT TRY to set it to the empty string. I tried :) Mouse will just always move windows. Can't select anything. Clicked on some window and you are dragging it around instead of selecting something. You will have to undo this w/o mouse.
  • Rajesh Chaudhary
    Rajesh Chaudhary about 5 years
    @mpen Thanks...
  • Dims
    Dims about 5 years
    How to save changes in this application? Unchecking option for Alt-move does nothing and does return on next run
  • kcpr
    kcpr about 5 years
    @Dims, I believe it should be saved automatically. Maybe just try changing the modifier from alt to something else (super is my personal favorite).
  • Khaled AbuShqear
    Khaled AbuShqear almost 5 years
    I'm using deepin, both ways doesn't work with me
  • jave.web
    jave.web about 4 years
    Yep, using Ubuntu 18.04 I forgot about that - this works for all with dconf-editor - you just need to use the right "org" - for cinnamon or any other => org > cinnamon > desktop > wm > preferences > mouse-button-modifier ; for gnome => org > gnome > desktop > wm > preferences > mouse-button-modifier etc ...
  • Juan José Melero Gómez
    Juan José Melero Gómez almost 4 years
    You can install dconf-editor with sudo apt install dconf-tools.
  • Colonder
    Colonder almost 4 years
    2020 Best answer
  • hsandt
    hsandt almost 4 years
    Great! Works on Cinnamon. Make sure to hold Alt before Super though. I used this in Unity to enable rotating view around selection. By the way, link is dead, I found the page at inkscape.org/doc/tutorials/basic/tutorial-basic.html (but it just recommended to disable window dragging or remap it to Super/Meta as in other answers).
  • Alex Marandon
    Alex Marandon over 2 years
    This also worked for me in Bitwig!