80

Dragging windows around with alt-click has always been one of my favorite features on a linux desktop: no need to aim at the window title to drag, just press alt, click anywhere within the window and drag.

This seems to be disabled in gnome 3 / gnome-shell in debian testing. How can I enable it? (I hope the feature still exists...)

janos
  • 3,297
  • 1
  • 22
  • 31

6 Answers6

86

You can also use gnome-tweak-tool to change the key back to Alt. The option is called Modifier to use for modified window click actions or Window Action Key (in 3.10 and later versions) and is available under the Windows category. See http://www.ryanlerch.org/blog/alt-click-drag-to-move-windows-no-longer-works-in-fedora-18-gnome-3-8/. Enable it as follows:

  1. Open a terminal.
  2. Type: gnome-tweak-tool
  3. Click Windows.
  4. Set Window Action Key to: Alt
  5. Close the tool.

Alt+Drag now works.


For Gnome 3, a command-line solution that may be used in scripts:

gsettings set org.gnome.desktop.wm.preferences mouse-button-modifier '<Alt>'
Dave Jarvis
  • 3,168
  • 5
  • 32
  • 37
pelle
  • 1,306
  • 9
  • 7
  • 4
    In GNOME 3.10 (possibly earlier) the option is called "Window Action Key" under the Windows section of GNOME Tweak Tool – STW Oct 22 '14 at 18:34
  • 1
    +1, thank you. Any idea how to do this from the command line? I'd like to script this tweak. – Adam Monsen Dec 10 '18 at 03:15
31

I have also used this feature regularly in Gnome on Fedora, and was disappointed or frustrated that it seemed to have disappeared as of Fedora 18. All is not lost, it's just moved one key over!

What used to be Alt+drag is now Super+drag. Super is the Windows/Apple/Meta key next to the Alt key on most keyboards. In the process of finding that, I also discovered that Super+middle button+drag resizes windows (which apparently used to work with Alt too, but I never knew about it).

Andrew Lott
  • 943
  • 1
  • 7
  • 22
Scott
  • 311
  • 3
  • 2
  • 1
    Thanks for that, I noticed lock had changed to Super + L but didn't think about trying that for drag, also thanks too for the resize, never knew about that either :-) – marsbard May 21 '15 at 07:51
  • Still sucks that someone thought they can change a long standing default because it suited them better. – Dagelf Aug 29 '22 at 07:29
8

This did what I needed:

gconftool-2 --set /apps/metacity/general/mouse_button_modifier --type string "<Alt>"

I figured it out based on another question: Gnome3 - Change window drag shortcut

It seems that alt-click-drag is usually enabled and I found several questions wanting to disable it. My case was the opposite. The feature was disabled, and I really wanted to enable it.

UPDATE

This solution worked for Gnome 3.0 in 2012 June, and it no longer works today. See the other answer I linked above, the answer seems to have updated more recently, or @STW's comment below.

janos
  • 3,297
  • 1
  • 22
  • 31
  • 1
    This doesn't appear to work (at least in 3.10), however the Tweak Tool UI controls this setting. It's the `Windows > Window Action Key` setting – STW Oct 22 '14 at 18:35
6

Running Gnome version 3.14.0 on OpenSUSE 13.2, here. To perform the Alt-drag capability out-of-the-box, use Super+drag.

naisanza
  • 297
  • 2
  • 9
  • I approve it works on Fedora 22 (gnome 3.16) by default. Nice feature btw. Also Alt+F7 works : it turns on window drag mode, the difference is, I can press Esc and the window will go back where it was. – Mikhail V Dec 10 '15 at 03:30
3

For everyone who wants to script this, try the following:

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

Note the quotes-in-quotes -- the GVariant format requires strings to be quoted.

  • 1
    Just use `dconf write` or `gsettings set`? – u1686_grawity Aug 11 '20 at 13:27
  • Thanks for the suggestion -- it took me a minute to figure out from the error messages that I needed to quote the quotes. I've updated the original. – Matt Winter Aug 12 '20 at 14:32
  • 1
    This also works for me in GNOME 3 on Ubuntu 18.04: `gsettings set org.gnome.desktop.wm.preferences mouse-button-modifier ''` – pts Oct 13 '20 at 18:07
0

Just these two lines will do, for the default Gnome session, and will take effect right away:

gsettings set org.gnome.desktop.wm.preferences mouse-button-modifier '<Alt>'
gsettings set org.gnome.desktop.wm.preferences resize-with-right-button true

The defaults in Gnome were changed to avoid conflicts the design crowd - to Super + drag for drag and Super + middle click to resize.

Dagelf
  • 901
  • 10
  • 18