summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qwidget_x11.cpp
diff options
context:
space:
mode:
authorBjørn Erik Nilsen <bjorn.nilsen@nokia.com>2009-05-12 14:54:18 (GMT)
committerBjørn Erik Nilsen <bjorn.nilsen@nokia.com>2009-05-12 19:41:47 (GMT)
commit4ffda2918b3f5c789ef325cdeaac72e5e7ef2c0c (patch)
tree031d21d9b85c643c486bcd3aa8dae74731dcc5b2 /src/gui/kernel/qwidget_x11.cpp
parent6c154a5fc2b6e3fe3ccf9dbee709b01c08c27f6c (diff)
downloadQt-4ffda2918b3f5c789ef325cdeaac72e5e7ef2c0c.zip
Qt-4ffda2918b3f5c789ef325cdeaac72e5e7ef2c0c.tar.gz
Qt-4ffda2918b3f5c789ef325cdeaac72e5e7ef2c0c.tar.bz2
Reduce QWidget footprint and do some cleanup.
This patch cleans up several things, like bit fields that are interleaved with with other variables, resulting in bits not being packed properly. Example: "uint a : 8; int c; uint b: 8;" -> "uint a : 8; uint b : 8; int c;" In that case we'll use 12 bytes instead of 8 bytes. I've also changed the order we declare certain variables to avoid unnecessary gaps/padding on 64-bit architectures. Example: "char *a; int c; char *b;" -> "char *a; char *b; int c;" Pointers are 64-bit aligned, so padding appears between 'c' and 'b', resulting in a total use of 24 bytes instead of 20 bytes. ...and since I anyways was moving the code around, I took the opportunity to add some overall structure by first declaring cross-platform functions/variables followed by platform specific functions/variables. ...and it was kinda scary to actually be able to see all the QStrings, pointers and whatnot we put into QWidgetPrivate. I'm sure we can remove lots of stuff, but I'll do that in a separate commit. Quick numbers (X11/64 bit): sizeof(QWidgetPrivate) == before: 472, after: 456 sizeof(QTLWExtra) == before: 112, after: 104 sizeof(QWExtra) == before: 152, after: 144 Acked-by: Olivier
Diffstat (limited to 'src/gui/kernel/qwidget_x11.cpp')
-rw-r--r--src/gui/kernel/qwidget_x11.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gui/kernel/qwidget_x11.cpp b/src/gui/kernel/qwidget_x11.cpp
index 6202b35..906500e 100644
--- a/src/gui/kernel/qwidget_x11.cpp
+++ b/src/gui/kernel/qwidget_x11.cpp
@@ -2152,7 +2152,7 @@ static void do_size_hints(QWidget* widget, QWExtra *x)
parentWRect is the geometry of the parent's X rect, measured in
parent's coord sys
*/
-void QWidgetPrivate::setWSGeometry(bool dontShow)
+void QWidgetPrivate::setWSGeometry(bool dontShow, const QRect &)
{
Q_Q(QWidget);
Q_ASSERT(q->testAttribute(Qt::WA_WState_Created));
@@ -2610,8 +2610,8 @@ int QWidget::metric(PaintDeviceMetric m) const
void QWidgetPrivate::createSysExtra()
{
- extra->xDndProxy = 0;
extra->compress_events = true;
+ extra->xDndProxy = 0;
}
void QWidgetPrivate::deleteSysExtra()
@@ -2620,8 +2620,11 @@ void QWidgetPrivate::deleteSysExtra()
void QWidgetPrivate::createTLSysExtra()
{
+ extra->topextra->spont_unmapped = 0;
+ extra->topextra->dnd = 0;
extra->topextra->validWMState = 0;
extra->topextra->waitingForMapNotify = 0;
+ extra->topextra->parentWinId = 0;
extra->topextra->userTimeWindow = 0;
}