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:
@@ -100,10 +100,8 @@ wmaker_SOURCES = \
|
|||||||
wmspec.c \
|
wmspec.c \
|
||||||
workspace.c \
|
workspace.c \
|
||||||
workspace.h \
|
workspace.h \
|
||||||
wsound.c \
|
|
||||||
wsound.h \
|
|
||||||
text.c \
|
text.c \
|
||||||
text.h
|
text.h
|
||||||
|
|
||||||
|
|
||||||
AM_CPPFLAGS = $(DFLAGS) -DLOCALEDIR=\"$(NLSDIR)\"
|
AM_CPPFLAGS = $(DFLAGS) -DLOCALEDIR=\"$(NLSDIR)\"
|
||||||
|
|||||||
@@ -375,7 +375,6 @@ typedef struct WPreferences {
|
|||||||
|
|
||||||
char no_dithering; /* use dithering or not */
|
char no_dithering; /* use dithering or not */
|
||||||
|
|
||||||
char no_sound; /* enable/disable sound */
|
|
||||||
char no_animations; /* enable/disable animations */
|
char no_animations; /* enable/disable animations */
|
||||||
|
|
||||||
char no_autowrap; /* wrap workspace when window is moved
|
char no_autowrap; /* wrap workspace when window is moved
|
||||||
|
|||||||
@@ -46,7 +46,6 @@
|
|||||||
#include "appmenu.h"
|
#include "appmenu.h"
|
||||||
#include "winspector.h"
|
#include "winspector.h"
|
||||||
#include "workspace.h"
|
#include "workspace.h"
|
||||||
#include "wsound.h"
|
|
||||||
#include "xinerama.h"
|
#include "xinerama.h"
|
||||||
|
|
||||||
/****** Global Variables ******/
|
/****** Global Variables ******/
|
||||||
@@ -227,7 +226,6 @@ void wShadeWindow(WWindow *wwin)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
XLowerWindow(dpy, wwin->client_win);
|
XLowerWindow(dpy, wwin->client_win);
|
||||||
wSoundPlay(WSOUND_SHADE);
|
|
||||||
shade_animate(wwin, SHADE);
|
shade_animate(wwin, SHADE);
|
||||||
|
|
||||||
wwin->flags.skip_next_animation = 0;
|
wwin->flags.skip_next_animation = 0;
|
||||||
@@ -268,7 +266,6 @@ void wUnshadeWindow(WWindow *wwin)
|
|||||||
wwin->flags.mapped = 1;
|
wwin->flags.mapped = 1;
|
||||||
XMapWindow(dpy, wwin->client_win);
|
XMapWindow(dpy, wwin->client_win);
|
||||||
|
|
||||||
wSoundPlay(WSOUND_UNSHADE);
|
|
||||||
shade_animate(wwin, UNSHADE);
|
shade_animate(wwin, UNSHADE);
|
||||||
|
|
||||||
wwin->flags.skip_next_animation = 0;
|
wwin->flags.skip_next_animation = 0;
|
||||||
@@ -396,7 +393,6 @@ void wMaximizeWindow(WWindow * wwin, int directions)
|
|||||||
|
|
||||||
WMPostNotificationName(WMNChangedState, wwin, "maximize");
|
WMPostNotificationName(WMNChangedState, wwin, "maximize");
|
||||||
|
|
||||||
wSoundPlay(WSOUND_MAXIMIZE);
|
|
||||||
/* set maximization state */
|
/* set maximization state */
|
||||||
wwin->flags.maximized = directions;
|
wwin->flags.maximized = directions;
|
||||||
}
|
}
|
||||||
@@ -561,8 +557,6 @@ void wUnmaximizeWindow(WWindow * wwin)
|
|||||||
wWindowConfigure(wwin, x, y, w, h);
|
wWindowConfigure(wwin, x, y, w, h);
|
||||||
|
|
||||||
WMPostNotificationName(WMNChangedState, wwin, "maximize");
|
WMPostNotificationName(WMNChangedState, wwin, "maximize");
|
||||||
|
|
||||||
wSoundPlay(WSOUND_UNMAXIMIZE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void wFullscreenWindow(WWindow * wwin)
|
void wFullscreenWindow(WWindow * wwin)
|
||||||
@@ -1015,8 +1009,6 @@ void wIconifyWindow(WWindow * wwin)
|
|||||||
unmapTransientsFor(wwin);
|
unmapTransientsFor(wwin);
|
||||||
|
|
||||||
if (present) {
|
if (present) {
|
||||||
wSoundPlay(WSOUND_ICONIFY);
|
|
||||||
|
|
||||||
XUngrabPointer(dpy, CurrentTime);
|
XUngrabPointer(dpy, CurrentTime);
|
||||||
wWindowUnmap(wwin);
|
wWindowUnmap(wwin);
|
||||||
/* let all Expose events arrive so that we can repaint
|
/* 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 the window is in another workspace, do it silently */
|
||||||
if (!netwm_hidden) {
|
if (!netwm_hidden) {
|
||||||
#ifdef ANIMATIONS
|
#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);
|
wClientSetState(wwin, IconicState, icon->icon_win);
|
||||||
flushExpose();
|
flushExpose();
|
||||||
wSoundPlay(WSOUND_HIDE);
|
|
||||||
#ifdef ANIMATIONS
|
#ifdef ANIMATIONS
|
||||||
if (!wwin->screen_ptr->flags.startup && !wPreferences.no_animations &&
|
if (!wwin->screen_ptr->flags.startup && !wPreferences.no_animations &&
|
||||||
!wwin->flags.skip_next_animation && animate) {
|
!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;
|
wwin->flags.hidden = 0;
|
||||||
|
|
||||||
wSoundPlay(WSOUND_UNHIDE);
|
|
||||||
#ifdef ANIMATIONS
|
#ifdef ANIMATIONS
|
||||||
if (!wwin->screen_ptr->flags.startup && !wPreferences.no_animations && animate) {
|
if (!wwin->screen_ptr->flags.startup && !wPreferences.no_animations && animate) {
|
||||||
animateResize(wwin->screen_ptr, icon_x, icon_y,
|
animateResize(wwin->screen_ptr, icon_x, icon_y,
|
||||||
|
|||||||
@@ -47,7 +47,6 @@
|
|||||||
#ifdef XDND
|
#ifdef XDND
|
||||||
#include "xdnd.h"
|
#include "xdnd.h"
|
||||||
#endif
|
#endif
|
||||||
#include "wsound.h"
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* icon_file for the dock is got from the preferences file by
|
* icon_file for the dock is got from the preferences file by
|
||||||
@@ -718,8 +717,6 @@ void appIconMouseDown(WObjDescriptor * desc, XEvent * event)
|
|||||||
* position */
|
* position */
|
||||||
SlideWindow(icon->core->window, x, y, oldX, oldY);
|
SlideWindow(icon->core->window, x, y, oldX, oldY);
|
||||||
}
|
}
|
||||||
|
|
||||||
wSoundPlay(WSOUND_DOCK);
|
|
||||||
} else {
|
} else {
|
||||||
if (movingSingle) {
|
if (movingSingle) {
|
||||||
/* move back to its place */
|
/* move back to its place */
|
||||||
|
|||||||
@@ -48,7 +48,6 @@
|
|||||||
#include "defaults.h"
|
#include "defaults.h"
|
||||||
#include "workspace.h"
|
#include "workspace.h"
|
||||||
#include "dock.h"
|
#include "dock.h"
|
||||||
#include "wsound.h"
|
|
||||||
|
|
||||||
#include "xinerama.h"
|
#include "xinerama.h"
|
||||||
|
|
||||||
@@ -401,7 +400,6 @@ WApplication *wApplicationCreate(WWindow * wwin)
|
|||||||
extractClientIcon(wapp->app_icon);
|
extractClientIcon(wapp->app_icon);
|
||||||
}
|
}
|
||||||
|
|
||||||
wSoundPlay(WSOUND_APPSTART);
|
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
printf("Created application for %x\n", (unsigned)main_window);
|
printf("Created application for %x\n", (unsigned)main_window);
|
||||||
@@ -473,6 +471,4 @@ void wApplicationDestroy(WApplication * wapp)
|
|||||||
if (wPreferences.auto_arrange_icons) {
|
if (wPreferences.auto_arrange_icons) {
|
||||||
wArrangeIcons(scr, True);
|
wArrangeIcons(scr, True);
|
||||||
}
|
}
|
||||||
|
|
||||||
wSoundPlay(WSOUND_APPEXIT);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -440,8 +440,6 @@ WDefaultEntry optionList[] = {
|
|||||||
&wPreferences.use_saveunders, getBool, NULL},
|
&wPreferences.use_saveunders, getBool, NULL},
|
||||||
{"OpaqueMove", "NO", NULL,
|
{"OpaqueMove", "NO", NULL,
|
||||||
&wPreferences.opaque_move, getBool, NULL},
|
&wPreferences.opaque_move, getBool, NULL},
|
||||||
{"DisableSound", "NO", NULL,
|
|
||||||
&wPreferences.no_sound, getBool, NULL},
|
|
||||||
{"DisableAnimations", "NO", NULL,
|
{"DisableAnimations", "NO", NULL,
|
||||||
&wPreferences.no_animations, getBool, NULL},
|
&wPreferences.no_animations, getBool, NULL},
|
||||||
{"DontLinkWorkspaces", "NO", NULL,
|
{"DontLinkWorkspaces", "NO", NULL,
|
||||||
|
|||||||
@@ -1624,12 +1624,6 @@ void wShowInfoPanel(WScreen * scr)
|
|||||||
strbuf = wstrappend(strbuf, buf);
|
strbuf = wstrappend(strbuf, buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wPreferences.no_sound) {
|
|
||||||
strbuf = wstrappend(strbuf, _("\nSound disabled"));
|
|
||||||
} else {
|
|
||||||
strbuf = wstrappend(strbuf, _("\nSound enabled"));
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef VIRTUAL_DESKTOP
|
#ifdef VIRTUAL_DESKTOP
|
||||||
if (wPreferences.vdesk_enable)
|
if (wPreferences.vdesk_enable)
|
||||||
strbuf = wstrappend(strbuf, _(", VirtualDesktop enabled"));
|
strbuf = wstrappend(strbuf, _(", VirtualDesktop enabled"));
|
||||||
|
|||||||
@@ -52,7 +52,6 @@
|
|||||||
#include "workspace.h"
|
#include "workspace.h"
|
||||||
#include "framewin.h"
|
#include "framewin.h"
|
||||||
#include "superfluous.h"
|
#include "superfluous.h"
|
||||||
#include "wsound.h"
|
|
||||||
#include "xinerama.h"
|
#include "xinerama.h"
|
||||||
|
|
||||||
/**** Local variables ****/
|
/**** Local variables ****/
|
||||||
@@ -3681,13 +3680,8 @@ static Bool handleIconMove(WDock *dock, WAppIcon *aicon, XEvent *event)
|
|||||||
if (aicon->icon->selected)
|
if (aicon->icon->selected)
|
||||||
wIconSelect(aicon->icon);
|
wIconSelect(aicon->icon);
|
||||||
|
|
||||||
wSoundPlay(WSOUND_KABOOM);
|
|
||||||
DoKaboom(scr, aicon->icon->core->window, x, y);
|
DoKaboom(scr, aicon->icon->core->window, x, y);
|
||||||
} else {
|
|
||||||
wSoundPlay(WSOUND_UNDOCK);
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
wSoundPlay(WSOUND_UNDOCK);
|
|
||||||
}
|
}
|
||||||
if (clip && clip->auto_raise_lower)
|
if (clip && clip->auto_raise_lower)
|
||||||
wDockLower(clip);
|
wDockLower(clip);
|
||||||
|
|||||||
37
src/wsound.c
37
src/wsound.c
@@ -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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
43
src/wsound.h
43
src/wsound.h
@@ -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_*/
|
|
||||||
Reference in New Issue
Block a user