mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 02:42:49 -04:00
disable audio for alt-tab
This commit is contained in:
parent
d478348a71
commit
704456e91d
@ -623,6 +623,20 @@ class ShowBase:
|
||||
self.notify.info("Taking screenshot: " + imageName)
|
||||
takeSnapshot(self.win, imageName)
|
||||
|
||||
def DisableAudio(self):
|
||||
if self.wantSfx:
|
||||
self.sfxManager.setActive(0)
|
||||
if self.wantMusic:
|
||||
self.musicManager.setActive(0)
|
||||
self.notify.debug("Disabling audio")
|
||||
|
||||
def EnableAudio(self):
|
||||
if self.wantSfx:
|
||||
self.sfxManager.setActive(1)
|
||||
if self.wantMusic:
|
||||
self.musicManager.setActive(1)
|
||||
self.notify.debug("Enabling audio")
|
||||
|
||||
def run(self):
|
||||
self.taskMgr.run()
|
||||
|
||||
|
@ -28,6 +28,8 @@
|
||||
#include <keyboardButton.h>
|
||||
#include <mouseButton.h>
|
||||
|
||||
#include <throw_event.h>
|
||||
|
||||
#ifdef DO_PSTATS
|
||||
#include <pStatTimer.h>
|
||||
#endif
|
||||
@ -673,6 +675,8 @@ void wdxGraphicsWindow::deactivate_window(void) {
|
||||
if((wndpl.showCmd!=SW_MINIMIZE)&&(wndpl.showCmd!=SW_SHOWMINIMIZED)) {
|
||||
ShowWindow(_mwindow, SW_MINIMIZE);
|
||||
}
|
||||
|
||||
throw_event("PandaPaused"); // right now this is used to signal python event handler to disable audio
|
||||
}
|
||||
|
||||
// if(!bResponsive_minimized_fullscreen_window) {
|
||||
@ -722,6 +726,10 @@ void wdxGraphicsWindow::reactivate_window(void) {
|
||||
// SetWindowPos(_mwindow, HWND_TOP, 0,0,0,0, SWP_NOMOVE | SWP_NOSENDCHANGING | SWP_NOSIZE | SWP_NOOWNERZORDER);
|
||||
GdiFlush();
|
||||
}
|
||||
|
||||
if(_props._fullscreen) {
|
||||
throw_event("PandaRestarted"); // right now this is used to signal python event handler to re-enable audio
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
Loading…
x
Reference in New Issue
Block a user