Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4024420
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T10:43:10+00:00 2026-05-20T10:43:10+00:00

How does the following code remove window borders? //note the struct is declared elsewhere,

  • 0

How does the following code remove window borders?

//note the struct is declared elsewhere, is here just for clarity.
//code is from [http://tonyobryan.com/index.php?article=9][1]
typedef struct Hints
{
    unsigned long   flags;
    unsigned long   functions;
    unsigned long   decorations;
    long            inputMode;
    unsigned long   status;
} Hints;

//code to remove decoration
Hints hints;
Atom property;
hints.flags = 2;
hints.decorations = 0;
property = XInternAtom(display, "_MOTIF_WM_HINTS", true);
XChangeProperty(display,window,property,property,32,PropModeReplace,(unsigned char *)&hints,5);
XMapWindow(display, window);

So far I have gathered that an Atom is a sort of identifier similar to Window and Display but I can’t figure out where the Hints structure or the “_MOTIF_WM_HINTS” came from. Can anyone explain all of this code for me? Thanks in advance, ell.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T10:43:11+00:00Added an answer on May 20, 2026 at 10:43 am

    It’s hard to come by any sort of “official”-looking standard or such, but the
    _MOTIF_WM_HINTS property does seem to come from the… Motif toolkit (ok, you
    guessed that 🙂 ).
    See the MotifZone site.

    Warning: what follows is incomplete, but should shed some light I hope.

    Documentation for the XmNmwmDecorations, XmNmwmFunctions and XmNmwmInputMode
    functions of the toolkit indicates that that property is a bitmask of various
    values used to control the appearance, functions (resize, move, …) and input
    mode that the window manager should provide/give to the window.
    See man vendorshell, or Oreilly Motif reference books, Vol6a chapter 16.

    Properties are a part of the whole X11 thing. A window can have any number of
    properties defined on it. Properties have a name, but setting/getting
    properties is done through an “atom” (identifier of sorts) to avoid sending
    the whole string on the wire for every get/set call.
    See Properties and Atoms

    The currently window manager (if any) can react to window property
    changes by setting the appropriate event filter and acting on PropertyNotify
    events, or simply inspecting the properties the window has when it gets mapped (or moved, or whatever). If the window manager knows of the _MOTIF_WM_HINT property, it’ll
    interpret those and (hopefully) do what you want.
    (Note: I’m not entierly sure if that privilege is devolved to the window
    manager, or if other windows can listen to those “PropertyNotify” events. Not
    sure that’s actually relevant to your question.)

    So the code you have works just fine as long as your window manager knows
    about the _MOTIF_WM_HINTS property.

    You start by getting the atom
    (identifier/shortcut) for it with XInternAtom, and setting its value via XChangeProperty()
    before the window is actually drawn via MapWindow() (not sure if that would
    work if you do it after the MapWindow(), that could depend on your window
    manager).

    [Edit: setting the .decorations part to zero clears all the decoration bits, so this requests that the window manager leave your borders the hell alone, essentially.]

    I can’t come up with somewhere “official” with the definition of that struct. It’s defined in lib/X11/MwmUtils.h of the openmotif-2.3.3 distribution. Not sure how the .flags entry is used (can’t find the code for the life of me :-/ ) but I suspect it’s used to indicate which of the {decoration, function, inputMode} “sub-properties” you’re acting on. (Don’t take my word for that.)

    As a side note, using _MOTIF_WM_HINTS might not be your best option right
    now. Have you looked at the Extended Window Manager hints
    specification
    and other information/standards/drafts over at freedesktop? I’ll wager most “modern” window managers/desktop environments/kitchen sinks will tend to adhere to that rather than keeping backwards compatibility with Motif. All depends on what you’re coding for I guess.

    Thanks for reading 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Why does the following code sometimes causes an Exception with the contents CLIPBRD_E_CANT_OPEN: Clipboard.SetText(str);
Why does the following code not work as I was expecting? <?php $data =
What does the following code do in C/C++? if (blah(), 5) { //do something
What does the following code do? A link to something in the PHP manual
Why does the following code print ‘read(): Resource temporarily unavailable’ 80% of the time?
Why does the following code NOT give an error, nor any type of a
Why does the following code in C work? const char* str = NULL; str
Why does the following code give me an error (g++ 4.1.2)? template<class A> class
Why does the following code get the runtime error: Members of the Triggers collection
Why does the following code throw ArrayStoreException ? double[] a = {2.0,3.4,3.6,2.7,5.6}; int[] b

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.