ea7247653bd388e87ce7997f83ce145ca074e690
[wmaker-crm.git] / src / client.c
blobea7247653bd388e87ce7997f83ce145ca074e690
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 * FRAME_BORDER_WIDTH;
79 wwin->frame_y -= gy * 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 /* account for titlebar and border */
85 wwin->frame_y += wwin->frame->top_width;
86 if (HAS_BORDER(wwin)) {
87 wwin->frame_x += FRAME_BORDER_WIDTH;
88 wwin->frame_y += FRAME_BORDER_WIDTH;
91 XSetWindowBorderWidth(dpy, wwin->client_win, wwin->old_border_width);
92 XReparentWindow(dpy, wwin->client_win, wwin->screen_ptr->root_win, wwin->frame_x, wwin->frame_y);
94 /* don't let the window get iconified after restart */
96 if (wwin->flags.shaded)
97 wClientSetState(wwin, NormalState, None);
102 *----------------------------------------------------------------------
103 * wClientSetState--
104 * Set the state of the client window to one of the window
105 * states defined in ICCCM (Iconic, Withdrawn, Normal)
107 * Side effects:
108 * The WM_STATE property of the window is updated as well as the
109 * WWindow.state variable.
110 *----------------------------------------------------------------------
112 void wClientSetState(WWindow * wwin, int state, Window icon_win)
114 long data[2];
116 wwin->state = state;
118 data[0] = (unsigned long)state;
119 data[1] = (unsigned long)icon_win;
121 XChangeProperty(dpy, wwin->client_win, _XA_WM_STATE, _XA_WM_STATE, 32,
122 PropModeReplace, (unsigned char *)data, 2);
125 void wClientGetGravityOffsets(WWindow * wwin, int *ofs_x, int *ofs_y)
127 switch (wwin->normal_hints->win_gravity) {
128 case ForgetGravity:
129 case CenterGravity:
130 case StaticGravity:
131 *ofs_x = 0;
132 *ofs_y = 0;
133 break;
134 case NorthWestGravity:
135 *ofs_x = -1;
136 *ofs_y = -1;
137 break;
138 case NorthGravity:
139 *ofs_x = 0;
140 *ofs_y = -1;
141 break;
142 case NorthEastGravity:
143 *ofs_x = 1;
144 *ofs_y = -1;
145 break;
146 case WestGravity:
147 *ofs_x = -1;
148 *ofs_y = 0;
149 break;
150 case EastGravity:
151 *ofs_x = 1;
152 *ofs_y = 0;
153 break;
154 case SouthWestGravity:
155 *ofs_x = -1;
156 *ofs_y = 1;
157 break;
158 case SouthGravity:
159 *ofs_x = 0;
160 *ofs_y = 1;
161 break;
162 case SouthEastGravity:
163 *ofs_x = 1;
164 *ofs_y = 1;
165 break;
169 void wClientConfigure(WWindow * wwin, XConfigureRequestEvent * xcre)
171 XWindowChanges xwc;
172 int nx, ny, nwidth, nheight;
173 int ofs_x, ofs_y;
175 /* printf("configure event: %d %d %d %d\n", xcre->x, xcre->y, xcre->width, xcre->height); */
177 if (wwin == NULL) {
179 * configure a window that was not mapped by us
181 xwc.x = xcre->x;
182 xwc.y = xcre->y;
183 xwc.width = xcre->width;
184 xwc.height = xcre->height;
185 xwc.border_width = xcre->border_width;
186 xwc.stack_mode = xcre->detail;
187 xwc.sibling = xcre->above;
188 XConfigureWindow(dpy, xcre->window, xcre->value_mask, &xwc);
189 return;
191 #ifdef SHAPE
192 if (wShapeSupported) {
193 int junk;
194 unsigned int ujunk;
195 int b_shaped;
197 XShapeSelectInput(dpy, wwin->client_win, ShapeNotifyMask);
198 XShapeQueryExtents(dpy, wwin->client_win, &b_shaped, &junk, &junk,
199 &ujunk, &ujunk, &junk, &junk, &junk, &ujunk, &ujunk);
200 wwin->flags.shaped = b_shaped;
202 #endif
203 if (xcre->value_mask & CWStackMode) {
204 WObjDescriptor *desc;
205 WWindow *sibling;
207 if ((xcre->value_mask & CWSibling) &&
208 (XFindContext(dpy, xcre->above, wWinContext, (XPointer *) & desc) == XCSUCCESS)
209 && (desc->parent_type == WCLASS_WINDOW)) {
210 sibling = desc->parent;
211 xwc.sibling = sibling->frame->core->window;
212 } else {
213 xwc.sibling = xcre->above;
215 xwc.stack_mode = xcre->detail;
216 XConfigureWindow(dpy, wwin->frame->core->window,
217 xcre->value_mask & (CWSibling | CWStackMode), &xwc);
218 /* fix stacking order */
219 RemakeStackList(wwin->screen_ptr);
222 wClientGetGravityOffsets(wwin, &ofs_x, &ofs_y);
224 if (xcre->value_mask & CWBorderWidth) {
225 wwin->old_border_width = xcre->border_width;
228 if (!wwin->flags.shaded) {
229 /* If the window is shaded, wrong height will be set for the window */
230 if (xcre->value_mask & CWX) {
231 nx = xcre->x;
232 /* Subtracting the border makes the window shift by 1 pixel -Dan */
233 /*if (HAS_BORDER(wwin)) {
234 nx -= FRAME_BORDER_WIDTH;
235 } */
236 } else {
237 nx = wwin->frame_x;
240 if (xcre->value_mask & CWY) {
241 ny = xcre->y - ((ofs_y < 0) ? 0 : wwin->frame->top_width);
242 /* Subtracting the border makes the window shift by 1 pixel -Dan */
243 /*if (HAS_BORDER(wwin)) {
244 ny -= FRAME_BORDER_WIDTH;
245 } */
246 } else {
247 ny = wwin->frame_y;
250 if (xcre->value_mask & CWWidth)
251 nwidth = xcre->width;
252 else
253 nwidth = wwin->frame->core->width;
255 if (xcre->value_mask & CWHeight)
256 nheight = xcre->height;
257 else
258 nheight = wwin->frame->core->height - wwin->frame->top_width - wwin->frame->bottom_width;
260 if (nwidth != wwin->old_geometry.width)
261 wwin->flags.maximized &= ~(MAX_HORIZONTAL | MAX_MAXIMUS);
262 if (nheight != wwin->old_geometry.height)
263 wwin->flags.maximized &= ~(MAX_VERTICAL | MAX_LEFTHALF | MAX_RIGHTHALF | MAX_MAXIMUS);
265 wWindowConfigure(wwin, nx, ny, nwidth, nheight);
266 wwin->old_geometry.x = nx;
267 wwin->old_geometry.y = ny;
268 wwin->old_geometry.width = nwidth;
269 wwin->old_geometry.height = nheight;
273 void wClientSendProtocol(WWindow * wwin, Atom protocol, Time time)
275 XEvent event;
277 event.xclient.type = ClientMessage;
278 event.xclient.message_type = _XA_WM_PROTOCOLS;
279 event.xclient.format = 32;
280 event.xclient.display = dpy;
281 event.xclient.window = wwin->client_win;
282 event.xclient.data.l[0] = protocol;
283 event.xclient.data.l[1] = time;
284 event.xclient.data.l[2] = 0;
285 event.xclient.data.l[3] = 0;
286 XSendEvent(dpy, wwin->client_win, False, NoEventMask, &event);
287 XSync(dpy, False);
290 void wClientKill(WWindow * wwin)
292 XKillClient(dpy, wwin->client_win);
294 XFlush(dpy);
298 *----------------------------------------------------------------------
299 * wClientCheckProperty--
300 * Handles PropertyNotify'es, verifying which property was
301 * changed and updating internal state according to that, like redrawing
302 * the icon title when it is changed.
304 * Side effects:
305 * Depends on the changed property.
307 * TODO: _GNUSTEP_WM_ATTR
308 *----------------------------------------------------------------------
310 void wClientCheckProperty(WWindow * wwin, XPropertyEvent * event)
312 XWindowAttributes attribs;
313 XWMHints *new_hints;
314 int i, g1, g2;
315 char *tmp = NULL;
317 switch (event->atom) {
318 case XA_WM_NAME:
319 if (!wwin->flags.net_has_title) {
320 /* window title was changed */
321 if (!wFetchName(dpy, wwin->client_win, &tmp)) {
322 wWindowUpdateName(wwin, NULL);
323 } else {
324 wWindowUpdateName(wwin, tmp);
326 if (tmp)
327 XFree(tmp);
329 break;
331 case XA_WM_ICON_NAME:
332 if (!wwin->flags.net_has_icon_title) {
333 if (!wwin->icon)
334 break;
335 else {
336 char *new_title;
338 /* icon title was changed */
339 wGetIconName(dpy, wwin->client_win, &new_title);
340 wIconChangeTitle(wwin->icon, new_title);
343 break;
345 case XA_WM_COMMAND:
346 if (wwin->main_window != None) {
347 WApplication *wapp = wApplicationOf(wwin->main_window);
348 char *command;
350 if (!wapp || !wapp->app_icon || wapp->app_icon->docked)
351 break;
353 command = GetCommandForWindow(wwin->main_window);
354 if (command) {
355 if (wapp->app_icon->command)
356 wfree(wapp->app_icon->command);
357 wapp->app_icon->command = command;
360 break;
362 case XA_WM_HINTS:
363 /* WM_HINTS */
365 new_hints = XGetWMHints(dpy, wwin->client_win);
367 /* group leader update
369 * This means that the window is setting the leader after
370 * it was mapped, changing leaders or removing the leader.
372 * Valid state transitions are:
374 * _1 __2
375 * / \ / \
376 * v | v |
377 * (GC) (GC')
378 * / ^ / ^
379 * 3| |4 5| |6
380 * | | | |
381 * v / v /
382 * (G'C) (G'C')
384 * Where G is the window_group hint, C is CLIENT_LEADER property
385 * and ' indicates the hint is unset.
387 * 1,2 - change group leader to new value of window_group
388 * 3 - change leader to value of CLIENT_LEADER
389 * 4 - change leader to value of window_group
390 * 5 - destroy application
391 * 6 - create application
393 if (new_hints && (new_hints->flags & WindowGroupHint)
394 && new_hints->window_group != None) {
395 g2 = 1;
396 } else {
397 g2 = 0;
399 if (wwin->wm_hints && (wwin->wm_hints->flags & WindowGroupHint)
400 && wwin->wm_hints->window_group != None) {
401 g1 = 1;
402 } else {
403 g1 = 0;
406 if (wwin->client_leader) {
407 if (g1 && g2 && wwin->wm_hints->window_group != new_hints->window_group) {
408 i = 1;
409 } else if (g1 && !g2) {
410 i = 3;
411 } else if (!g1 && g2) {
412 i = 4;
413 } else {
414 i = 0;
416 } else {
417 if (g1 && g2 && wwin->wm_hints->window_group != new_hints->window_group) {
418 i = 2;
419 } else if (g1 && !g2) {
420 i = 5;
421 } else if (!g1 && g2) {
422 i = 6;
423 } else {
424 i = 0;
428 /* Handling this may require more work. -Dan */
429 if (wwin->fake_group != NULL) {
430 i = 7;
433 if (wwin->wm_hints)
434 XFree(wwin->wm_hints);
436 wwin->wm_hints = new_hints;
438 /* do action according to state transition */
439 switch (i) {
440 /* 3 - change leader to value of CLIENT_LEADER */
441 case 3:
442 wApplicationDestroy(wApplicationOf(wwin->main_window));
443 wwin->main_window = wwin->client_leader;
444 wwin->group_id = None;
445 wApplicationCreate(wwin);
446 break;
448 /* 1,2,4 - change leader to new value of window_group */
449 case 1:
450 case 2:
451 case 4:
452 wApplicationDestroy(wApplicationOf(wwin->main_window));
453 wwin->main_window = new_hints->window_group;
454 wwin->group_id = wwin->main_window;
455 wApplicationCreate(wwin);
456 break;
458 /* 5 - destroy application */
459 case 5:
460 wApplicationDestroy(wApplicationOf(wwin->main_window));
461 wwin->main_window = None;
462 wwin->group_id = None;
463 break;
465 /* 6 - create application */
466 case 6:
467 wwin->main_window = new_hints->window_group;
468 wwin->group_id = wwin->main_window;
469 wApplicationCreate(wwin);
470 break;
471 /* 7 - we have a fake window group id, so just ignore anything else */
472 case 7:
473 break;
476 if (wwin->wm_hints) {
477 /* update icon */
478 if ((wwin->wm_hints->flags & IconPixmapHint)
479 || (wwin->wm_hints->flags & IconWindowHint)) {
480 WApplication *wapp;
482 if (wwin->flags.miniaturized && wwin->icon) {
483 wIconUpdate(wwin->icon, NULL);
485 wapp = wApplicationOf(wwin->main_window);
486 if (wapp && wapp->app_icon) {
487 wIconUpdate(wapp->app_icon->icon, NULL);
488 wAppIconPaint(wapp->app_icon);
492 if (wwin->wm_hints->flags & UrgencyHint)
493 wwin->flags.urgent = 1;
494 else
495 wwin->flags.urgent = 0;
496 wAppBounceWhileUrgent(wApplicationOf(wwin->main_window));
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 wNETWMCheckClientHintChange(wwin, event);
652 *----------------------------------------------------------------------
653 * wClientGetNormalHints--
654 * Get size (normal) hints and a default geometry for the client
655 * window. The hints are also checked for inconsistency. If geometry is
656 * True, the returned data will account for client specified initial
657 * geometry.
659 * Side effects:
660 * normal_hints is filled with valid data.
661 *----------------------------------------------------------------------
663 void
664 wClientGetNormalHints(WWindow * wwin, XWindowAttributes * wattribs, Bool geometry,
665 int *x, int *y, unsigned *width, unsigned *height)
667 int pre_icccm = 0; /* not used */
669 /* find a position for the window */
670 if (!wwin->normal_hints)
671 wwin->normal_hints = XAllocSizeHints();
673 if (!PropGetNormalHints(wwin->client_win, wwin->normal_hints, &pre_icccm)) {
674 wwin->normal_hints->flags = 0;
676 *x = wattribs->x;
677 *y = wattribs->y;
679 *width = wattribs->width;
680 *height = wattribs->height;
682 if (!(wwin->normal_hints->flags & PWinGravity)) {
683 wwin->normal_hints->win_gravity = NorthWestGravity;
685 if (!(wwin->normal_hints->flags & PMinSize)) {
686 wwin->normal_hints->min_width = MIN_WINDOW_SIZE;
687 wwin->normal_hints->min_height = MIN_WINDOW_SIZE;
689 if (!(wwin->normal_hints->flags & PBaseSize)) {
690 wwin->normal_hints->base_width = 0;
691 wwin->normal_hints->base_height = 0;
693 if (!(wwin->normal_hints->flags & PMaxSize)) {
694 wwin->normal_hints->max_width = wwin->screen_ptr->scr_width * 2;
695 wwin->normal_hints->max_height = wwin->screen_ptr->scr_height * 2;
698 /* some buggy apps set weird hints.. */
699 if (wwin->normal_hints->min_width <= 0)
700 wwin->normal_hints->min_width = MIN_WINDOW_SIZE;
702 if (wwin->normal_hints->min_height <= 0)
703 wwin->normal_hints->min_height = MIN_WINDOW_SIZE;
705 if (wwin->normal_hints->max_width < wwin->normal_hints->min_width)
706 wwin->normal_hints->max_width = wwin->normal_hints->min_width;
708 if (wwin->normal_hints->max_height < wwin->normal_hints->min_height)
709 wwin->normal_hints->max_height = wwin->normal_hints->min_height;
711 if (!(wwin->normal_hints->flags & PResizeInc)) {
712 wwin->normal_hints->width_inc = 1;
713 wwin->normal_hints->height_inc = 1;
714 } else {
715 if (wwin->normal_hints->width_inc <= 0)
716 wwin->normal_hints->width_inc = 1;
717 if (wwin->normal_hints->height_inc <= 0)
718 wwin->normal_hints->height_inc = 1;
721 if (wwin->normal_hints->flags & PAspect) {
722 if (wwin->normal_hints->min_aspect.x < 1)
723 wwin->normal_hints->min_aspect.x = 1;
724 if (wwin->normal_hints->min_aspect.y < 1)
725 wwin->normal_hints->min_aspect.y = 1;
727 if (wwin->normal_hints->max_aspect.x < 1)
728 wwin->normal_hints->max_aspect.x = 1;
729 if (wwin->normal_hints->max_aspect.y < 1)
730 wwin->normal_hints->max_aspect.y = 1;
733 if (wwin->normal_hints->min_height > wwin->normal_hints->max_height) {
734 wwin->normal_hints->min_height = wwin->normal_hints->max_height;
736 if (wwin->normal_hints->min_width > wwin->normal_hints->max_width) {
737 wwin->normal_hints->min_width = wwin->normal_hints->max_width;
739 #ifdef IGNORE_PPOSITION
740 wwin->normal_hints->flags &= ~PPosition;
741 #endif
743 if (pre_icccm && !wwin->screen_ptr->flags.startup && geometry) {
744 if (wwin->normal_hints->flags & (USPosition | PPosition)) {
745 *x = wwin->normal_hints->x;
746 *y = wwin->normal_hints->y;
748 if (wwin->normal_hints->flags & (USSize | PSize)) {
749 *width = wwin->normal_hints->width;
750 *height = wwin->normal_hints->height;
755 void GetColormapWindows(WWindow * wwin)
757 #ifndef NO_CRASHES
758 if (wwin->cmap_windows) {
759 XFree(wwin->cmap_windows);
762 wwin->cmap_windows = NULL;
763 wwin->cmap_window_no = 0;
765 if (!XGetWMColormapWindows(dpy, wwin->client_win, &(wwin->cmap_windows), &(wwin->cmap_window_no))
766 || !wwin->cmap_windows) {
767 wwin->cmap_window_no = 0;
768 wwin->cmap_windows = NULL;
770 #endif