[PATCH] compiz - Auto unmaximize when attempting to drag maximized window (like Metacity).

Colin Guthrie xorg at colin.guthr.ie
Sun Apr 23 16:24:30 PDT 2006


(sorry - daft me got the subject wrong!! - the rest of the message is 
the same)

Hi,

I attach my first compiz patch for you David or Dan!

I've adjusted the "move" plugin to allow the user to attempt to move a
maximized window by dragging the title bar. The user will be able to
move their mouse as normal when making this drag attempt but the window
will do nothing (as it's maximized). If the mouse moves in the y
direction past a threshold (currently hard coded to 100px), the window
will automatically unmaximize itself and allow the user to drag/move the
window as if it was not maximized. If the user drops the window, it will
stay in it's new non-maximized state, if however the user moves the
window near the top of the screen again (currently set at a threshold of
20px), the window will automatically become maximized again.

This allows you to e.g. "rip" a maximized window of the top of your
desktop, move the (now unmaximized) window such that your mouse reaches
the corner of your cube and it automatically edge-flips to the next cube
face, where you can move the window to within 20px of the top of the
screen and it will maximize itself again.

Note that it will only maximize windows in the 20px zone if they were
originally maximazed when the drag started.

There is a slight bug where if you move cube faces and drag to the top
of the screen too quicky that the maximize operation will called prior
to the cube flip finishing and the window will be maximized on the
previous cube face. Draging back out from 100px will lead to some
sillyness, but I've not lost a window yet!!

Try it, I think it adds a lot of functionality!

I've attached two versions of the same patch. One contains several
whitespace changes (tryed to format the code so I could read it... ),
the other contains the differences without the whitespace changes (diff -b).

Hope you like it.

Col.
-- 

+------------------------+
|     Colin Guthrie      |
+------------------------+
| xorg(at)colin.guthr.ie |
| http://colin.guthr.ie/ |
+------------------------+

-------------- next part --------------
A non-text attachment was scrubbed...
Name: maximize_no_whitespace.diff
Type: text/x-patch
Size: 2001 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg/attachments/20060424/71d28537/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: maximize_move.4space_indent.diff
Type: text/x-patch
Size: 4045 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg/attachments/20060424/71d28537/attachment-0001.bin>


More information about the xorg mailing list