Closed GoogleCodeExporter closed 9 years ago
Hi, check EWMHRoot.cpp line 190:
void EWMHRoot::sendDesktopNames(const QString& name) const {
// TODO Don't works fine!!
const char* charName = name.toUtf8().constData() + '\0';
XChangeProperty(QX11Info::display(),
QX11Info::appRootWindow(QX11Info::appScreen()),
al->getAtom("_NET_DESKTOP_NAMES"),
al->getAtom("UTF8_STRING"),
8, PropModeReplace,
(const unsigned char*)&charName,
name.length()+1);
}
I need to sent a real UTF8_STRING, but I can't... some idea/code?
Original comment by jose.exposito89@gmail.com
on 27 Jan 2011 at 11:29
in qt4 qwidget's implementation they use:
QByteArray net_wm_name = caption.toUtf8();
XChangeProperty(X11->display, q->internalWinId(), ATOM(_NET_WM_NAME),
ATOM(UTF8_STRING), 8,
PropModeReplace, (unsigned char *)net_wm_name.data(), net_wm_name.size());
Original comment by yarpe...@gmail.com
on 27 Jan 2011 at 11:39
What object is "caption" in your code?
Original comment by jose.exposito89@gmail.com
on 27 Jan 2011 at 11:49
it's a snippet only. It looks like they just use QByteArray instead of const
char*. It should be the same, but this one works. Maybe there is something with
constData() in your code. Dunno.
void QWidgetPrivate::setWindowTitle_sys(const QString &caption)
{
Q_Q(QWidget);
Q_ASSERT(q->testAttribute(Qt::WA_WState_Created));
if (!q->internalWinId())
return;
XSetWMName(X11->display, q->internalWinId(), qstring_to_xtp(caption));
QByteArray net_wm_name = caption.toUtf8();
XChangeProperty(X11->display, q->internalWinId(), ATOM(_NET_WM_NAME), ATOM(UTF8_STRING), 8,
PropModeReplace, (unsigned char *)net_wm_name.data(), net_wm_name.size());
}
Original comment by yarpe...@gmail.com
on 27 Jan 2011 at 12:29
Ok solved:
void EWMHRoot::sendDesktopNames(const QString& name) const {
QWidget w;
w.setWindowTitle(name);
QByteArray desktopName = w.windowTitle().toUtf8();
XChangeProperty(QX11Info::display(),
QX11Info::appRootWindow(QX11Info::appScreen()),
al->getAtom("_NET_DESKTOP_NAMES"),
al->getAtom("UTF8_STRING"),
8, PropModeReplace,
(const unsigned char*)desktopName.data(),
desktopName.size());
}
Is a really nasty hack.. but works...
For next version will be avalible ;)
Thanks!!!!
Original comment by jose.exposito89@gmail.com
on 27 Jan 2011 at 12:39
where I can test it, please? Trunk's last change is from Jan 16, 2011.
Original comment by yarpe...@gmail.com
on 27 Jan 2011 at 12:57
Updated ;)
Original comment by jose.exposito89@gmail.com
on 27 Jan 2011 at 1:11
Original issue reported on code.google.com by
yarpe...@gmail.com
on 27 Jan 2011 at 7:29