[Message Prev][Message Next][Thread Prev][Thread Next][Message Index][Thread Index]

bug with backing store



One of our fvwm users has noticed a bug in rdesktop that shows up
when rdesktop runs under fvwm.  The latest stable fvwm release
(fvwm-2.4.4) will do.  You can get a copy at http://fvwm.org.

This is the original bug report:
------------------------------------ snip ---------------------------------
When starting rdesktop (www.rdesktop.org), a client to access Windows
servers via RDP, I get Always when I request DoesBackingStore of my
window.
This is the same on fvwm2 2.0.x and 2.4.x. But on fvwm2 2.4.x there are no
Expose events generated when uncovering parts or all of rdesktop and these
parts remain black. The whole rdesktop window gets black when I do the
fvwm2
Refresh command.

With fvwm2 2.0.x and all other WM's I tested everything is fine. rdesktop
is
the only app where I detected this problem.
------------------------------------ snip ---------------------------------

I debugged into rdesktop and noticed that backing store handling
is buggy:

If the window has backing store enabled, rdesktop assumes that the
window will never get Expose events and even explicitly asks not
to receive such events.  But that is wrong for two reasons:

 a) The X server may not have the window contents in backing store
    even if it says the window uses backing store.  This can
    happen for example if the X server runs out of memory (e.g.
    too many windows are open).
 b) Fvwm *disables* backing store for all managed windows.  The
    reason is that with modern video cards, reading the video
    memory is much slower than writing it.  Thus, redrawing the
    whole window is usually much faster, at least if the X server
    runs on the same machine as the client. Since fvwm disables
    backing store after rdesktop has looked at its backing_store
    attribute, rdesktop never notices the change from "WhenMapped"
    or "Always" to "NotUseful".

The code in xwin.c does not handle Expose events at all if
ownbackstore is off.  The intention of the code seems to be to
minimize resource usage by not keeping any information about the
window's contents if the X server claims that the window uses
backing store.  I'm afraid, but that *does not* work.  Under X,
the application *must* keep all recessary information to redraw
its windows completely and *must* handle Expose events if it does
not want to have random window contents.

The easiest way to achieve this is to enable the "ownbackstore"
logic unconditionally.  I have attached a tiny patch to show what
I mean, but I do not suggest to use the patch.  I couldn't test
the patch because I don't have access to a Windows Terminal
Server.

If you need any further assistance in fixing this problem, please
don't hesitate to contact me.

I will soon make a patch to fvwm that should eliminate the problem
between fvwm/rdesktop, so its best to stick with 2.4.4 to test
this.

Bye

Dominik ^_^  ^_^

 --
Dominik Vogt, dominik.vogt@gmx.de
Reply-To: dominik.vogt@gmx.de