1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-19 20:38:08 +01:00

Remove sound support

Two reasons for removing it:

    1) I won't ever want to hear useless sounds

    2) The sound support is a bit of a joke. The code is there but you have
       to hunt it somewhere else (not in any repository that I know of).
       In my 10 years of using wmaker, I never used it for this reason.
       Now I consider having no sound in Window Maker a feature, and I like
       it that way. So there is no point in carrying useless code around.

PS: There is still the code in WPrefs to be removed.
This commit is contained in:
Carlos R. Mafra
2009-10-09 19:57:25 +02:00
parent 7df49cce14
commit 2765bec3e4
10 changed files with 2 additions and 118 deletions

View File

@@ -100,8 +100,6 @@ wmaker_SOURCES = \
wmspec.c \
workspace.c \
workspace.h \
wsound.c \
wsound.h \
text.c \
text.h

View File

@@ -375,7 +375,6 @@ typedef struct WPreferences {
char no_dithering; /* use dithering or not */
char no_sound; /* enable/disable sound */
char no_animations; /* enable/disable animations */
char no_autowrap; /* wrap workspace when window is moved

View File

@@ -46,7 +46,6 @@
#include "appmenu.h"
#include "winspector.h"
#include "workspace.h"
#include "wsound.h"
#include "xinerama.h"
/****** Global Variables ******/
@@ -227,7 +226,6 @@ void wShadeWindow(WWindow *wwin)
return;
XLowerWindow(dpy, wwin->client_win);
wSoundPlay(WSOUND_SHADE);
shade_animate(wwin, SHADE);
wwin->flags.skip_next_animation = 0;
@@ -268,7 +266,6 @@ void wUnshadeWindow(WWindow *wwin)
wwin->flags.mapped = 1;
XMapWindow(dpy, wwin->client_win);
wSoundPlay(WSOUND_UNSHADE);
shade_animate(wwin, UNSHADE);
wwin->flags.skip_next_animation = 0;
@@ -396,7 +393,6 @@ void wMaximizeWindow(WWindow * wwin, int directions)
WMPostNotificationName(WMNChangedState, wwin, "maximize");
wSoundPlay(WSOUND_MAXIMIZE);
/* set maximization state */
wwin->flags.maximized = directions;
}
@@ -561,8 +557,6 @@ void wUnmaximizeWindow(WWindow * wwin)
wWindowConfigure(wwin, x, y, w, h);
WMPostNotificationName(WMNChangedState, wwin, "maximize");
wSoundPlay(WSOUND_UNMAXIMIZE);
}
void wFullscreenWindow(WWindow * wwin)
@@ -1015,8 +1009,6 @@ void wIconifyWindow(WWindow * wwin)
unmapTransientsFor(wwin);
if (present) {
wSoundPlay(WSOUND_ICONIFY);
XUngrabPointer(dpy, CurrentTime);
wWindowUnmap(wwin);
/* let all Expose events arrive so that we can repaint
@@ -1191,9 +1183,6 @@ void wDeiconifyWindow(WWindow * wwin)
}
}
if (!netwm_hidden)
wSoundPlay(WSOUND_DEICONIFY);
/* if the window is in another workspace, do it silently */
if (!netwm_hidden) {
#ifdef ANIMATIONS
@@ -1308,7 +1297,7 @@ static void hideWindow(WIcon * icon, int icon_x, int icon_y, WWindow * wwin, int
wClientSetState(wwin, IconicState, icon->icon_win);
flushExpose();
wSoundPlay(WSOUND_HIDE);
#ifdef ANIMATIONS
if (!wwin->screen_ptr->flags.startup && !wPreferences.no_animations &&
!wwin->flags.skip_next_animation && animate) {
@@ -1440,7 +1429,6 @@ static void unhideWindow(WIcon * icon, int icon_x, int icon_y, WWindow * wwin, i
wwin->flags.hidden = 0;
wSoundPlay(WSOUND_UNHIDE);
#ifdef ANIMATIONS
if (!wwin->screen_ptr->flags.startup && !wPreferences.no_animations && animate) {
animateResize(wwin->screen_ptr, icon_x, icon_y,

View File

@@ -47,7 +47,6 @@
#ifdef XDND
#include "xdnd.h"
#endif
#include "wsound.h"
/*
* icon_file for the dock is got from the preferences file by
@@ -718,8 +717,6 @@ void appIconMouseDown(WObjDescriptor * desc, XEvent * event)
* position */
SlideWindow(icon->core->window, x, y, oldX, oldY);
}
wSoundPlay(WSOUND_DOCK);
} else {
if (movingSingle) {
/* move back to its place */

View File

@@ -48,7 +48,6 @@
#include "defaults.h"
#include "workspace.h"
#include "dock.h"
#include "wsound.h"
#include "xinerama.h"
@@ -401,7 +400,6 @@ WApplication *wApplicationCreate(WWindow * wwin)
extractClientIcon(wapp->app_icon);
}
wSoundPlay(WSOUND_APPSTART);
#ifdef DEBUG
printf("Created application for %x\n", (unsigned)main_window);
@@ -473,6 +471,4 @@ void wApplicationDestroy(WApplication * wapp)
if (wPreferences.auto_arrange_icons) {
wArrangeIcons(scr, True);
}
wSoundPlay(WSOUND_APPEXIT);
}

View File

@@ -440,8 +440,6 @@ WDefaultEntry optionList[] = {
&wPreferences.use_saveunders, getBool, NULL},
{"OpaqueMove", "NO", NULL,
&wPreferences.opaque_move, getBool, NULL},
{"DisableSound", "NO", NULL,
&wPreferences.no_sound, getBool, NULL},
{"DisableAnimations", "NO", NULL,
&wPreferences.no_animations, getBool, NULL},
{"DontLinkWorkspaces", "NO", NULL,

View File

@@ -1624,12 +1624,6 @@ void wShowInfoPanel(WScreen * scr)
strbuf = wstrappend(strbuf, buf);
}
if (wPreferences.no_sound) {
strbuf = wstrappend(strbuf, _("\nSound disabled"));
} else {
strbuf = wstrappend(strbuf, _("\nSound enabled"));
}
#ifdef VIRTUAL_DESKTOP
if (wPreferences.vdesk_enable)
strbuf = wstrappend(strbuf, _(", VirtualDesktop enabled"));

View File

@@ -52,7 +52,6 @@
#include "workspace.h"
#include "framewin.h"
#include "superfluous.h"
#include "wsound.h"
#include "xinerama.h"
/**** Local variables ****/
@@ -3681,13 +3680,8 @@ static Bool handleIconMove(WDock *dock, WAppIcon *aicon, XEvent *event)
if (aicon->icon->selected)
wIconSelect(aicon->icon);
wSoundPlay(WSOUND_KABOOM);
DoKaboom(scr, aicon->icon->core->window, x, y);
} else {
wSoundPlay(WSOUND_UNDOCK);
}
} else {
wSoundPlay(WSOUND_UNDOCK);
}
if (clip && clip->auto_raise_lower)
wDockLower(clip);

View File

@@ -1,37 +0,0 @@
#include "wconfig.h"
#include <stdio.h>
#include <stdlib.h>
#include <X11/X.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xproto.h>
#include "WindowMaker.h"
#include "funcs.h"
#include "wsound.h"
extern WPreferences wPreferences;
void wSoundPlay(long event_sound)
{
static Atom atom = 0;
XEvent sound_event;
if (!atom) {
atom = XInternAtom(dpy, "_WINDOWMAKER_EVENT", False);
}
if (!wPreferences.no_sound) {
Window win = wScreenWithNumber(0)->info_window;
sound_event.xclient.type = ClientMessage;
sound_event.xclient.message_type = atom;
sound_event.xclient.format = 32;
sound_event.xclient.display = dpy;
sound_event.xclient.window = win;
sound_event.xclient.data.l[0] = event_sound;
XSendEvent(dpy, win, False, StructureNotifyMask, &sound_event);
XFlush(dpy);
}
}

View File

@@ -1,43 +0,0 @@
/*
* Window Maker Sound Server
*
* Copyright (c) 1997 Anthony P. Quinn
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
* USA.
*/
#ifndef WSOUND_H_
#define WSOUND_H_
#define WSOUND_SHADE 1001
#define WSOUND_UNSHADE 1002
#define WSOUND_MAXIMIZE 1003
#define WSOUND_UNMAXIMIZE 1004
#define WSOUND_ICONIFY 1005
#define WSOUND_DEICONIFY 1006
#define WSOUND_HIDE 1007
#define WSOUND_UNHIDE 1008
#define WSOUND_APPSTART 1009
#define WSOUND_APPEXIT 1010
#define WSOUND_DOCK 1011
#define WSOUND_UNDOCK 1012
#define WSOUND_KABOOM 1013
void wSoundPlay(long event_sound);
void wSoundServerGrab(Window wm_win);
#endif /*WSOUND_H_*/