Re: Status?



Nathan Clemons wrote:
> 
> On Wed, 25 Aug 1999 14:34:00 Sam Lantinga wrote:
> |> Hi, we would like to support the various window managers, and our
> |> windows come in two flavors (toggled at run-time):
> |>
> |> 1.  Normal
> |> 2.  Decorationless, but still managed normally.
> |>
> |> What hints do we use to switch between the two?
> |> Is there example code available that we can look at?
> |>
> |> FYI, we're a game company, porting games to Linux:
> |>      http://www.lokigames.com/
> |> --
> |>      -Sam Lantinga, Lead Programmer, Loki Entertainment Software
> |>
> 
> Greetings Sam.
> 
> I've heard a lot about the company you work for of late, and you guys
> are doing a good job proving that Linux is not just for the server
> environment. What better method than games to prove it's dor the desktop
> as well?
> 
> This list is mainly for introducing a specification of _new_ window manager
> hints (ie, in addition to the MWM hint, etc.) to be compatible with GNOME,
> KDE, etc.
> 
> However, could someone please respond to Sam and help him with his question?
> Support for companies like Loki is a good thing to come from the Linux
> community that Loki is embracing. Please cc: me when you do so so that I
> can make sure that he's all set.
> 
> --Nathan

I apologize for posting a message not related to the content of the
list.

However, let me give a brief update so people can comment privately, if
they want.

We decided to go with MWM hints and the following code:

Remove titlebar:
            Atom WM_HINTS;
            Display *display;
            Window window;

            /* First try to set MWM hints */
            WM_HINTS = XInternAtom(display, "_MOTIF_WM_HINTS", True);
            if ( WM_HINTS != None ) {
#               define    MWM_HINTS_DECORATIONS    (1L << 1)
                MWM_Hints MWMHints = { MWM_HINTS_DECORATIONS, 0, 0, 0, 0
};

                XChangeProperty(display, window, WM_HINTS, WM_HINTS, 32,
                                PropModeReplace, (unsigned char
*)&MWMHints,
                                sizeof(MWMHints)/4);
                wm_type = Motif_WM;
            }
            /* Now try to set KWM hints */
            WM_HINTS = XInternAtom(display, "KWM_WIN_DECORATION", True);
            if ( WM_HINTS != None ) {
                long KWMHints = 0;

                XChangeProperty(display, window, WM_HINTS, WM_HINTS, 32,
                                PropModeReplace, (unsigned char
*)&KWMHints,
                                sizeof(KWMHints)/4);
                wm_type = KDE_WM;
            }
            /* Now try to set GNOME hints */
            WM_HINTS = XInternAtom(display, "_WIN_HINTS", True);
            if ( WM_HINTS != None ) {
                long GNOMEHints = 0;

                XChangeProperty(display, window, WM_HINTS, WM_HINTS, 32,
                                PropModeReplace, (unsigned char
*)&GNOMEHints,
                                sizeof(GNOMEHints)/4);
                wm_type = GNOME_WM;
            }

Adding a titlebar:
            Atom WM_HINTS;
            Display *display;
            Window window;

            switch(wm_type){
                case GNOME_WM:
                case Motif_WM:
                  WM_HINTS = XInternAtom(display, "_MOTIF_WM_HINTS",
True);
                  break;
                case KDE_WM:
                  WM_HINTS = XInternAtom(display, "KWM_WIN_DECORATION",
True);
                  break;
            }
            XDeleteProperty(display,window,WM_HINTS);

The title-bar state change is followed with a window remapping sequence.
Using the above sequence, title-less windows seem to be click-raisable
using default window manager configurations on GNOME and KDE.  FVWM and
afterstep do proper alt-tab and autoraise on title-less windows.

If I'm missing something, or anyone has any suggestions, I welcome your
feedback.:)
-- 
	-Sam Lantinga, Lead Programmer, Loki Entertainment Software



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]