On Fri, Sep 30, 2005 at 06:55:16AM +0200, Viktor Griph wrote:
> On Thu, 29 Sep 2005, Dominik Vogt wrote:
> >On Thu, Sep 29, 2005 at 02:09:49AM -0500, fvwm-workers wrote:
> >>CVSROOT:    /home/cvs/fvwm
> >>Module name:        fvwm
> >>Changes by: griph   05/09/29 02:09:48
> >>
> >>Modified files:
> >>    .              : ChangeLog NEWS
> >>    fvwm           : frame.c move_resize.c
> >>
> >>Log message:
> >>fixes for resizing shaded windows, and windows changed by complex 
> >>functions
> >>as
> >>AddToFunc ResizeShadedOpaque
> >>+ I WindowShade off
> >>+ I Resize
> >>+ I WindowShade on
> >
> >Can you please post the diffs on frame.c and explain what you
> >did?  I've been working on some resize-when-shaded issues a
> >while ago but had to stop because the patch became too
> >difficult to manage and I wanted to think more about it first.
> 
> The diffs is attached. The first two hunks are for the complex function 
> fix. There I simply unset the pressed window part if it has moved, to 
> avoid it being used as a starting point for resizes.

But that breaks

  Style * DepressableBorder

for resize.  And if the complex function looks like this:

  addtofunc foo
  + i resize
  + i menu somemenu

the menu will not stick to the border because the context window
is gone.  (Actually that currently works only with the title and
the title buttons, not with the window border, but I think that is
a bug).

I think this part of the patch should be removed.  Can you please
demonstrate the problem you tried to solve?

> The last hunk is for the resizing of the client area of shaded windows. 
> The only change is that, for shaded windows, the get_client_geometry 
> function (that calculates the client geometry based on the frame and 
> border) is used instead of querying the geometry of the client window. 
> That makes the unshading to resize the client window to the correct size 
> during the unshade, and not to the size it had when the window was first 
> shaded.

Very good patch!  I tried to fix it myself but ended up with a far
more complex solution that did not work either.  I never thought
of such a simple approach :-)

> >Also, latest CVS does not compile without warnings:
> >[snip]
> Ooops. Sorry about that. What was the compiler flags that should be used 
> to disable all ignorable warnings?

gcc-2.95.x:

  make CFLAGS="-g -O2 -Wall -Werror"

gcc-3.x and gcc-4.x:

  make CFLAGS="-g -O2 -Wall -Wpointer-arith -fno-stric-aliasing -Werror"

> --- frame.c.~1.60.~   2005-09-20 23:15:34.000000000 +0200
> +++ frame.c   2005-09-29 08:39:46.000000000 +0200
> @@ -45,6 +45,8 @@
>  
>  /* ---------------------------- imports ------------------------------------ 
> */
>  
> +extern Window PressedW;
> +
>  /* ---------------------------- included code files ------------------------ 
> */
>  
>  /* ---------------------------- local types -------------------------------- 
> */
> @@ -290,15 +292,53 @@
>               }
>               if (diff_g != NULL)
>               {
> +                     /* Reset PressedW to NULL if the part has moved.
> +                      * This prevents strange ref points from being used 
> +                      * in resize if the window is unshaded or moved via a
> +                      * complex function before a resize. 
> +                      * If this isn't desired a flag will be needed to
> +                      * indicate that a part has moved. */
>                       if (part == PART_BORDER_NE || part == PART_BORDER_E ||
>                           part == PART_BORDER_SE)
>                       {
>                               xwc.x -= diff_g->width;
> +                             if (PressedW == FW_W_SIDE(fw,1) ||
> +                                 PressedW == FW_W_CORNER(fw, 1) ||
> +                                 PressedW == FW_W_CORNER(fw, 3))
> +                             {
> +                                     PressedW = NULL;
> +                             }
>                       }
>                       if (part == PART_BORDER_SW || part == PART_BORDER_S ||
>                           part == PART_BORDER_SE)
>                       {
>                               xwc.y -= diff_g->height;
> +                             if (PressedW == FW_W_SIDE(fw,2)||
> +                                 PressedW == FW_W_CORNER(fw, 2) ||
> +                                 PressedW == FW_W_CORNER(fw, 3))
> +                             {
> +                                     PressedW = NULL;
> +                             }
> +                     }
> +                     if (part == PART_BORDER_SW || part == PART_BORDER_W ||
> +                         part == PART_BORDER_NW)
> +                     {
> +                             if (PressedW == FW_W_SIDE(fw,3)||
> +                                 PressedW == FW_W_CORNER(fw, 0) ||
> +                                 PressedW == FW_W_CORNER(fw, 2))
> +                             {
> +                                     PressedW = NULL;
> +                             }
> +                     }
> +                     if (part == PART_BORDER_NW || part == PART_BORDER_N ||
> +                         part == PART_BORDER_NE)
> +                     {
> +                             if (PressedW == FW_W_SIDE(fw,0)||
> +                                 PressedW == FW_W_CORNER(fw, 0) ||
> +                                 PressedW == FW_W_CORNER(fw, 1))
> +                             {
> +                                     PressedW = NULL;
> +                             }
>                       }
>               }
>               XConfigureWindow(dpy, w, CWWidth | CWHeight | CWX | CWY, &xwc);
> @@ -1755,20 +1795,31 @@
>       mra->w_with_focus = (fw == get_focus_window()) ? FW_W(fw) : None;
>  
>       /* calculate various geometries */
> -     rc = XGetGeometry(
> -             dpy, FW_W(fw), &JunkRoot, &mra->client_g.x, &mra->client_g.y,
> -             &mra->client_g.width, &mra->client_g.height, &JunkBW,
> -             &JunkDepth);
> -     if (rc == True)
> -     {
> -             rc = XTranslateCoordinates(
> -                     dpy, FW_W_PARENT(fw), Scr.Root, mra->client_g.x,
> -                     mra->client_g.y, &mra->client_g.x, &mra->client_g.y,
> -                     &JunkChild);
> +     if (!IS_SHADED(fw))
> +     {
> +             rc = XGetGeometry(
> +                     dpy, FW_W(fw), &JunkRoot, &mra->client_g.x,
> +                     &mra->client_g.y, &mra->client_g.width,
> +                     &mra->client_g.height, &JunkBW, &JunkDepth);
> +             if (rc == True)
> +             {
> +                     rc = XTranslateCoordinates(
> +                             dpy, FW_W_PARENT(fw), Scr.Root,
> +                             mra->client_g.x, mra->client_g.y,
> +                             &mra->client_g.x, &mra->client_g.y,
> +                             &JunkChild);
> +             }
> +             if (rc == False)
> +             {
> +                     /* Can only happen if the window died */
> +                     get_client_geometry(fw, &mra->client_g);
> +             }
>       }
> -     if (rc == False)
> +     else
>       {
> -             /* Can only happen if the window died */
> +             /* If the window was reisez while shaded the client window
> +              * will not have been resized. Use the frame to get the
> +              * geometry */
>               get_client_geometry(fw, &mra->client_g);
>       }
>       get_window_borders(fw, &mra->b_g);



Ciao

Dominik ^_^  ^_^

 --
Dominik Vogt, [EMAIL PROTECTED]

Attachment: signature.asc
Description: Digital signature

Reply via email to