How do I get the Grid plugin to work with the mouse and not only with the keyboard?

Asked by Geoffrey van Wyk on 2012-08-24

I use Linux Mint 13 MATE. I switched from Metacity to Compiz and enabled the Grid plugin.

The Grid plugin works with the keybindings, but I when I drag a window with the mouse to the top, left or right of the screen, it does not work.

Question information

Language:
English Edit question
Status:
Solved
For:
Compiz Edit question
Assignee:
No assignee Edit question
Solved by:
Geoffrey van Wyk
Solved:
2012-08-25
Last query:
2012-08-25
Last reply:

I found a solution here: http://www.omgubuntu.co.uk/2009/11/get-aero-snap-in-ubuntu

It is not a modification of the Grid plugin, but something additional. Here are the steps.

You Will Need Compiz enabled and the following applications installed: -

    sudo apt-get install compizconfig-settings-manager wmctrl

Now you’re all set to begin.

    1. Open the Compiz Config Settings Manager (ALT+F2 ccsm, system > preferences > CompizConfig…, etc)
    2. Select the “Commands” option.
    3. In ‘Command Line 0′ paste: -

WIDTH=`xdpyinfo | grep 'dimensions:' | cut -f 2 -d ':' | cut -f 1 -d 'x' `&& HALF=$(($WIDTH/2)) && wmctrl -r :ACTIVE: -b add,maximized_vert && wmctrl -r :ACTIVE: -e 0,0,0,$HALF,-1

    4. In ‘Command Line 1′ paste: -

WIDTH=`xdpyinfo | grep 'dimensions:' | cut -f 2 -d ':' | cut -f 1 -d 'x' `&& HALF=$(($WIDTH/2)) && wmctrl -r :ACTIVE: -b add,maximized_vert && wmctrl -r :ACTIVE: -e 0,$HALF,0,$HALF,-1

    5. And in ‘Command Line 2′ paste: -

wmctrl -r :ACTIVE: -b add,maximized_vert,maximized_horz

    6. Now choose the ‘Edge Bindings’ tab at the top and set the following: -

    Run Command 0 – Set To Left
    Run Command 1 – Set To Right
    Run Command 2 – Set To Top

    7. Click on the back button and go to ‘General options’. Set the ‘Edge Trigger Delay’ to something around 400 – 500 by dragging the slider to the right.

Now all you have to do is drag a window to one of the specified sides and your window will automatically resize.

MC Return (mc-return) said : #2

The problem with grid edge and corner bindings not triggering with certain windows, like gedit is now fixed in trunk.
Please retry with the latest Compiz version.