+bool wxClientDC::CocoaLockFocus()
+{
+ wxLogDebug("Locking focus on wxClientDC=%p, NSView=%p",this, m_window->GetNSView());
+ if([m_window->GetNSView() lockFocusIfCanDraw])
+ {
+ sm_cocoaDCStack.Insert(this);
+ m_cocoaFlipped = [m_window->GetNSView() isFlipped];
+ m_cocoaHeight = [m_window->GetNSView() bounds].size.height;
+ CocoaApplyTransformations();
+ return true;
+ }
+ wxLogDebug("focus lock failed!");
+ return false;
+}
+
+bool wxClientDC::CocoaUnlockFocus()
+{
+ wxLogDebug("Unlocking focus on wxClientDC=%p, NSView=%p",this, m_window->GetNSView());
+ [[m_window->GetNSView() window] flushWindow];
+ [m_window->GetNSView() unlockFocus];
+ return true;
+}
+