<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
<tr>
<td>
This is an automatically generated e-mail. To reply, visit:
<a href="https://git.reviewboard.kde.org/r/118016/">https://git.reviewboard.kde.org/r/118016/</a>
</td>
</tr>
</table>
<br />
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<p style="margin-top: 0;">On May 6th, 2014, 1:30 p.m. UTC, <b>Kevin Ottens</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;">AFAICT it is BIC but no SIC, no brainer.</pre>
</blockquote>
<p>On May 6th, 2014, 1:36 p.m. UTC, <b>Martin Gräßlin</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;">it's a SIC change as one could have used the variant specifying just NET::Properties and screen. This would now have to be changed to use NET::Properties2 before screen argument.</pre>
</blockquote>
<p>On May 6th, 2014, 1:37 p.m. UTC, <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;">It's SIC.
"NETRootInfo(connection, properties, 1);" would now cause an error, but since it's been buggy anyway (enums are indeed not polymorphic, but for int,... though gcc could have known better) that should hardly matter.
@Marco
got that with gcc or clang? And which version and what specific call?
The constructor is (theoretically) correctly resolvable and if it's an ambiguous call, i'd expect a compiler error as well...</pre>
</blockquote>
<p>On May 6th, 2014, 1:44 p.m. UTC, <b>Kevin Ottens</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;">Ah I see. Hm, is it very much used outside of the workspace?</pre>
</blockquote>
<p>On May 6th, 2014, 1:54 p.m. UTC, <b>Martin Gräßlin</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;">> is it very much used outside of the workspace?
probably not and ftr the ctors are SIC anyway compared to 4.x as it's now based on xcb</pre>
</blockquote>
<p>On May 6th, 2014, 1:56 p.m. UTC, <b>Kevin Ottens</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;">I stand by my "ship it!" then.</pre>
</blockquote>
<p>On May 6th, 2014, 2:08 p.m. UTC, <b>Marco Martin</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;">@Thomas: gcc 4.7.2 on opensuse
the error happens for instance in the virtual desktop KCM
NETRootInfo info(QX11Info::connection(), NET::NumberOfDesktops | NET::DesktopNames, NET::WM2DesktopLayout);
NET::WM2DesktopLayout gets passed as screen</pre>
</blockquote>
<p>On May 6th, 2014, 2:19 p.m. UTC, <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;">Ahh...
"You're holding it wrongly"™ ;-)
typeof(NET::NumberOfDesktops | NET::DesktopNames) == typeof(int)
NET::Property has no Q_DECLARE_OPERATORS_FOR_FLAGS (at least i don't see them) and thus "|" is the integer operator and the result is - integer.
calling
NETRootInfo info(QX11Info::connection(), static_cast<NET::Property>(NET::NumberOfDesktops | NET::DesktopNames), NET::WM2DesktopLayout);
should get you the correct result (but scratching the duplicated code is oc. fine anyway =)</pre>
</blockquote>
<p>On May 6th, 2014, 2:34 p.m. UTC, <b>Marco Martin</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;">yes, it does have Q_DECLARE_OPERATORS_FOR_FLAGS in the end of netwm_def.h
both Properties and Properties2
anyways, the problem is the last parameter, NET::WM2DesktopLayout that even if not or-ed, it gets casted as int anyways</pre>
</blockquote>
<p>On May 6th, 2014, 3 p.m. UTC, <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;">It's actually seems a bug in Q_DECLARE_FLAGS / QFlags, for this does *not* happen w/
-------------------
#include <stdio.h>
enum Foo { Foo1, Foo2 };
enum Bar { Bar1, Bar2 };
void fooBar(Foo foo, Bar bar, int i = 5)
{
printf("foo bar int\n");
}
void fooBar(Foo foo, int i = 5)
{
printf("foo int\n");
}
int main(int, char **)
{
fooBar(Foo1, Bar1);
fooBar(Foo1, Bar1|Bar2);
}
---------------------------
which prints (as can be expected)
foo bar int
foo int
but it *does* happen w/
-------------------------
#include <stdio.h>
#include <QFlags>
enum Foo { Foo1, Foo2 };
enum Bar { Bar1, Bar2 };
Q_DECLARE_FLAGS(Foos, Foo)
Q_DECLARE_OPERATORS_FOR_FLAGS(Foos)
Q_DECLARE_FLAGS(Bars, Bar)
Q_DECLARE_OPERATORS_FOR_FLAGS(Bars)
void fooBar(Foos foo, Bars bar, int i = 5)
{
printf("foo bar int\n");
}
void fooBar(Foos foo, int i = 5)
{
printf("foo int\n");
}
int main(int, char **)
{
fooBar(Foo1, Bar1);
fooBar(Foo1, Bar1|Bar2);
}
--------------------
which prints
foo int
foo bar int
IOW, QFlags maintains type safety for operated enums/flags, but *not* for singleton ones.</pre>
</blockquote>
<p>On May 6th, 2014, 7:19 p.m. UTC, <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;">https://bugreports.qt-project.org/browse/QTBUG-38810</pre>
</blockquote>
<p>On May 6th, 2014, 8:10 p.m. UTC, <b>Marco Martin</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;">So it seems is a known problem and there is nothing that can be done.
for now is pushed, if there are problems with it, can be changed/reverted for an handful of days still</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;">- i'm fine w/ the patch anyway (Qt fix or not, it was broken, so SIC doesn't matter - plus it removes a bunch of LOC)
- "nothing can be done" does not exist in my language ;-)
- could frameworks already use c++11 strongly typed enums?</pre>
<br />
<p>- Thomas</p>
<br />
<p>On May 6th, 2014, 8:08 p.m. UTC, Marco Martin wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('https://git.reviewboard.kde.org/static/rb/images/review_request_box_top_bg.ab6f3b1072c9.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
<tr>
<td>
<div>Review request for KDE Frameworks and kwin.</div>
<div>By Marco Martin.</div>
<p style="color: grey;"><i>Updated May 6, 2014, 8:08 p.m.</i></p>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt;">Repository: </b>
kwindowsystem
</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;">when the constructor
NETRootInfo(xcb_connection_t *connection, NET::Properties properties, NET::Properties2 properties2,
int screen = -1, bool doActivate = true);
gets called, NET::Properties2 gets casted as int and the other constructor
NETRootInfo(xcb_connection_t *connection, NET::Properties properties, int screen = -1, bool doActivate = true)
is called instead.
This patch merges the two constructors, fixing all the users of the first one</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;">screen and doActivate parameter weren't used by any, so all the currently ported software still builds and works correctly</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>autotests/netrootinfotestwm.cpp <span style="color: grey">(da7dcea)</span></li>
<li>src/netwm.h <span style="color: grey">(7cbf2ab)</span></li>
<li>src/netwm.cpp <span style="color: grey">(a0e9105)</span></li>
</ul>
<p><a href="https://git.reviewboard.kde.org/r/118016/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>