[VCM] fix ToolbarHide behavior (#21348)

This commit is contained in:
Andrey Nekrasov 2022-10-26 00:25:53 +03:00 committed by GitHub
parent e171264dc2
commit a3042b8435
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 91 additions and 47 deletions

View File

@ -62,6 +62,7 @@ APIENTRY
APIIs APIIs
APPBARDATA APPBARDATA
appdata appdata
APPEXECLINK
APPICON APPICON
appid appid
appium appium
@ -75,6 +76,7 @@ apps
appwindow appwindow
appwiz appwiz
appx appx
appxpackage
APSTUDIO APSTUDIO
AQS AQS
Aqtobe Aqtobe
@ -265,6 +267,7 @@ cnt
Cocklebiddy Cocklebiddy
coclass coclass
codebase codebase
codecvt
CODENAME CODENAME
codeofconduct codeofconduct
codereview codereview
@ -296,6 +299,7 @@ comsuppw
comsuppwd comsuppwd
comutil comutil
Concat Concat
concrt
configs configs
Configurator Configurator
CONFLICTINGMODIFIERKEY CONFLICTINGMODIFIERKEY
@ -314,6 +318,7 @@ CONTROLPARENT
Controlz Controlz
coord coord
copiedcolorrepresentation copiedcolorrepresentation
corewebview
cortana cortana
cotaskmem cotaskmem
COULDNOT COULDNOT
@ -350,6 +355,7 @@ CSY
CTAB CTAB
CTest CTest
ctime ctime
Ctl
ctor ctor
CTRLALTDEL CTRLALTDEL
Ctrls Ctrls
@ -385,6 +391,7 @@ DARKPURPLE
DARKTEAL DARKTEAL
DARKYELLOW DARKYELLOW
datareader datareader
datatemplate
Datavalue Datavalue
DATAW DATAW
davidegiacometti davidegiacometti
@ -546,6 +553,7 @@ ENTERSIZEMOVE
entrypoint entrypoint
ENU ENU
enum enum
enumerationoptions
EOAC EOAC
EOL EOL
epicgames epicgames
@ -566,6 +574,7 @@ etl
etw etw
Eucla Eucla
EUQ EUQ
eurochange
eventlog eventlog
everytime everytime
evt evt
@ -610,6 +619,7 @@ fileapi
FILEEXPLORER FILEEXPLORER
FILEFLAGS FILEFLAGS
FILEFLAGSMASK FILEFLAGSMASK
fileio
FILEOP FILEOP
FILEOS FILEOS
filepath filepath
@ -624,7 +634,7 @@ Filterkeyboard
Filterx Filterx
finalizer finalizer
findfast findfast
Firefox firefox
FIXEDFILEINFO FIXEDFILEINFO
flt flt
flyout flyout
@ -641,6 +651,7 @@ franky
frankychen frankychen
Froml Froml
FROMTOUCH FROMTOUCH
FSCTL
fstream fstream
FTYPE FTYPE
func func
@ -662,7 +673,8 @@ gcode
gdi gdi
gdiplus gdiplus
GDISCALED GDISCALED
generatesqlfromuserquery getancestor
getasynckeystate
GETDESKWALLPAPER GETDESKWALLPAPER
GETDLGCODE GETDLGCODE
GETDPISCALEDSIZE GETDPISCALEDSIZE
@ -675,7 +687,9 @@ GETTEXTLENGTH
GHND GHND
github github
githubusercontent githubusercontent
globalassemblycache
globals globals
Globbing
GMEM GMEM
GNumber GNumber
google google
@ -690,10 +704,12 @@ GValue
gwl gwl
GWLP GWLP
HACCEL HACCEL
handlerroutine
hangeul hangeul
hanselman hanselman
hardcoded hardcoded
Hardlines Hardlines
hardlinks
HARDWAREINPUT HARDWAREINPUT
hashcode hashcode
Hashset Hashset
@ -835,6 +851,7 @@ IDrive
idx idx
IDXGI IDXGI
IEasing IEasing
IElevation
IEnum IEnum
IEnumerable IEnumerable
IEnumerator IEnumerator
@ -860,6 +877,7 @@ IFormatter
ifstream ifstream
IGraph IGraph
IGraphics IGraphics
ihost
iid iid
IImage IImage
Iindex Iindex
@ -907,6 +925,7 @@ INotify
inout inout
INPC INPC
inproc inproc
inputdev
INPUTHARDWARE INPUTHARDWARE
INPUTKEYBOARD INPUTKEYBOARD
INPUTLANGCHANGED INPUTLANGCHANGED
@ -951,6 +970,7 @@ IPin
IPlugin IPlugin
IPower IPower
ipreview ipreview
ipreviewhandler
ipreviewhandlertranslateaccelerator ipreviewhandlertranslateaccelerator
ipreviewhandlervisualssetfont ipreviewhandlervisualssetfont
IPrincipal IPrincipal
@ -975,6 +995,7 @@ isetting
isfinite isfinite
IShell IShell
ISingle ISingle
ISite
ISmart ISmart
isocpp isocpp
iss iss
@ -983,6 +1004,7 @@ istreambuf
istringstream istringstream
iswpunct iswpunct
iswspace iswspace
ISynchronize
ITab ITab
ITask ITask
ITemplate ITemplate
@ -1002,6 +1024,7 @@ IValue
IVector IVector
IView IView
IVirtual IVirtual
ivirtualdesktopmanager
IWbem IWbem
IWIC IWIC
iwindow iwindow
@ -1011,8 +1034,6 @@ IYUV
IZone IZone
IZoom IZoom
JArray JArray
jarro
Jarryd
jefflord jefflord
jfif jfif
jgeosdfsdsgmkedfgdfgdfgbkmhcgcflmi jgeosdfsdsgmkedfgdfgdfgbkmhcgcflmi
@ -1219,6 +1240,7 @@ memcpy
memset memset
MENUITEMINFO MENUITEMINFO
MENUITEMINFOW MENUITEMINFOW
menurc
Metadatas Metadatas
metafile metafile
mfapi mfapi
@ -1251,6 +1273,7 @@ mjpg
mkd mkd
mkdn mkdn
mlcfg mlcfg
MMdd
MMDDYYYY MMDDYYYY
mmdeviceapi mmdeviceapi
mmi mmi
@ -1287,8 +1310,9 @@ msclr
mscoree mscoree
mscorlib mscorlib
msdata msdata
MSDN msdn
msedge msedge
MSFT
MSGFLT MSGFLT
MSIFASTINSTALL MSIFASTINSTALL
MSIHANDLE MSIHANDLE
@ -1302,6 +1326,7 @@ msp
msrc msrc
mst mst
msvc msvc
msvcp
MTND MTND
Mul Mul
multiline multiline
@ -1312,7 +1337,8 @@ multizone
Mundrabilla Mundrabilla
mutex mutex
mutexes mutexes
MVVM muxc
mvvm
myfile myfile
MYICON MYICON
MYTZ MYTZ
@ -1320,6 +1346,7 @@ NAMECHANGE
nameof nameof
namespace namespace
Navassa Navassa
navigatetostring
NCACTIVATE NCACTIVATE
ncc ncc
NCCALCSIZE NCCALCSIZE
@ -1359,7 +1386,7 @@ newdev
newitem newitem
newpath newpath
newrow newrow
Newtonsoft newtonsoft
nia nia
niels niels
nielslaute nielslaute
@ -1386,6 +1413,7 @@ nonclient
NONCONVERT NONCONVERT
NONELEVATED NONELEVATED
NONINFRINGEMENT NONINFRINGEMENT
nonpackaged
nonstd nonstd
NOOWNERZORDER NOOWNERZORDER
NOPARENTNOTIFY NOPARENTNOTIFY
@ -1437,6 +1465,7 @@ OBJID
objidl objidl
oblitum oblitum
ocr ocr
Ocrsettings
odbc odbc
odbccp odbccp
Oem Oem
@ -1450,7 +1479,9 @@ oldpath
oldtheme oldtheme
oleaut oleaut
OLECHAR OLECHAR
OLEDB oledb
oledbcommand
oledbconnection
OLIVEGREEN OLIVEGREEN
onebranch onebranch
onenote onenote
@ -1561,7 +1592,6 @@ POWERRENAMECONTEXTMENU
powerrenameinput powerrenameinput
POWERRENAMETEST POWERRENAMETEST
powertoy powertoy
powertoysinterop
powertoyssetup powertoyssetup
Powrprof Powrprof
ppidl ppidl
@ -1584,7 +1614,7 @@ preload
PREMULTIPLIED PREMULTIPLIED
prevhost prevhost
previewer previewer
PREVIEWHANDLERFRAMEINFO previewhandlerframeinfo
previewpane previewpane
previouscamera previouscamera
PREVIOUSINSTALLFOLDER PREVIOUSINSTALLFOLDER
@ -1642,6 +1672,7 @@ qps
quateur quateur
Queryable Queryable
QUERYENDSESSION QUERYENDSESSION
queryfocus
QUERYOPEN QUERYOPEN
QUEUESYNC QUEUESYNC
Quickime Quickime
@ -1688,9 +1719,11 @@ REFIID
REGCLS REGCLS
regedit regedit
regex regex
regfile
REGFILTER REGFILTER
REGFILTERPINS REGFILTERPINS
REGISTERCLASSFAILED REGISTERCLASSFAILED
registerhotkey
registrypath registrypath
regkey regkey
REGPINTYPES REGPINTYPES
@ -1707,7 +1740,7 @@ Removelnk
renamable renamable
RENAMEONCOLLISION RENAMEONCOLLISION
Renamer Renamer
Reparse reparse
requery requery
requerying requerying
rescap rescap
@ -1717,6 +1750,7 @@ Resizable
resizers resizers
resmimetype resmimetype
RESOURCEID RESOURCEID
resourcemanager
RESTORETOMAXIMIZED RESTORETOMAXIMIZED
restrictedcapabilities restrictedcapabilities
restrictederrorinfo restrictederrorinfo
@ -1760,6 +1794,7 @@ Rstrtmgr
RTB RTB
RTLREADING RTLREADING
RTSS RTSS
ruleset
runas runas
rundll rundll
rungameid rungameid
@ -1783,6 +1818,7 @@ SAVEFAILED
scalability scalability
scancode scancode
scanled scanled
Schd
schedtasks schedtasks
Scip Scip
scipbe scipbe
@ -1797,11 +1833,14 @@ SDKDDK
sdns sdns
searchterm searchterm
Secur Secur
securityoverview
seekg seekg
Segoe segoe
Sekan Sekan
SENDCHANGE SENDCHANGE
sendinput
sendvirtualinput sendvirtualinput
Seperate
serializer serializer
serverside serverside
SETCONTEXT SETCONTEXT
@ -1837,6 +1876,7 @@ SHGFI
Shl Shl
shldisp shldisp
shlobj shlobj
Shlw
shlwapi shlwapi
shmem shmem
shobjidl shobjidl
@ -1851,6 +1891,7 @@ Shortcuttool
shortdate shortdate
SHORTPATH SHORTPATH
shortsplit shortsplit
should't
showcolorname showcolorname
SHOWDEFAULT SHOWDEFAULT
SHOWELEVATIONPROMPT SHOWELEVATIONPROMPT
@ -1860,7 +1901,7 @@ SHOWMINNOACTIVE
SHOWNA SHOWNA
SHOWNOACTIVATE SHOWNOACTIVATE
SHOWNORMAL SHOWNORMAL
SHOWWINDOW showwindow
shtypes shtypes
SICHINT SICHINT
sid sid
@ -1888,6 +1929,7 @@ sku
SLGP SLGP
sln sln
SMALLICON SMALLICON
smartphone
SMTO SMTO
snd snd
snickler snickler
@ -1937,7 +1979,7 @@ STARTUPINFO
STARTUPINFOEX STARTUPINFOEX
STARTUPINFOW STARTUPINFOW
startupscreen startupscreen
STATFLAG statflag
STATICEDGE STATICEDGE
STATSTG STATSTG
stdafx stdafx
@ -1954,7 +1996,7 @@ STDMETHODIMP
stdout stdout
stefan stefan
Stereolithography Stereolithography
STGM stgm
STGMEDIUM STGMEDIUM
sticpl sticpl
stl stl
@ -2005,7 +2047,6 @@ swprintf
SWRESTORE SWRESTORE
swscanf swscanf
SYMED SYMED
symlink
SYMOPT SYMOPT
SYNCMFT SYNCMFT
SYNCPAINT SYNCPAINT
@ -2015,9 +2056,10 @@ SYSCOMMAND
SYSDEADCHAR SYSDEADCHAR
sysdm sysdm
SYSICONINDEX SYSICONINDEX
sysinfo
SYSKEY SYSKEY
syskeydown syskeydown
SYSKEYUP syskeyup
syslog syslog
SYSMENU SYSMENU
SYSTEMAPPS SYSTEMAPPS
@ -2083,6 +2125,7 @@ Toolset
toolwindow toolwindow
TOPDOWNDIB TOPDOWNDIB
toplevel toplevel
tostring
TOUCHEVENTF TOUCHEVENTF
TOUCHINPUT TOUCHINPUT
touchpad touchpad
@ -2105,7 +2148,7 @@ TStr
Tuva Tuva
TValue TValue
TWF TWF
TYMED tymed
typedef typedef
TYPEKEY TYPEKEY
TYPEKEYBOARD TYPEKEYBOARD
@ -2118,6 +2161,7 @@ TYPESHORTCUT
UAC UAC
UAL UAL
uap uap
uapmanifestschema
ubuntu ubuntu
udit udit
Udk Udk
@ -2126,6 +2170,7 @@ Udp
uefi uefi
UHash UHash
UIA UIA
uiauto
uid uid
UIEx UIEx
uint uint
@ -2198,12 +2243,15 @@ vabdq
validmodulename validmodulename
Vanara Vanara
vcamp vcamp
vccorlib
vcdl vcdl
vcgtq vcgtq
VCINSTALLDIR VCINSTALLDIR
vcm vcm
vcomp
Vcpkg Vcpkg
VCRT VCRT
vcruntime
vcvars vcvars
VDesktop VDesktop
vdi vdi
@ -2229,6 +2277,7 @@ viewmodel
vih vih
virtualization virtualization
Virtualizing Virtualizing
virtualkey
visiblecolorformats visiblecolorformats
Visibletrue Visibletrue
visualbrush visualbrush
@ -2295,6 +2344,7 @@ wikipedia
wildcards wildcards
winapi winapi
winappdriver winappdriver
winauto
wincodec wincodec
Wincodecsdk Wincodecsdk
wincolor wincolor
@ -2328,7 +2378,8 @@ winkey
WINL WINL
winmd winmd
winmm winmm
WINNT winmsg
winnt
winres winres
winrt winrt
winsdk winsdk
@ -2337,6 +2388,7 @@ winspool
WINTHRESHOLD WINTHRESHOLD
winui winui
winuiex winuiex
winuser
winxamlmanager winxamlmanager
wistd wistd
withinrafael withinrafael
@ -2349,6 +2401,7 @@ WKSG
Wlkr Wlkr
wmain wmain
Wman Wman
wmentha
wmi wmi
WMICIM WMICIM
WMKEYDOWN WMKEYDOWN
@ -2392,6 +2445,7 @@ wtoi
WTS WTS
wtsapi wtsapi
WTSAT WTSAT
wtypes
Wubi Wubi
wuceffectsi wuceffectsi
WVC WVC
@ -2429,6 +2483,7 @@ YUYV
YVIRTUALSCREEN YVIRTUALSCREEN
YVU YVU
YVYU YVYU
yyyy
Zabaykalsky Zabaykalsky
ZEROINIT ZEROINIT
ZIndex ZIndex

View File

@ -152,38 +152,27 @@ LRESULT Toolbar::WindowProcessMessages(HWND hwnd, UINT msg, WPARAM wparam, LPARA
const bool showOverlayTimeout = nowMillis - toolbar->lastTimeCamOrMicMuteStateChanged > OVERLAY_SHOW_TIME; const bool showOverlayTimeout = nowMillis - toolbar->lastTimeCamOrMicMuteStateChanged > OVERLAY_SHOW_TIME;
static bool previousShow = false; static bool previousShow = false;
bool show = false; bool show = toolbar->ToolbarHide == L"Never";
if (toolbar->ToolbarHide == L"Never") const bool cameraJustStoppedInUse = toolbar->previouscameraInUse && !toolbar->cameraInUse;
bool shouldUnmuteAll = cameraJustStoppedInUse;
if (toolbar->ToolbarHide == L"When both camera and microphone are muted")
{ {
show = true; // We shouldn't unmute devices, since we'd like to only show the toolbar only
} // when something is unmuted -> the use case is to keep everything muted by default and track it
else if (toolbar->ToolbarHide == L"When both camera and microphone are muted") shouldUnmuteAll = false;
{ show = (!toolbar->cameraMuted && toolbar->cameraInUse) || !toolbar->microphoneMuted;
if(!toolbar->previouscameraInUse && toolbar->cameraInUse && !toolbar->moduleSettingsUpdateScheduled)
{
VideoConferenceModule::muteAll();
}
show = !(toolbar->microphoneMuted && (toolbar->cameraMuted || !toolbar->cameraInUse));
} }
else if (toolbar->ToolbarHide == L"When both camera and microphone are unmuted") else if (toolbar->ToolbarHide == L"When both camera and microphone are unmuted")
{ show = (toolbar->cameraMuted && toolbar->cameraInUse) || toolbar->microphoneMuted;
if(!toolbar->previouscameraInUse && toolbar->cameraInUse && !toolbar->moduleSettingsUpdateScheduled)
{ if (shouldUnmuteAll && !toolbar->moduleSettingsUpdateScheduled)
VideoConferenceModule::unmuteAll(); VideoConferenceModule::unmuteAll();
}
show = toolbar->microphoneMuted || toolbar->cameraMuted;
}
show = show || !showOverlayTimeout; show = show || !showOverlayTimeout;
if (show) ShowWindow(hwnd, show ? SW_SHOW : SW_HIDE);
{
ShowWindow(hwnd, SW_SHOW);
}
else
{
ShowWindow(hwnd, SW_HIDE);
}
if (previousShow != show) if (previousShow != show)
{ {
previousShow = show; previousShow = show;

View File

@ -54,7 +54,7 @@ private:
std::wstring theme = L"system"; std::wstring theme = L"system";
std::wstring ToolbarHide = L"Never"; std::wstring ToolbarHide = L"When both camera and microphone are unmuted";
uint64_t lastTimeCamOrMicMuteStateChanged{}; uint64_t lastTimeCamOrMicMuteStateChanged{};

View File

@ -73,7 +73,7 @@ namespace Microsoft.PowerToys.Settings.UI.Library
public StringProperty Theme { get; set; } public StringProperty Theme { get; set; }
[JsonPropertyName("toolbar_hide")] [JsonPropertyName("toolbar_hide")]
public StringProperty ToolbarHide { get; set; } = "Never"; public StringProperty ToolbarHide { get; set; } = "When both camera and microphone are unmuted";
// converts the current to a json string. // converts the current to a json string.
public string ToJsonString() public string ToJsonString()