Issue 83195 - sfx2: Remove timer use from sfx2 used for volatile slot state polling
Summary: sfx2: Remove timer use from sfx2 used for volatile slot state polling
Status: CLOSED FIXED
Alias: None
Product: General
Classification: Code
Component: code (show other issues)
Version: 680m235
Hardware: All All
: P3 Trivial (vote)
Target Milestone: OOo 3.2
Assignee: Mathias_Bauer
QA Contact: issues@framework
URL:
Keywords:
Depends on: 102119
Blocks: 106485
  Show dependency tree
 
Reported: 2007-11-01 11:35 UTC by caolanm
Modified: 2009-10-30 14:27 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description caolanm 2007-11-01 11:35:17 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.
Comment 1 Mathias_Bauer 2007-11-01 11:36:29 UTC
accepted
Comment 2 Mathias_Bauer 2008-06-05 16:12:41 UTC
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.
Comment 3 Mathias_Bauer 2009-02-02 12:22:59 UTC
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.
Comment 4 caolanm 2009-02-17 09:39:31 UTC
I say have it just do nothing, not having libXfixes is extraordinary rare
really. Extending battery life is a more contemporary concern.
Comment 5 Mathias_Bauer 2009-05-20 14:14:23 UTC
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).
Comment 6 Mathias_Bauer 2009-05-20 16:55:25 UTC
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
Comment 7 Mathias_Bauer 2009-05-20 17:34:52 UTC
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. :-)
Comment 8 Mathias_Bauer 2009-05-20 23:35:53 UTC
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
Comment 9 Mathias_Bauer 2009-05-21 13:03:39 UTC
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.
Comment 10 Mathias_Bauer 2009-05-21 15:59:33 UTC
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
Comment 11 Mathias_Bauer 2009-05-21 22:32:57 UTC
More slots: SID_FM_FILTER_NAVIGATOR_CONTROL, SID_OUTLINE_BULLET, SID_SELECT
Changed and tested.
Comment 12 Mathias_Bauer 2009-05-21 23:25:09 UTC
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.
Comment 13 Mathias_Bauer 2009-06-09 19:45:18 UTC
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.
Comment 14 Mathias_Bauer 2009-06-12 10:46:55 UTC
I also disabled the "volatile" support in svidl to make sure that no new
volatile slots are added.
Comment 15 Mathias_Bauer 2009-07-29 10:36:39 UTC
Caolan, do you want to test yourself or is the fact that svidl.exe does not
support "volatile" anymore proof enough?
Comment 16 caolanm 2009-07-29 10:45:01 UTC
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.
Comment 17 Mathias_Bauer 2009-08-31 15:58:31 UTC
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.
Comment 18 caolanm 2009-10-30 13:00:30 UTC
closed, integrated m60 and no timers are triggered when idle with the bare empty
frame