What is probably needed is a property on the root window that
both apps pay attention to, sort of like a mutex.   The first one
to get there sets it and the other honors this request.

In the case of xlock, you have a problem since the purpose is to
lock the screen.  I would think that you would have to have special
code in xbattbar to yield to xlock, since it is probably more
important to lock your screen than display your battery life.
On the hand, you might want to make that configurable.

Rick


Hi!

This is a general question on X client design. Please excuse me that
it is not directly related to the XFree86 Project.

Imagine there are two clients running the same code:

    while (!done)
    {
        XWindowEvent(... | VisibilityChangeMask, &theEvent);
        switch (theEvent.type)
        {
        ...
        case VisibilityNotify:
            XRaiseWindow(...);
            break;
        }
    }

Obviously, there's a race here. Both clients are fighting to get on top.

There's a real example of this problem. One application is called
xbattbar (which is a battery status indicator), another is xlock
(used as screensaver).

What would be the right way to solve this problem?


Thanks for any answers in advance!



-- +--------------------------------------------------------------------------+ | Rick Beldin | Hewlett-Packard Company | | | Global Solutions Engineering | | | 20 Perimeter Summit | | | Atlanta, GA 30319 | +--------------------------------------------------------------------------+


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

Reply via email to