WPrefs: fix missing drawer image in Makefile.am
[wmaker-crm.git] / src / client.c
blobcfe51815aeabfe46d96872c01bd01cfd8f2fe36e
1 /*
2 * Window Maker window manager
4 * Copyright (c) 1997-2003 Alfredo K. Kojima
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 #include "wconfig.h"
22 #include <X11/Xlib.h>
23 #include <X11/Xutil.h>
24 #include <X11/Xatom.h>
25 #ifdef SHAPE
26 #include <X11/extensions/shape.h>
27 #endif
29 #include <stdlib.h>
30 #include <stdio.h>
31 #include <string.h>
33 #include "WindowMaker.h"
34 #include "framewin.h"
35 #include "window.h"
36 #include "properties.h"
37 #include "actions.h"
38 #include "icon.h"
39 #include "client.h"
40 #include "colormap.h"
41 #include "stacking.h"
42 #include "appicon.h"
43 #include "appmenu.h"
44 #include "wmspec.h"
46 /****** Global Variables ******/
48 /* contexts */
49 extern XContext wWinContext;
51 extern Atom _XA_WM_STATE;
52 extern Atom _XA_WM_PROTOCOLS;
53 extern Atom _XA_WM_COLORMAP_WINDOWS;
55 extern Atom _XA_WINDOWMAKER_MENU;
57 extern Atom _XA_GNUSTEP_WM_ATTR;
58 extern Atom _XA_GNUSTEP_WM_RESIZEBAR;
60 #ifdef SHAPE
61 extern Bool wShapeSupported;
62 #endif
65 *--------------------------------------------------------------------
66 * wClientRestore--
67 * Reparent the window back to the root window.
69 *--------------------------------------------------------------------
71 void wClientRestore(WWindow * wwin)
73 #if 0
74 int gx, gy;
76 wClientGetGravityOffsets(wwin, &gx, &gy);
77 /* set the position of the frame on screen */
78 wwin->frame_x -= gx * wwin->screen_ptr->frame_border_width;
79 wwin->frame_y -= gy * wwin->screen_ptr->frame_border_width;
80 /* if gravity is to the south, account for the border sizes */
81 if (gy > 0)
82 wwin->frame_y += (wwin->frame->top_width + wwin->frame->bottom_width);
83 #endif
84 XSetWindowBorderWidth(dpy, wwin->client_win, wwin->old_border_width);
85 XReparentWindow(dpy, wwin->client_win, wwin->screen_ptr->root_win, wwin->frame_x, wwin->frame_y);
87 /* don't let the window get iconified after restart */
89 if (wwin->flags.shaded)
90 wClientSetState(wwin, NormalState, None);
95 *----------------------------------------------------------------------
96 * wClientSetState--
97 * Set the state of the client window to one of the window
98 * states defined in ICCCM (Iconic, Withdrawn, Normal)
100 * Side effects:
101 * The WM_STATE property of the window is updated as well as the
102 * WWindow.state variable.
103 *----------------------------------------------------------------------
105 void wClientSetState(WWindow * wwin, int state, Window icon_win)
107 long data[2];
109 wwin->state = state;
111 data[0] = (unsigned long)state;
112 data[1] = (unsigned long)icon_win;
114 XChangeProperty(dpy, wwin->client_win, _XA_WM_STATE, _XA_WM_STATE, 32,
115 PropModeReplace, (unsigned char *)data, 2);
118 void wClientGetGravityOffsets(WWindow * wwin, int *ofs_x, int *ofs_y)
120 switch (wwin->normal_hints->win_gravity) {
121 case ForgetGravity:
122 case CenterGravity:
123 case StaticGravity:
124 *ofs_x = 0;
125 *ofs_y = 0;
126 break;
127 case NorthWestGravity:
128 *ofs_x = -1;
129 *ofs_y = -1;
130 break;
131 case NorthGravity:
132 *ofs_x = 0;
133 *ofs_y = -1;
134 break;
135 case NorthEastGravity:
136 *ofs_x = 1;
137 *ofs_y = -1;
138 break;
139 case WestGravity:
140 *ofs_x = -1;
141 *ofs_y = 0;
142 break;
143 case EastGravity:
144 *ofs_x = 1;
145 *ofs_y = 0;
146 break;
147 case SouthWestGravity:
148 *ofs_x = -1;
149 *ofs_y = 1;
150 break;
151 case SouthGravity:
152 *ofs_x = 0;
153 *ofs_y = 1;
154 break;
155 case SouthEastGravity:
156 *ofs_x = 1;
157 *ofs_y = 1;
158 break;
162 void wClientConfigure(WWindow * wwin, XConfigureRequestEvent * xcre)
164 XWindowChanges xwc;
165 int nx, ny, nwidth, nheight;
166 int ofs_x, ofs_y;
168 /* printf("configure event: %d %d %d %d\n", xcre->x, xcre->y, xcre->width, xcre->height); */
170 if (wwin == NULL) {
172 * configure a window that was not mapped by us
174 xwc.x = xcre->x;
175 xwc.y = xcre->y;
176 xwc.width = xcre->width;
177 xwc.height = xcre->height;
178 xwc.border_width = xcre->border_width;
179 xwc.stack_mode = xcre->detail;
180 xwc.sibling = xcre->above;
181 XConfigureWindow(dpy, xcre->window, xcre->value_mask, &xwc);
182 return;
184 #ifdef SHAPE
185 if (wShapeSupported) {
186 int junk;
187 unsigned int ujunk;
188 int b_shaped;
190 XShapeSelectInput(dpy, wwin->client_win, ShapeNotifyMask);
191 XShapeQueryExtents(dpy, wwin->client_win, &b_shaped, &junk, &junk,
192 &ujunk, &ujunk, &junk, &junk, &junk, &ujunk, &ujunk);
193 wwin->flags.shaped = b_shaped;
195 #endif
196 if (xcre->value_mask & CWStackMode) {
197 WObjDescriptor *desc;
198 WWindow *sibling;
200 if ((xcre->value_mask & CWSibling) &&
201 (XFindContext(dpy, xcre->above, wWinContext, (XPointer *) & desc) == XCSUCCESS)
202 && (desc->parent_type == WCLASS_WINDOW)) {
203 sibling = desc->parent;
204 xwc.sibling = sibling->frame->core->window;
205 } else {
206 xwc.sibling = xcre->above;
208 xwc.stack_mode = xcre->detail;
209 XConfigureWindow(dpy, wwin->frame->core->window,
210 xcre->value_mask & (CWSibling | CWStackMode), &xwc);
211 /* fix stacking order */
212 RemakeStackList(wwin->screen_ptr);
215 wClientGetGravityOffsets(wwin, &ofs_x, &ofs_y);
217 if (xcre->value_mask & CWBorderWidth) {
218 wwin->old_border_width = xcre->border_width;
221 if (!wwin->flags.shaded) {
222 /* If the window is shaded, wrong height will be set for the window */
223 if (xcre->value_mask & CWX) {
224 nx = xcre->x;
225 /* Subtracting the border makes the window shift by 1 pixel -Dan */
226 /*if (HAS_BORDER(wwin)) {
227 nx -= wwin->screen_ptr->frame_border_width;
228 } */
229 } else {
230 nx = wwin->frame_x;
233 if (xcre->value_mask & CWY) {
234 ny = xcre->y - ((ofs_y < 0) ? 0 : wwin->frame->top_width);
235 /* Subtracting the border makes the window shift by 1 pixel -Dan */
236 /*if (HAS_BORDER(wwin)) {
237 ny -= wwin->screen_ptr->frame_border_width;
238 } */
239 } else {
240 ny = wwin->frame_y;
243 if (xcre->value_mask & CWWidth)
244 nwidth = xcre->width;
245 else
246 nwidth = wwin->frame->core->width;
248 if (xcre->value_mask & CWHeight)
249 nheight = xcre->height;
250 else
251 nheight = wwin->frame->core->height - wwin->frame->top_width - wwin->frame->bottom_width;
253 if (nwidth != wwin->old_geometry.width)
254 wwin->flags.maximized &= ~(MAX_HORIZONTAL | MAX_MAXIMUS);
255 if (nheight != wwin->old_geometry.height)
256 wwin->flags.maximized &= ~(MAX_VERTICAL | MAX_LEFTHALF | MAX_RIGHTHALF | MAX_MAXIMUS);
258 wWindowConfigure(wwin, nx, ny, nwidth, nheight);
259 wwin->old_geometry.x = nx;
260 wwin->old_geometry.y = ny;
261 wwin->old_geometry.width = nwidth;
262 wwin->old_geometry.height = nheight;
266 void wClientSendProtocol(WWindow * wwin, Atom protocol, Time time)
268 XEvent event;
270 event.xclient.type = ClientMessage;
271 event.xclient.message_type = _XA_WM_PROTOCOLS;
272 event.xclient.format = 32;
273 event.xclient.display = dpy;
274 event.xclient.window = wwin->client_win;
275 event.xclient.data.l[0] = protocol;
276 event.xclient.data.l[1] = time;
277 event.xclient.data.l[2] = 0;
278 event.xclient.data.l[3] = 0;
279 XSendEvent(dpy, wwin->client_win, False, NoEventMask, &event);
280 XSync(dpy, False);
283 void wClientKill(WWindow * wwin)
285 XKillClient(dpy, wwin->client_win);
287 XFlush(dpy);
291 *----------------------------------------------------------------------
292 * wClientCheckProperty--
293 * Handles PropertyNotify'es, verifying which property was
294 * changed and updating internal state according to that, like redrawing
295 * the icon title when it is changed.
297 * Side effects:
298 * Depends on the changed property.
300 * TODO: _GNUSTEP_WM_ATTR
301 *----------------------------------------------------------------------
303 void wClientCheckProperty(WWindow * wwin, XPropertyEvent * event)
305 XWindowAttributes attribs;
306 XWMHints *new_hints;
307 int i, g1, g2;
308 char *tmp = NULL;
310 switch (event->atom) {
311 case XA_WM_NAME:
312 if (!wwin->flags.net_has_title) {
313 /* window title was changed */
314 if (!wFetchName(dpy, wwin->client_win, &tmp)) {
315 wWindowUpdateName(wwin, NULL);
316 } else {
317 wWindowUpdateName(wwin, tmp);
319 if (tmp)
320 XFree(tmp);
322 break;
324 case XA_WM_ICON_NAME:
325 /* Title has changed, update the icon title */
326 if (wwin->icon) {
327 wIconChangeTitle(wwin->icon, wwin);
328 wIconPaint(wwin->icon);
330 break;
332 case XA_WM_COMMAND:
333 if (wwin->main_window != None) {
334 WApplication *wapp = wApplicationOf(wwin->main_window);
335 char *command;
337 if (!wapp || !wapp->app_icon || wapp->app_icon->docked)
338 break;
340 command = GetCommandForWindow(wwin->main_window);
341 if (command) {
342 if (wapp->app_icon->command)
343 wfree(wapp->app_icon->command);
344 wapp->app_icon->command = command;
347 break;
349 case XA_WM_HINTS:
350 /* WM_HINTS */
352 new_hints = XGetWMHints(dpy, wwin->client_win);
354 /* group leader update
356 * This means that the window is setting the leader after
357 * it was mapped, changing leaders or removing the leader.
359 * Valid state transitions are:
361 * _1 __2
362 * / \ / \
363 * v | v |
364 * (GC) (GC')
365 * / ^ / ^
366 * 3| |4 5| |6
367 * | | | |
368 * v / v /
369 * (G'C) (G'C')
371 * Where G is the window_group hint, C is CLIENT_LEADER property
372 * and ' indicates the hint is unset.
374 * 1,2 - change group leader to new value of window_group
375 * 3 - change leader to value of CLIENT_LEADER
376 * 4 - change leader to value of window_group
377 * 5 - destroy application
378 * 6 - create application
380 if (new_hints && (new_hints->flags & WindowGroupHint)
381 && new_hints->window_group != None) {
382 g2 = 1;
383 } else {
384 g2 = 0;
386 if (wwin->wm_hints && (wwin->wm_hints->flags & WindowGroupHint)
387 && wwin->wm_hints->window_group != None) {
388 g1 = 1;
389 } else {
390 g1 = 0;
393 if (wwin->client_leader) {
394 if (g1 && g2 && wwin->wm_hints->window_group != new_hints->window_group) {
395 i = 1;
396 } else if (g1 && !g2) {
397 i = 3;
398 } else if (!g1 && g2) {
399 i = 4;
400 } else {
401 i = 0;
403 } else {
404 if (g1 && g2 && wwin->wm_hints->window_group != new_hints->window_group) {
405 i = 2;
406 } else if (g1 && !g2) {
407 i = 5;
408 } else if (!g1 && g2) {
409 i = 6;
410 } else {
411 i = 0;
415 /* Handling this may require more work. -Dan */
416 if (wwin->fake_group != NULL) {
417 i = 7;
420 if (wwin->wm_hints)
421 XFree(wwin->wm_hints);
423 wwin->wm_hints = new_hints;
425 /* do action according to state transition */
426 switch (i) {
427 /* 3 - change leader to value of CLIENT_LEADER */
428 case 3:
429 wApplicationDestroy(wApplicationOf(wwin->main_window));
430 wwin->main_window = wwin->client_leader;
431 wwin->group_id = None;
432 wApplicationCreate(wwin);
433 break;
435 /* 1,2,4 - change leader to new value of window_group */
436 case 1:
437 case 2:
438 case 4:
439 wApplicationDestroy(wApplicationOf(wwin->main_window));
440 wwin->main_window = new_hints->window_group;
441 wwin->group_id = wwin->main_window;
442 wApplicationCreate(wwin);
443 break;
445 /* 5 - destroy application */
446 case 5:
447 wApplicationDestroy(wApplicationOf(wwin->main_window));
448 wwin->main_window = None;
449 wwin->group_id = None;
450 break;
452 /* 6 - create application */
453 case 6:
454 wwin->main_window = new_hints->window_group;
455 wwin->group_id = wwin->main_window;
456 wApplicationCreate(wwin);
457 break;
458 /* 7 - we have a fake window group id, so just ignore anything else */
459 case 7:
460 break;
463 if (wwin->wm_hints) {
464 /* update icon */
465 if ((wwin->wm_hints->flags & IconPixmapHint)
466 || (wwin->wm_hints->flags & IconWindowHint)) {
467 WApplication *wapp;
469 if (wwin->flags.miniaturized && wwin->icon)
470 wIconUpdate(wwin->icon);
472 wapp = wApplicationOf(wwin->main_window);
473 if (wapp && wapp->app_icon) {
474 wIconUpdate(wapp->app_icon->icon);
475 wAppIconPaint(wapp->app_icon);
479 if (wwin->wm_hints->flags & UrgencyHint)
480 wwin->flags.urgent = 1;
481 else
482 wwin->flags.urgent = 0;
483 wAppBounceWhileUrgent(wApplicationOf(wwin->main_window));
484 /*} else if (wwin->fake_group!=NULL) {
485 wwin->group_id = wwin->fake_group->leader; */
486 } else {
487 wwin->group_id = None;
489 break;
491 case XA_WM_NORMAL_HINTS:
492 /* normal (geometry) hints */
494 int foo;
495 unsigned bar;
497 XGetWindowAttributes(dpy, wwin->client_win, &attribs);
498 wClientGetNormalHints(wwin, &attribs, False, &foo, &foo, &bar, &bar);
499 /* TODO: should we check for consistency of the current
500 * size against the new geometry hints? */
502 break;
504 case XA_WM_TRANSIENT_FOR:
506 Window new_owner;
507 WWindow *owner;
509 if (!XGetTransientForHint(dpy, wwin->client_win, &new_owner)) {
510 new_owner = None;
511 } else {
512 if (new_owner == 0 || new_owner == wwin->client_win) {
513 new_owner = wwin->screen_ptr->root_win;
516 if (new_owner != wwin->transient_for) {
517 owner = wWindowFor(wwin->transient_for);
518 if (owner) {
519 if (owner->flags.semi_focused) {
520 owner->flags.semi_focused = 0;
521 if ((owner->flags.mapped || owner->flags.shaded)
522 && owner->frame)
523 wFrameWindowPaint(owner->frame);
526 owner = wWindowFor(new_owner);
527 if (owner) {
528 if (!owner->flags.semi_focused) {
529 owner->flags.semi_focused = 1;
530 if ((owner->flags.mapped || owner->flags.shaded)
531 && owner->frame)
532 wFrameWindowPaint(owner->frame);
535 wwin->transient_for = new_owner;
536 if (new_owner == None) {
537 if (WFLAGP(wwin, no_miniaturizable)) {
538 WSETUFLAG(wwin, no_miniaturizable, 0);
539 WSETUFLAG(wwin, no_miniaturize_button, 0);
540 if (wwin->frame)
541 wWindowConfigureBorders(wwin);
543 } else if (!WFLAGP(wwin, no_miniaturizable)) {
544 WSETUFLAG(wwin, no_miniaturizable, 1);
545 WSETUFLAG(wwin, no_miniaturize_button, 1);
546 if (wwin->frame)
547 wWindowConfigureBorders(wwin);
551 break;
553 default:
554 if (event->atom == _XA_WM_PROTOCOLS) {
556 PropGetProtocols(wwin->client_win, &wwin->protocols);
558 WSETUFLAG(wwin, kill_close, !wwin->protocols.DELETE_WINDOW);
560 if (wwin->frame)
561 wWindowUpdateButtonImages(wwin);
563 } else if (event->atom == _XA_WM_COLORMAP_WINDOWS) {
565 GetColormapWindows(wwin);
566 wColormapInstallForWindow(wwin->screen_ptr, wwin);
568 } else if (event->atom == _XA_WINDOWMAKER_MENU) {
569 WApplication *wapp;
571 wapp = wApplicationOf(wwin->main_window);
572 if (wapp) {
573 if (wapp->menu) {
574 /* update menu */
575 /* TODO: remake appmenu update */
576 wAppMenuDestroy(wapp->menu);
578 if (wwin->fake_group) {
579 extern WPreferences wPreferences;
580 WScreen *scr = wwin->screen_ptr;
581 WWindow *foo = scr->focused_window;
582 WFakeGroupLeader *fPtr = wwin->fake_group;
584 wApplicationDestroy(wapp);
585 while (foo) {
586 if (foo->fake_group && foo->fake_group == fPtr) {
587 WSETUFLAG(foo, shared_appicon, 0);
588 foo->fake_group = NULL;
589 if (foo->group_id != None)
590 foo->main_window = foo->group_id;
591 else if (foo->client_leader != None)
592 foo->main_window = foo->client_leader;
593 else if (WFLAGP(foo, emulate_appicon))
594 foo->main_window = foo->client_win;
595 else
596 foo->main_window = None;
597 if (foo->main_window) {
598 wapp = wApplicationCreate(foo);
601 foo = foo->prev;
604 if (fPtr->leader != None)
605 XDestroyWindow(dpy, fPtr->leader);
606 fPtr->retainCount = 0;
607 fPtr->leader = None;
608 fPtr->origLeader = None;
610 wapp = wApplicationOf(wwin->main_window);
611 if (wapp) {
612 wapp->menu = wAppMenuGet(scr, wwin->main_window);
614 if (wPreferences.auto_arrange_icons) {
615 wArrangeIcons(wwin->screen_ptr, True);
617 } else {
618 wapp->menu = wAppMenuGet(wwin->screen_ptr, wwin->main_window);
620 /* make the appmenu be mapped */
621 wSetFocusTo(wwin->screen_ptr, NULL);
622 wSetFocusTo(wwin->screen_ptr, wwin->screen_ptr->focused_window);
624 } else if (event->atom == _XA_GNUSTEP_WM_ATTR) {
625 GNUstepWMAttributes *attr;
627 PropGetGNUstepWMAttr(wwin->client_win, &attr);
629 wWindowUpdateGNUstepAttr(wwin, attr);
631 XFree(attr);
632 } else {
633 wNETWMCheckClientHintChange(wwin, event);
639 *----------------------------------------------------------------------
640 * wClientGetNormalHints--
641 * Get size (normal) hints and a default geometry for the client
642 * window. The hints are also checked for inconsistency. If geometry is
643 * True, the returned data will account for client specified initial
644 * geometry.
646 * Side effects:
647 * normal_hints is filled with valid data.
648 *----------------------------------------------------------------------
650 void
651 wClientGetNormalHints(WWindow * wwin, XWindowAttributes * wattribs, Bool geometry,
652 int *x, int *y, unsigned *width, unsigned *height)
654 int pre_icccm = 0; /* not used */
656 /* find a position for the window */
657 if (!wwin->normal_hints)
658 wwin->normal_hints = XAllocSizeHints();
660 if (!PropGetNormalHints(wwin->client_win, wwin->normal_hints, &pre_icccm)) {
661 wwin->normal_hints->flags = 0;
663 *x = wattribs->x;
664 *y = wattribs->y;
666 *width = wattribs->width;
667 *height = wattribs->height;
669 if (!(wwin->normal_hints->flags & PWinGravity)) {
670 wwin->normal_hints->win_gravity = NorthWestGravity;
672 if (!(wwin->normal_hints->flags & PMinSize)) {
673 wwin->normal_hints->min_width = MIN_WINDOW_SIZE;
674 wwin->normal_hints->min_height = MIN_WINDOW_SIZE;
676 if (!(wwin->normal_hints->flags & PBaseSize)) {
677 wwin->normal_hints->base_width = 0;
678 wwin->normal_hints->base_height = 0;
680 if (!(wwin->normal_hints->flags & PMaxSize)) {
681 wwin->normal_hints->max_width = wwin->screen_ptr->scr_width * 2;
682 wwin->normal_hints->max_height = wwin->screen_ptr->scr_height * 2;
685 /* some buggy apps set weird hints.. */
686 if (wwin->normal_hints->min_width <= 0)
687 wwin->normal_hints->min_width = MIN_WINDOW_SIZE;
689 if (wwin->normal_hints->min_height <= 0)
690 wwin->normal_hints->min_height = MIN_WINDOW_SIZE;
692 if (wwin->normal_hints->max_width < wwin->normal_hints->min_width)
693 wwin->normal_hints->max_width = wwin->normal_hints->min_width;
695 if (wwin->normal_hints->max_height < wwin->normal_hints->min_height)
696 wwin->normal_hints->max_height = wwin->normal_hints->min_height;
698 if (!(wwin->normal_hints->flags & PResizeInc)) {
699 wwin->normal_hints->width_inc = 1;
700 wwin->normal_hints->height_inc = 1;
701 } else {
702 if (wwin->normal_hints->width_inc <= 0)
703 wwin->normal_hints->width_inc = 1;
704 if (wwin->normal_hints->height_inc <= 0)
705 wwin->normal_hints->height_inc = 1;
708 if (wwin->normal_hints->flags & PAspect) {
709 if (wwin->normal_hints->min_aspect.x < 1)
710 wwin->normal_hints->min_aspect.x = 1;
711 if (wwin->normal_hints->min_aspect.y < 1)
712 wwin->normal_hints->min_aspect.y = 1;
714 if (wwin->normal_hints->max_aspect.x < 1)
715 wwin->normal_hints->max_aspect.x = 1;
716 if (wwin->normal_hints->max_aspect.y < 1)
717 wwin->normal_hints->max_aspect.y = 1;
720 if (wwin->normal_hints->min_height > wwin->normal_hints->max_height) {
721 wwin->normal_hints->min_height = wwin->normal_hints->max_height;
723 if (wwin->normal_hints->min_width > wwin->normal_hints->max_width) {
724 wwin->normal_hints->min_width = wwin->normal_hints->max_width;
726 #ifdef IGNORE_PPOSITION
727 wwin->normal_hints->flags &= ~PPosition;
728 #endif
730 if (pre_icccm && !wwin->screen_ptr->flags.startup && geometry) {
731 if (wwin->normal_hints->flags & (USPosition | PPosition)) {
732 *x = wwin->normal_hints->x;
733 *y = wwin->normal_hints->y;
735 if (wwin->normal_hints->flags & (USSize | PSize)) {
736 *width = wwin->normal_hints->width;
737 *height = wwin->normal_hints->height;
742 void GetColormapWindows(WWindow * wwin)
744 #ifndef NO_CRASHES
745 if (wwin->cmap_windows) {
746 XFree(wwin->cmap_windows);
749 wwin->cmap_windows = NULL;
750 wwin->cmap_window_no = 0;
752 if (!XGetWMColormapWindows(dpy, wwin->client_win, &(wwin->cmap_windows), &(wwin->cmap_window_no))
753 || !wwin->cmap_windows) {
754 wwin->cmap_window_no = 0;
755 wwin->cmap_windows = NULL;
757 #endif