moved onError() method to IScreenReceiver from IPrimaryScreenReceiver.

also implemented onError in CClient which previously did not have
any way to handle display disconnection.
This commit is contained in:
crs
2002-07-16 16:52:26 +00:00
parent 0bfe12d6ab
commit 7c391a0f35
26 changed files with 114 additions and 98 deletions

View File

@@ -2,11 +2,10 @@
#include "IScreen.h"
#include "IScreenReceiver.h"
#include "ProtocolTypes.h"
#include "CLock.h"
#include "CThread.h"
#include "CLog.h"
// FIXME -- should be locking
//
// CPrimaryScreen
//
@@ -84,7 +83,10 @@ CPrimaryScreen::open()
}
// enter the screen
enterNoWarp();
{
CLock lock(&m_mutex);
enterNoWarp();
}
// send screen info
m_receiver->onInfoChanged(info);
@@ -104,6 +106,7 @@ void
CPrimaryScreen::enter(SInt32 x, SInt32 y, bool forScreensaver)
{
log((CLOG_INFO "entering primary at %d,%d%s", x, y, forScreensaver ? " for screen saver" : ""));
CLock lock(&m_mutex);
assert(m_active == true);
enterNoWarp();
@@ -118,6 +121,8 @@ CPrimaryScreen::enter(SInt32 x, SInt32 y, bool forScreensaver)
void
CPrimaryScreen::enterNoWarp()
{
// note -- must be locked on entry
// not active anymore
m_active = false;
@@ -135,6 +140,7 @@ bool
CPrimaryScreen::leave()
{
log((CLOG_INFO "leaving primary"));
CLock lock(&m_mutex);
assert(m_active == false);
// subclass hook
@@ -187,6 +193,7 @@ CPrimaryScreen::grabClipboard(ClipboardID id)
bool
CPrimaryScreen::isActive() const
{
CLock lock(&m_mutex);
return m_active;
}