Application-controlled window dragging



Hey everyone.

I'm working on an experimental project at VMware that will require us to have greater control over a window's position while the window manager is dragging it. We'd need to basically give the application more control over the movement of the window, yet allow the the window manager to apply whatever effects and conditions it would typically apply while moving a window. We'd need to let the application, for example, prevent the window from going past a certain part of the screen, or to stay within a bounding box, or to just prevent it from moving over another window.

We need this for custom shaped windows without standard window decorations. Right now, we go the xmms, etc. route and listen to mouse events and reposition the window, but 1) we won't be able to move off the left side of the screen on Metacity (as Metacity seems to only allow that when it's moving the window) and 2) we won't get any window manager effects when moving (such as wobbly windows).

Ideally, to allow the greatest flexibility, I'd like to see messages similar to _NET_WM_MOVERESIZE that performs any effects the window manager would normally use with a moving window, except instead of grabbing the mouse, the application would have the responsibility of listening to mouse events and moving the window. To the user, it would look like the window is moving normally, but the application would be in full control of the move operation.

There would be two messages, one for beginning the operation, and one for ending it. The _BEGIN operation would be fairly similar to _NET_WM_MOVERESIZE, though without the button parameter (I don't think it'd be needed)? The _END would merely finalize the _BEGIN operation. It'd be the equivalent of releasing the mouse button used to drag the window.

Another option would be to introduce two new flags for the existing _NET_WM_MOVERESIZE that would initiate and finalize this operation. Maybe this is the right thing to do, so long as there's a way we can detect whether this is supported from the application.

Thoughts?

Christian

--
Christian Hammond - chipx86 chipx86 com
VMware, Inc.

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]