8 #include <X11/Xproto.h>
10 #include "WindowMaker.h"
18 extern WPreferences wPreferences
;
22 wSoundServerGrab(Window wm_win
)
31 if (XQueryTree(dpy
, wm_win
, &retRoot
, &retParent
, &lstChildren
, &numChildren
)) {
32 for (indexCount
= 1; indexCount
< numChildren
; indexCount
++) {
33 retHint
= XAllocClassHint();
39 XGetClassHint (dpy
, lstChildren
[indexCount
], retHint
);
41 if (retHint
->res_class
) {
42 if (strcmp("WMSoundServer", retHint
->res_class
)==0 ||
43 /*strcmp("WSoundServer", retHint->res_class)==0 ||*/
45 strcmp("wsoundserver", retHint
->res_name
)==0 &&
46 strcmp("DockApp", retHint
->res_class
)==0)) {
48 soundServer
= lstChildren
[indexCount
];
66 wSoundPlay(long event_sound
)
72 atom
= XInternAtom(dpy
, "_WINDOWMAKER_EVENT", False
);
75 if(!wPreferences
.no_sound
) {
76 Window win
= wScreenWithNumber(0)->info_window
;
78 sound_event
.xclient
.type
= ClientMessage
;
79 sound_event
.xclient
.message_type
= atom
;
80 sound_event
.xclient
.format
= 32;
81 sound_event
.xclient
.display
= dpy
;
82 sound_event
.xclient
.window
= win
;
83 sound_event
.xclient
.data
.l
[0] = event_sound
;
84 XSendEvent(dpy
, win
, False
, StructureNotifyMask
, &sound_event
);