<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="12" style="border: 1px #c9c399 solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
<tr>
<td>
This is an automatically generated e-mail. To reply, visit:
<a href="https://git.reviewboard.kde.org/r/120355/">https://git.reviewboard.kde.org/r/120355/</a>
</td>
</tr>
</table>
<br />
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<p style="margin-top: 0;">On September 26th, 2014, 7:40 p.m. CEST, <b>René J.V. Bertin</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">changing this patch to prevent just the call to invalidateBuffer_resizeHelper (and setting isResize=false when that function cannot be called) shows something in place of the menu's title exactly once. All other times the menu is opened, empty space is shown.</p></pre>
</blockquote>
<p>On September 26th, 2014, 7:57 p.m. CEST, <b>Thomas Lübking</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">No idea why you want to manipulate the resize flag, try just:</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm<br style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;" />
index f58a755..d6a2741 100644<br style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;" />
--- a/src/gui/kernel/qwidget_mac.mm<br style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;" />
+++ b/src/gui/kernel/qwidget_mac.mm<br style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;" />
@@ -4619,7 +4619,7 @@ void QWidgetPrivate::setGeometry_sys_helper(int x, int y, int w, int h, bool isM</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;"><div class="codehilite" style="background: #f8f8f8"><pre style="line-height: 125%"> setWSGeometry(<span style="color: #008000">false</span>, oldRect);
</pre></div>
</p>
<ul style="padding: 0;text-rendering: inherit;margin: 0 0 0 1em;line-height: inherit;white-space: normal;">
<li style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">if (isResize && QApplicationPrivate::graphicsSystem())</li>
<li style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">if (isResize && QApplicationPrivate::graphicsSystem() && q->parentWidget())<br style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;" />
invalidateBuffer_resizeHelper(oldp, olds);<br style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;" />
}</li>
</ul></pre>
</blockquote>
<p>On September 26th, 2014, 7:57 p.m. CEST, <b>Thomas Lübking</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">blast.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;"><div class="codehilite" style="background: #f8f8f8"><pre style="line-height: 125%"><span style="color: #000080; font-weight: bold">diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm</span>
<span style="color: #000080; font-weight: bold">index f58a755..d6a2741 100644</span>
<span style="color: #A00000">--- a/src/gui/kernel/qwidget_mac.mm</span>
<span style="color: #00A000">+++ b/src/gui/kernel/qwidget_mac.mm</span>
<span style="color: #800080; font-weight: bold">@@ -4619,7 +4619,7 @@ void QWidgetPrivate::setGeometry_sys_helper(int x, int y, int w, int h, bool isM</span>
setWSGeometry(false, oldRect);
<span style="color: #A00000">- if (isResize && QApplicationPrivate::graphicsSystem())</span>
<span style="color: #00A000">+ if (isResize && QApplicationPrivate::graphicsSystem() && q->parentWidget())</span>
invalidateBuffer_resizeHelper(oldp, olds);
}
</pre></div>
</p></pre>
</blockquote>
<p>On September 26th, 2014, 8:29 p.m. CEST, <b>René J.V. Bertin</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">let's say that I unset isResize so that the rest of the function can finish in a slightly more appropriate fashion. I don't think it'd do to let it behave as if the resize helper did its job when that function hasn't been called.</p></pre>
</blockquote>
<p>On September 26th, 2014, 8:59 p.m. CEST, <b>Thomas Lübking</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">It did the resize in a reasonable fashion - at "worst" i't required to follow the function with isRealWindow, ie. have qt_mac_update_sizer() called, but the resize event very most likely needs to be sent.</p></pre>
</blockquote>
</blockquote>
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Thomas, I thought I'd make a pure Qt example to add to a bug report on qt-projects.org, so I copied over <code style="text-rendering: inherit;color: #4444cc;padding: 0;white-space: normal;margin: 0;line-height: inherit;">KMenu::addTitle</code> and the minimum required stuff from <code style="text-rendering: inherit;color: #4444cc;padding: 0;white-space: normal;margin: 0;line-height: inherit;">KMenuPrivate</code> into a Qt example (systray):</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;"><div class="codehilite" style="background: #f8f8f8"><pre style="line-height: 125%">class KMenuPrivate
<span style="color: #666666">:</span> public QObject
{
<span style="color: #A0A000">public:</span>
KMenuPrivate (QMenu <span style="color: #666666">*</span>_parent)
{
parent <span style="color: #666666">=</span> _parent;
}
<span style="color: #408080; font-style: italic">/**</span>
<span style="color: #408080; font-style: italic"> * @internal</span>
<span style="color: #408080; font-style: italic"> *</span>
<span style="color: #408080; font-style: italic"> * This event filter which is installed</span>
<span style="color: #408080; font-style: italic"> * on the title of the menu, which is a QToolButton. This will</span>
<span style="color: #408080; font-style: italic"> * prevent clicks (what would change down and focus properties on</span>
<span style="color: #408080; font-style: italic"> * the title) on the title of the menu.</span>
<span style="color: #408080; font-style: italic"> *</span>
<span style="color: #408080; font-style: italic"> * @author Rafael Fernández López <ereslibre@kde.org></span>
<span style="color: #408080; font-style: italic"> */</span>
<span style="color: #B00040">bool</span> eventFilter(QObject <span style="color: #666666">*</span>object, QEvent <span style="color: #666666">*</span>event)
{
<span style="color: #008000; font-weight: bold">if</span> (event<span style="color: #666666">-></span>type() <span style="color: #666666">==</span> QEvent<span style="color: #666666">::</span>Paint <span style="color: #666666">||</span>
event<span style="color: #666666">-></span>type() <span style="color: #666666">==</span> QEvent<span style="color: #666666">::</span>KeyPress <span style="color: #666666">||</span>
event<span style="color: #666666">-></span>type() <span style="color: #666666">==</span> QEvent<span style="color: #666666">::</span>KeyRelease) {
qDebug() <span style="color: #666666"><<</span> <span style="color: #BA2121">"Menu"</span> <span style="color: #666666"><<</span> parent <span style="color: #666666"><<</span> parent<span style="color: #666666">-></span>title() <span style="color: #666666"><<</span> <span style="color: #BA2121">"rejecting event"</span> <span style="color: #666666"><<</span> event <span style="color: #666666"><<</span> <span style="color: #BA2121">"for"</span> <span style="color: #666666"><<</span> object <span style="color: #666666"><<</span> object<span style="color: #666666">-></span>objectName();
<span style="color: #008000; font-weight: bold">return</span> <span style="color: #008000">false</span>;
}
event<span style="color: #666666">-></span>accept();
<span style="color: #008000; font-weight: bold">return</span> <span style="color: #008000">true</span>;
}
QMenu <span style="color: #666666">*</span>parent;
};
QAction<span style="color: #666666">*</span> <span style="color: #0000FF">qMenuAddTitle</span>(QMenu <span style="color: #666666">*</span>menu, <span style="color: #008000; font-weight: bold">const</span> QIcon <span style="color: #666666">&</span>icon, <span style="color: #008000; font-weight: bold">const</span> QString <span style="color: #666666">&</span>text, QAction<span style="color: #666666">*</span> before<span style="color: #666666">=</span><span style="color: #008000">NULL</span>)
{
QAction <span style="color: #666666">*</span>buttonAction <span style="color: #666666">=</span> new QAction(menu);
QFont font <span style="color: #666666">=</span> buttonAction<span style="color: #666666">-></span>font();
font.setBold(<span style="color: #008000">true</span>);
buttonAction<span style="color: #666666">-></span>setFont(font);
buttonAction<span style="color: #666666">-></span>setText(text);
buttonAction<span style="color: #666666">-></span>setIcon(icon);
QWidgetAction <span style="color: #666666">*</span>action <span style="color: #666666">=</span> new QWidgetAction(menu);
action<span style="color: #666666">-></span>setObjectName(<span style="color: #BA2121">"KMENU_TITLE"</span>);
QToolButton <span style="color: #666666">*</span>titleButton <span style="color: #666666">=</span> new QToolButton(menu);
titleButton<span style="color: #666666">-></span>installEventFilter(new KMenuPrivate(menu)); <span style="color: #408080; font-style: italic">// prevent clicks on the title of the menu</span>
titleButton<span style="color: #666666">-></span>setDefaultAction(buttonAction);
titleButton<span style="color: #666666">-></span>setDown(<span style="color: #008000">true</span>); <span style="color: #408080; font-style: italic">// prevent hover style changes in some styles</span>
titleButton<span style="color: #666666">-></span>setToolButtonStyle(Qt<span style="color: #666666">::</span>ToolButtonTextBesideIcon);
action<span style="color: #666666">-></span>setDefaultWidget(titleButton);
menu<span style="color: #666666">-></span>insertAction(before, action);
<span style="color: #008000; font-weight: bold">return</span> action;
}
<span style="color: #408080; font-style: italic">//...</span>
<span style="color: #B00040">void</span> Window<span style="color: #666666">::</span>addActions( QMenu <span style="color: #666666">*</span>menu )
{
qMenuAddTitle(menu, QIcon(), <span style="color: #BA2121">"Window actions"</span>);
menu<span style="color: #666666">-></span>addAction(minimizeAction);
menu<span style="color: #666666">-></span>addAction(maximizeAction);
menu<span style="color: #666666">-></span>addAction(restoreAction);
<span style="color: #408080; font-style: italic">// menu->addSeparator();</span>
qMenuAddTitle(menu, QIcon(), <span style="color: #BA2121">"Lethal action"</span>);
menu<span style="color: #666666">-></span>addAction(quitAction);
}
<span style="color: #B00040">void</span> Window<span style="color: #666666">::</span>createTrayIcon()
{
trayIconMenu <span style="color: #666666">=</span> new QMenu(this);
addActions(trayIconMenu);
trayIcon <span style="color: #666666">=</span> new QSystemTrayIcon(this);
trayIcon<span style="color: #666666">-></span>setContextMenu(trayIconMenu);
<span style="color: #008000; font-weight: bold">if</span>( (menuBar <span style="color: #666666">=</span> new QMenuBar(<span style="color: #008000">NULL</span>)) <span style="color: #666666">&&</span> (standardMenu <span style="color: #666666">=</span> menuBar<span style="color: #666666">-></span>addMenu(tr(<span style="color: #BA2121">"a Menu"</span>))) ){
addActions(standardMenu);
}
}
</pre></div>
</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">I then reinstalled an unpatched Qt4. And guess what ... no crash. I presume you have no idea what KDE might do differently that KDE apps crash when invoking <code style="text-rendering: inherit;color: #4444cc;padding: 0;white-space: normal;margin: 0;line-height: inherit;">insertAction</code> in <code style="text-rendering: inherit;color: #4444cc;padding: 0;white-space: normal;margin: 0;line-height: inherit;">addTitle</code>?!</p></pre>
<br />
<p>- René J.V.</p>
<br />
<p>On September 26th, 2014, 7:28 p.m. CEST, René J.V. Bertin wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="12" style="border: 1px #888a85 solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
<tr>
<td>
<div>Review request for KDE Base Apps, KDE Software on Mac OS X, kdelibs, and Qt KDE.</div>
<div>By René J.V. Bertin.</div>
<p style="color: grey;"><i>Updated Sept. 26, 2014, 7:28 p.m.</i></p>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt;">Repository: </b>
kde-baseapps
</div>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Mac OS X cannot handle the formatting used for title menu items when it applies to items in the toplevel menu bar. An application calling KMenu::addTitle on such a menu item will crash immediately, somewhere deep in Qt.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">This patch works around that crash by emulating the addTitle effect.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Curiously, the addTitle call that causes the crash when clicking on the Help menu concerns a submenu of an item of the Tools menu...</p></pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">OS X 10.6.8 with kdelibs 4.14.1</p></pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>konq-plugins/uachanger/uachangerplugin.cpp <span style="color: grey">(5e2d094)</span></li>
</ul>
<p><a href="https://git.reviewboard.kde.org/r/120355/diff/" style="margin-left: 3em;">View Diff</a></p>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">File Attachments </h1>
<li><a href="https://git.reviewboard.kde.org/media/uploaded/files/2014/09/26/b5c2dd92-33db-4225-9750-d10e13f0f835__prevent_addTitleRelated_crash.patch">patch for qwidget_mac.mm</a></li>
<li><a href="https://git.reviewboard.kde.org/media/uploaded/files/2014/09/26/96f4fbfa-854e-4596-9f5f-d82f98a06955__Screen_shot_2014-09-26_at_19.16.20.png">with the Qt patch</a></li>
<li><a href="https://git.reviewboard.kde.org/media/uploaded/files/2014/09/26/5ddf4a63-b3bb-415a-815a-c06eb7a5c7f2__Screen_shot_2014-09-26_at_19.19.40.png">with the addTitle emulation patch</a></li>
</ul>
</td>
</tr>
</table>
</div>
</body>
</html>