mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-08-24 14:22:40 -06:00
Ctrl::Lock fix
git-svn-id: svn://ultimatepp.org/upp/trunk@1194 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
f8c07350de
commit
f31448ff64
3 changed files with 10 additions and 6 deletions
|
|
@ -432,8 +432,12 @@ public:
|
|||
LazyUpdate();
|
||||
};
|
||||
|
||||
inline bool IsMainThread() { return Thread::IsMain(); }
|
||||
|
||||
#else
|
||||
|
||||
inline bool IsMainThread() { return true; }
|
||||
|
||||
#define thread__
|
||||
|
||||
#define PROFILEMT(mutex)
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ NAMESPACE_UPP
|
|||
void LocalLoop::Run()
|
||||
{
|
||||
ASSERT(master);
|
||||
ASSERT(Thread::IsMain());
|
||||
ASSERT(IsMainThread());
|
||||
master->AddChild(this);
|
||||
Ptr<Ctrl> focus = GetFocusCtrl();
|
||||
SetCapture();
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ void Ctrl::DoPaint(const Vector<Rect>& invalid)
|
|||
GC gc = XCreateGC(Xdisplay, (Drawable)top->window, 0, 0);
|
||||
XftDraw *xftdraw = XftDrawCreate(Xdisplay, (Drawable) top->window,
|
||||
DefaultVisual(Xdisplay, Xscreenno), Xcolormap);
|
||||
Draw draw(top->window, gc, xftdraw, invalid);
|
||||
SystemDraw draw(top->window, gc, xftdraw, invalid);
|
||||
UpdateArea(draw, draw.GetClip());
|
||||
XftDrawDestroy(xftdraw);
|
||||
XFreeGC(Xdisplay, gc);
|
||||
|
|
@ -303,7 +303,7 @@ bool Ctrl::ProcessEvents(bool *)
|
|||
void Ctrl::GuiSleep(int ms)
|
||||
{
|
||||
GuiLock __;
|
||||
ASSERT(Thread::IsMain());
|
||||
ASSERT(IsMainThread());
|
||||
fd_set fdset;
|
||||
FD_ZERO(&fdset);
|
||||
FD_SET(Xconnection, &fdset);
|
||||
|
|
@ -327,7 +327,7 @@ void Ctrl::SetTimerGranularity(int ms)
|
|||
void Ctrl::EventLoop(Ctrl *ctrl)
|
||||
{
|
||||
GuiLock __;
|
||||
ASSERT(Thread::IsMain());
|
||||
ASSERT(IsMainThread());
|
||||
ASSERT(LoopLevel == 0 || ctrl);
|
||||
LoopLevel++;
|
||||
LLOG("Entering event loop at level " << LoopLevel << BeginIndent);
|
||||
|
|
@ -381,7 +381,7 @@ void Ctrl::SyncExpose()
|
|||
void Ctrl::Create(Ctrl *owner, bool redirect, bool savebits)
|
||||
{
|
||||
GuiLock __;
|
||||
ASSERT(Thread::IsMain());
|
||||
ASSERT(IsMainThread());
|
||||
LLOG("Create " << Name() << " " << GetRect());
|
||||
ASSERT(!IsChild() && !IsOpen());
|
||||
LLOG("Ungrab1");
|
||||
|
|
@ -442,7 +442,7 @@ void Ctrl::Create(Ctrl *owner, bool redirect, bool savebits)
|
|||
void Ctrl::WndDestroy()
|
||||
{
|
||||
GuiLock __;
|
||||
ASSERT(Thread::IsMain());
|
||||
ASSERT(IsMainThread());
|
||||
LLOG("WndDestroy " << Name());
|
||||
if(!top || !isopen) return;
|
||||
AddGlobalRepaint();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue