Out of general laziness I’ve been using quite a lot of gnome on ubuntu instead of fluxbox. One of the little things I got used to on fluxbox is resizing windows dragging the right mouse button while holding the alt-button(another one is easy borderless windows for stuff like mplayer). Gnome can do this too, but only by clicking the middle mouse button (mouse wheel), I don’t even dare to get used to this to prevent accidental pastes. Unfortunately which button does what is unconfigurable with Gnome (I’ve been told Linus Torvalds has been ranting on Gnome for this recently), so telling it to resize on a right click is impossible.
So I patched metacity to have + right mouse button to resize (and swapped the behavior the right mouse button had to the middle mouse button instead, although I never use it). Patch:
--- src/display.old.c 2007-03-02 23:09:58.000000000 +0100
+++ src/display.c 2007-03-02 23:13:19.000000000 +0100
@@ -1691,7 +1691,7 @@
if (!unmodified)
begin_move = TRUE;
}
- else if (!unmodified && event->xbutton.button == 2)
+ else if (!unmodified && event->xbutton.button == 3)
{
if (window->has_resize_func)
{
@@ -1740,7 +1740,7 @@
event->xbutton.y_root);
}
}
- else if (event->xbutton.button == 3)
+ else if (event->xbutton.button == 2)
{
if (meta_prefs_get_raise_on_click ())
meta_window_raise (window);
Save it in debian/patches/008_rightmouse.patch before you run ./debian/rules binary to build your package (or get it at http://blog.bz2.nl/files/008_rightmouse.patch). Or (probably working, not recommended, untested, all that) get my compiled package at http://blog.bz2.nl/files/metacity_2.16.3-0ubuntu2_i386.deb.
It’s rather trivial, but I couldn’t find if anyone else already did it. It might break all kinds of things, but it’s been running fine for a while over here.
Hey, thanks! I’ve been looking for a way to ‘fix’ this in metacity for a while. It’s even more annoying on my ThinkPad — I have the middle trackpoint button mapped to act as a scroll wheel, so if I try to drag the cursor with the middle button, it just scrolls.
Any chance they’ll roll this into the main metacity code?
Left by Larry on October 5th, 2007
[...] simple just swapping a couple of numbers. I just read a few lines from the file he discovered on someone’s blog. I didn’t really bother to read the rest of it but Nikolay explained a bit more on how to [...]
Left by Pekk’s Blog ;D » Blog Archive » Alt Left-Click Resizing for Metacity/Gnome on November 6th, 2007
Thank you !
I ve been searching through docs and gconf for a while for this settings and i was pretty despair to not find it .. i didnt even though it could be hard coded..
display.c has moved to src/core/display.c in last metacity releases but same kind of patch still works
Left by Christophe on February 23rd, 2009