FVWM: [BUG/PATCH] resize race condition

From: Albrecht Kadlec <albrecht_at_auto.tuwien.ac.at>
Date: Mon, 9 Sep 96 13:22:33 +0200

Hi,

There is an odd interaction between resize stick & paging.

I wanted to resize a sticky perfmeter window:

I select resize from the root window menu (no decorations on my
perfmeters).

When dragging the lower left border of the perfmeter into the lower left
border of the page (lower middle page of my 4x2 desktop), I release the
button, just while the page flips.

Then the window is gone.

Not on any page, of the desktop any more (I use only one desktop)

Simply not mapped.

The process is still there and must be killed.

If I release the button AFTER the pageflip, everything is fine (not
exactly, as I wanted the window to stay on that page, and not to span over
two pages, but well, it's still there at least).

Ok, so I changed my .fvwm2rc for perfmeters to be seen in the windowlist:

When I select the "missing" perfmeter, I get warped to the next (right)
page.

Strange. nothing's there.
I retry.
I get warped to the next page.

And so on, till I'm at the rightmost page.

A closer look at the windowlist reveals: position: +1400-74


It's now a sticky window with position on "right page" (i.e:
screenxsize+xxx), so it's always just on the _next_ page.

Always just one page away, but forever unreachable.
Unless I could do some "unstick -> select from windowlist" :-(

BTW: Chuck, have you decided on my windowlist/menu changes yet?

so I got 2 possible fixes: read comments for more info.


*** resize.c.orig Mon Sep 9 11:45:24 1996
--- resize.c Mon Sep 9 13:08:32 1996
***************
*** 217,224 ****
            /* need to move the viewport */
            HandlePaging(Scr.EdgeScrollX,Scr.EdgeScrollY,&x,&y,
                         &delta_x,&delta_y,False);
! origx -= delta_x;
! origy -= delta_y;
            dragx -= delta_x;
            dragy -= delta_y;
  
--- 217,235 ----
            /* need to move the viewport */
            HandlePaging(Scr.EdgeScrollX,Scr.EdgeScrollY,&x,&y,
                         &delta_x,&delta_y,False);
!
! /* This is a little big-sisterish, as a sticky window cannot grow larger than */
! /* the screen now (well you can resize-move-resize-move-... but that's yucky */
! /* Also the not-being-moved border of the sticky window hops to the current page */
! /* after a flip. It's rather, uhm, "unmotivated & not-asked-for hopping around". */
! #if 1
! /* DON'T adjust origin for sticky windows !!! albrecht */
! if (!(tmp_win->flags & STICKY))
! #endif
! {
! origx -= delta_x;
! origy -= delta_y;
! }
            dragx -= delta_x;
            dragy -= delta_y;
  
***************
*** 248,253 ****
--- 259,283 ----
    if(!abort)
      {
        ConstrainSize (tmp_win, &dragWidth, &dragHeight);
+
+ #if 0
+ /* maybe better, less limiting fix for offscreen sticky windows: resize */
+ /* normally, then fetch it back to the current screen upon finish, if the */
+ /* dammned race condition hit. I know it's not pretty, but I can't find the */
+ /* race, I'm no X programmer. albrecht */
+ if (tmp_win->flags & STICKY) /* if it was a sticky window, move it's */
+ { /* origin back to the visible page */
+ while (origx >= Scr.MyDisplayWidth)
+ origx -= Scr.MyDisplayWidth;
+ while (origy >= Scr.MyDisplayHeight)
+ origx -= Scr.MyDisplayHeight;
+ while (origx+dragWidth <= 0)
+ origx += Scr.MyDisplayWidth;
+ while (origy+dragHeight <= 0)
+ origy += Scr.MyDisplayHeight;
+ }
+ #endif
+
        SetupFrame (tmp_win, dragx - tmp_win->bw,
                    dragy - tmp_win->bw, dragWidth, dragHeight,FALSE);
      }


albrecht

BTW: what has happened to the workers list, I only get matsushita san's and
     my own postings there since Aug 30th.
     Very private, but I'd like to see some more traffic there.
-- 
My boss thinks that giving developers enough memory helps
productivity, so as long as nobody tells him that it just makes us
write bloated software, I don't have a problem.
						-- Per Abrahamsen
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to majordomo_at_hpc.uh.edu.
To report problems, send mail to fvwm-owner_at_hpc.uh.edu.
Received on Mon Sep 09 1996 - 06:32:41 BST

This archive was generated by hypermail 2.3.0 : Mon Aug 29 2016 - 19:37:59 BST