I need help with mouse resize

Hi, I need some help with mouse resize (maybe Brandon is around?). Basically, I'm going to use what Brandon suggested: check for a button event on the lower right corner of the window (I'm thinking about a 4 pixels wide square). The problem is that the window's mask doesn't include button press events. Now I'm puzzled (due to my ignorance): should I change that? should I add some other decorations in the window's corners and set their event mask? I do not really know what happens in other WM and, since this is not like our mouseResizeWindow (which is basically a key binding and is not related to button events), I don't know what I should do. Any direction is appreciated. Andrea ps: I must confess I do not think this is an indispensable feature... it would be nice though. But now that I'm going to push a patch that unifies mouse focus and mouse drag (which means that you can start grabbing an unfocused window) I think that what is really needed is there...;)

On Feb 11, 2008, at 6:35 , Andrea Rossato wrote:
Basically, I'm going to use what Brandon suggested: check for a button event on the lower right corner of the window (I'm thinking about a 4 pixels wide square).
The problem is that the window's mask doesn't include button press events. Now I'm puzzled (due to my ignorance): should I change that? should I add some other decorations in the window's corners and set their event mask?
The usual way to do this is to place a transparent window (InputOnly, often called an "event window") over the place where you want to intercept clicks and select for ButtonPress on it. Selecting for ButtonPress on the whole window (a) requires you to calculate whether to pay attention to it or not (b) complicates things when the application owning the window is *also* selecting for ButtonPress in the same area. -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH

On Mon, Feb 11, 2008 at 02:12:02PM -0500, Brandon S. Allbery KF8NH wrote:
The usual way to do this is to place a transparent window (InputOnly, often called an "event window") over the place where you want to intercept clicks and select for ButtonPress on it. Selecting for ButtonPress on the whole window (a) requires you to calculate whether to pay attention to it or not (b) complicates things when the application owning the window is *also* selecting for ButtonPress in the same area.
b) is the real problem I think, which basically makes my attempted approach wrong: the application will prevail and you won't be able to move the window, unless you grab the border (when there is one). Moreover, I came to the conclusion that mouse resize is *not* related to decorations (only mouse focus and mouse drag are, since the pointer is operating with the decorations). So I'm going to remove the code from Decoration and write a layout modifier in a separated contrib module (as you suggested at the beginning on IRC if I remember correctly), to be used together with WindowArranger and any possible layout (with decorated ones among them). This way we can have different approaches (grabbing the corner, the corners, the borders too and so on). Thanks. Andrea
participants (2)
-
Andrea Rossato
-
Brandon S. Allbery KF8NH