2 * Window related functions
4 * Copyright 1993, 1994, 1995, 1996, 2001 Alexandre Julliard
5 * Copyright 1993 David Metcalfe
6 * Copyright 1995, 1996 Alex Korobka
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
32 #include <X11/Xresource.h>
33 #include <X11/Xutil.h>
40 #include "wine/unicode.h"
42 #include "wine/debug.h"
48 WINE_DEFAULT_DEBUG_CHANNEL(x11drv
);
50 extern Pixmap
X11DRV_BITMAP_Pixmap( HBITMAP
);
52 /* X context to associate a hwnd to an X window */
53 XContext winContext
= 0;
55 Atom X11DRV_Atoms
[NB_XATOMS
- FIRST_XATOM
];
57 static const char * const atom_names
[NB_XATOMS
- FIRST_XATOM
] =
76 "_KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR",
81 "_NET_WM_WINDOW_TYPE",
82 "_NET_WM_WINDOW_TYPE_UTILITY",
106 static LPCSTR whole_window_atom
;
107 static LPCSTR client_window_atom
;
108 static LPCSTR icon_window_atom
;
110 /***********************************************************************
113 * Check if a given window should be managed
115 inline static BOOL
is_window_managed( WND
*win
)
117 if (!managed_mode
) return FALSE
;
118 /* tray window is always managed */
119 if (win
->dwExStyle
& WS_EX_TRAYWINDOW
) return TRUE
;
120 /* child windows are not managed */
121 if (win
->dwStyle
& WS_CHILD
) return FALSE
;
122 /* windows with caption are managed */
123 if ((win
->dwStyle
& WS_CAPTION
) == WS_CAPTION
) return TRUE
;
124 /* tool windows are not managed */
125 if (win
->dwExStyle
& WS_EX_TOOLWINDOW
) return FALSE
;
126 /* windows with thick frame are managed */
127 if (win
->dwStyle
& WS_THICKFRAME
) return TRUE
;
128 /* application windows are managed */
129 if (win
->dwExStyle
& WS_EX_APPWINDOW
) return TRUE
;
130 /* full-screen popup windows are managed */
131 if ((win
->dwStyle
& WS_POPUP
) &&
132 (win
->rectWindow
.right
-win
->rectWindow
.left
) == screen_width
&&
133 (win
->rectWindow
.bottom
-win
->rectWindow
.top
) == screen_height
)
137 /* default: not managed */
142 /***********************************************************************
143 * is_client_window_mapped
145 * Check if the X client window should be mapped
147 inline static BOOL
is_client_window_mapped( WND
*win
)
149 struct x11drv_win_data
*data
= win
->pDriverData
;
150 return !(win
->dwStyle
& WS_MINIMIZE
) && !IsRectEmpty( &data
->client_rect
);
154 /***********************************************************************
155 * X11DRV_is_window_rect_mapped
157 * Check if the X whole window should be mapped based on its rectangle
159 BOOL
X11DRV_is_window_rect_mapped( const RECT
*rect
)
161 /* don't map if rect is empty */
162 if (IsRectEmpty( rect
)) return FALSE
;
164 /* don't map if rect is off-screen */
165 if (rect
->left
>= (int)screen_width
|| rect
->top
>= (int)screen_height
) return FALSE
;
166 if (rect
->right
< 0 || rect
->bottom
< 0) return FALSE
;
172 /***********************************************************************
173 * get_window_attributes
175 * Fill the window attributes structure for an X window.
177 static int get_window_attributes( Display
*display
, WND
*win
, XSetWindowAttributes
*attr
)
179 BOOL is_top_level
= is_window_top_level( win
);
180 BOOL managed
= is_top_level
&& is_window_managed( win
);
182 if (managed
) WIN_SetExStyle( win
->hwndSelf
, win
->dwExStyle
| WS_EX_MANAGED
);
183 else WIN_SetExStyle( win
->hwndSelf
, win
->dwExStyle
& ~WS_EX_MANAGED
);
185 attr
->override_redirect
= !managed
;
186 attr
->colormap
= X11DRV_PALETTE_PaletteXColormap
;
187 attr
->save_under
= ((win
->clsStyle
& CS_SAVEBITS
) != 0);
188 attr
->cursor
= x11drv_thread_data()->cursor
;
189 attr
->event_mask
= (ExposureMask
| PointerMotionMask
|
190 ButtonPressMask
| ButtonReleaseMask
| EnterWindowMask
);
192 if (is_window_top_level( win
))
193 attr
->event_mask
|= (KeyPressMask
| KeyReleaseMask
| StructureNotifyMask
|
194 FocusChangeMask
| KeymapStateMask
);
196 return (CWOverrideRedirect
| CWSaveUnder
| CWEventMask
| CWColormap
| CWCursor
);
200 /***********************************************************************
201 * X11DRV_sync_window_style
203 * Change the X window attributes when the window style has changed.
205 void X11DRV_sync_window_style( Display
*display
, WND
*win
)
207 XSetWindowAttributes attr
;
211 mask
= get_window_attributes( display
, win
, &attr
);
212 XChangeWindowAttributes( display
, get_whole_window(win
), mask
, &attr
);
217 /***********************************************************************
220 * fill the window changes structure
222 static int get_window_changes( XWindowChanges
*changes
, const RECT
*old
, const RECT
*new )
226 if (old
->right
- old
->left
!= new->right
- new->left
)
228 if (!(changes
->width
= new->right
- new->left
)) changes
->width
= 1;
231 if (old
->bottom
- old
->top
!= new->bottom
- new->top
)
233 if (!(changes
->height
= new->bottom
- new->top
)) changes
->height
= 1;
236 if (old
->left
!= new->left
)
238 changes
->x
= new->left
;
241 if (old
->top
!= new->top
)
243 changes
->y
= new->top
;
250 /***********************************************************************
253 static Window
create_icon_window( Display
*display
, WND
*win
)
255 struct x11drv_win_data
*data
= win
->pDriverData
;
256 XSetWindowAttributes attr
;
258 attr
.event_mask
= (ExposureMask
| KeyPressMask
| KeyReleaseMask
| PointerMotionMask
|
259 ButtonPressMask
| ButtonReleaseMask
| EnterWindowMask
);
260 attr
.bit_gravity
= NorthWestGravity
;
261 attr
.backing_store
= NotUseful
/*WhenMapped*/;
262 attr
.colormap
= X11DRV_PALETTE_PaletteXColormap
; /* Needed due to our visual */
265 data
->icon_window
= XCreateWindow( display
, root_window
, 0, 0,
266 GetSystemMetrics( SM_CXICON
),
267 GetSystemMetrics( SM_CYICON
),
270 CWEventMask
| CWBitGravity
| CWBackingStore
| CWColormap
, &attr
);
271 XSaveContext( display
, data
->icon_window
, winContext
, (char *)win
->hwndSelf
);
274 TRACE( "created %lx\n", data
->icon_window
);
275 SetPropA( win
->hwndSelf
, icon_window_atom
, (HANDLE
)data
->icon_window
);
276 return data
->icon_window
;
281 /***********************************************************************
282 * destroy_icon_window
284 inline static void destroy_icon_window( Display
*display
, WND
*win
)
286 struct x11drv_win_data
*data
= win
->pDriverData
;
288 if (!data
->icon_window
) return;
289 if (x11drv_thread_data()->cursor_window
== data
->icon_window
)
290 x11drv_thread_data()->cursor_window
= None
;
292 XDeleteContext( display
, data
->icon_window
, winContext
);
293 XDestroyWindow( display
, data
->icon_window
);
294 data
->icon_window
= 0;
296 RemovePropA( win
->hwndSelf
, icon_window_atom
);
300 /***********************************************************************
303 * Set the icon wm hints
305 static void set_icon_hints( Display
*display
, WND
*wndPtr
, XWMHints
*hints
, HICON hIcon
)
307 X11DRV_WND_DATA
*data
= wndPtr
->pDriverData
;
309 if (data
->hWMIconBitmap
) DeleteObject( data
->hWMIconBitmap
);
310 if (data
->hWMIconMask
) DeleteObject( data
->hWMIconMask
);
311 data
->hWMIconBitmap
= 0;
312 data
->hWMIconMask
= 0;
314 if (!(wndPtr
->dwExStyle
& WS_EX_MANAGED
))
316 destroy_icon_window( display
, wndPtr
);
317 hints
->flags
&= ~(IconPixmapHint
| IconMaskHint
| IconWindowHint
);
321 if (!data
->icon_window
) create_icon_window( display
, wndPtr
);
322 hints
->icon_window
= data
->icon_window
;
323 hints
->flags
= (hints
->flags
& ~(IconPixmapHint
| IconMaskHint
)) | IconWindowHint
;
333 GetIconInfo(hIcon
, &ii
);
335 GetObjectA(ii
.hbmMask
, sizeof(bmMask
), &bmMask
);
338 rcMask
.right
= bmMask
.bmWidth
;
339 rcMask
.bottom
= bmMask
.bmHeight
;
341 hDC
= CreateCompatibleDC(0);
342 hbmOrig
= SelectObject(hDC
, ii
.hbmMask
);
343 InvertRect(hDC
, &rcMask
);
344 SelectObject(hDC
, ii
.hbmColor
); /* force the color bitmap to x11drv mode too */
345 SelectObject(hDC
, hbmOrig
);
348 data
->hWMIconBitmap
= ii
.hbmColor
;
349 data
->hWMIconMask
= ii
.hbmMask
;
351 hints
->icon_pixmap
= X11DRV_BITMAP_Pixmap(data
->hWMIconBitmap
);
352 hints
->icon_mask
= X11DRV_BITMAP_Pixmap(data
->hWMIconMask
);
353 destroy_icon_window( display
, wndPtr
);
354 hints
->flags
= (hints
->flags
& ~IconWindowHint
) | IconPixmapHint
| IconMaskHint
;
359 /***********************************************************************
362 * set the window size hints
364 static void set_size_hints( Display
*display
, WND
*win
)
366 XSizeHints
* size_hints
;
367 struct x11drv_win_data
*data
= win
->pDriverData
;
369 if ((size_hints
= XAllocSizeHints()))
371 size_hints
->win_gravity
= StaticGravity
;
372 size_hints
->x
= data
->whole_rect
.left
;
373 size_hints
->y
= data
->whole_rect
.top
;
374 size_hints
->flags
= PWinGravity
| PPosition
;
376 if ( !(win
->dwStyle
& WS_THICKFRAME
) )
378 size_hints
->max_width
= data
->whole_rect
.right
- data
->whole_rect
.left
;
379 size_hints
->max_height
= data
->whole_rect
.bottom
- data
->whole_rect
.top
;
380 size_hints
->min_width
= size_hints
->max_width
;
381 size_hints
->min_height
= size_hints
->max_height
;
382 size_hints
->flags
|= PMinSize
| PMaxSize
;
384 XSetWMNormalHints( display
, data
->whole_window
, size_hints
);
390 /***********************************************************************
391 * X11DRV_set_wm_hints
393 * Set the window manager hints for a newly-created window
395 void X11DRV_set_wm_hints( Display
*display
, WND
*win
)
397 struct x11drv_win_data
*data
= win
->pDriverData
;
399 XClassHint
*class_hints
;
410 protocols
[i
++] = x11drv_atom(WM_DELETE_WINDOW
);
411 protocols
[i
++] = x11drv_atom(_NET_WM_PING
);
412 if (use_take_focus
) protocols
[i
++] = x11drv_atom(WM_TAKE_FOCUS
);
413 XChangeProperty( display
, data
->whole_window
, x11drv_atom(WM_PROTOCOLS
),
414 XA_ATOM
, 32, PropModeReplace
, (char *)protocols
, i
);
417 if ((class_hints
= XAllocClassHint()))
419 class_hints
->res_name
= "wine";
420 class_hints
->res_class
= "Wine";
421 XSetClassHint( display
, data
->whole_window
, class_hints
);
422 XFree( class_hints
);
425 /* transient for hint */
428 Window owner_win
= X11DRV_get_whole_window( win
->owner
);
429 XSetTransientForHint( display
, data
->whole_window
, owner_win
);
430 group_leader
= owner_win
;
432 else group_leader
= data
->whole_window
;
435 set_size_hints( display
, win
);
437 /* systray properties (KDE only for now) */
438 if (win
->dwExStyle
& WS_EX_TRAYWINDOW
)
441 XChangeProperty( display
, data
->whole_window
, x11drv_atom(KWM_DOCKWINDOW
),
442 x11drv_atom(KWM_DOCKWINDOW
), 32, PropModeReplace
, (char*)&val
, 1 );
443 XChangeProperty( display
, data
->whole_window
, x11drv_atom(_KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR
),
444 XA_WINDOW
, 32, PropModeReplace
, (char*)&data
->whole_window
, 1 );
447 /* set the WM_CLIENT_MACHINE and WM_LOCALE_NAME properties */
448 XSetWMProperties(display
, data
->whole_window
, NULL
, NULL
, NULL
, 0, NULL
, NULL
, NULL
);
449 /* set the pid. together, these properties are needed so the window manager can kill us if we freeze */
451 XChangeProperty(display
, data
->whole_window
, x11drv_atom(_NET_WM_PID
),
452 XA_CARDINAL
, 32, PropModeReplace
, (char *)&i
, 1);
454 /* map WS_EX_TOOLWINDOW to _NET_WM_WINDOW_TYPE_UTILITY */
455 if (win
->dwExStyle
& WS_EX_TOOLWINDOW
)
457 Atom a
= x11drv_atom(_NET_WM_WINDOW_TYPE_UTILITY
);
458 XChangeProperty(display
, data
->whole_window
, x11drv_atom(_NET_WM_WINDOW_TYPE
),
459 XA_ATOM
, 32, PropModeReplace
, (char*)&a
, 1);
462 mwm_hints
.flags
= MWM_HINTS_FUNCTIONS
| MWM_HINTS_DECORATIONS
;
463 mwm_hints
.functions
= 0;
464 if ((win
->dwStyle
& WS_CAPTION
) == WS_CAPTION
) mwm_hints
.functions
|= MWM_FUNC_MOVE
;
465 if (win
->dwStyle
& WS_THICKFRAME
) mwm_hints
.functions
|= MWM_FUNC_MOVE
| MWM_FUNC_RESIZE
;
466 if (win
->dwStyle
& WS_MINIMIZEBOX
) mwm_hints
.functions
|= MWM_FUNC_MINIMIZE
;
467 if (win
->dwStyle
& WS_MAXIMIZEBOX
) mwm_hints
.functions
|= MWM_FUNC_MAXIMIZE
;
468 if (win
->dwStyle
& WS_SYSMENU
) mwm_hints
.functions
|= MWM_FUNC_CLOSE
;
469 mwm_hints
.decorations
= 0;
470 if ((win
->dwStyle
& WS_CAPTION
) == WS_CAPTION
) mwm_hints
.decorations
|= MWM_DECOR_TITLE
;
471 if (win
->dwExStyle
& WS_EX_DLGMODALFRAME
) mwm_hints
.decorations
|= MWM_DECOR_BORDER
;
472 else if (win
->dwStyle
& WS_THICKFRAME
) mwm_hints
.decorations
|= MWM_DECOR_BORDER
| MWM_DECOR_RESIZEH
;
473 else if ((win
->dwStyle
& (WS_DLGFRAME
|WS_BORDER
)) == WS_DLGFRAME
) mwm_hints
.decorations
|= MWM_DECOR_BORDER
;
474 else if (win
->dwStyle
& WS_BORDER
) mwm_hints
.decorations
|= MWM_DECOR_BORDER
;
475 else if (!(win
->dwStyle
& (WS_CHILD
|WS_POPUP
))) mwm_hints
.decorations
|= MWM_DECOR_BORDER
;
476 if (win
->dwStyle
& WS_SYSMENU
) mwm_hints
.decorations
|= MWM_DECOR_MENU
;
477 if (win
->dwStyle
& WS_MINIMIZEBOX
) mwm_hints
.decorations
|= MWM_DECOR_MINIMIZE
;
478 if (win
->dwStyle
& WS_MAXIMIZEBOX
) mwm_hints
.decorations
|= MWM_DECOR_MAXIMIZE
;
480 XChangeProperty( display
, data
->whole_window
, x11drv_atom(_MOTIF_WM_HINTS
),
481 x11drv_atom(_MOTIF_WM_HINTS
), 32, PropModeReplace
,
482 (char*)&mwm_hints
, sizeof(mwm_hints
)/sizeof(long) );
484 XChangeProperty( display
, data
->whole_window
, x11drv_atom(XdndAware
),
485 XA_ATOM
, 32, PropModeReplace
, (unsigned char*)&dndVersion
, 1 );
487 wm_hints
= XAllocWMHints();
493 wm_hints
->flags
= InputHint
| StateHint
| WindowGroupHint
;
494 wm_hints
->input
= !(win
->dwStyle
& WS_DISABLED
);
496 set_icon_hints( display
, win
, wm_hints
, (HICON
)GetClassLongA( win
->hwndSelf
, GCL_HICON
));
498 wm_hints
->initial_state
= (win
->dwStyle
& WS_MINIMIZE
) ? IconicState
: NormalState
;
499 wm_hints
->window_group
= group_leader
;
502 XSetWMHints( display
, data
->whole_window
, wm_hints
);
509 /***********************************************************************
510 * X11DRV_set_iconic_state
512 * Set the X11 iconic state according to the window style.
514 void X11DRV_set_iconic_state( WND
*win
)
516 Display
*display
= thread_display();
517 struct x11drv_win_data
*data
= win
->pDriverData
;
519 BOOL iconic
= IsIconic( win
->hwndSelf
);
523 if (iconic
) XUnmapWindow( display
, data
->client_window
);
524 else if (is_client_window_mapped( win
)) XMapWindow( display
, data
->client_window
);
526 if (!(wm_hints
= XGetWMHints( display
, data
->whole_window
))) wm_hints
= XAllocWMHints();
527 wm_hints
->flags
|= StateHint
| IconPositionHint
;
528 wm_hints
->initial_state
= iconic
? IconicState
: NormalState
;
529 wm_hints
->icon_x
= win
->rectWindow
.left
;
530 wm_hints
->icon_y
= win
->rectWindow
.top
;
531 XSetWMHints( display
, data
->whole_window
, wm_hints
);
533 if (win
->dwStyle
& WS_VISIBLE
)
536 XIconifyWindow( display
, data
->whole_window
, DefaultScreen(display
) );
538 if (X11DRV_is_window_rect_mapped( &win
->rectWindow
))
539 XMapWindow( display
, data
->whole_window
);
547 /***********************************************************************
548 * X11DRV_window_to_X_rect
550 * Convert a rect from client to X window coordinates
552 void X11DRV_window_to_X_rect( WND
*win
, RECT
*rect
)
556 if (!(win
->dwExStyle
& WS_EX_MANAGED
)) return;
557 if (IsRectEmpty( rect
)) return;
559 rc
.top
= rc
.bottom
= rc
.left
= rc
.right
= 0;
561 AdjustWindowRectEx( &rc
, win
->dwStyle
& ~(WS_HSCROLL
|WS_VSCROLL
), FALSE
, win
->dwExStyle
);
563 rect
->left
-= rc
.left
;
564 rect
->right
-= rc
.right
;
566 rect
->bottom
-= rc
.bottom
;
567 if (rect
->top
>= rect
->bottom
) rect
->bottom
= rect
->top
+ 1;
568 if (rect
->left
>= rect
->right
) rect
->right
= rect
->left
+ 1;
572 /***********************************************************************
573 * X11DRV_X_to_window_rect
575 * Opposite of X11DRV_window_to_X_rect
577 void X11DRV_X_to_window_rect( WND
*win
, RECT
*rect
)
579 if (!(win
->dwExStyle
& WS_EX_MANAGED
)) return;
580 if (IsRectEmpty( rect
)) return;
582 AdjustWindowRectEx( rect
, win
->dwStyle
& ~(WS_HSCROLL
|WS_VSCROLL
), FALSE
, win
->dwExStyle
);
584 if (rect
->top
>= rect
->bottom
) rect
->bottom
= rect
->top
+ 1;
585 if (rect
->left
>= rect
->right
) rect
->right
= rect
->left
+ 1;
589 /***********************************************************************
590 * X11DRV_sync_whole_window_position
592 * Synchronize the X whole window position with the Windows one
594 int X11DRV_sync_whole_window_position( Display
*display
, WND
*win
, int zorder
)
596 XWindowChanges changes
;
598 struct x11drv_win_data
*data
= win
->pDriverData
;
599 RECT whole_rect
= win
->rectWindow
;
601 X11DRV_window_to_X_rect( win
, &whole_rect
);
602 mask
= get_window_changes( &changes
, &data
->whole_rect
, &whole_rect
);
606 if (is_window_top_level( win
))
608 /* find window that this one must be after */
609 HWND prev
= GetWindow( win
->hwndSelf
, GW_HWNDPREV
);
610 while (prev
&& !(GetWindowLongW( prev
, GWL_STYLE
) & WS_VISIBLE
))
611 prev
= GetWindow( prev
, GW_HWNDPREV
);
612 if (!prev
) /* top child */
614 changes
.stack_mode
= Above
;
619 /* should use stack_mode Below but most window managers don't get it right */
620 /* so move it above the next one in Z order */
621 HWND next
= GetWindow( win
->hwndSelf
, GW_HWNDNEXT
);
622 while (next
&& !(GetWindowLongW( next
, GWL_STYLE
) & WS_VISIBLE
))
623 next
= GetWindow( next
, GW_HWNDNEXT
);
626 changes
.stack_mode
= Above
;
627 changes
.sibling
= X11DRV_get_whole_window(next
);
628 mask
|= CWStackMode
| CWSibling
;
634 HWND next
= GetWindow( win
->hwndSelf
, GW_HWNDNEXT
);
636 if (win
->parent
== GetDesktopWindow() &&
637 root_window
!= DefaultRootWindow(display
))
639 /* in desktop mode we need the sibling to belong to the same process */
642 WND
*ptr
= WIN_GetPtr( next
);
643 if (ptr
!= WND_OTHER_PROCESS
)
645 WIN_ReleasePtr( ptr
);
648 next
= GetWindow( next
, GW_HWNDNEXT
);
652 if (!next
) /* bottom child */
654 changes
.stack_mode
= Below
;
659 changes
.stack_mode
= Above
;
660 changes
.sibling
= X11DRV_get_whole_window(next
);
661 mask
|= CWStackMode
| CWSibling
;
666 data
->whole_rect
= whole_rect
;
670 TRACE( "setting win %lx pos %ld,%ld,%ldx%ld after %lx changes=%x\n",
671 data
->whole_window
, whole_rect
.left
, whole_rect
.top
,
672 whole_rect
.right
- whole_rect
.left
, whole_rect
.bottom
- whole_rect
.top
,
673 changes
.sibling
, mask
);
675 XSync( gdi_display
, False
); /* flush graphics operations before moving the window */
676 if (is_window_top_level( win
))
678 if (mask
& (CWWidth
|CWHeight
)) set_size_hints( display
, win
);
679 XReconfigureWMWindow( display
, data
->whole_window
,
680 DefaultScreen(display
), mask
, &changes
);
682 else XConfigureWindow( display
, data
->whole_window
, mask
, &changes
);
689 /***********************************************************************
690 * X11DRV_sync_client_window_position
692 * Synchronize the X client window position with the Windows one
694 int X11DRV_sync_client_window_position( Display
*display
, WND
*win
)
696 XWindowChanges changes
;
698 struct x11drv_win_data
*data
= win
->pDriverData
;
699 RECT client_rect
= win
->rectClient
;
701 OffsetRect( &client_rect
, -data
->whole_rect
.left
, -data
->whole_rect
.top
);
703 if ((mask
= get_window_changes( &changes
, &data
->client_rect
, &client_rect
)))
705 BOOL was_mapped
= is_client_window_mapped( win
);
707 TRACE( "setting win %lx pos %ld,%ld,%ldx%ld (was %ld,%ld,%ldx%ld) after %lx changes=%x\n",
708 data
->client_window
, client_rect
.left
, client_rect
.top
,
709 client_rect
.right
- client_rect
.left
, client_rect
.bottom
- client_rect
.top
,
710 data
->client_rect
.left
, data
->client_rect
.top
,
711 data
->client_rect
.right
- data
->client_rect
.left
,
712 data
->client_rect
.bottom
- data
->client_rect
.top
,
713 changes
.sibling
, mask
);
714 data
->client_rect
= client_rect
;
716 XSync( gdi_display
, False
); /* flush graphics operations before moving the window */
717 if (was_mapped
&& !is_client_window_mapped( win
))
718 XUnmapWindow( display
, data
->client_window
);
719 XConfigureWindow( display
, data
->client_window
, mask
, &changes
);
720 if (!was_mapped
&& is_client_window_mapped( win
))
721 XMapWindow( display
, data
->client_window
);
728 /***********************************************************************
729 * X11DRV_register_window
731 * Associate an X window to a HWND.
733 void X11DRV_register_window( Display
*display
, HWND hwnd
, struct x11drv_win_data
*data
)
736 XSaveContext( display
, data
->whole_window
, winContext
, (char *)hwnd
);
737 XSaveContext( display
, data
->client_window
, winContext
, (char *)hwnd
);
742 /**********************************************************************
745 static void create_desktop( Display
*display
, WND
*wndPtr
)
747 X11DRV_WND_DATA
*data
= wndPtr
->pDriverData
;
750 winContext
= XUniqueContext();
751 XInternAtoms( display
, (char **)atom_names
, NB_XATOMS
- FIRST_XATOM
, False
, X11DRV_Atoms
);
754 whole_window_atom
= MAKEINTATOMA( GlobalAddAtomA( "__wine_x11_whole_window" ));
755 client_window_atom
= MAKEINTATOMA( GlobalAddAtomA( "__wine_x11_client_window" ));
756 icon_window_atom
= MAKEINTATOMA( GlobalAddAtomA( "__wine_x11_icon_window" ));
758 data
->whole_window
= data
->client_window
= root_window
;
759 data
->whole_rect
= data
->client_rect
= wndPtr
->rectWindow
;
761 SetPropA( wndPtr
->hwndSelf
, whole_window_atom
, (HANDLE
)root_window
);
762 SetPropA( wndPtr
->hwndSelf
, client_window_atom
, (HANDLE
)root_window
);
763 SetPropA( wndPtr
->hwndSelf
, "__wine_x11_visual_id", (HANDLE
)XVisualIDFromVisual(visual
) );
765 X11DRV_InitClipboard();
767 if (root_window
!= DefaultRootWindow(display
)) X11DRV_create_desktop_thread();
771 /**********************************************************************
772 * create_whole_window
774 * Create the whole X window for a given window
776 static Window
create_whole_window( Display
*display
, WND
*win
)
778 struct x11drv_win_data
*data
= win
->pDriverData
;
780 XSetWindowAttributes attr
;
783 BOOL is_top_level
= is_window_top_level( win
);
785 rect
= win
->rectWindow
;
786 X11DRV_window_to_X_rect( win
, &rect
);
788 if (!(cx
= rect
.right
- rect
.left
)) cx
= 1;
789 if (!(cy
= rect
.bottom
- rect
.top
)) cy
= 1;
791 parent
= X11DRV_get_client_window( win
->parent
);
795 mask
= get_window_attributes( display
, win
, &attr
);
797 /* set the attributes that don't change over the lifetime of the window */
798 attr
.bit_gravity
= ForgetGravity
;
799 attr
.win_gravity
= NorthWestGravity
;
800 attr
.backing_store
= NotUseful
/*WhenMapped*/;
801 mask
|= CWBitGravity
| CWWinGravity
| CWBackingStore
;
803 data
->whole_rect
= rect
;
804 data
->whole_window
= XCreateWindow( display
, parent
, rect
.left
, rect
.top
, cx
, cy
,
805 0, screen_depth
, InputOutput
, visual
,
808 if (!data
->whole_window
)
814 /* non-maximized child must be at bottom of Z order */
815 if ((win
->dwStyle
& (WS_CHILD
|WS_MAXIMIZE
)) == WS_CHILD
)
817 XWindowChanges changes
;
818 changes
.stack_mode
= Below
;
819 XConfigureWindow( display
, data
->whole_window
, CWStackMode
, &changes
);
826 XIM xim
= x11drv_thread_data()->xim
;
827 if (xim
) data
->xic
= X11DRV_CreateIC( xim
, display
, data
->whole_window
);
828 X11DRV_set_wm_hints( display
, win
);
831 return data
->whole_window
;
835 /**********************************************************************
836 * create_client_window
838 * Create the client window for a given window
840 static Window
create_client_window( Display
*display
, WND
*win
)
842 struct x11drv_win_data
*data
= win
->pDriverData
;
843 RECT rect
= data
->whole_rect
;
844 XSetWindowAttributes attr
;
846 OffsetRect( &rect
, -data
->whole_rect
.left
, -data
->whole_rect
.top
);
847 data
->client_rect
= rect
;
849 attr
.event_mask
= (ExposureMask
| PointerMotionMask
|
850 ButtonPressMask
| ButtonReleaseMask
| EnterWindowMask
);
851 attr
.bit_gravity
= (win
->clsStyle
& (CS_VREDRAW
| CS_HREDRAW
)) ?
852 ForgetGravity
: NorthWestGravity
;
853 attr
.backing_store
= NotUseful
/*WhenMapped*/;
856 data
->client_window
= XCreateWindow( display
, data
->whole_window
, 0, 0,
857 max( rect
.right
- rect
.left
, 1 ),
858 max( rect
.bottom
- rect
.top
, 1 ),
861 CWEventMask
| CWBitGravity
| CWBackingStore
, &attr
);
862 if (data
->client_window
&& is_client_window_mapped( win
))
863 XMapWindow( display
, data
->client_window
);
865 return data
->client_window
;
869 /*****************************************************************
870 * SetWindowText (X11DRV.@)
872 BOOL
X11DRV_SetWindowText( HWND hwnd
, LPCWSTR text
)
874 Display
*display
= thread_display();
881 if ((win
= X11DRV_get_whole_window( hwnd
)))
883 /* allocate new buffer for window text */
884 count
= WideCharToMultiByte(CP_UNIXCP
, 0, text
, -1, NULL
, 0, NULL
, NULL
);
885 if (!(buffer
= HeapAlloc( GetProcessHeap(), 0, count
)))
887 ERR("Not enough memory for window text\n");
890 WideCharToMultiByte(CP_UNIXCP
, 0, text
, -1, buffer
, count
, NULL
, NULL
);
892 count
= WideCharToMultiByte(CP_UTF8
, 0, text
, strlenW(text
), NULL
, 0, NULL
, NULL
);
893 if (!(utf8_buffer
= HeapAlloc( GetProcessHeap(), 0, count
)))
895 ERR("Not enough memory for window text in UTF-8\n");
898 WideCharToMultiByte(CP_UTF8
, 0, text
, strlenW(text
), utf8_buffer
, count
, NULL
, NULL
);
901 if (XmbTextListToTextProperty( display
, &buffer
, 1, XStdICCTextStyle
, &prop
) == Success
)
903 XSetWMName( display
, win
, &prop
);
904 XSetWMIconName( display
, win
, &prop
);
908 Implements a NET_WM UTF-8 title. It should be without a trailing \0,
909 according to the standard
910 ( http://www.pps.jussieu.fr/~jch/software/UTF8_STRING/UTF8_STRING.text ).
912 XChangeProperty( display
, win
, x11drv_atom(_NET_WM_NAME
), x11drv_atom(UTF8_STRING
),
913 8, PropModeReplace
, (unsigned char *) utf8_buffer
, count
);
916 HeapFree( GetProcessHeap(), 0, utf8_buffer
);
917 HeapFree( GetProcessHeap(), 0, buffer
);
923 /***********************************************************************
924 * DestroyWindow (X11DRV.@)
926 BOOL
X11DRV_DestroyWindow( HWND hwnd
)
928 struct x11drv_thread_data
*thread_data
= x11drv_thread_data();
929 Display
*display
= thread_data
->display
;
930 WND
*wndPtr
= WIN_GetPtr( hwnd
);
931 X11DRV_WND_DATA
*data
= wndPtr
->pDriverData
;
933 if (!data
) goto done
;
935 if (data
->whole_window
)
937 TRACE( "win %p xwin %lx/%lx\n", hwnd
, data
->whole_window
, data
->client_window
);
938 if (thread_data
->cursor_window
== data
->whole_window
) thread_data
->cursor_window
= None
;
939 if (thread_data
->last_focus
== hwnd
) thread_data
->last_focus
= 0;
941 XSync( gdi_display
, False
); /* flush any reference to this drawable in GDI queue */
942 XDeleteContext( display
, data
->whole_window
, winContext
);
943 XDeleteContext( display
, data
->client_window
, winContext
);
944 XDestroyWindow( display
, data
->whole_window
); /* this destroys client too */
947 XUnsetICFocus( data
->xic
);
948 XDestroyIC( data
->xic
);
950 destroy_icon_window( display
, wndPtr
);
954 if (data
->hWMIconBitmap
) DeleteObject( data
->hWMIconBitmap
);
955 if (data
->hWMIconMask
) DeleteObject( data
->hWMIconMask
);
956 HeapFree( GetProcessHeap(), 0, data
);
957 wndPtr
->pDriverData
= NULL
;
959 WIN_ReleasePtr( wndPtr
);
964 /**********************************************************************
965 * CreateWindow (X11DRV.@)
967 BOOL
X11DRV_CreateWindow( HWND hwnd
, CREATESTRUCTA
*cs
, BOOL unicode
)
969 Display
*display
= thread_display();
971 struct x11drv_win_data
*data
;
978 ERR( "invalid window width %d\n", cs
->cx
);
983 ERR( "invalid window height %d\n", cs
->cx
);
987 if (!(data
= HeapAlloc(GetProcessHeap(), 0, sizeof(*data
)))) return FALSE
;
988 data
->whole_window
= 0;
989 data
->client_window
= 0;
990 data
->icon_window
= 0;
992 data
->hWMIconBitmap
= 0;
993 data
->hWMIconMask
= 0;
995 wndPtr
= WIN_GetPtr( hwnd
);
996 wndPtr
->pDriverData
= data
;
998 /* initialize the dimensions before sending WM_GETMINMAXINFO */
999 SetRect( &rect
, cs
->x
, cs
->y
, cs
->x
+ cs
->cx
, cs
->y
+ cs
->cy
);
1000 WIN_SetRectangles( hwnd
, &rect
, &rect
);
1002 if (!wndPtr
->parent
)
1004 create_desktop( display
, wndPtr
);
1005 WIN_ReleasePtr( wndPtr
);
1009 if (!create_whole_window( display
, wndPtr
)) goto failed
;
1010 if (!create_client_window( display
, wndPtr
)) goto failed
;
1012 XSync( display
, False
);
1013 wine_tsx11_unlock();
1015 SetPropA( hwnd
, whole_window_atom
, (HANDLE
)data
->whole_window
);
1016 SetPropA( hwnd
, client_window_atom
, (HANDLE
)data
->client_window
);
1018 /* Call the WH_CBT hook */
1020 cbtc
.hwndInsertAfter
= HWND_TOP
;
1021 if (HOOK_CallHooks( WH_CBT
, HCBT_CREATEWND
, (WPARAM
)hwnd
, (LPARAM
)&cbtc
, unicode
))
1023 TRACE("CBT-hook returned !0\n");
1027 /* Send the WM_GETMINMAXINFO message and fix the size if needed */
1028 if ((cs
->style
& WS_THICKFRAME
) || !(cs
->style
& (WS_POPUP
| WS_CHILD
)))
1030 POINT maxSize
, maxPos
, minTrack
, maxTrack
;
1032 WIN_ReleasePtr( wndPtr
);
1033 WINPOS_GetMinMaxInfo( hwnd
, &maxSize
, &maxPos
, &minTrack
, &maxTrack
);
1034 if (maxSize
.x
< cs
->cx
) cs
->cx
= maxSize
.x
;
1035 if (maxSize
.y
< cs
->cy
) cs
->cy
= maxSize
.y
;
1036 if (cs
->cx
< 0) cs
->cx
= 0;
1037 if (cs
->cy
< 0) cs
->cy
= 0;
1039 if (!(wndPtr
= WIN_GetPtr( hwnd
))) return FALSE
;
1040 SetRect( &rect
, cs
->x
, cs
->y
, cs
->x
+ cs
->cx
, cs
->y
+ cs
->cy
);
1041 WIN_SetRectangles( hwnd
, &rect
, &rect
);
1042 X11DRV_sync_whole_window_position( display
, wndPtr
, 0 );
1044 WIN_ReleasePtr( wndPtr
);
1046 /* send WM_NCCREATE */
1047 TRACE( "hwnd %p cs %d,%d %dx%d\n", hwnd
, cs
->x
, cs
->y
, cs
->cx
, cs
->cy
);
1049 ret
= SendMessageW( hwnd
, WM_NCCREATE
, 0, (LPARAM
)cs
);
1051 ret
= SendMessageA( hwnd
, WM_NCCREATE
, 0, (LPARAM
)cs
);
1054 WARN("aborted by WM_xxCREATE!\n");
1058 if (!(wndPtr
= WIN_GetPtr(hwnd
))) return FALSE
;
1060 X11DRV_sync_window_style( display
, wndPtr
);
1062 /* send WM_NCCALCSIZE */
1063 rect
= wndPtr
->rectWindow
;
1064 WIN_ReleasePtr( wndPtr
);
1065 SendMessageW( hwnd
, WM_NCCALCSIZE
, FALSE
, (LPARAM
)&rect
);
1067 if (!(wndPtr
= WIN_GetPtr(hwnd
))) return FALSE
;
1068 if (rect
.left
> rect
.right
|| rect
.top
> rect
.bottom
) rect
= wndPtr
->rectWindow
;
1069 WIN_SetRectangles( hwnd
, &wndPtr
->rectWindow
, &rect
);
1070 X11DRV_sync_client_window_position( display
, wndPtr
);
1071 X11DRV_register_window( display
, hwnd
, data
);
1073 TRACE( "win %p window %ld,%ld,%ld,%ld client %ld,%ld,%ld,%ld whole %ld,%ld,%ld,%ld X client %ld,%ld,%ld,%ld xwin %x/%x\n",
1074 hwnd
, wndPtr
->rectWindow
.left
, wndPtr
->rectWindow
.top
,
1075 wndPtr
->rectWindow
.right
, wndPtr
->rectWindow
.bottom
,
1076 wndPtr
->rectClient
.left
, wndPtr
->rectClient
.top
,
1077 wndPtr
->rectClient
.right
, wndPtr
->rectClient
.bottom
,
1078 data
->whole_rect
.left
, data
->whole_rect
.top
,
1079 data
->whole_rect
.right
, data
->whole_rect
.bottom
,
1080 data
->client_rect
.left
, data
->client_rect
.top
,
1081 data
->client_rect
.right
, data
->client_rect
.bottom
,
1082 (unsigned int)data
->whole_window
, (unsigned int)data
->client_window
);
1084 /* yes, even if the CBT hook was called with HWND_TOP */
1085 if ((wndPtr
->dwStyle
& (WS_CHILD
|WS_MAXIMIZE
)) == WS_CHILD
)
1086 WIN_LinkWindow( hwnd
, wndPtr
->parent
, HWND_BOTTOM
);
1088 WIN_LinkWindow( hwnd
, wndPtr
->parent
, HWND_TOP
);
1090 WIN_ReleasePtr( wndPtr
);
1093 ret
= (SendMessageW( hwnd
, WM_CREATE
, 0, (LPARAM
)cs
) != -1);
1095 ret
= (SendMessageA( hwnd
, WM_CREATE
, 0, (LPARAM
)cs
) != -1);
1099 WIN_UnlinkWindow( hwnd
);
1103 /* Send the size messages */
1105 if (!(wndPtr
= WIN_FindWndPtr(hwnd
))) return FALSE
;
1106 if (!(wndPtr
->flags
& WIN_NEED_SIZE
))
1108 /* send it anyway */
1109 if (((wndPtr
->rectClient
.right
-wndPtr
->rectClient
.left
) <0)
1110 ||((wndPtr
->rectClient
.bottom
-wndPtr
->rectClient
.top
)<0))
1111 WARN("sending bogus WM_SIZE message 0x%08lx\n",
1112 MAKELONG(wndPtr
->rectClient
.right
-wndPtr
->rectClient
.left
,
1113 wndPtr
->rectClient
.bottom
-wndPtr
->rectClient
.top
));
1114 SendMessageW( hwnd
, WM_SIZE
, SIZE_RESTORED
,
1115 MAKELONG(wndPtr
->rectClient
.right
-wndPtr
->rectClient
.left
,
1116 wndPtr
->rectClient
.bottom
-wndPtr
->rectClient
.top
));
1117 SendMessageW( hwnd
, WM_MOVE
, 0,
1118 MAKELONG( wndPtr
->rectClient
.left
, wndPtr
->rectClient
.top
) );
1121 /* Show the window, maximizing or minimizing if needed */
1123 if (wndPtr
->dwStyle
& (WS_MINIMIZE
| WS_MAXIMIZE
))
1125 extern UINT
WINPOS_MinMaximize( HWND hwnd
, UINT cmd
, LPRECT rect
); /*FIXME*/
1128 UINT swFlag
= (wndPtr
->dwStyle
& WS_MINIMIZE
) ? SW_MINIMIZE
: SW_MAXIMIZE
;
1129 WIN_SetStyle( hwnd
, wndPtr
->dwStyle
& ~(WS_MAXIMIZE
| WS_MINIMIZE
) );
1130 WINPOS_MinMaximize( hwnd
, swFlag
, &newPos
);
1131 swFlag
= ((wndPtr
->dwStyle
& WS_CHILD
) || GetActiveWindow())
1132 ? SWP_NOACTIVATE
| SWP_NOZORDER
| SWP_FRAMECHANGED
1133 : SWP_NOZORDER
| SWP_FRAMECHANGED
;
1134 SetWindowPos( hwnd
, 0, newPos
.left
, newPos
.top
,
1135 newPos
.right
, newPos
.bottom
, swFlag
);
1138 WIN_ReleaseWndPtr( wndPtr
);
1142 X11DRV_DestroyWindow( hwnd
);
1143 if (wndPtr
) WIN_ReleasePtr( wndPtr
);
1148 /***********************************************************************
1149 * X11DRV_get_client_window
1151 * Return the X window associated with the client area of a window
1153 Window
X11DRV_get_client_window( HWND hwnd
)
1156 WND
*win
= WIN_GetPtr( hwnd
);
1158 if (win
== WND_OTHER_PROCESS
)
1159 return (Window
)GetPropA( hwnd
, client_window_atom
);
1163 struct x11drv_win_data
*data
= win
->pDriverData
;
1164 ret
= data
->client_window
;
1165 WIN_ReleasePtr( win
);
1171 /***********************************************************************
1172 * X11DRV_get_whole_window
1174 * Return the X window associated with the full area of a window
1176 Window
X11DRV_get_whole_window( HWND hwnd
)
1179 WND
*win
= WIN_GetPtr( hwnd
);
1181 if (win
== WND_OTHER_PROCESS
)
1182 return (Window
)GetPropA( hwnd
, whole_window_atom
);
1186 struct x11drv_win_data
*data
= win
->pDriverData
;
1187 ret
= data
->whole_window
;
1188 WIN_ReleasePtr( win
);
1194 /***********************************************************************
1197 * Return the X input context associated with a window
1199 XIC
X11DRV_get_ic( HWND hwnd
)
1202 WND
*win
= WIN_GetPtr( hwnd
);
1204 if (win
&& win
!= WND_OTHER_PROCESS
)
1206 struct x11drv_win_data
*data
= win
->pDriverData
;
1208 WIN_ReleasePtr( win
);
1214 /*****************************************************************
1215 * SetParent (X11DRV.@)
1217 HWND
X11DRV_SetParent( HWND hwnd
, HWND parent
)
1219 Display
*display
= thread_display();
1223 /* Windows hides the window first, then shows it again
1224 * including the WM_SHOWWINDOW messages and all */
1225 BOOL was_visible
= ShowWindow( hwnd
, SW_HIDE
);
1227 if (!IsWindow( parent
)) return 0;
1228 if (!(wndPtr
= WIN_GetPtr(hwnd
)) || wndPtr
== WND_OTHER_PROCESS
) return 0;
1230 retvalue
= wndPtr
->parent
; /* old parent */
1231 if (parent
!= retvalue
)
1233 struct x11drv_win_data
*data
= wndPtr
->pDriverData
;
1235 WIN_LinkWindow( hwnd
, parent
, HWND_TOP
);
1237 if (parent
!= GetDesktopWindow()) /* a child window */
1239 if (!(wndPtr
->dwStyle
& WS_CHILD
))
1241 HMENU menu
= (HMENU
)SetWindowLongW( hwnd
, GWL_ID
, 0 );
1242 if (menu
) DestroyMenu( menu
);
1246 if (is_window_top_level( wndPtr
)) X11DRV_set_wm_hints( display
, wndPtr
);
1248 X11DRV_sync_window_style( display
, wndPtr
);
1249 XReparentWindow( display
, data
->whole_window
, X11DRV_get_client_window(parent
),
1250 data
->whole_rect
.left
, data
->whole_rect
.top
);
1251 wine_tsx11_unlock();
1253 WIN_ReleasePtr( wndPtr
);
1255 /* SetParent additionally needs to make hwnd the topmost window
1256 in the x-order and send the expected WM_WINDOWPOSCHANGING and
1257 WM_WINDOWPOSCHANGED notification messages.
1259 SetWindowPos( hwnd
, HWND_TOPMOST
, 0, 0, 0, 0,
1260 SWP_NOACTIVATE
| SWP_NOMOVE
| SWP_NOSIZE
| (was_visible
? SWP_SHOWWINDOW
: 0) );
1261 /* FIXME: a WM_MOVE is also generated (in the DefWindowProc handler
1262 * for WM_WINDOWPOSCHANGED) in Windows, should probably remove SWP_NOMOVE */
1268 /*****************************************************************
1269 * SetFocus (X11DRV.@)
1272 * Explicit colormap management seems to work only with OLVWM.
1274 void X11DRV_SetFocus( HWND hwnd
)
1276 Display
*display
= thread_display();
1277 XWindowAttributes win_attr
;
1280 /* Only mess with the X focus if there's */
1281 /* no desktop window and if the window is not managed by the WM. */
1282 if (root_window
!= DefaultRootWindow(display
)) return;
1284 if (!hwnd
) /* If setting the focus to 0, uninstall the colormap */
1287 if (X11DRV_PALETTE_PaletteFlags
& X11DRV_PALETTE_PRIVATE
)
1288 XUninstallColormap( display
, X11DRV_PALETTE_PaletteXColormap
);
1289 wine_tsx11_unlock();
1293 hwnd
= GetAncestor( hwnd
, GA_ROOT
);
1294 if (GetWindowLongW( hwnd
, GWL_EXSTYLE
) & WS_EX_MANAGED
) return;
1295 if (!(win
= X11DRV_get_whole_window( hwnd
))) return;
1297 /* Set X focus and install colormap */
1299 if (XGetWindowAttributes( display
, win
, &win_attr
) &&
1300 (win_attr
.map_state
== IsViewable
))
1302 /* If window is not viewable, don't change anything */
1304 /* we must not use CurrentTime (ICCCM), so try to use last message time instead */
1305 /* FIXME: this is not entirely correct */
1306 XSetInputFocus( display
, win
, RevertToParent
,
1307 /*CurrentTime*/ GetMessageTime() + X11DRV_server_startticks
);
1308 if (X11DRV_PALETTE_PaletteFlags
& X11DRV_PALETTE_PRIVATE
)
1309 XInstallColormap( display
, X11DRV_PALETTE_PaletteXColormap
);
1311 wine_tsx11_unlock();
1315 /**********************************************************************
1316 * SetWindowIcon (X11DRV.@)
1318 * hIcon or hIconSm has changed (or is being initialised for the
1319 * first time). Complete the X11 driver-specific initialisation
1320 * and set the window hints.
1322 * This is not entirely correct, may need to create
1323 * an icon window and set the pixmap as a background
1325 void X11DRV_SetWindowIcon( HWND hwnd
, UINT type
, HICON icon
)
1328 Display
*display
= thread_display();
1330 if (type
!= ICON_BIG
) return; /* nothing to do here */
1332 if (!(wndPtr
= WIN_GetPtr( hwnd
)) || wndPtr
== WND_OTHER_PROCESS
) return;
1334 if (wndPtr
->dwExStyle
& WS_EX_MANAGED
)
1336 Window win
= get_whole_window(wndPtr
);
1340 if (!(wm_hints
= XGetWMHints( display
, win
))) wm_hints
= XAllocWMHints();
1341 wine_tsx11_unlock();
1344 set_icon_hints( display
, wndPtr
, wm_hints
, icon
);
1346 XSetWMHints( display
, win
, wm_hints
);
1348 wine_tsx11_unlock();
1351 WIN_ReleasePtr( wndPtr
);