On Sun,  4 Mar 2012 at 17:31:52 +0100, Rodolfo García Peñas wrote:
> 
> Subject: [PATCH] WindowMaker: Tech+opaque resize
> 
> This patch solves a problem when the user set "technical" and "opaque" flags 
> and then resize the window.
> The pach also removes some curly brackets and make some if-else easier.

Thanks for the patch!

But please, don't mix cleanups with bug fixes. If you want to clean the
style a bit (which is nice) you should write the cleanup patch first
doing just the cleanup. Then you write the smaller bug fix, trying
to explain in the message what happened etc.
It makes reviewing much easier.

In any case, thanks a lot for fixing the bug!

> ---
>  src/moveres.c |   41 ++++++++++++++++++++---------------------
>  1 files changed, 20 insertions(+), 21 deletions(-)
> 
> diff --git a/src/moveres.c b/src/moveres.c
> index a232fbe..6563258 100644
> --- a/src/moveres.c
> +++ b/src/moveres.c
> @@ -2016,36 +2016,36 @@ void wMouseResizeWindow(WWindow * wwin, XEvent * ev)
>  
>                               /* Draw the resize frame for the first time. */
>                               mapGeometryDisplay(wwin, fx, fy, fw, fh);
> -                             if (!opaqueResize) {
> +
> +                             if (!opaqueResize)
>                                       drawTransparentFrame(wwin, fx, fy, fw, 
> fh);
> -                             };
> +
>                               showGeometry(wwin, fx, fy, fx + fw, fy + fh, 
> res);
>  
>                               started = 1;
>                       }
>                       if (started) {
> -                             if (wPreferences.size_display == 
> WDIS_FRAME_CENTER) {
> -                                     if (!opaqueResize) {
> -                                             drawTransparentFrame(wwin, 
> orig_fx, orig_fy, orig_fw, orig_fh);
> -                                     };
> +                             if (!opaqueResize)
> +                                     drawTransparentFrame(wwin, orig_fx, 
> orig_fy, orig_fw, orig_fh);
> +
> +                             if (wPreferences.size_display == 
> WDIS_FRAME_CENTER)
>                                       moveGeometryDisplayCentered(scr, fx + 
> fw / 2, fy + fh / 2);
> -                                     if (!opaqueResize) {
> -                                             drawTransparentFrame(wwin, fx, 
> fy, fw, fh);
> -                                     };
> -                             } else {
> -                                     if (!opaqueResize) {
> -                                             drawTransparentFrame(wwin, 
> orig_fx, orig_fy, orig_fw, orig_fh);
> -                                             drawTransparentFrame(wwin, fx, 
> fy, fw, fh);
> -                                     };
> -                             }
> +
> +                             if (!opaqueResize)
> +                                     drawTransparentFrame(wwin, fx, fy, fw, 
> fh);
> +
>                               if (fh != orig_fh || fw != orig_fw) {
> -                                     if (wPreferences.size_display == 
> WDIS_NEW) {
> +                                     if (wPreferences.size_display == 
> WDIS_NEW)
>                                               showGeometry(wwin, orig_fx, 
> orig_fy, orig_fx + orig_fw,
>                                                            orig_fy + orig_fh, 
> res);
> -                                     }
> +
>                                       showGeometry(wwin, fx, fy, fx + fw, fy 
> + fh, res);
>                               }
> +
>                               if (opaqueResize) {
> +                                     /* Fist clean the geometry line */
> +                                     showGeometry(wwin, fx, fy, fx + fw, fy 
> + fh, res);
> +                                     /* Now, continue drawing */
>                                       XUngrabServer(dpy);
>                                       wwin->flags.user_changed_width = 1;
>                                       moveGeometryDisplayCentered(scr, fx + 
> fw / 2, fy + fh / 2);
> @@ -2065,9 +2065,9 @@ void wMouseResizeWindow(WWindow * wwin, XEvent * ev)
>                       if (started) {
>                               showGeometry(wwin, fx, fy, fx + fw, fy + fh, 
> res);
>  
> -                             if (!opaqueResize) {
> +                             if (!opaqueResize)
>                                       drawTransparentFrame(wwin, fx, fy, fw, 
> fh);
> -                             }
> +
>                               XUngrabKeyboard(dpy, CurrentTime);
>                               WMUnmapWidget(scr->gview);
>                               XUngrabServer(dpy);
> @@ -2092,9 +2092,8 @@ void wMouseResizeWindow(WWindow * wwin, XEvent * ev)
>               }
>       }
>  
> -     if (wPreferences.auto_arrange_icons && wXineramaHeads(scr) > 1 && head 
> != wGetHeadForWindow(wwin)) {
> +     if (wPreferences.auto_arrange_icons && wXineramaHeads(scr) > 1 && head 
> != wGetHeadForWindow(wwin))
>               wArrangeIcons(scr, True);
> -     }
>  }
>  
>  #undef LEFT
> -- 
> 1.7.7.3
> 
> -- 
> ||// //\\// Rodolfo "kix" Garcia
> ||\\// //\\ http://www.kix.es/

> From 65f2fbf1e6befe918681a59f806260c8277ee5fc Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?"Rodolfo=20Garc=C3=ADa=20Pe=C3=B1as=20(kix)"?= <[email protected]>
> Date: Sun, 4 Mar 2012 09:20:49 +0100
> Subject: [PATCH] WindowMaker: Tech+opaque resize
> 
> This patch solves a problem when the user set "technical" and "opaque" flags 
> and then resize the window.
> The pach also removes some curly brackets and make some if-else easier.
> ---
>  src/moveres.c |   41 ++++++++++++++++++++---------------------
>  1 files changed, 20 insertions(+), 21 deletions(-)
> 
> diff --git a/src/moveres.c b/src/moveres.c
> index a232fbe..6563258 100644
> --- a/src/moveres.c
> +++ b/src/moveres.c
> @@ -2016,36 +2016,36 @@ void wMouseResizeWindow(WWindow * wwin, XEvent * ev)
>  
>                               /* Draw the resize frame for the first time. */
>                               mapGeometryDisplay(wwin, fx, fy, fw, fh);
> -                             if (!opaqueResize) {
> +
> +                             if (!opaqueResize)
>                                       drawTransparentFrame(wwin, fx, fy, fw, 
> fh);
> -                             };
> +
>                               showGeometry(wwin, fx, fy, fx + fw, fy + fh, 
> res);
>  
>                               started = 1;
>                       }
>                       if (started) {
> -                             if (wPreferences.size_display == 
> WDIS_FRAME_CENTER) {
> -                                     if (!opaqueResize) {
> -                                             drawTransparentFrame(wwin, 
> orig_fx, orig_fy, orig_fw, orig_fh);
> -                                     };
> +                             if (!opaqueResize)
> +                                     drawTransparentFrame(wwin, orig_fx, 
> orig_fy, orig_fw, orig_fh);
> +
> +                             if (wPreferences.size_display == 
> WDIS_FRAME_CENTER)
>                                       moveGeometryDisplayCentered(scr, fx + 
> fw / 2, fy + fh / 2);
> -                                     if (!opaqueResize) {
> -                                             drawTransparentFrame(wwin, fx, 
> fy, fw, fh);
> -                                     };
> -                             } else {
> -                                     if (!opaqueResize) {
> -                                             drawTransparentFrame(wwin, 
> orig_fx, orig_fy, orig_fw, orig_fh);
> -                                             drawTransparentFrame(wwin, fx, 
> fy, fw, fh);
> -                                     };
> -                             }
> +
> +                             if (!opaqueResize)
> +                                     drawTransparentFrame(wwin, fx, fy, fw, 
> fh);
> +
>                               if (fh != orig_fh || fw != orig_fw) {
> -                                     if (wPreferences.size_display == 
> WDIS_NEW) {
> +                                     if (wPreferences.size_display == 
> WDIS_NEW)
>                                               showGeometry(wwin, orig_fx, 
> orig_fy, orig_fx + orig_fw,
>                                                            orig_fy + orig_fh, 
> res);
> -                                     }
> +
>                                       showGeometry(wwin, fx, fy, fx + fw, fy 
> + fh, res);
>                               }
> +
>                               if (opaqueResize) {
> +                                     /* Fist clean the geometry line */
> +                                     showGeometry(wwin, fx, fy, fx + fw, fy 
> + fh, res);
> +                                     /* Now, continue drawing */
>                                       XUngrabServer(dpy);
>                                       wwin->flags.user_changed_width = 1;
>                                       moveGeometryDisplayCentered(scr, fx + 
> fw / 2, fy + fh / 2);
> @@ -2065,9 +2065,9 @@ void wMouseResizeWindow(WWindow * wwin, XEvent * ev)
>                       if (started) {
>                               showGeometry(wwin, fx, fy, fx + fw, fy + fh, 
> res);
>  
> -                             if (!opaqueResize) {
> +                             if (!opaqueResize)
>                                       drawTransparentFrame(wwin, fx, fy, fw, 
> fh);
> -                             }
> +
>                               XUngrabKeyboard(dpy, CurrentTime);
>                               WMUnmapWidget(scr->gview);
>                               XUngrabServer(dpy);
> @@ -2092,9 +2092,8 @@ void wMouseResizeWindow(WWindow * wwin, XEvent * ev)
>               }
>       }
>  
> -     if (wPreferences.auto_arrange_icons && wXineramaHeads(scr) > 1 && head 
> != wGetHeadForWindow(wwin)) {
> +     if (wPreferences.auto_arrange_icons && wXineramaHeads(scr) > 1 && head 
> != wGetHeadForWindow(wwin))
>               wArrangeIcons(scr, True);
> -     }
>  }
>  
>  #undef LEFT
> -- 
> 1.7.7.3
> 


-- 
To unsubscribe, send mail to [email protected].

Reply via email to