1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/unix/utilsx11.cpp
3 // Purpose: Miscellaneous X11 functions
4 // Author: Mattia Barbon, Vaclav Slavik, Robert Roebling
8 // Copyright: (c) wxWidgets team
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #if defined(__WXX11__) || defined(__WXGTK__) || defined(__WXMOTIF__)
14 // for compilers that support precompilation, includes "wx.h".
15 #include "wx/wxprec.h"
17 #include "wx/unix/utilsx11.h"
23 #include "wx/iconbndl.h"
28 #pragma message disable nosimpint
31 #include <X11/Xatom.h>
33 #pragma message enable nosimpint
41 // Various X11 Atoms used in this file:
42 static Atom _NET_WM_ICON
= 0;
43 static Atom _NET_WM_STATE
= 0;
44 static Atom _NET_WM_STATE_FULLSCREEN
= 0;
45 static Atom _NET_WM_STATE_STAYS_ON_TOP
= 0;
46 static Atom _NET_WM_WINDOW_TYPE
= 0;
47 static Atom _NET_WM_WINDOW_TYPE_NORMAL
= 0;
48 static Atom _KDE_NET_WM_WINDOW_TYPE_OVERRIDE
= 0;
49 static Atom _WIN_LAYER
= 0;
50 static Atom KWIN_RUNNING
= 0;
52 static Atom _NET_SUPPORTING_WM_CHECK
= 0;
53 static Atom _NET_SUPPORTED
= 0;
56 #define wxMAKE_ATOM(name, display) \
57 if (name == 0) name = XInternAtom((display), #name, False)
60 // X11 Window is an int type, so use the macro to suppress warnings when
62 #define WindowCast(w) (Window)(wxPtrToUInt(w))
64 // Is the window mapped?
65 static bool IsMapped(Display
*display
, Window window
)
67 XWindowAttributes attr
;
68 XGetWindowAttributes(display
, window
, &attr
);
69 return (attr
.map_state
!= IsUnmapped
);
74 // Suspends X11 errors. Used when we expect errors but they are not fatal
78 typedef int (*wxX11ErrorHandler
)(Display
*, XErrorEvent
*);
80 static int wxX11ErrorsSuspender_handler(Display
*, XErrorEvent
*) { return 0; }
83 class wxX11ErrorsSuspender
86 wxX11ErrorsSuspender(Display
*d
) : m_display(d
)
88 m_old
= XSetErrorHandler(wxX11ErrorsSuspender_handler
);
90 ~wxX11ErrorsSuspender()
93 XSetErrorHandler(m_old
);
98 wxX11ErrorHandler m_old
;
103 // ----------------------------------------------------------------------------
104 // Setting icons for window manager:
105 // ----------------------------------------------------------------------------
107 void wxSetIconsX11( WXDisplay
* display
, WXWindow window
,
108 const wxIconBundle
& ib
)
112 size_t i
, max
= ib
.m_icons
.GetCount();
114 for( i
= 0; i
< max
; ++i
)
115 if( ib
.m_icons
[i
].Ok() )
116 size
+= 2 + ib
.m_icons
[i
].GetWidth() * ib
.m_icons
[i
].GetHeight();
118 wxMAKE_ATOM(_NET_WM_ICON
, (Display
*)display
);
122 // The code below is correct for 64-bit machines also.
123 // wxUint32* data = new wxUint32[size];
124 // wxUint32* ptr = data;
125 unsigned long* data
= new unsigned long[size
];
126 unsigned long* ptr
= data
;
128 for( i
= 0; i
< max
; ++i
)
130 const wxImage image
= ib
.m_icons
[i
].ConvertToImage();
131 int width
= image
.GetWidth(), height
= image
.GetHeight();
132 unsigned char* imageData
= image
.GetData();
133 unsigned char* imageDataEnd
= imageData
+ ( width
* height
* 3 );
134 bool hasMask
= image
.HasMask();
135 unsigned char rMask
, gMask
, bMask
;
136 unsigned char r
, g
, b
, a
;
140 rMask
= image
.GetMaskRed();
141 gMask
= image
.GetMaskGreen();
142 bMask
= image
.GetMaskBlue();
144 else // no mask, but still init the variables to avoid warnings
154 while( imageData
< imageDataEnd
) {
158 if( hasMask
&& r
== rMask
&& g
== gMask
&& b
== bMask
)
163 *ptr
++ = ( a
<< 24 ) | ( r
<< 16 ) | ( g
<< 8 ) | b
;
169 XChangeProperty( (Display
*)display
,
174 (unsigned char*)data
, size
);
179 XDeleteProperty( (Display
*)display
,
183 #endif // !wxUSE_NANOX
187 // ----------------------------------------------------------------------------
189 // ----------------------------------------------------------------------------
191 // NB: Setting fullscreen mode under X11 is a complicated matter. There was
192 // no standard way of doing it until recently. ICCCM doesn't know the
193 // concept of fullscreen windows and the only way to make a window
194 // fullscreen is to remove decorations, resize it to cover entire screen
195 // and set WIN_LAYER_ABOVE_DOCK.
197 // This doesn't always work, though. Specifically, at least kwin from
198 // KDE 3 ignores the hint. The only way to make kwin accept our request
199 // is to emulate the way Qt does it. That is, unmap the window, set
200 // _NET_WM_WINDOW_TYPE to _KDE_NET_WM_WINDOW_TYPE_OVERRIDE (KDE extension),
201 // add _NET_WM_STATE_STAYS_ON_TOP (ditto) to _NET_WM_STATE and map
204 // Version 1.2 of Window Manager Specification (aka wm-spec aka
205 // Extended Window Manager Hints) introduced _NET_WM_STATE_FULLSCREEN
206 // window state which provides cleanest and simplest possible way of
207 // making a window fullscreen. WM-spec is a de-facto standard adopted
208 // by GNOME and KDE folks, but _NET_WM_STATE_FULLSCREEN isn't yet widely
209 // supported. As of January 2003, only GNOME 2's default WM Metacity
210 // implements, KDE will support it from version 3.2. At toolkits level,
211 // GTK+ >= 2.1.2 uses it as the only method of making windows fullscreen
212 // (that's why wxGTK will *not* switch to using gtk_window_fullscreen
213 // unless it has better compatibility with older WMs).
216 // This is what wxWidgets does in wxSetFullScreenStateX11:
217 // 1) if _NET_WM_STATE_FULLSCREEN is supported, use it
218 // 2) otherwise try WM-specific hacks (KDE, IceWM)
219 // 3) use _WIN_LAYER and hope that the WM will recognize it
220 // The code was tested with:
221 // twm, IceWM, WindowMaker, Metacity, kwin, sawfish, lesstif-mwm
224 #define WIN_LAYER_NORMAL 4
225 #define WIN_LAYER_ABOVE_DOCK 10
227 static void wxWinHintsSetLayer(Display
*display
, Window rootWnd
,
228 Window window
, int layer
)
230 wxX11ErrorsSuspender
noerrors(display
);
234 wxMAKE_ATOM( _WIN_LAYER
, display
);
236 if (IsMapped(display
, window
))
238 xev
.type
= ClientMessage
;
239 xev
.xclient
.type
= ClientMessage
;
240 xev
.xclient
.window
= window
;
241 xev
.xclient
.message_type
= _WIN_LAYER
;
242 xev
.xclient
.format
= 32;
243 xev
.xclient
.data
.l
[0] = (long)layer
;
244 xev
.xclient
.data
.l
[1] = CurrentTime
;
246 XSendEvent(display
, rootWnd
, False
,
247 SubstructureNotifyMask
, (XEvent
*) &xev
);
254 XChangeProperty(display
, window
,
255 _WIN_LAYER
, XA_CARDINAL
, 32,
256 PropModeReplace
, (unsigned char *)data
, 1);
263 static bool wxQueryWMspecSupport(Display
* WXUNUSED(display
),
264 Window
WXUNUSED(rootWnd
),
267 GdkAtom gatom
= gdk_x11_xatom_to_atom(feature
);
268 return gdk_net_wm_supports(gatom
);
271 static bool wxQueryWMspecSupport(Display
*display
, Window rootWnd
, Atom feature
)
273 wxMAKE_ATOM(_NET_SUPPORTING_WM_CHECK
, display
);
274 wxMAKE_ATOM(_NET_SUPPORTED
, display
);
276 // FIXME: We may want to cache these checks. Note that we can't simply
277 // remember the results in global variable because the WM may go
278 // away and be replaced by another one! One possible approach
279 // would be invalidate the case every 15 seconds or so. Since this
280 // code is currently only used by wxTopLevelWindow::ShowFullScreen,
281 // it is not important that it is not optimized.
283 // If the WM supports ICCCM (i.e. the root window has
284 // _NET_SUPPORTING_WM_CHECK property that points to a WM-owned
285 // window), we could watch for DestroyNotify event on the window
286 // and invalidate our cache when the windows goes away (= WM
287 // is replaced by another one). This is what GTK+ 2 does.
288 // Let's do it only if it is needed, it requires changes to
296 unsigned long nwins
, natoms
;
298 // Is the WM ICCCM supporting?
299 XGetWindowProperty(display
, rootWnd
,
300 _NET_SUPPORTING_WM_CHECK
, 0, LONG_MAX
,
301 False
, XA_WINDOW
, &type
, &format
, &nwins
,
302 &after
, (unsigned char **)&wins
);
303 if ( type
!= XA_WINDOW
|| nwins
<= 0 || wins
[0] == None
)
307 // Query for supported features:
308 XGetWindowProperty(display
, rootWnd
,
309 _NET_SUPPORTED
, 0, LONG_MAX
,
310 False
, XA_ATOM
, &type
, &format
, &natoms
,
311 &after
, (unsigned char **)&atoms
);
312 if ( type
!= XA_ATOM
|| atoms
== NULL
)
315 // Lookup the feature we want:
316 for (unsigned i
= 0; i
< natoms
; i
++)
318 if ( atoms
[i
] == feature
)
330 #define _NET_WM_STATE_REMOVE 0
331 #define _NET_WM_STATE_ADD 1
333 static void wxWMspecSetState(Display
*display
, Window rootWnd
,
334 Window window
, int operation
, Atom state
)
336 wxMAKE_ATOM(_NET_WM_STATE
, display
);
338 if ( IsMapped(display
, window
) )
341 xev
.type
= ClientMessage
;
342 xev
.xclient
.type
= ClientMessage
;
343 xev
.xclient
.serial
= 0;
344 xev
.xclient
.send_event
= True
;
345 xev
.xclient
.display
= display
;
346 xev
.xclient
.window
= window
;
347 xev
.xclient
.message_type
= _NET_WM_STATE
;
348 xev
.xclient
.format
= 32;
349 xev
.xclient
.data
.l
[0] = operation
;
350 xev
.xclient
.data
.l
[1] = state
;
351 xev
.xclient
.data
.l
[2] = None
;
353 XSendEvent(display
, rootWnd
,
355 SubstructureRedirectMask
| SubstructureNotifyMask
,
358 // FIXME - must modify _NET_WM_STATE property list if the window
362 static void wxWMspecSetFullscreen(Display
*display
, Window rootWnd
,
363 Window window
, bool fullscreen
)
365 wxMAKE_ATOM(_NET_WM_STATE_FULLSCREEN
, display
);
366 wxWMspecSetState(display
, rootWnd
,
368 fullscreen
? _NET_WM_STATE_ADD
: _NET_WM_STATE_REMOVE
,
369 _NET_WM_STATE_FULLSCREEN
);
373 // Is the user running KDE's kwin window manager? At least kwin from KDE 3
374 // sets KWIN_RUNNING property on the root window.
375 static bool wxKwinRunning(Display
*display
, Window rootWnd
)
377 wxMAKE_ATOM(KWIN_RUNNING
, display
);
382 unsigned long nitems
, after
;
383 if (XGetWindowProperty(display
, rootWnd
,
384 KWIN_RUNNING
, 0, 1, False
, KWIN_RUNNING
,
385 &type
, &format
, &nitems
, &after
,
386 (unsigned char**)&data
) != Success
)
391 bool retval
= (type
== KWIN_RUNNING
&&
392 nitems
== 1 && data
&& data
[0] == 1);
397 // KDE's kwin is Qt-centric so much than no normal method of fullscreen
398 // mode will work with it. We have to carefully emulate the Qt way.
399 static void wxSetKDEFullscreen(Display
*display
, Window rootWnd
,
400 Window w
, bool fullscreen
, wxRect
*origRect
)
405 wxMAKE_ATOM(_NET_WM_WINDOW_TYPE
, display
);
406 wxMAKE_ATOM(_NET_WM_WINDOW_TYPE_NORMAL
, display
);
407 wxMAKE_ATOM(_KDE_NET_WM_WINDOW_TYPE_OVERRIDE
, display
);
408 wxMAKE_ATOM(_NET_WM_STATE_STAYS_ON_TOP
, display
);
412 data
[0] = _KDE_NET_WM_WINDOW_TYPE_OVERRIDE
;
413 data
[1] = _NET_WM_WINDOW_TYPE_NORMAL
;
418 data
[0] = _NET_WM_WINDOW_TYPE_NORMAL
;
423 // it is necessary to unmap the window, otherwise kwin will ignore us:
424 XSync(display
, False
);
426 bool wasMapped
= IsMapped(display
, w
);
429 XUnmapWindow(display
, w
);
430 XSync(display
, False
);
433 XChangeProperty(display
, w
, _NET_WM_WINDOW_TYPE
, XA_ATOM
, 32,
434 PropModeReplace
, (unsigned char *) &data
[0], lng
);
435 XSync(display
, False
);
439 XMapRaised(display
, w
);
440 XSync(display
, False
);
443 wxWMspecSetState(display
, rootWnd
, w
,
444 fullscreen
? _NET_WM_STATE_ADD
: _NET_WM_STATE_REMOVE
,
445 _NET_WM_STATE_STAYS_ON_TOP
);
446 XSync(display
, False
);
450 // NB: like many other WMs, kwin ignores the first request for a window
451 // position change after the window was mapped. This additional
452 // move+resize event will ensure that the window is restored in
453 // exactly the same position as before it was made fullscreen
454 // (because wxTopLevelWindow::ShowFullScreen will call SetSize, thus
455 // setting the position for the second time).
456 XMoveResizeWindow(display
, w
,
457 origRect
->x
, origRect
->y
,
458 origRect
->width
, origRect
->height
);
459 XSync(display
, False
);
464 wxX11FullScreenMethod
wxGetFullScreenMethodX11(WXDisplay
* display
,
467 Window root
= WindowCast(rootWindow
);
468 Display
*disp
= (Display
*)display
;
470 // if WM supports _NET_WM_STATE_FULLSCREEN from wm-spec 1.2, use it:
471 wxMAKE_ATOM(_NET_WM_STATE_FULLSCREEN
, disp
);
472 if (wxQueryWMspecSupport(disp
, root
, _NET_WM_STATE_FULLSCREEN
))
474 wxLogTrace(_T("fullscreen"),
475 _T("detected _NET_WM_STATE_FULLSCREEN support"));
476 return wxX11_FS_WMSPEC
;
479 // if the user is running KDE's kwin WM, use a legacy hack because
480 // kwin doesn't understand any other method:
481 if (wxKwinRunning(disp
, root
))
483 wxLogTrace(_T("fullscreen"), _T("detected kwin"));
487 // finally, fall back to ICCCM heuristic method:
488 wxLogTrace(_T("fullscreen"), _T("unknown WM, using _WIN_LAYER"));
489 return wxX11_FS_GENERIC
;
493 void wxSetFullScreenStateX11(WXDisplay
* display
, WXWindow rootWindow
,
494 WXWindow window
, bool show
,
496 wxX11FullScreenMethod method
)
498 // NB: please see the comment under "Fullscreen mode:" title above
499 // for implications of changing this code.
501 Window wnd
= WindowCast(window
);
502 Window root
= WindowCast(rootWindow
);
503 Display
*disp
= (Display
*)display
;
505 if (method
== wxX11_FS_AUTODETECT
)
506 method
= wxGetFullScreenMethodX11(display
, rootWindow
);
510 case wxX11_FS_WMSPEC
:
511 wxWMspecSetFullscreen(disp
, root
, wnd
, show
);
514 wxSetKDEFullscreen(disp
, root
, wnd
, show
, origRect
);
517 wxWinHintsSetLayer(disp
, root
, wnd
,
518 show
? WIN_LAYER_ABOVE_DOCK
: WIN_LAYER_NORMAL
);
525 // ----------------------------------------------------------------------------
526 // keycode translations
527 // ----------------------------------------------------------------------------
529 #include <X11/keysym.h>
531 // FIXME what about tables??
533 int wxCharCodeXToWX(KeySym keySym
)
540 id
= WXK_SHIFT
; break;
543 id
= WXK_CONTROL
; break;
548 id
= WXK_BACK
; break;
550 id
= WXK_DELETE
; break;
552 id
= WXK_CLEAR
; break;
558 id
= WXK_RETURN
; break;
560 id
= WXK_ESCAPE
; break;
563 id
= WXK_PAUSE
; break;
565 id
= WXK_NUMLOCK
; break;
567 id
= WXK_SCROLL
; break;
570 id
= WXK_HOME
; break;
574 id
= WXK_LEFT
; break;
576 id
= WXK_RIGHT
; break;
580 id
= WXK_DOWN
; break;
582 id
= WXK_PAGEDOWN
; break;
584 id
= WXK_PAGEUP
; break;
586 id
= WXK_MENU
; break;
588 id
= WXK_SELECT
; break;
590 id
= WXK_CANCEL
; break;
592 id
= WXK_PRINT
; break;
594 id
= WXK_EXECUTE
; break;
596 id
= WXK_INSERT
; break;
598 id
= WXK_HELP
; break;
601 id
= WXK_MULTIPLY
; break;
605 id
= WXK_SUBTRACT
; break;
607 id
= WXK_DIVIDE
; break;
609 id
= WXK_DECIMAL
; break;
617 id
= WXK_RETURN
; break;
619 id
= WXK_NUMPAD0
; break;
621 id
= WXK_NUMPAD1
; break;
623 id
= WXK_NUMPAD2
; break;
625 id
= WXK_NUMPAD3
; break;
627 id
= WXK_NUMPAD4
; break;
629 id
= WXK_NUMPAD5
; break;
631 id
= WXK_NUMPAD6
; break;
633 id
= WXK_NUMPAD7
; break;
635 id
= WXK_NUMPAD8
; break;
637 id
= WXK_NUMPAD9
; break;
687 id
= (keySym
<= 255) ? (int)keySym
: -1;
693 KeySym
wxCharCodeWXToX(int id
)
699 case WXK_CANCEL
: keySym
= XK_Cancel
; break;
700 case WXK_BACK
: keySym
= XK_BackSpace
; break;
701 case WXK_TAB
: keySym
= XK_Tab
; break;
702 case WXK_CLEAR
: keySym
= XK_Clear
; break;
703 case WXK_RETURN
: keySym
= XK_Return
; break;
704 case WXK_SHIFT
: keySym
= XK_Shift_L
; break;
705 case WXK_CONTROL
: keySym
= XK_Control_L
; break;
706 case WXK_ALT
: keySym
= XK_Meta_L
; break;
707 case WXK_MENU
: keySym
= XK_Menu
; break;
708 case WXK_PAUSE
: keySym
= XK_Pause
; break;
709 case WXK_ESCAPE
: keySym
= XK_Escape
; break;
710 case WXK_SPACE
: keySym
= ' '; break;
711 case WXK_PAGEUP
: keySym
= XK_Prior
; break;
712 case WXK_PAGEDOWN
: keySym
= XK_Next
; break;
713 case WXK_END
: keySym
= XK_End
; break;
714 case WXK_HOME
: keySym
= XK_Home
; break;
715 case WXK_LEFT
: keySym
= XK_Left
; break;
716 case WXK_UP
: keySym
= XK_Up
; break;
717 case WXK_RIGHT
: keySym
= XK_Right
; break;
718 case WXK_DOWN
: keySym
= XK_Down
; break;
719 case WXK_SELECT
: keySym
= XK_Select
; break;
720 case WXK_PRINT
: keySym
= XK_Print
; break;
721 case WXK_EXECUTE
: keySym
= XK_Execute
; break;
722 case WXK_INSERT
: keySym
= XK_Insert
; break;
723 case WXK_DELETE
: keySym
= XK_Delete
; break;
724 case WXK_HELP
: keySym
= XK_Help
; break;
725 case WXK_NUMPAD0
: keySym
= XK_KP_0
; break;
726 case WXK_NUMPAD1
: keySym
= XK_KP_1
; break;
727 case WXK_NUMPAD2
: keySym
= XK_KP_2
; break;
728 case WXK_NUMPAD3
: keySym
= XK_KP_3
; break;
729 case WXK_NUMPAD4
: keySym
= XK_KP_4
; break;
730 case WXK_NUMPAD5
: keySym
= XK_KP_5
; break;
731 case WXK_NUMPAD6
: keySym
= XK_KP_6
; break;
732 case WXK_NUMPAD7
: keySym
= XK_KP_7
; break;
733 case WXK_NUMPAD8
: keySym
= XK_KP_8
; break;
734 case WXK_NUMPAD9
: keySym
= XK_KP_9
; break;
735 case WXK_MULTIPLY
: keySym
= XK_KP_Multiply
; break;
736 case WXK_ADD
: keySym
= XK_KP_Add
; break;
737 case WXK_SUBTRACT
: keySym
= XK_KP_Subtract
; break;
738 case WXK_DECIMAL
: keySym
= XK_KP_Decimal
; break;
739 case WXK_DIVIDE
: keySym
= XK_KP_Divide
; break;
740 case WXK_F1
: keySym
= XK_F1
; break;
741 case WXK_F2
: keySym
= XK_F2
; break;
742 case WXK_F3
: keySym
= XK_F3
; break;
743 case WXK_F4
: keySym
= XK_F4
; break;
744 case WXK_F5
: keySym
= XK_F5
; break;
745 case WXK_F6
: keySym
= XK_F6
; break;
746 case WXK_F7
: keySym
= XK_F7
; break;
747 case WXK_F8
: keySym
= XK_F8
; break;
748 case WXK_F9
: keySym
= XK_F9
; break;
749 case WXK_F10
: keySym
= XK_F10
; break;
750 case WXK_F11
: keySym
= XK_F11
; break;
751 case WXK_F12
: keySym
= XK_F12
; break;
752 case WXK_F13
: keySym
= XK_F13
; break;
753 case WXK_F14
: keySym
= XK_F14
; break;
754 case WXK_F15
: keySym
= XK_F15
; break;
755 case WXK_F16
: keySym
= XK_F16
; break;
756 case WXK_F17
: keySym
= XK_F17
; break;
757 case WXK_F18
: keySym
= XK_F18
; break;
758 case WXK_F19
: keySym
= XK_F19
; break;
759 case WXK_F20
: keySym
= XK_F20
; break;
760 case WXK_F21
: keySym
= XK_F21
; break;
761 case WXK_F22
: keySym
= XK_F22
; break;
762 case WXK_F23
: keySym
= XK_F23
; break;
763 case WXK_F24
: keySym
= XK_F24
; break;
764 case WXK_NUMLOCK
: keySym
= XK_Num_Lock
; break;
765 case WXK_SCROLL
: keySym
= XK_Scroll_Lock
; break;
766 default: keySym
= id
<= 255 ? (KeySym
)id
: 0;
773 // ----------------------------------------------------------------------------
774 // check current state of a key
775 // ----------------------------------------------------------------------------
779 bool wxGetKeyState(wxKeyCode key
)
781 wxASSERT_MSG(key
!= WXK_LBUTTON
&& key
!= WXK_RBUTTON
&& key
!=
782 WXK_MBUTTON
, wxT("can't use wxGetKeyState() for mouse buttons"));
784 #if defined(__WXX11__)
785 Display
*pDisplay
= (Display
*) wxApp::GetDisplay();
786 #elif defined(__WXGTK__)
787 Display
*pDisplay
= GDK_DISPLAY();
788 #elif defined(__WXMOTIF__)
789 Display
*pDisplay
= (Display
*) (wxTheApp
? wxTheApp
->GetInitialDisplay() : NULL
);
791 #error Add code to get the DISPLAY for this platform
794 int iKey
= wxCharCodeWXToX(key
);
796 Window wDummy1
, wDummy2
;
797 int iDummy3
, iDummy4
, iDummy5
, iDummy6
;
799 XModifierKeymap
* map
= XGetModifierMapping(pDisplay
);
800 KeyCode keyCode
= XKeysymToKeycode(pDisplay
,iKey
);
801 if (keyCode
== NoSymbol
)
804 for (int i
= 0; i
< 8; ++i
)
806 if ( map
->modifiermap
[map
->max_keypermod
* i
] == keyCode
)
812 XQueryPointer(pDisplay
, DefaultRootWindow(pDisplay
), &wDummy1
, &wDummy2
,
813 &iDummy3
, &iDummy4
, &iDummy5
, &iDummy6
, &iMask
);
814 XFreeModifiermap(map
);
815 return (iMask
& iKeyMask
) != 0;
818 #endif // __WXX11__ || __WXGTK__ || __WXMOTIF__