[Kde-games-devel] Extra resize events from KXmlGuiWindow

Ian Wadham ianw2 at optusnet.com.au
Tue Mar 24 05:46:13 CET 2009


On Tue, 24 Mar 2009 1:30:41 pm Parker Coates wrote:
> In the KDEGames camp we've run into a small bit of trouble with
> KXmlGuiWindow generating an extra resize event on startup. An extra
> resize event may seem trivial enough, but because our games now all
> have resizable SVG based interfaces, a single extra resize event can
> mean extra SVG rendering, cache lookups, layout logic and a noticeable
> increase in start up time.
>
There are several threads on this problem in the KDE Games list about
15 months to a year ago.  There can actually be 1, 2 or 3 resize events
from KXmlGuiWindow, depending on the user's previous setup, and it
is apparently not possible to determine which is the "last" one.  The
following thread discusses the workaround I used in KGoldrunner:

http://lists.kde.org/?l=kde-games-devel&m=120071267328984&w=2

It also describes the various behaviors of KXMlGuiWindow with respect
to resize events and AFAIK still represents the state of play in KXmlGW.

><snip>
> So my questions are: Would it be possible to insert the menu bar at
> the same time as the tool and status bars so that the main widget is
> resized only once? If not, do you have any suggestions on how to avoid
> these resize events without relying on timers? I've had a look at the
> xmlgui code, but I'll quickly admit that most of it was over my head
> and I really didn't know what I was looking for.
>
I'm with Parker on this.  I think KXmlGuiWindow should only ever issue
*one* resize event - then the app need only ever need to do one setup
of the graphics in its central widget and one load of SVG.  Some SVG
theme-files are very large and can take a while to load and render.

Cheers, Ian W.


More information about the kde-games-devel mailing list