objective c - NSWindow setFrame very laggy -


my application video window follows application window. i'm capturing screen, find location of other application , moves mine accordingly. have tracking thread capturing , tracking right position , if has been changed dispatches call updating position on main thread:

void tracingthread() {     while(true)     {         captureandtrack();         if(positionchanged)         {             dispatch_async(dispatch_get_main_queue(), ^{ setwindowpos(); });         }     } }  void setwindowpos() {     [window setframe:_newframe display:yes]; } 

everything works fine except fact setframe laggy when dragging other app. guess because amount of events being dispatched. maybe there else. ideas how can improve performance?


Comments

Popular posts from this blog

html - Difficulties with background-image property -

visual studio code - What does the isShellCommand property actually do and how should you use it? -

ios - Segue not passing data between ViewControllers -