User forums > Help
Slow editing in Ubuntu Feisty
dmoore:
this *could* be a wxscintilla related problem. each time wxscintilla needs to redraw it fires a wxWakeUpIdle, which by default sends message to all application windows (C::B has lots of windows).
If this is the problem, the fix seems relatively easy. In the wxWidgets Manual (http://www.wxwidgets.org/manuals/stable/wx_wxidleevent.html#wxidleeventsetmode) :
By default, idle events are sent to all windows (and also wxApp, as usual). If this is causing a significant overhead in your application, you can call wxIdleEvent::SetMode with the value wxIDLE_PROCESS_SPECIFIED, and set the wxWS_EX_PROCESS_IDLE extra window style for every window which should receive idle events.
someone just needs to go through the handful of instances in the code where Idle events are processed and set the window style and then put a call to the static function SetMode somewhere in the startup code...
thomas:
From looking at it for 3 minutes, adding wxIdleEvent::SetMode(wxIDLE_PROCESS_SPECIFIED); to the application under Windows seems to have no visible side effect. Everything seems as before.
It thus seems that whatever uses idle events already requests them properly and we might just try and add that line without any other modifications, and see if it fixes anything for Linux.
dmoore:
Thomas: unfortunately I don't think the windows do set the extended style properly (not even wxscintilla). the only side effect may be slow updates because OnIdle handlers don't get called often enough. Just in case, I've put up a patch to add the window style in as many places as I could find including wxPropGrid and wxScintilla (I haven't touched the contrib plugins). I had to comment many of the SetExtraStyle calls out because many of the classes in question were derived from wxEvtHandler and not wxWindow - I've left the commented lines in the patch - not sure if wxWidgets will send the onIdle message to non-wxWinodw EvtHandlers...
patch: http://developer.berlios.de/patch/index.php?func=detailpatch&patch_id=2048&group_id=5358
In any case, spawning idle events with wxWakeUpIdle seems like a very unstable way to call data/gui refresh methods because wxWakeUpIdle appears to tell everything in the app that it is now an idle time not just the parent/child event handlers of the caller. Maybe we need to file a bug with wxScintilla maintainers?
it didn't appear to break anything on windows (didn't test any contrib plugins, but did try debug and build). As I don't have access to a linux machine right now can someone on linux test to see if there's any improvement? In the past I have noticed lagginess while scrolling through text on my Ubuntu Feisty machine.
dmoore:
hi again. i deleted a couple of my posts on this thread because I had deluded myself that this patch was the answer :). (I've updated the patch a few times as well). I doubt that my patch will solve the problem on Linux - other gui elements such as wxAUI may be partially to blame.
Navigation
[0] Message Index
[*] Previous page
Go to full version