Re: Patch to TWM to make NoGrabServer affect resize as well as move

2004-10-08 Thread Greg Stark
Carsten Haitzler (The Rasterman) [EMAIL PROTECTED] writes:

 it is doing it to guarantee it can undraw its rubber banded xored lines to
 display the outline where u are moving to or resizing to. if you disable this
 you will get display artifacts and garbage on your screen if a program redraws
 or changes its window contents while u are moving and resizing and a rubber band
 is over that window.

Yeah, I actually figured that out after I sent the message.

Personally, while the rubber band artifacts are bad, the grabbed server is
worse. There is no opaque resize option in twm. I would welcome an option to
do opaque resizes or use some other method for avoiding the artifacts, but in
the meantime I would really like to get away without the grabs.

It's not like NoGrabServer is the default. Anyone enabling it can make the
decision for themselves if they prefer the visual correctness of the grab but
the practical problems of frozen clients versus the practical benefits of
avoiding the grab but the minor problems it causes.

-- 
greg

___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel


Re: Patch to TWM to make NoGrabServer affect resize as well as move

2004-10-07 Thread The Rasterman
On 08 Oct 2004 01:29:44 -0400 Greg Stark [EMAIL PROTECTED] babbled:

 I got annoyed at twm grabbing the server whenever I resized windows. I mean
 seriously annoyed. It freezes videos playing in other windows, even other
 screens. This plays havoc with streaming network connections.
 
 So I looked at the code. It doesn't seem to me that there's anything more
 special about resizing than moving or the other cases where the grab can be
 disabled by the user. 
 
 Is there some danger I'm unaware of that makes it absolutely critical to grab
 the server during the resize? Or is twm just doing it specially to annoy me.
 
 I tried the following patch and everything seems to be working fine. I haven't
 run into any problems at all from it. And my video now plays smoothly while
 I'm resizing windows. I'm much happier now.

it is doing it to guarantee it can undraw its rubber banded "xored" lines to
display the outline where u are moving to or resizing to. if you disable this
you will get display artifacts and garbage on your screen if a program redraws
or changes its window contents while u are moving and resizing and a rubber band
is over that window.

here is a simple way to show it:

open 2 xterms.
in 1 xterm type:

sleep 5; cat /etc/passwd

now go resize the other window but dont let GO of the mouse. make sure one of
the resize outlines is over the xterm you typed the above command into at the
time the sleep command ends... now keep resizing... notice how it will LEAVE the
band mark there needing you to xrefresh or force xterm to redraw somehow.

THIS is why twm grabs the server. XOR banded rendering of outlines and allowing
programs to draw in their windows are mutually exclusive. the solution is to use
opaque moves, resizes or have twm display the rubber band without using
includeinferiros and scribbling all of the the screen with xor'ed lines. (using
4 small windows to indicate a box/band and move/resize those windows around for
example).

(nb - i have skipped xdamage etc. that COULD let u know if an app had damaged a
window or region that you just scribbled on with xor).

 --- xc/programs/twm/resize.c.~1~  2001-12-14 15:01:09.0 -0500
 +++ xc/programs/twm/resize.c  2004-10-07 17:41:03.0 -0400
 @@ -163,7 +163,8 @@
  unsigned int junkbw, junkDepth;
  
  ResizeWindow = tmp_win-frame;
 -XGrabServer(dpy);
 +if (!Scr-NoGrabServer)
 + XGrabServer(dpy);
  XGrabPointer(dpy, Scr-Root, True,
  ButtonPressMask | ButtonReleaseMask |
   ButtonMotionMask | PointerMotionHintMask,
 @@ -206,7 +207,8 @@
  TwmWindow *tmp_win;
  int x, y, w, h;
  {
 -XGrabServer(dpy);
 +if (!Scr-NoGrabServer)
 + XGrabServer(dpy);
  XGrabPointer(dpy, Scr-Root, True,
  ButtonPressMask | ButtonMotionMask | PointerMotionMask,
  GrabModeAsync, GrabModeAsync,
 @@ -249,7 +251,8 @@
  TwmWindow *tmp_win;
  int x, y, w, h;
  {
 -XGrabServer(dpy);
 +if (!Scr-NoGrabServer)
 + XGrabServer(dpy);
  XGrabPointer(dpy, Scr-Root, True,
  ButtonReleaseMask | ButtonMotionMask | PointerMotionHintMask,
  GrabModeAsync, GrabModeAsync,
 
 
 -- 
 greg
 
 ___
 Devel mailing list
 [EMAIL PROTECTED]
 http://XFree86.Org/mailman/listinfo/devel
 


-- 
- Codito, ergo sum - "I code, therefore I am" --
The Rasterman (Carsten Haitzler)[EMAIL PROTECTED]
裸好多  [EMAIL PROTECTED]
Tokyo, Japan (東京 日本)
___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel