mirror of
https://github.com/debauchee/barrier.git
synced 2025-08-06 10:09:28 +02:00
added feature to control uac elevation on desk switch (login screen, lock, etc)
This commit is contained in:
parent
268f3a99bb
commit
86bb49aeae
13 changed files with 64 additions and 21 deletions
|
@ -92,7 +92,7 @@
|
|||
CMSWindowsDesks::CMSWindowsDesks(
|
||||
bool isPrimary, bool noHooks, HINSTANCE hookLibrary,
|
||||
const IScreenSaver* screensaver, IEventQueue& eventQueue,
|
||||
IJob* updateKeys) :
|
||||
IJob* updateKeys, bool stopOnDeskSwitch) :
|
||||
m_isPrimary(isPrimary),
|
||||
m_noHooks(noHooks),
|
||||
m_is95Family(CArchMiscWindows::isWindows95Family()),
|
||||
|
@ -110,7 +110,8 @@ CMSWindowsDesks::CMSWindowsDesks(
|
|||
m_mutex(),
|
||||
m_deskReady(&m_mutex, false),
|
||||
m_updateKeys(updateKeys),
|
||||
m_eventQueue(eventQueue)
|
||||
m_eventQueue(eventQueue),
|
||||
m_stopOnDeskSwitch(stopOnDeskSwitch)
|
||||
{
|
||||
if (hookLibrary != NULL)
|
||||
queryHookLibrary(hookLibrary);
|
||||
|
@ -906,6 +907,14 @@ CMSWindowsDesks::checkDesk()
|
|||
desk = index->second;
|
||||
}
|
||||
|
||||
// if we are told to shut down on desk switch, and this is not the
|
||||
// first switch, then shut down.
|
||||
if (m_stopOnDeskSwitch && m_activeDesk != NULL && name != m_activeDeskName) {
|
||||
LOG((CLOG_DEBUG "shutting down because of desk switch to \"%s\"", name.c_str()));
|
||||
EVENTQUEUE->addEvent(CEvent(CEvent::kQuit));
|
||||
return;
|
||||
}
|
||||
|
||||
// if active desktop changed then tell the old and new desk threads
|
||||
// about the change. don't switch desktops when the screensaver is
|
||||
// active becaue we'd most likely switch to the screensaver desktop
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue