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

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -