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
Post a Comment