bill@polygen.uucp (Bill Poitras) (02/07/91)
Hello netland,
I am trying to set window manager hints in an X program. I use the
following code: (assumue all variables are declared)
Note: eventMask is defined as
KeyPressMask|KeyReleaseMask|ButtonPressMask|
ButtonReleaseMask|Button1MotionMask|ExposureMask|
Button2MotionMask|Button3MotionMask|
StructureNotifyMask|EnterWindowMask;
.
.
.
new_frame->prim_window_id = new_frame->base_win_id =
XCreateWindow(display,
DefaultRootWindow(display),
size_hint.x - MAIN_WIN_INSET,
size_hint.y - MAIN_WIN_INSET,
size_hint.width + MAIN_WIN_INSET,
size_hint.height + MAIN_WIN_INSET,
border_width,
CopyFromParent,
InputOutput,
CopyFromParent,
valueMask,
&attributes);
window_is_open = 1;
XFreePixmap( display, back );
/* create the cursor */
new_cursor = XCreateFontCursor(display, XC_left_ptr);
XDefineCursor(display, new_frame->prim_window_id, new_cursor);
XFreeCursor( display, new_cursor );
XSetNormalHints(display, new_frame->prim_window_id, &size_hint);
/* set the window manager hints */
wm_hints.input = TRUE;
wm_hints.initial_state = NormalState;
wm_hints.flags = InputHint|StateHint;
result = XSetWMHints( display, new_frame->prim_window_id, &wm_hints );
/* set the application Class */
class_hint.res_class = "Centrum";
class_hint.res_name = LAM_Appid;
XSetClassHint( display, new_frame->prim_window_id, &class_hint);
.
.
.
if( new_frame->parent_frame == NULL ) {
empty_icon =
XCreateBitmapFromData(display,new_frame->prim_window_id,
polygen_icon_bits, polygen_icon_width, polygen_icon_height );
XSetStandardProperties( display, new_frame->prim_window_id,
title, icontitle, empty_icon, NULL, 0, NULL );
image = (gra_image *)MEM_Alloc((int32)sizeof(gra_image));
image->pixmap = empty_icon;
} else {
image = (gra_image *)new_frame->parent_frame->icon;
if( image != NULL ) {
new_frame->icon = (GRA_image)image;
XSetStandardProperties( display, new_frame->prim_window_id,
title, icontitle, image->pixmap, NULL, 0, NULL );
}
}
/* Make this frame accept events */
XSelectInput(display, new_frame->prim_window_id, eventMask);
/* map (display) the window */
XMapWindow(display, new_frame->prim_window_id);
.
.
.
While this program is running, xwininfo -wm outputs this:
xwininfo ==> Please select the window about which you
==> would like information by clicking the
==> mouse in that window.
xwininfo ==> Window id: 0xc0001d (A Very long title for a frame)
==> Window manager hints:
if there were no window manager hints being set, the last line should
have read:
==> No window manager hints defined
So why is the window manager hints coming up null? Any help would
greatly be appreciated.
+-----------------+---------------------------+-----------------------------+
| Bill Poitras | Polygen Corporation | {princeton mit-eddie |
| (bill) | Waltham, MA USA | bu sunne}!polygen!bill |
| | FAX (617)890-8694 | bill@polygen.com |
+-----------------+---------------------------+-----------------------------+