Change to the linux kernel coding style
[wmaker-crm.git] / src / wsound.c
blob85cc5014e718143ca2cb8843c1aa4fed776cfc65
1 #include "wconfig.h"
3 #include <stdio.h>
4 #include <stdlib.h>
5 #include <X11/X.h>
6 #include <X11/Xlib.h>
7 #include <X11/Xutil.h>
8 #include <X11/Xproto.h>
10 #include "WindowMaker.h"
11 #include "funcs.h"
12 #include "wsound.h"
14 extern WPreferences wPreferences;
16 void wSoundPlay(long event_sound)
18 static Atom atom = 0;
19 XEvent sound_event;
21 if (!atom) {
22 atom = XInternAtom(dpy, "_WINDOWMAKER_EVENT", False);
25 if (!wPreferences.no_sound) {
26 Window win = wScreenWithNumber(0)->info_window;
28 sound_event.xclient.type = ClientMessage;
29 sound_event.xclient.message_type = atom;
30 sound_event.xclient.format = 32;
31 sound_event.xclient.display = dpy;
32 sound_event.xclient.window = win;
33 sound_event.xclient.data.l[0] = event_sound;
34 XSendEvent(dpy, win, False, StructureNotifyMask, &sound_event);
35 XFlush(dpy);