Update Serbian translation from master branch
[wmaker-crm.git] / src / client.c
blob68c82c5239b00c2b51c9d5e3a2adba570b73a839
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 USE_XSHAPE
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"
45 #include "misc.h"
49 *--------------------------------------------------------------------
50 * wClientRestore--
51 * Reparent the window back to the root window.
53 *--------------------------------------------------------------------
55 void wClientRestore(WWindow * wwin)
57 #if 0
58 int gx, gy;
60 wClientGetGravityOffsets(wwin, &gx, &gy);
61 /* set the position of the frame on screen */
62 wwin->frame_x -= gx * wwin->screen_ptr->frame_border_width;
63 wwin->frame_y -= gy * wwin->screen_ptr->frame_border_width;
64 /* if gravity is to the south, account for the border sizes */
65 if (gy > 0)
66 wwin->frame_y += (wwin->frame->top_width + wwin->frame->bottom_width);
67 #endif
68 XSetWindowBorderWidth(dpy, wwin->client_win, wwin->old_border_width);
69 XReparentWindow(dpy, wwin->client_win, wwin->screen_ptr->root_win, wwin->frame_x, wwin->frame_y);
71 /* don't let the window get iconified after restart */
73 if (wwin->flags.shaded)
74 wClientSetState(wwin, NormalState, None);
79 *----------------------------------------------------------------------
80 * wClientSetState--
81 * Set the state of the client window to one of the window
82 * states defined in ICCCM (Iconic, Withdrawn, Normal)
84 * Side effects:
85 * The WM_STATE property of the window is updated as well as the
86 * WWindow.state variable.
87 *----------------------------------------------------------------------
89 void wClientSetState(WWindow * wwin, int state, Window icon_win)
91 long data[2];
93 wwin->state = state;
95 data[0] = (unsigned long)state;
96 data[1] = (unsigned long)icon_win;
98 XChangeProperty(dpy, wwin->client_win, w_global.atom.wm.state,
99 w_global.atom.wm.state, 32, PropModeReplace,
100 (unsigned char *)data, 2);
103 void wClientGetGravityOffsets(WWindow * wwin, int *ofs_x, int *ofs_y)
105 switch (wwin->normal_hints->win_gravity) {
106 case ForgetGravity:
107 case CenterGravity:
108 case StaticGravity:
109 *ofs_x = 0;
110 *ofs_y = 0;
111 break;
112 case NorthWestGravity:
113 *ofs_x = -1;
114 *ofs_y = -1;
115 break;
116 case NorthGravity:
117 *ofs_x = 0;
118 *ofs_y = -1;
119 break;
120 case NorthEastGravity:
121 *ofs_x = 1;
122 *ofs_y = -1;
123 break;
124 case WestGravity:
125 *ofs_x = -1;
126 *ofs_y = 0;
127 break;
128 case EastGravity:
129 *ofs_x = 1;
130 *ofs_y = 0;
131 break;
132 case SouthWestGravity:
133 *ofs_x = -1;
134 *ofs_y = 1;
135 break;
136 case SouthGravity:
137 *ofs_x = 0;
138 *ofs_y = 1;
139 break;
140 case SouthEastGravity:
141 *ofs_x = 1;
142 *ofs_y = 1;
143 break;
147 void wClientConfigure(WWindow * wwin, XConfigureRequestEvent * xcre)
149 XWindowChanges xwc;
150 int nx, ny, nwidth, nheight;
151 int ofs_x, ofs_y;
153 /* printf("configure event: %d %d %d %d\n", xcre->x, xcre->y, xcre->width, xcre->height); */
155 if (wwin == NULL) {
157 * configure a window that was not mapped by us
159 xwc.x = xcre->x;
160 xwc.y = xcre->y;
161 xwc.width = xcre->width;
162 xwc.height = xcre->height;
163 xwc.border_width = xcre->border_width;
164 xwc.stack_mode = xcre->detail;
165 xwc.sibling = xcre->above;
166 XConfigureWindow(dpy, xcre->window, xcre->value_mask, &xwc);
167 return;
169 #ifdef USE_XSHAPE
170 if (w_global.xext.shape.supported) {
171 int junk;
172 unsigned int ujunk;
173 int b_shaped;
175 XShapeSelectInput(dpy, wwin->client_win, ShapeNotifyMask);
176 XShapeQueryExtents(dpy, wwin->client_win, &b_shaped, &junk, &junk,
177 &ujunk, &ujunk, &junk, &junk, &junk, &ujunk, &ujunk);
178 wwin->flags.shaped = b_shaped;
180 #endif
181 if (xcre->value_mask & CWStackMode) {
182 WObjDescriptor *desc;
183 WWindow *sibling;
185 if ((xcre->value_mask & CWSibling) &&
186 (XFindContext(dpy, xcre->above, w_global.context.client_win, (XPointer *) & desc) == XCSUCCESS)
187 && (desc->parent_type == WCLASS_WINDOW)) {
188 sibling = desc->parent;
189 xwc.sibling = sibling->frame->core->window;
190 } else {
191 xwc.sibling = xcre->above;
193 xwc.stack_mode = xcre->detail;
194 XConfigureWindow(dpy, wwin->frame->core->window,
195 xcre->value_mask & (CWSibling | CWStackMode), &xwc);
196 /* fix stacking order */
197 RemakeStackList(wwin->screen_ptr);
200 wClientGetGravityOffsets(wwin, &ofs_x, &ofs_y);
202 if (xcre->value_mask & CWBorderWidth) {
203 wwin->old_border_width = xcre->border_width;
206 if (!wwin->flags.shaded) {
207 /* If the window is shaded, wrong height will be set for the window */
208 if (xcre->value_mask & CWX) {
209 nx = xcre->x;
210 /* Subtracting the border makes the window shift by 1 pixel -Dan */
211 /*if (HAS_BORDER(wwin)) {
212 nx -= wwin->screen_ptr->frame_border_width;
213 } */
214 } else {
215 nx = wwin->frame_x;
218 if (xcre->value_mask & CWY) {
219 ny = xcre->y - ((ofs_y < 0) ? 0 : wwin->frame->top_width);
220 /* Subtracting the border makes the window shift by 1 pixel -Dan */
221 /*if (HAS_BORDER(wwin)) {
222 ny -= wwin->screen_ptr->frame_border_width;
223 } */
224 } else {
225 ny = wwin->frame_y;
228 if (xcre->value_mask & CWWidth)
229 nwidth = xcre->width;
230 else
231 nwidth = wwin->frame->core->width;
233 if (xcre->value_mask & CWHeight)
234 nheight = xcre->height;
235 else
236 nheight = wwin->frame->core->height - wwin->frame->top_width - wwin->frame->bottom_width;
238 /* Don't overwrite the saved geometry unnecessarily. */
239 if (!(xcre->value_mask & (CWX | CWY | CWWidth | CWHeight)))
240 return;
242 if (nwidth != wwin->old_geometry.width)
243 wwin->flags.maximized &= ~(MAX_HORIZONTAL | MAX_TOPHALF | MAX_BOTTOMHALF | MAX_MAXIMUS | MAX_CENTRAL);
244 if (nheight != wwin->old_geometry.height)
245 wwin->flags.maximized &= ~(MAX_VERTICAL | MAX_LEFTHALF | MAX_RIGHTHALF | MAX_MAXIMUS | MAX_CENTRAL);
247 wWindowConstrainSize(wwin, (unsigned int *)&nwidth, (unsigned int *)&nheight);
248 wWindowConfigure(wwin, nx, ny, nwidth, nheight);
249 wwin->old_geometry.x = nx;
250 wwin->old_geometry.y = ny;
251 wwin->old_geometry.width = nwidth;
252 wwin->old_geometry.height = nheight;
256 void wClientSendProtocol(WWindow * wwin, Atom protocol, Time time)
258 XEvent event;
260 event.xclient.type = ClientMessage;
261 event.xclient.message_type = w_global.atom.wm.protocols;
262 event.xclient.format = 32;
263 event.xclient.display = dpy;
264 event.xclient.window = wwin->client_win;
265 event.xclient.data.l[0] = protocol;
266 event.xclient.data.l[1] = time;
267 event.xclient.data.l[2] = 0;
268 event.xclient.data.l[3] = 0;
269 XSendEvent(dpy, wwin->client_win, False, NoEventMask, &event);
270 XSync(dpy, False);
273 void wClientKill(WWindow * wwin)
275 XKillClient(dpy, wwin->client_win);
277 XFlush(dpy);
281 *----------------------------------------------------------------------
282 * wClientCheckProperty--
283 * Handles PropertyNotify'es, verifying which property was
284 * changed and updating internal state according to that, like redrawing
285 * the icon title when it is changed.
287 * Side effects:
288 * Depends on the changed property.
290 * TODO: _GNUSTEP_WM_ATTR
291 *----------------------------------------------------------------------
293 void wClientCheckProperty(WWindow * wwin, XPropertyEvent * event)
295 XWindowAttributes attribs;
296 XWMHints *new_hints;
297 int i, g1, g2;
298 char *tmp = NULL;
300 switch (event->atom) {
301 case XA_WM_NAME:
302 if (!wwin->flags.net_has_title) {
303 /* window title was changed */
304 if (!wFetchName(dpy, wwin->client_win, &tmp)) {
305 wWindowUpdateName(wwin, NULL);
306 } else {
307 wWindowUpdateName(wwin, tmp);
309 if (tmp)
310 XFree(tmp);
312 break;
314 case XA_WM_ICON_NAME:
315 /* Title has changed, update the icon title */
316 if (wwin->icon) {
317 wIconChangeTitle(wwin->icon, wwin);
318 wIconPaint(wwin->icon);
320 break;
322 case XA_WM_COMMAND:
323 if (wwin->main_window != None) {
324 WApplication *wapp = wApplicationOf(wwin->main_window);
325 char *command;
327 if (!wapp || !wapp->app_icon || wapp->app_icon->docked)
328 break;
330 command = GetCommandForWindow(wwin->main_window);
331 if (command) {
332 if (wapp->app_icon->command)
333 wfree(wapp->app_icon->command);
334 wapp->app_icon->command = command;
337 break;
339 case XA_WM_HINTS:
340 /* WM_HINTS */
342 new_hints = XGetWMHints(dpy, wwin->client_win);
344 /* group leader update
346 * This means that the window is setting the leader after
347 * it was mapped, changing leaders or removing the leader.
349 * Valid state transitions are:
351 * _1 __2
352 * / \ / \
353 * v | v |
354 * (GC) (GC')
355 * / ^ / ^
356 * 3| |4 5| |6
357 * | | | |
358 * v / v /
359 * (G'C) (G'C')
361 * Where G is the window_group hint, C is CLIENT_LEADER property
362 * and ' indicates the hint is unset.
364 * 1,2 - change group leader to new value of window_group
365 * 3 - change leader to value of CLIENT_LEADER
366 * 4 - change leader to value of window_group
367 * 5 - destroy application
368 * 6 - create application
370 if (new_hints && (new_hints->flags & WindowGroupHint)
371 && new_hints->window_group != None) {
372 g2 = 1;
373 } else {
374 g2 = 0;
376 if (wwin->wm_hints && (wwin->wm_hints->flags & WindowGroupHint)
377 && wwin->wm_hints->window_group != None) {
378 g1 = 1;
379 } else {
380 g1 = 0;
383 if (wwin->client_leader) {
384 if (g1 && g2 && wwin->wm_hints->window_group != new_hints->window_group) {
385 i = 1;
386 } else if (g1 && !g2) {
387 i = 3;
388 } else if (!g1 && g2) {
389 i = 4;
390 } else {
391 i = 0;
393 } else {
394 if (g1 && g2 && wwin->wm_hints->window_group != new_hints->window_group) {
395 i = 2;
396 } else if (g1 && !g2) {
397 i = 5;
398 } else if (!g1 && g2) {
399 i = 6;
400 } else {
401 i = 0;
405 /* Handling this may require more work. -Dan */
406 if (wwin->fake_group != NULL) {
407 i = 7;
410 if (wwin->wm_hints)
411 XFree(wwin->wm_hints);
413 wwin->wm_hints = new_hints;
415 /* do action according to state transition */
416 switch (i) {
417 /* 3 - change leader to value of CLIENT_LEADER */
418 case 3:
419 wApplicationDestroy(wApplicationOf(wwin->main_window));
420 wwin->main_window = wwin->client_leader;
421 wwin->group_id = None;
422 wApplicationCreate(wwin);
423 break;
425 /* 1,2,4 - change leader to new value of window_group */
426 case 1:
427 case 2:
428 case 4:
429 wApplicationDestroy(wApplicationOf(wwin->main_window));
430 wwin->main_window = new_hints->window_group;
431 wwin->group_id = wwin->main_window;
432 wApplicationCreate(wwin);
433 break;
435 /* 5 - destroy application */
436 case 5:
437 wApplicationDestroy(wApplicationOf(wwin->main_window));
438 wwin->main_window = None;
439 wwin->group_id = None;
440 break;
442 /* 6 - create application */
443 case 6:
444 wwin->main_window = new_hints->window_group;
445 wwin->group_id = wwin->main_window;
446 wApplicationCreate(wwin);
447 break;
448 /* 7 - we have a fake window group id, so just ignore anything else */
449 case 7:
450 break;
453 if (wwin->wm_hints) {
454 /* update icon */
455 if ((wwin->wm_hints->flags & IconPixmapHint)
456 || (wwin->wm_hints->flags & IconWindowHint)) {
457 WApplication *wapp;
459 if (wwin->flags.miniaturized && wwin->icon)
460 wIconUpdate(wwin->icon);
462 wapp = wApplicationOf(wwin->main_window);
463 if (wapp && wapp->app_icon) {
464 wIconUpdate(wapp->app_icon->icon);
465 wAppIconPaint(wapp->app_icon);
469 if (wwin->wm_hints->flags & UrgencyHint)
470 wwin->flags.urgent = 1;
471 else
472 wwin->flags.urgent = 0;
473 wAppBounceWhileUrgent(wApplicationOf(wwin->main_window));
474 /*} else if (wwin->fake_group!=NULL) {
475 wwin->group_id = wwin->fake_group->leader; */
476 } else {
477 wwin->group_id = None;
479 break;
481 case XA_WM_NORMAL_HINTS:
482 /* normal (geometry) hints */
484 int foo;
485 unsigned bar;
487 if (XGetWindowAttributes(dpy, wwin->client_win, &attribs) != 0)
488 wClientGetNormalHints(wwin, &attribs, False, &foo, &foo, &bar, &bar);
489 /* TODO: should we check for consistency of the current
490 * size against the new geometry hints? */
492 break;
494 case XA_WM_TRANSIENT_FOR:
496 Window new_owner;
497 WWindow *owner;
499 if (!XGetTransientForHint(dpy, wwin->client_win, &new_owner)) {
500 new_owner = None;
501 } else {
502 if (new_owner == 0 || new_owner == wwin->client_win) {
503 new_owner = wwin->screen_ptr->root_win;
506 if (new_owner != wwin->transient_for) {
507 owner = wWindowFor(wwin->transient_for);
508 if (owner) {
509 if (owner->flags.semi_focused) {
510 owner->flags.semi_focused = 0;
511 if ((owner->flags.mapped || owner->flags.shaded)
512 && owner->frame)
513 wFrameWindowPaint(owner->frame);
516 owner = wWindowFor(new_owner);
517 if (owner) {
518 if (!owner->flags.semi_focused) {
519 owner->flags.semi_focused = 1;
520 if ((owner->flags.mapped || owner->flags.shaded)
521 && owner->frame)
522 wFrameWindowPaint(owner->frame);
525 wwin->transient_for = new_owner;
526 if (new_owner == None) {
527 if (WFLAGP(wwin, no_miniaturizable)) {
528 wwin->client_flags.no_miniaturizable = 0;
529 wwin->client_flags.no_miniaturize_button = 0;
530 if (wwin->frame)
531 wWindowConfigureBorders(wwin);
533 } else if (!WFLAGP(wwin, no_miniaturizable)) {
534 wwin->client_flags.no_miniaturizable = 1;
535 wwin->client_flags.no_miniaturize_button = 1;
536 if (wwin->frame)
537 wWindowConfigureBorders(wwin);
541 break;
543 default:
544 if (event->atom == w_global.atom.wm.protocols) {
546 PropGetProtocols(wwin->client_win, &wwin->protocols);
548 wwin->client_flags.kill_close = !wwin->protocols.DELETE_WINDOW;
550 if (wwin->frame)
551 wWindowUpdateButtonImages(wwin);
553 } else if (event->atom == w_global.atom.wm.colormap_windows) {
555 GetColormapWindows(wwin);
556 wColormapInstallForWindow(wwin->screen_ptr, wwin);
558 } else if (event->atom == w_global.atom.wmaker.menu) {
559 WApplication *wapp;
561 wapp = wApplicationOf(wwin->main_window);
562 if (wapp) {
563 if (wapp->menu) {
564 /* update menu */
565 /* TODO: remake appmenu update */
566 wAppMenuDestroy(wapp->menu);
568 if (wwin->fake_group) {
569 WScreen *scr = wwin->screen_ptr;
570 WWindow *foo = scr->focused_window;
571 WFakeGroupLeader *fPtr = wwin->fake_group;
573 wApplicationDestroy(wapp);
574 while (foo) {
575 if (foo->fake_group && foo->fake_group == fPtr) {
576 foo->client_flags.shared_appicon = 0;
577 foo->fake_group = NULL;
579 if (foo->group_id != None)
580 foo->main_window = foo->group_id;
581 else if (foo->client_leader != None)
582 foo->main_window = foo->client_leader;
583 else if (WFLAGP(foo, emulate_appicon))
584 foo->main_window = foo->client_win;
585 else
586 foo->main_window = None;
588 if (foo->main_window)
589 wApplicationCreate(foo);
591 foo = foo->prev;
594 if (fPtr->leader != None)
595 XDestroyWindow(dpy, fPtr->leader);
596 fPtr->retainCount = 0;
597 fPtr->leader = None;
598 fPtr->origLeader = None;
600 wapp = wApplicationOf(wwin->main_window);
601 if (wapp) {
602 wapp->menu = wAppMenuGet(scr, wwin->main_window);
604 if (wPreferences.auto_arrange_icons) {
605 wArrangeIcons(wwin->screen_ptr, True);
607 } else {
608 wapp->menu = wAppMenuGet(wwin->screen_ptr, wwin->main_window);
610 /* make the appmenu be mapped */
611 wSetFocusTo(wwin->screen_ptr, NULL);
612 wSetFocusTo(wwin->screen_ptr, wwin->screen_ptr->focused_window);
614 } else if (event->atom == w_global.atom.gnustep.wm_attr) {
615 GNUstepWMAttributes *attr;
617 PropGetGNUstepWMAttr(wwin->client_win, &attr);
619 wWindowUpdateGNUstepAttr(wwin, attr);
621 XFree(attr);
622 } else {
623 wNETWMCheckClientHintChange(wwin, event);
629 *----------------------------------------------------------------------
630 * wClientGetNormalHints--
631 * Get size (normal) hints and a default geometry for the client
632 * window. The hints are also checked for inconsistency. If geometry is
633 * True, the returned data will account for client specified initial
634 * geometry.
636 * Side effects:
637 * normal_hints is filled with valid data.
638 *----------------------------------------------------------------------
640 void
641 wClientGetNormalHints(WWindow * wwin, XWindowAttributes * wattribs, Bool geometry,
642 int *x, int *y, unsigned *width, unsigned *height)
644 int pre_icccm = 0; /* not used */
646 /* find a position for the window */
647 if (!wwin->normal_hints)
648 wwin->normal_hints = XAllocSizeHints();
650 if (!PropGetNormalHints(wwin->client_win, wwin->normal_hints, &pre_icccm)) {
651 wwin->normal_hints->flags = 0;
653 *x = wattribs->x;
654 *y = wattribs->y;
656 *width = wattribs->width;
657 *height = wattribs->height;
659 if (!(wwin->normal_hints->flags & PWinGravity)) {
660 wwin->normal_hints->win_gravity = NorthWestGravity;
662 if (!(wwin->normal_hints->flags & PMinSize)) {
663 wwin->normal_hints->min_width = MIN_WINDOW_SIZE;
664 wwin->normal_hints->min_height = MIN_WINDOW_SIZE;
666 if (!(wwin->normal_hints->flags & PBaseSize)) {
667 wwin->normal_hints->base_width = 0;
668 wwin->normal_hints->base_height = 0;
670 if (!(wwin->normal_hints->flags & PMaxSize)) {
671 wwin->normal_hints->max_width = wwin->screen_ptr->scr_width * 2;
672 wwin->normal_hints->max_height = wwin->screen_ptr->scr_height * 2;
675 /* some buggy apps set weird hints.. */
676 if (wwin->normal_hints->min_width <= 0)
677 wwin->normal_hints->min_width = MIN_WINDOW_SIZE;
679 if (wwin->normal_hints->min_height <= 0)
680 wwin->normal_hints->min_height = MIN_WINDOW_SIZE;
682 if (wwin->normal_hints->max_width < wwin->normal_hints->min_width)
683 wwin->normal_hints->max_width = wwin->normal_hints->min_width;
685 if (wwin->normal_hints->max_height < wwin->normal_hints->min_height)
686 wwin->normal_hints->max_height = wwin->normal_hints->min_height;
688 if (!(wwin->normal_hints->flags & PResizeInc)) {
689 wwin->normal_hints->width_inc = 1;
690 wwin->normal_hints->height_inc = 1;
691 } else {
692 if (wwin->normal_hints->width_inc <= 0)
693 wwin->normal_hints->width_inc = 1;
694 if (wwin->normal_hints->height_inc <= 0)
695 wwin->normal_hints->height_inc = 1;
698 if (wwin->normal_hints->flags & PAspect) {
699 if (wwin->normal_hints->min_aspect.x < 1)
700 wwin->normal_hints->min_aspect.x = 1;
701 if (wwin->normal_hints->min_aspect.y < 1)
702 wwin->normal_hints->min_aspect.y = 1;
704 if (wwin->normal_hints->max_aspect.x < 1)
705 wwin->normal_hints->max_aspect.x = 1;
706 if (wwin->normal_hints->max_aspect.y < 1)
707 wwin->normal_hints->max_aspect.y = 1;
710 if (wwin->normal_hints->min_height > wwin->normal_hints->max_height) {
711 wwin->normal_hints->min_height = wwin->normal_hints->max_height;
713 if (wwin->normal_hints->min_width > wwin->normal_hints->max_width) {
714 wwin->normal_hints->min_width = wwin->normal_hints->max_width;
716 #ifdef IGNORE_PPOSITION
717 wwin->normal_hints->flags &= ~PPosition;
718 #endif
720 if (pre_icccm && !wwin->screen_ptr->flags.startup && geometry) {
721 if (wwin->normal_hints->flags & (USPosition | PPosition)) {
722 *x = wwin->normal_hints->x;
723 *y = wwin->normal_hints->y;
725 if (wwin->normal_hints->flags & (USSize | PSize)) {
726 *width = wwin->normal_hints->width;
727 *height = wwin->normal_hints->height;
732 void GetColormapWindows(WWindow * wwin)
734 #ifndef NO_CRASHES
735 if (wwin->cmap_windows) {
736 XFree(wwin->cmap_windows);
739 wwin->cmap_windows = NULL;
740 wwin->cmap_window_no = 0;
742 if (!XGetWMColormapWindows(dpy, wwin->client_win, &(wwin->cmap_windows), &(wwin->cmap_window_no))
743 || !wwin->cmap_windows) {
744 wwin->cmap_window_no = 0;
745 wwin->cmap_windows = NULL;
747 #endif