Domingo Alvarez Duarte wrote:
> Reading the documentation I couldn't find any reference to it.
> 

        Rainbowsally sent me the following over the weekend;
        I've not tried it myself, but it may be of use.

        This sort of thing should maybe be added to FLTK as a method,
        with docs that include caveats about any window manager specific
        mis-behaviors..

**********************************************************************************

To: Greg Ercolano
From: rainbowsally
Subject: got it... finally. A window that stays on top of ALL other windows in 
X11

[..]

In sendxjunk, add...

-----------------------------------------------------------------
  // Make it stay on top... -rs
  // new flag? or check if modal & some other flag?
  if(window->stays_on_top())
  {
    Atom cmd[3]; // 2 would probably be enough
      cmd[0] = _NET_WM_STATE_ABOVE;
      cmd[1] = _NET_WM_STATE_STAYS_ON_TOP;
      cmd[2] = 0;
    XChangeProperty(xdisplay, xid, _NET_WM_STATE,
                    XA_ATOM, 32, PropModeReplace, (uchar*)cmd, 2);
  }
-----------------------------------------------------------------

I put mine near the bottom of the sendxjunk routine, which also exists in 1.x

These atoms...

  _NET_WM_STATE
  _NET_STATE_ABOVE
  _NET_STATE_STAYS_ON_TOP

are all declared and defined exactly like the other atoms are.

In 2x I had to monkey with MAX_ATOMS in order to get the new ones in.  Not
sure about any 1.x issues.

[..]

Turns out that no override necessary in X but this may only be true for kde.
I haven't tried it in any other wm's yet.

[In Windows this feature can be set using the WS_TOPMOST style flag during 
creation,
I think.]

One gotcha with the stays_on_top thing is that if you hide the window and then
show it again, the property will get mangled and have to be reset somehow.

Test with other window managers.

FVWM: Does not stay on top and in fact doesn't even draw right in the first 
place.
TWM: Stays on top and does draw right.
WindowMaker: Stays on top, draws right, and can be dragged with mouse.

Looks good.  And I was hoping it would work with WindowMaker (NextStep).
It's very pretty.  :-)

That one gotcha came up in the case of version 2.x "ShapedWindow".
If version 3.x plans to use a similar concept, beware!!  The shaped window
should NOT hide() and show().

This causes two problems.  One is that it ALWAYS puts the shaped window behind
something else, and two, it clobbers the stays_on_top property.
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to