Turning off WM's decorations using XLib?!

Turning off WM's decorations using XLib?!

Post by Andreas Koep » Fri, 09 Apr 1999 04:00:00



Hi,

I would like to know what I have to do in order to tell most WMs to turn off
all or some window decorations. As far as I know most WM's support either
the property Motif or the property Open Look used for this task.

If I want to do this on XLib level I suppose I have to use
XChangeProperty(). To turn off decorations for all Motif compatible WM I
need now the MwmHints structure definition which I do not have. I also need
the property-name to requesting the right atom.

Could perhaps someone send me the MwmHints struct definition and point out
what is needed additionaly byside of a XChangeProperty() call for my root
window? And does anyone know which WMs use which propertys - KDE, fvwm,
WindowMaker, AfterStep, Enlightenment?

I also heard that I could use override_redirect when creating my root-window
but I am not quite sure what I have to be aware of when using that
thechnique. For instance: Isn't override_redirect a real bypassing of the WM
whereby the WM doesn't get any information about my app so that my app
wouldn't even appear in a WM's taskbar?

Thanks in advance,
Andreas Koepf

 
 
 

Turning off WM's decorations using XLib?!

Post by Andreas Koep » Fri, 09 Apr 1999 04:00:00


Hi again,

here is what I found using metacrawler... It's exactly what I was looking
for! Thanx a thousand times Brian Paul!!
(copied directly from: http://www.ssec.wisc.edu/~brianp/mwmborder.c )

cIAo '`' Andreas Koepf

Source follows:

// ===> BEGIN
/* mwmborder.c */

/*
 * This function shows how to remove the border, title bar, resize button,
 * etc from a Motif window frame from inside an Xlib-based application.
 *

 */

#include <X11/Xlib.h>
#include <X11/Xatom.h>

#define HAVE_MOTIF
#ifdef HAVE_MOTIF

#include <X11/Xm/MwmUtil.h>

#else

/* bit definitions for MwmHints.flags */
#define MWM_HINTS_FUNCTIONS (1L << 0)
#define MWM_HINTS_DECORATIONS (1L << 1)
#define MWM_HINTS_INPUT_MODE (1L << 2)
#define MWM_HINTS_STATUS (1L << 3)

/* bit definitions for MwmHints.decorations */
#define MWM_DECOR_ALL  (1L << 0)
#define MWM_DECOR_BORDER (1L << 1)
#define MWM_DECOR_RESIZEH (1L << 2)
#define MWM_DECOR_TITLE  (1L << 3)
#define MWM_DECOR_MENU  (1L << 4)
#define MWM_DECOR_MINIMIZE (1L << 5)
#define MWM_DECOR_MAXIMIZE (1L << 6)

typedef struct
{
    unsigned long flags;
    unsigned long functions;
    unsigned long decorations;
    long          inputMode;
    unsigned long status;

Quote:} PropMotifWmHints;

#define PROP_MOTIF_WM_HINTS_ELEMENTS 5

#endif

/*
 * Specify which Motif window manager border decorations to put on a
 * top-level window.  For example, you can specify that a window is not
 * resizabe, or omit the titlebar, or completely remove all decorations.
 * Input:  dpy - the X display
 *         w - the X window
 *         flags - bitwise-OR of the MWM_DECOR_xxx symbols in
X11/Xm/MwmUtil.h
 *                 indicating what decoration elements to enable.  Zero
would
 *                 be no decoration.
 */
void set_mwm_border( Display *dpy, Window w, unsigned long flags )
{
   PropMotifWmHints motif_hints;
   Atom prop, proptype;

   /* setup the property */
   motif_hints.flags = MWM_HINTS_DECORATIONS;
   motif_hints.decorations = flags;

   /* get the atom for the property */
   prop = XInternAtom( dpy, "_MOTIF_WM_HINTS", True );
   if (!prop) {
      /* something went wrong! */
      return;
   }

   /* not sure this is correct, seems to work, XA_WM_HINTS didn't work */
   proptype = prop;

   XChangeProperty( dpy, w,                         /* display, window */
                    prop, proptype,                 /* property, type */
                    32,                             /* format: 32-bit datums
*/
                    PropModeReplace,                /* mode */
                    (unsigned char *) &motif_hints, /* data */
                    PROP_MOTIF_WM_HINTS_ELEMENTS    /* nelements */
                  );

Quote:}

// ===> END.



Quote:> Hi,
> I would like to know what I have to do in order to tell most WMs to turn
off
> all or some window decorations. As far as I know most WM's support either
> the property Motif or the property Open Look used for this task.

> If I want to do this on XLib level I suppose I have to use
> XChangeProperty(). To turn off decorations for all Motif compatible WM I
> need now the MwmHints structure definition which I do not have. I also
need
> the property-name to requesting the right atom.
> Could perhaps someone send me the MwmHints struct definition and point out
> what is needed additionaly byside of a XChangeProperty() call for my root
> window? And does anyone know which WMs use which propertys - KDE, fvwm,
> WindowMaker, AfterStep, Enlightenment?
> I also heard that I could use override_redirect when creating my
root-window
> but I am not quite sure what I have to be aware of when using that
> thechnique. For instance: Isn't override_redirect a real bypassing of the
WM
> whereby the WM doesn't get any information about my app so that my app
> wouldn't even appear in a WM's taskbar?
> Thanks in advance,
> Andreas Koepf


 
 
 

Turning off WM's decorations using XLib?!

Post by David B. Lew » Fri, 09 Apr 1999 04:00:00


|> I would like to know what I have to do in order to tell most WMs to turn off
|> all or some window decorations. As far as I know most WM's support either

You can't, really.

|> the property Motif or the property Open Look used for this task.

That's about all you can do, and hope for the best.

|> thechnique. For instance: Isn't override_redirect a real bypassing of the WM
|> whereby the WM doesn't get any information about my app so that my app
|> wouldn't even appear in a WM's taskbar?

Exactly.

--
David B. Lewis      Editor, The Motif Developer: http://www.motifzone.com/tmd/

 
 
 

1. Using crontab to turn on and off 'mesg'

Hello, I have been using Linux for a long time but this one has me
stumped. I want to turn off messages (mesg n) at 11pm and turn them back
on (mesg y) at 7am. The entries in my crontab look like this:

0 23 * * * /usr/bin/mesg n 2>&1 1>/dev/null
0 7 * * * /usr/bin/mesg y 2>&1 1>/dev/null

Apparently, the command does not get run, and I get a damned email every
time it unsuccessfully executes both lines. I have several other crontab
entries (taking pictures, deleting old files, etc.) and they all work
fine. I have read the FM, and I do not use RedHat 4.2

From the command line, if I type in:

/usr/bin/mesg y 1>/dev/null

It toggles the mesg from n to y. But if I then type in:

/usr/bin/mesg n 2>/dev/null

It has no effect. Does 'mesg' send something important to stderr? If so,
is there a way to get it to work AND to not get those damned emails from
cron?

Any help will be appreciated..
--
http://207.42.61.74       Online image!!!       ftp://207.42.61.74/pub
   ***   Need Linux users in Atlanta area to help establish   ***
   ***            a voice/data LOS laser network              ***

2. Help - No Server Configured to Handle Request PUT ?

3. Can't turn off handshaking using ioctl

4. Backspace

5. Monitor turned off itself when using SVGALib's applications

6. CD-ROM 1.2.13 [R420] and +1024 cyl drives

7. Employment Opportunity

8. ''Charlie Root'' System Monitor - TURN OFF

9. How do I remove WM decorations in X?

10. Turning off 'talk' help. . .

11. turn off '^S' (XON/XOFF)

12. Turning 'ping' off, please help.