Apache OpenOffice (AOO) Bugzilla – Issue 83195
sfx2: Remove timer use from sfx2 used for volatile slot state polling
Last modified: 2009-10-30 14:27:44 UTC
The goal is to remove the never-ceasing timer in sfx2/source/control/bindings.cxx so that we can reduce our wake-ups when we're nominally idle and so save battery life on laptops. So the volatile slots which require constant checking need to be reworking somehow to be triggered when their state initially changes and not polled looking for a state change.
accepted
As it turned out we already get problems with the clipboard slots. Currently at least on X11 systems there is no reliable notification about changes in the clipboard content. So we either have to keep the "volatile" state of the "Paste" slot or we have to always enable it (and deal with empty clipboard or not suitable content). This would be a UI change and also needs some more thoughts. So 3.1.
I would be interested to hear more opinions on how to proceed. Shall we accept that on all computers that don't support clipboard notifications (e.g. Linux systems without necessary X11 extensions installed) the "Paste" button is always enabled but does not do anything when pressed (except perhaps a "clipboard is empty" message)? As this is a user experience problem I will pass this to the dev@ux mailing list.
I say have it just do nothing, not having libXfixes is extraordinary rare really. Extending battery life is a more contemporary concern.
I started with removing the volatile attribute (and making sure that notifications are sent in all relevant cases where the status of them could change) for SID_EDITDOC, SID_RELOAD, SID_MOFIDIED, SID_SAVEDOC. I removed the volatile slots SID_CURRENTDATE and SID_CURRENTTIME (not uses since a long time).
Some more slots made cachable, now in Writer: SID_BROWSER_MODE, FN_PRINT_LAYOUT, SID_SOURCEVIEW, FN_CHANGE_DBFIELD, FN_EXECUTE_MACROFIELD, FN_EDIT_FIELD, FN_INSERT_MULTI_TOX
Next step: make SID_CUT and SID_COPY cachable in several shells; just for SourceView some new notifications were necessary. I added them in MouseButtonUp and KeyInput Handler. This is still much cheaper than doing it every 200 ms. :-)
Now the following slots also have been made cachable: FN_STAT_SELMODE, FN_ADJUST_TABLE_CELL, FN_STAT_PAGE, FN_VIEW_BOUNDS This leaves for Writer the undo/redo and clipboard slots
I have created two sub tasks for the slots in Draw/Impress (as the code is too fuzzy for my small little brain ;-)) and the "Paste" functionality as it needs some work done in the system layer before.
Calc still had some superfluous slots defined that weren't used anymore: SID_GET_CLPBRD_FORMAT_BY_IX SID_GET_CLPBRD_FORMAT_COUNT SID_GET_CLPBRD_FORMAT_NAME I removed them in hrc, sdi and cxx
More slots: SID_FM_FILTER_NAVIGATOR_CONTROL, SID_OUTLINE_BULLET, SID_SELECT Changed and tested.
Math also has some volatile slots. By adding notifications for modification, cursor movements or mousebuttonup events the slots can be invalidated easily. That should still be cheaper than all the volatile slots.
I've fixed the slots in sd also: SID_DELETE_PAGE SID_DELETE_MASTER_PAGE SID_DELETE_LAYER The code handling SID_DELETE_MASTER_PAGE is quite buggy there, but at least I didn't make it worse. ;-) Now only the clipboard slots (issue 102119) are missing.
I also disabled the "volatile" support in svidl to make sure that no new volatile slots are added.
Caolan, do you want to test yourself or is the fact that svidl.exe does not support "volatile" anymore proof enough?
That's good enough for me for now. The individual apps themselves generally then add a pile of ceaseless timers as well so once this is in master I hope to start at the simplest of them (e.g. math constantly relayouting, impress constantly spellchecking) and work my way up the tree trying to resolve them.
The mere fact that "volatile" is no longer supported by the svidl compiler and the build does not break should be verification enough that the removal was successful.
closed, integrated m60 and no timers are triggered when idle with the bare empty frame