Constrain switching workspace name to one head.
[wmaker-crm.git] / src / client.c
blob95dfe2699ec852ef0f45dc811740ce83f33a5b64
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
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
19 * USA.
21 #include "wconfig.h"
23 #include <X11/Xlib.h>
24 #include <X11/Xutil.h>
25 #include <X11/Xatom.h>
26 #ifdef SHAPE
27 #include <X11/extensions/shape.h>
28 #endif
30 #include <stdlib.h>
31 #include <stdio.h>
32 #include <string.h>
34 #include "WindowMaker.h"
35 #include "wcore.h"
36 #include "framewin.h"
37 #include "window.h"
38 #include "properties.h"
39 #include "actions.h"
40 #include "icon.h"
41 #include "client.h"
42 #include "funcs.h"
43 #include "stacking.h"
44 #include "appicon.h"
45 #include "appmenu.h"
46 #ifdef NETWM_HINTS
47 # include "wmspec.h"
48 #endif
50 /****** Global Variables ******/
52 /* contexts */
53 extern XContext wWinContext;
55 extern Atom _XA_WM_STATE;
56 extern Atom _XA_WM_PROTOCOLS;
57 extern Atom _XA_WM_COLORMAP_WINDOWS;
59 extern Atom _XA_WINDOWMAKER_MENU;
61 extern Atom _XA_GNUSTEP_WM_ATTR;
62 extern Atom _XA_GNUSTEP_WM_RESIZEBAR;
64 #ifdef SHAPE
65 extern Bool wShapeSupported;
66 #endif
69 *--------------------------------------------------------------------
70 * wClientRestore--
71 * Reparent the window back to the root window.
73 *--------------------------------------------------------------------
75 void wClientRestore(WWindow * wwin)
77 #if 0
78 int gx, gy;
80 wClientGetGravityOffsets(wwin, &gx, &gy);
81 /* set the positio of the frame on screen */
82 wwin->frame_x -= gx * FRAME_BORDER_WIDTH;
83 wwin->frame_y -= gy * FRAME_BORDER_WIDTH;
84 /* if gravity is to the south, account for the border sizes */
85 if (gy > 0)
86 wwin->frame_y += (wwin->frame->top_width + wwin->frame->bottom_width);
87 #endif
88 XSetWindowBorderWidth(dpy, wwin->client_win, wwin->old_border_width);
89 XReparentWindow(dpy, wwin->client_win, wwin->screen_ptr->root_win, wwin->frame_x, wwin->frame_y);
91 /* don't let the window get iconified after restart */
93 if (wwin->flags.shaded)
94 wClientSetState(wwin, NormalState, None);
99 *----------------------------------------------------------------------
100 * wClientSetState--
101 * Set the state of the client window to one of the window
102 * states defined in ICCCM (Iconic, Withdrawn, Normal)
104 * Side effects:
105 * The WM_STATE property of the window is updated as well as the
106 * WWindow.state variable.
107 *----------------------------------------------------------------------
109 void wClientSetState(WWindow * wwin, int state, Window icon_win)
111 CARD32 data[2];
113 wwin->state = state;
115 data[0] = (unsigned long)state;
116 data[1] = (unsigned long)icon_win;
118 XChangeProperty(dpy, wwin->client_win, _XA_WM_STATE, _XA_WM_STATE, 32,
119 PropModeReplace, (unsigned char *)data, 2);
122 void wClientGetGravityOffsets(WWindow * wwin, int *ofs_x, int *ofs_y)
124 switch (wwin->normal_hints->win_gravity) {
125 case ForgetGravity:
126 case CenterGravity:
127 case StaticGravity:
128 *ofs_x = 0;
129 *ofs_y = 0;
130 break;
131 case NorthWestGravity:
132 *ofs_x = -1;
133 *ofs_y = -1;
134 break;
135 case NorthGravity:
136 *ofs_x = 0;
137 *ofs_y = -1;
138 break;
139 case NorthEastGravity:
140 *ofs_x = 1;
141 *ofs_y = -1;
142 break;
143 case WestGravity:
144 *ofs_x = -1;
145 *ofs_y = 0;
146 break;
147 case EastGravity:
148 *ofs_x = 1;
149 *ofs_y = 0;
150 break;
151 case SouthWestGravity:
152 *ofs_x = -1;
153 *ofs_y = 1;
154 break;
155 case SouthGravity:
156 *ofs_x = 0;
157 *ofs_y = 1;
158 break;
159 case SouthEastGravity:
160 *ofs_x = 1;
161 *ofs_y = 1;
162 break;
166 void wClientConfigure(WWindow * wwin, XConfigureRequestEvent * xcre)
168 XWindowChanges xwc;
169 int nx, ny, nwidth, nheight;
170 int ofs_x, ofs_y;
172 /* printf("configure event: %d %d %d %d\n", xcre->x, xcre->y, xcre->width, xcre->height); */
174 if (wwin == NULL) {
176 * configure a window that was not mapped by us
178 xwc.x = xcre->x;
179 xwc.y = xcre->y;
180 xwc.width = xcre->width;
181 xwc.height = xcre->height;
182 xwc.border_width = xcre->border_width;
183 xwc.stack_mode = xcre->detail;
184 xwc.sibling = xcre->above;
185 XConfigureWindow(dpy, xcre->window, xcre->value_mask, &xwc);
186 return;
188 #ifdef SHAPE
189 if (wShapeSupported) {
190 int junk;
191 unsigned int ujunk;
192 int b_shaped;
194 XShapeSelectInput(dpy, wwin->client_win, ShapeNotifyMask);
195 XShapeQueryExtents(dpy, wwin->client_win, &b_shaped, &junk, &junk,
196 &ujunk, &ujunk, &junk, &junk, &junk, &ujunk, &ujunk);
197 wwin->flags.shaped = b_shaped;
199 #endif
200 if (xcre->value_mask & CWStackMode) {
201 WObjDescriptor *desc;
202 WWindow *sibling;
204 if ((xcre->value_mask & CWSibling) &&
205 (XFindContext(dpy, xcre->above, wWinContext, (XPointer *) & desc) == XCSUCCESS)
206 && (desc->parent_type == WCLASS_WINDOW)) {
207 sibling = desc->parent;
208 xwc.sibling = sibling->frame->core->window;
209 } else {
210 xwc.sibling = xcre->above;
212 xwc.stack_mode = xcre->detail;
213 XConfigureWindow(dpy, wwin->frame->core->window,
214 xcre->value_mask & (CWSibling | CWStackMode), &xwc);
215 /* fix stacking order */
216 RemakeStackList(wwin->screen_ptr);
219 wClientGetGravityOffsets(wwin, &ofs_x, &ofs_y);
221 if (xcre->value_mask & CWBorderWidth) {
222 wwin->old_border_width = xcre->border_width;
225 if (!wwin->flags.shaded) {
226 /* If the window is shaded, wrong height will be set for the window */
227 if (xcre->value_mask & CWX) {
228 nx = xcre->x;
229 /* Subtracting the border makes the window shift by 1 pixel -Dan */
230 /*if (HAS_BORDER(wwin)) {
231 nx -= FRAME_BORDER_WIDTH;
232 } */
233 } else {
234 nx = wwin->frame_x;
237 if (xcre->value_mask & CWY) {
238 ny = xcre->y - ((ofs_y < 0) ? 0 : wwin->frame->top_width);
239 /* Subtracting the border makes the window shift by 1 pixel -Dan */
240 /*if (HAS_BORDER(wwin)) {
241 ny -= FRAME_BORDER_WIDTH;
242 } */
243 } else {
244 ny = wwin->frame_y;
247 if (xcre->value_mask & CWWidth)
248 nwidth = xcre->width;
249 else
250 nwidth = wwin->frame->core->width;
252 if (xcre->value_mask & CWHeight)
253 nheight = xcre->height;
254 else
255 nheight = wwin->frame->core->height - wwin->frame->top_width - wwin->frame->bottom_width;
257 if (nwidth != wwin->old_geometry.width)
258 wwin->flags.maximized &= ~(MAX_HORIZONTAL | MAX_MAXIMUS);
259 if (nheight != wwin->old_geometry.height)
260 wwin->flags.maximized &= ~(MAX_VERTICAL | MAX_LEFTHALF | MAX_RIGHTHALF | MAX_MAXIMUS);
262 wWindowConfigure(wwin, nx, ny, nwidth, nheight);
263 wwin->old_geometry.x = nx;
264 wwin->old_geometry.y = ny;
265 wwin->old_geometry.width = nwidth;
266 wwin->old_geometry.height = nheight;
270 void wClientSendProtocol(WWindow * wwin, Atom protocol, Time time)
272 XEvent event;
274 event.xclient.type = ClientMessage;
275 event.xclient.message_type = _XA_WM_PROTOCOLS;
276 event.xclient.format = 32;
277 event.xclient.display = dpy;
278 event.xclient.window = wwin->client_win;
279 event.xclient.data.l[0] = protocol;
280 event.xclient.data.l[1] = time;
281 event.xclient.data.l[2] = 0;
282 event.xclient.data.l[3] = 0;
283 XSendEvent(dpy, wwin->client_win, False, NoEventMask, &event);
284 XSync(dpy, False);
287 void wClientKill(WWindow * wwin)
289 XKillClient(dpy, wwin->client_win);
291 XFlush(dpy);
295 *----------------------------------------------------------------------
296 * wClientCheckProperty--
297 * Handles PropertyNotify'es, verifying which property was
298 * changed and updating internal state according to that, like redrawing
299 * the icon title when it is changed.
301 * Side effects:
302 * Depends on the changed property.
304 * TODO: _GNUSTEP_WM_ATTR
305 *----------------------------------------------------------------------
307 void wClientCheckProperty(WWindow * wwin, XPropertyEvent * event)
309 XWindowAttributes attribs;
310 XWMHints *new_hints;
311 int i, g1, g2;
312 char *tmp = NULL;
314 switch (event->atom) {
315 case XA_WM_NAME:
316 if (!wwin->flags.net_has_title) {
317 /* window title was changed */
318 if (!wFetchName(dpy, wwin->client_win, &tmp)) {
319 wWindowUpdateName(wwin, NULL);
320 } else {
321 wWindowUpdateName(wwin, tmp);
323 if (tmp)
324 XFree(tmp);
326 break;
328 case XA_WM_ICON_NAME:
329 if (!wwin->flags.net_has_icon_title) {
330 if (!wwin->icon)
331 break;
332 else {
333 char *new_title;
335 /* icon title was changed */
336 wGetIconName(dpy, wwin->client_win, &new_title);
337 wIconChangeTitle(wwin->icon, new_title);
340 break;
342 case XA_WM_COMMAND:
343 if (wwin->main_window != None) {
344 WApplication *wapp = wApplicationOf(wwin->main_window);
345 char *command;
347 if (!wapp || !wapp->app_icon || wapp->app_icon->docked)
348 break;
350 command = GetCommandForWindow(wwin->main_window);
351 if (command) {
352 if (wapp->app_icon->command)
353 wfree(wapp->app_icon->command);
354 wapp->app_icon->command = command;
357 break;
359 case XA_WM_HINTS:
360 /* WM_HINTS */
362 new_hints = XGetWMHints(dpy, wwin->client_win);
364 /* group leader update
366 * This means that the window is setting the leader after
367 * it was mapped, changing leaders or removing the leader.
369 * Valid state transitions are:
371 * _1 __2
372 * / \ / \
373 * v | v |
374 * (GC) (GC')
375 * / ^ / ^
376 * 3| |4 5| |6
377 * | | | |
378 * v / v /
379 * (G'C) (G'C')
381 * Where G is the window_group hint, C is CLIENT_LEADER property
382 * and ' indicates the hint is unset.
384 * 1,2 - change group leader to new value of window_group
385 * 3 - change leader to value of CLIENT_LEADER
386 * 4 - change leader to value of window_group
387 * 5 - destroy application
388 * 6 - create application
390 if (new_hints && (new_hints->flags & WindowGroupHint)
391 && new_hints->window_group != None) {
392 g2 = 1;
393 } else {
394 g2 = 0;
396 if (wwin->wm_hints && (wwin->wm_hints->flags & WindowGroupHint)
397 && wwin->wm_hints->window_group != None) {
398 g1 = 1;
399 } else {
400 g1 = 0;
403 if (wwin->client_leader) {
404 if (g1 && g2 && wwin->wm_hints->window_group != new_hints->window_group) {
405 i = 1;
406 } else if (g1 && !g2) {
407 i = 3;
408 } else if (!g1 && g2) {
409 i = 4;
410 } else {
411 i = 0;
413 } else {
414 if (g1 && g2 && wwin->wm_hints->window_group != new_hints->window_group) {
415 i = 2;
416 } else if (g1 && !g2) {
417 i = 5;
418 } else if (!g1 && g2) {
419 i = 6;
420 } else {
421 i = 0;
425 /* Handling this may require more work. -Dan */
426 if (wwin->fake_group != NULL) {
427 i = 7;
430 if (wwin->wm_hints)
431 XFree(wwin->wm_hints);
433 wwin->wm_hints = new_hints;
435 /* do action according to state transition */
436 switch (i) {
437 /* 3 - change leader to value of CLIENT_LEADER */
438 case 3:
439 wApplicationDestroy(wApplicationOf(wwin->main_window));
440 wwin->main_window = wwin->client_leader;
441 wwin->group_id = None;
442 wApplicationCreate(wwin);
443 break;
445 /* 1,2,4 - change leader to new value of window_group */
446 case 1:
447 case 2:
448 case 4:
449 wApplicationDestroy(wApplicationOf(wwin->main_window));
450 wwin->main_window = new_hints->window_group;
451 wwin->group_id = wwin->main_window;
452 wApplicationCreate(wwin);
453 break;
455 /* 5 - destroy application */
456 case 5:
457 wApplicationDestroy(wApplicationOf(wwin->main_window));
458 wwin->main_window = None;
459 wwin->group_id = None;
460 break;
462 /* 6 - create application */
463 case 6:
464 wwin->main_window = new_hints->window_group;
465 wwin->group_id = wwin->main_window;
466 wApplicationCreate(wwin);
467 break;
468 /* 7 - we have a fake window group id, so just ignore anything else */
469 case 7:
470 break;
472 #ifdef DEBUG
473 if (i) {
474 printf("window leader update caused state transition %i\n", i);
476 #endif
478 if (wwin->wm_hints) {
479 /* update icon */
480 if ((wwin->wm_hints->flags & IconPixmapHint)
481 || (wwin->wm_hints->flags & IconWindowHint)) {
482 WApplication *wapp;
484 if (wwin->flags.miniaturized && wwin->icon) {
485 wIconUpdate(wwin->icon);
487 wapp = wApplicationOf(wwin->main_window);
488 if (wapp && wapp->app_icon) {
489 wIconUpdate(wapp->app_icon->icon);
493 if (wwin->wm_hints->flags & UrgencyHint)
494 wwin->flags.urgent = 1;
495 else
496 wwin->flags.urgent = 0;
497 /*} else if (wwin->fake_group!=NULL) {
498 wwin->group_id = wwin->fake_group->leader; */
499 } else {
500 wwin->group_id = None;
502 break;
504 case XA_WM_NORMAL_HINTS:
505 /* normal (geometry) hints */
507 int foo;
508 unsigned bar;
510 XGetWindowAttributes(dpy, wwin->client_win, &attribs);
511 wClientGetNormalHints(wwin, &attribs, False, &foo, &foo, &bar, &bar);
512 /* TODO: should we check for consistency of the current
513 * size against the new geometry hints? */
515 break;
517 case XA_WM_TRANSIENT_FOR:
519 Window new_owner;
520 WWindow *owner;
522 if (!XGetTransientForHint(dpy, wwin->client_win, &new_owner)) {
523 new_owner = None;
524 } else {
525 if (new_owner == 0 || new_owner == wwin->client_win) {
526 new_owner = wwin->screen_ptr->root_win;
529 if (new_owner != wwin->transient_for) {
530 owner = wWindowFor(wwin->transient_for);
531 if (owner) {
532 if (owner->flags.semi_focused) {
533 owner->flags.semi_focused = 0;
534 if ((owner->flags.mapped || owner->flags.shaded)
535 && owner->frame)
536 wFrameWindowPaint(owner->frame);
539 owner = wWindowFor(new_owner);
540 if (owner) {
541 if (!owner->flags.semi_focused) {
542 owner->flags.semi_focused = 1;
543 if ((owner->flags.mapped || owner->flags.shaded)
544 && owner->frame)
545 wFrameWindowPaint(owner->frame);
548 wwin->transient_for = new_owner;
549 if (new_owner == None) {
550 if (WFLAGP(wwin, no_miniaturizable)) {
551 WSETUFLAG(wwin, no_miniaturizable, 0);
552 WSETUFLAG(wwin, no_miniaturize_button, 0);
553 if (wwin->frame)
554 wWindowConfigureBorders(wwin);
556 } else if (!WFLAGP(wwin, no_miniaturizable)) {
557 WSETUFLAG(wwin, no_miniaturizable, 1);
558 WSETUFLAG(wwin, no_miniaturize_button, 1);
559 if (wwin->frame)
560 wWindowConfigureBorders(wwin);
564 break;
566 default:
567 if (event->atom == _XA_WM_PROTOCOLS) {
569 PropGetProtocols(wwin->client_win, &wwin->protocols);
571 WSETUFLAG(wwin, kill_close, !wwin->protocols.DELETE_WINDOW);
573 if (wwin->frame)
574 wWindowUpdateButtonImages(wwin);
576 } else if (event->atom == _XA_WM_COLORMAP_WINDOWS) {
578 GetColormapWindows(wwin);
579 wColormapInstallForWindow(wwin->screen_ptr, wwin);
581 } else if (event->atom == _XA_WINDOWMAKER_MENU) {
582 WApplication *wapp;
584 wapp = wApplicationOf(wwin->main_window);
585 if (wapp) {
586 if (wapp->menu) {
587 /* update menu */
588 /* TODO: remake appmenu update */
589 wAppMenuDestroy(wapp->menu);
591 if (wwin->fake_group) {
592 extern WPreferences wPreferences;
593 WScreen *scr = wwin->screen_ptr;
594 WWindow *foo = scr->focused_window;
595 WFakeGroupLeader *fPtr = wwin->fake_group;
597 wApplicationDestroy(wapp);
598 while (foo) {
599 if (foo->fake_group && foo->fake_group == fPtr) {
600 WSETUFLAG(foo, shared_appicon, 0);
601 foo->fake_group = NULL;
602 if (foo->group_id != None)
603 foo->main_window = foo->group_id;
604 else if (foo->client_leader != None)
605 foo->main_window = foo->client_leader;
606 else if (WFLAGP(foo, emulate_appicon))
607 foo->main_window = foo->client_win;
608 else
609 foo->main_window = None;
610 if (foo->main_window) {
611 wapp = wApplicationCreate(foo);
614 foo = foo->prev;
617 if (fPtr->leader != None)
618 XDestroyWindow(dpy, fPtr->leader);
619 fPtr->retainCount = 0;
620 fPtr->leader = None;
621 fPtr->origLeader = None;
623 wapp = wApplicationOf(wwin->main_window);
624 if (wapp) {
625 wapp->menu = wAppMenuGet(scr, wwin->main_window);
627 if (wPreferences.auto_arrange_icons) {
628 wArrangeIcons(wwin->screen_ptr, True);
630 } else {
631 wapp->menu = wAppMenuGet(wwin->screen_ptr, wwin->main_window);
633 /* make the appmenu be mapped */
634 wSetFocusTo(wwin->screen_ptr, NULL);
635 wSetFocusTo(wwin->screen_ptr, wwin->screen_ptr->focused_window);
637 } else if (event->atom == _XA_GNUSTEP_WM_ATTR) {
638 GNUstepWMAttributes *attr;
640 PropGetGNUstepWMAttr(wwin->client_win, &attr);
642 wWindowUpdateGNUstepAttr(wwin, attr);
644 XFree(attr);
645 } else {
646 #ifdef NETWM_HINTS
647 wNETWMCheckClientHintChange(wwin, event);
648 #endif
654 *----------------------------------------------------------------------
655 * wClientGetNormalHints--
656 * Get size (normal) hints and a default geometry for the client
657 * window. The hints are also checked for inconsistency. If geometry is
658 * True, the returned data will account for client specified initial
659 * geometry.
661 * Side effects:
662 * normal_hints is filled with valid data.
663 *----------------------------------------------------------------------
665 void
666 wClientGetNormalHints(WWindow * wwin, XWindowAttributes * wattribs, Bool geometry,
667 int *x, int *y, unsigned *width, unsigned *height)
669 int pre_icccm = 0; /* not used */
671 /* find a position for the window */
672 if (!wwin->normal_hints)
673 wwin->normal_hints = XAllocSizeHints();
675 if (!PropGetNormalHints(wwin->client_win, wwin->normal_hints, &pre_icccm)) {
676 wwin->normal_hints->flags = 0;
678 *x = wattribs->x;
679 *y = wattribs->y;
681 *width = wattribs->width;
682 *height = wattribs->height;
684 if (!(wwin->normal_hints->flags & PWinGravity)) {
685 wwin->normal_hints->win_gravity = NorthWestGravity;
687 if (!(wwin->normal_hints->flags & PMinSize)) {
688 wwin->normal_hints->min_width = MIN_WINDOW_SIZE;
689 wwin->normal_hints->min_height = MIN_WINDOW_SIZE;
691 if (!(wwin->normal_hints->flags & PBaseSize)) {
692 wwin->normal_hints->base_width = 0;
693 wwin->normal_hints->base_height = 0;
695 if (!(wwin->normal_hints->flags & PMaxSize)) {
696 wwin->normal_hints->max_width = wwin->screen_ptr->scr_width * 2;
697 wwin->normal_hints->max_height = wwin->screen_ptr->scr_height * 2;
700 /* some buggy apps set weird hints.. */
701 if (wwin->normal_hints->min_width <= 0)
702 wwin->normal_hints->min_width = MIN_WINDOW_SIZE;
704 if (wwin->normal_hints->min_height <= 0)
705 wwin->normal_hints->min_height = MIN_WINDOW_SIZE;
707 if (wwin->normal_hints->max_width < wwin->normal_hints->min_width)
708 wwin->normal_hints->max_width = wwin->normal_hints->min_width;
710 if (wwin->normal_hints->max_height < wwin->normal_hints->min_height)
711 wwin->normal_hints->max_height = wwin->normal_hints->min_height;
713 if (!(wwin->normal_hints->flags & PResizeInc)) {
714 wwin->normal_hints->width_inc = 1;
715 wwin->normal_hints->height_inc = 1;
716 } else {
717 if (wwin->normal_hints->width_inc <= 0)
718 wwin->normal_hints->width_inc = 1;
719 if (wwin->normal_hints->height_inc <= 0)
720 wwin->normal_hints->height_inc = 1;
723 if (wwin->normal_hints->flags & PAspect) {
724 if (wwin->normal_hints->min_aspect.x < 1)
725 wwin->normal_hints->min_aspect.x = 1;
726 if (wwin->normal_hints->min_aspect.y < 1)
727 wwin->normal_hints->min_aspect.y = 1;
729 if (wwin->normal_hints->max_aspect.x < 1)
730 wwin->normal_hints->max_aspect.x = 1;
731 if (wwin->normal_hints->max_aspect.y < 1)
732 wwin->normal_hints->max_aspect.y = 1;
735 if (wwin->normal_hints->min_height > wwin->normal_hints->max_height) {
736 wwin->normal_hints->min_height = wwin->normal_hints->max_height;
738 if (wwin->normal_hints->min_width > wwin->normal_hints->max_width) {
739 wwin->normal_hints->min_width = wwin->normal_hints->max_width;
741 #ifdef IGNORE_PPOSITION
742 wwin->normal_hints->flags &= ~PPosition;
743 #endif
745 if (pre_icccm && !wwin->screen_ptr->flags.startup && geometry) {
746 if (wwin->normal_hints->flags & (USPosition | PPosition)) {
747 *x = wwin->normal_hints->x;
748 *y = wwin->normal_hints->y;
750 if (wwin->normal_hints->flags & (USSize | PSize)) {
751 *width = wwin->normal_hints->width;
752 *height = wwin->normal_hints->height;
757 void GetColormapWindows(WWindow * wwin)
759 #ifndef NO_CRASHES
760 if (wwin->cmap_windows) {
761 XFree(wwin->cmap_windows);
764 wwin->cmap_windows = NULL;
765 wwin->cmap_window_no = 0;
767 if (!XGetWMColormapWindows(dpy, wwin->client_win, &(wwin->cmap_windows), &(wwin->cmap_window_no))
768 || !wwin->cmap_windows) {
769 wwin->cmap_window_no = 0;
770 wwin->cmap_windows = NULL;
772 #endif