XChangeProperty() questions - Xwindows

This is a discussion on XChangeProperty() questions - Xwindows ; After much difficulty and searching someone showed my how to use an XChangeProperty() call to remove Window Decorations, as follows:- XChangeProperty (display, mainWin, XInternAtom (display, "_MOTIF_WM_HINTS", False), XInternAtom (display, "_MOTIF_WM_HINTS", False), 32, PropModeReplace, (const unsigned char *) &hints, sizeof (hints) ...

+ Reply to Thread
Results 1 to 6 of 6

Thread: XChangeProperty() questions

  1. XChangeProperty() questions

    After much difficulty and searching someone showed my how to use an
    XChangeProperty() call to remove Window Decorations, as follows:-

    XChangeProperty (display, mainWin,
    XInternAtom (display, "_MOTIF_WM_HINTS", False),
    XInternAtom (display, "_MOTIF_WM_HINTS", False),
    32, PropModeReplace,
    (const unsigned char *) &hints,
    sizeof (hints) / sizeof (long));

    With hints being:-
    struct {
    unsigned long flags;
    unsigned long functions;
    unsigned long decorations;
    long input_mode;
    unsigned long status;
    } hints = {
    2, 0, 0, 0, 0,
    };


    Firstly can anyone point me at some documentation which describes
    what's in that hints structure please.

    Secondly, at present I can only get the above to be effective when
    it's run before the initial window expose event. Is it possible to
    change the window decorations 'on the fly' and, if so, what sequence
    of calls and event handling etc. is needed? Are there any good
    tutorials (and/or books) which show how to do this sort of thing or
    good examples?

    --
    Chris Green


  2. Re: XChangeProperty() questions

    usenet@isbd.co.uk wrote:
    > After much difficulty and searching someone showed my how to use an
    > XChangeProperty() call to remove Window Decorations, as follows:-
    >
    > XChangeProperty (display, mainWin,
    > XInternAtom (display, "_MOTIF_WM_HINTS", False),
    > XInternAtom (display, "_MOTIF_WM_HINTS", False),
    > 32, PropModeReplace,
    > (const unsigned char *) &hints,
    > sizeof (hints) / sizeof (long));
    >
    > With hints being:-
    > struct {
    > unsigned long flags;
    > unsigned long functions;
    > unsigned long decorations;
    > long input_mode;
    > unsigned long status;
    > } hints = {
    > 2, 0, 0, 0, 0,
    > };
    >
    >
    > Firstly can anyone point me at some documentation which describes
    > what's in that hints structure please.
    >
    > Secondly, at present I can only get the above to be effective when
    > it's run before the initial window expose event. Is it possible to
    > change the window decorations 'on the fly' and, if so, what sequence
    > of calls and event handling etc. is needed? Are there any good
    > tutorials (and/or books) which show how to do this sort of thing or
    > good examples?
    >

    MOTIF_WM_HINTS hints :-) that you are using the Motif WM, or Motif
    widgets, or both. If using Motif widgets, Any particular reason to do it
    in such a complicated way instead of just changing the XmNmwmDecorations
    and mwmFunctions resources on the shell widget?

    --
    Michel Bardiaux
    R&D Director
    T +32 [0] 2 790 29 41
    F +32 [0] 2 790 29 02
    E mailto:mbardiaux@mediaxim.be

    Mediaxim NV/SA
    Vorstlaan 191 Boulevard du Souverain
    Brussel 1160 Bruxelles
    http://www.mediaxim.com/

  3. Re: XChangeProperty() questions

    Michel Bardiaux wrote:
    > usenet@isbd.co.uk wrote:
    > > After much difficulty and searching someone showed my how to use an
    > > XChangeProperty() call to remove Window Decorations, as follows:-
    > >
    > > XChangeProperty (display, mainWin,
    > > XInternAtom (display, "_MOTIF_WM_HINTS", False),
    > > XInternAtom (display, "_MOTIF_WM_HINTS", False),
    > > 32, PropModeReplace,
    > > (const unsigned char *) &hints,
    > > sizeof (hints) / sizeof (long));
    > >
    > > With hints being:-
    > > struct {
    > > unsigned long flags;
    > > unsigned long functions;
    > > unsigned long decorations;
    > > long input_mode;
    > > unsigned long status;
    > > } hints = {
    > > 2, 0, 0, 0, 0,
    > > };
    > >
    > >
    > > Firstly can anyone point me at some documentation which describes
    > > what's in that hints structure please.
    > >
    > > Secondly, at present I can only get the above to be effective when
    > > it's run before the initial window expose event. Is it possible to
    > > change the window decorations 'on the fly' and, if so, what sequence
    > > of calls and event handling etc. is needed? Are there any good
    > > tutorials (and/or books) which show how to do this sort of thing or
    > > good examples?
    > >

    > MOTIF_WM_HINTS hints :-) that you are using the Motif WM, or Motif
    > widgets, or both. If using Motif widgets, Any particular reason to do it
    > in such a complicated way instead of just changing the XmNmwmDecorations
    > and mwmFunctions resources on the shell widget?
    >

    I'm not actually using Motif, the utility I'm playing with just uses
    the basic Xlib libraries. The initial "after much difficulty" is
    because of the problems I had finding anyone or anywhere that could
    tell me how to do this from Xlib. The above solution was the best
    anyone came up with and works as long as the Window manager complies
    with the MWM standards - apparently most do.

    Personally I think it's really down to the Window manager to handle
    this but many modern WMs don't allow the user to selectively remove
    decorations from some apps so one is forced to provide the ability in
    the application if it's one that's likely to want to run without
    decorations.

    --
    Chris Green


  4. Re: XChangeProperty() questions

    usenet@isbd.co.uk wrote:
    > Michel Bardiaux wrote:
    >
    >>usenet@isbd.co.uk wrote:
    >>
    >>>After much difficulty and searching someone showed my how to use an
    >>>XChangeProperty() call to remove Window Decorations, as follows:-
    >>>
    >>> XChangeProperty (display, mainWin,
    >>> XInternAtom (display, "_MOTIF_WM_HINTS", False),
    >>> XInternAtom (display, "_MOTIF_WM_HINTS", False),
    >>> 32, PropModeReplace,
    >>> (const unsigned char *) &hints,
    >>> sizeof (hints) / sizeof (long));
    >>>
    >>>With hints being:-
    >>> struct {
    >>> unsigned long flags;
    >>> unsigned long functions;
    >>> unsigned long decorations;
    >>> long input_mode;
    >>> unsigned long status;
    >>> } hints = {
    >>> 2, 0, 0, 0, 0,
    >>> };
    >>>
    >>>
    >>>Firstly can anyone point me at some documentation which describes
    >>>what's in that hints structure please.
    >>>
    >>>Secondly, at present I can only get the above to be effective when
    >>>it's run before the initial window expose event. Is it possible to
    >>>change the window decorations 'on the fly' and, if so, what sequence
    >>>of calls and event handling etc. is needed? Are there any good
    >>>tutorials (and/or books) which show how to do this sort of thing or
    >>>good examples?
    >>>

    >>
    >>MOTIF_WM_HINTS hints :-) that you are using the Motif WM, or Motif
    >>widgets, or both. If using Motif widgets, Any particular reason to do it
    >>in such a complicated way instead of just changing the XmNmwmDecorations
    >>and mwmFunctions resources on the shell widget?
    >>

    >
    > I'm not actually using Motif, the utility I'm playing with just uses
    > the basic Xlib libraries. The initial "after much difficulty" is
    > because of the problems I had finding anyone or anywhere that could
    > tell me how to do this from Xlib. The above solution was the best
    > anyone came up with and works as long as the Window manager complies
    > with the MWM standards - apparently most do.


    Unfortunately, no. Eg KDE2 or KDE3 does not honor *some* of the
    MOTIF_WM_HINTS: remove f.resize from mwmFunctions, your window should be
    come fixed-size, but that does not happen.

    >
    > Personally I think it's really down to the Window manager to handle
    > this but many modern WMs don't allow the user to selectively remove
    > decorations from some apps so one is forced to provide the ability in
    > the application if it's one that's likely to want to run without
    > decorations.


    Correct.

    I have a very fuzzy recollection that after the ChangeProperty you have
    to somehow notify the WM that a property change has occurred. I dont
    remember exactly how, try googling for _NET_WM_STATE


    --
    Michel Bardiaux
    R&D Director
    T +32 [0] 2 790 29 41
    F +32 [0] 2 790 29 02
    E mailto:mbardiaux@mediaxim.be

    Mediaxim NV/SA
    Vorstlaan 191 Boulevard du Souverain
    Brussel 1160 Bruxelles
    http://www.mediaxim.com/

  5. Re: XChangeProperty() questions

    Michel Bardiaux wrote:
    >
    > >
    > > Personally I think it's really down to the Window manager to handle
    > > this but many modern WMs don't allow the user to selectively remove
    > > decorations from some apps so one is forced to provide the ability in
    > > the application if it's one that's likely to want to run without
    > > decorations.

    >
    > Correct.
    >
    > I have a very fuzzy recollection that after the ChangeProperty you have
    > to somehow notify the WM that a property change has occurred. I dont
    > remember exactly how, try googling for _NET_WM_STATE
    >

    Thanks, yes, it tells me a little more about these things. However
    I'm not sure that _NET_WM_STATE is related to changes to window
    decorations.

    --
    Chris Green


  6. Re: XChangeProperty() questions

    usenet@isbd.co.uk wrote:
    > Michel Bardiaux wrote:
    >
    >>>Personally I think it's really down to the Window manager to handle
    >>>this but many modern WMs don't allow the user to selectively remove
    >>>decorations from some apps so one is forced to provide the ability in
    >>>the application if it's one that's likely to want to run without
    >>>decorations.

    >>
    >>Correct.
    >>
    >>I have a very fuzzy recollection that after the ChangeProperty you have
    >>to somehow notify the WM that a property change has occurred. I dont
    >>remember exactly how, try googling for _NET_WM_STATE
    >>

    >
    > Thanks, yes, it tells me a little more about these things. However
    > I'm not sure that _NET_WM_STATE is related to changes to window
    > decorations.
    >

    I'm pretty sure its not; it's just that I remember seeing some sample
    code on how to change some WM-related props while I was trying to use
    _NET_WM_STATE.


    --
    Michel Bardiaux
    R&D Director
    T +32 [0] 2 790 29 41
    F +32 [0] 2 790 29 02
    E mailto:mbardiaux@mediaxim.be

    Mediaxim NV/SA
    Vorstlaan 191 Boulevard du Souverain
    Brussel 1160 Bruxelles
    http://www.mediaxim.com/

+ Reply to Thread