[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyQt] Drawing on desktop (root window) under X11
From:       Maurizio Berti <maurizio.berti () gmail ! com>
Date:       2019-07-24 2:45:52
Message-ID: CAPn+-XTSCd=UJv=0ey_ecYiqt9EF4cXexNcR1EKEf_m6c4HOFA () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Il giorno mar 23 lug 2019 alle ore 12:00 David Boddie <david@boddie.org.uk>
ha scritto:

> The documentation about drawing on the desktop is very old - from Qt 3, if
> not earlier. I remember trying to draw on the desktop with Qt 4 (and maybe
> even Qt 3) using similar techniques but didn't manage to make it work.
> I would be very surprised if any modern desktop would allow this to be
> done.
>

I thought the same thing, but I decided to give it a try anyway.

Plus, the painting model changed in Qt 4 to disallow (or deprecate) painting
> on widgets from outside of paint event handlers, so some of the tricks used
> in the old Qt 3 example won't work now.
>

Indeed. Also, QDesktopWidget is obsolete for Qt5.
I tried to send a QPaintEvent to QApplication, but got this:

StdErr: QWidget::paintEngine: Should no longer be called
QPainter::begin: Paint device returned engine == 0, type: 1


The same happens if I try to send that event to a new QWidget with
Qt.Desktop
set as windowFlag (which doesn't call the paintEvent itself anyway).
Creating a new QWidget with the QDesktopWidget as a parent doesn't work
either.

I seem to remember that it was (is?) possible to do it using Gtk along with
Cairo,
but that was more than 5 years ago.

Does anyone know if it's possible to draw on the root window on X11 via Qt
or,
at least, Python?

Thanks,
Maurizio

-- 
È difficile avere una convinzione precisa quando si parla delle ragioni del
cuore. - "Sostiene Pereira", Antonio Tabucchi
http://www.jidesk.net

[Attachment #5 (text/html)]

<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Il giorno mar 23 lug 2019 \
alle ore 12:00 David Boddie &lt;<a \
href="mailto:david@boddie.org.uk">david@boddie.org.uk</a>&gt; ha \
scritto:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" \
style="margin:0px 0px 0px 0.8ex;border-left:1px solid \
rgb(204,204,204);padding-left:1ex">The documentation about drawing on the desktop is \
very old - from Qt 3, if<br> not earlier. I remember trying to draw on the desktop \
with Qt 4 (and maybe<br> even Qt 3) using similar techniques but didn&#39;t manage to \
make it work.<br> I would be very surprised if any modern desktop would allow this to \
be done.<br></blockquote><div><br></div><div>I thought the same thing, but I decided \
to give it a try anyway.</div><div><br></div><blockquote class="gmail_quote" \
style="margin:0px 0px 0px 0.8ex;border-left:1px solid \
rgb(204,204,204);padding-left:1ex">Plus, the painting model changed in Qt 4 to \
disallow (or deprecate) painting<br> on widgets from outside of paint event handlers, \
so some of the tricks used<br> in the old Qt 3 example won&#39;t work \
now.<br></blockquote><div><br></div><div></div></div><div>Indeed. Also, \
QDesktopWidget is obsolete for Qt5.</div><div>I tried to send a QPaintEvent to \
QApplication, but got this:</div></div><blockquote style="margin:0px 0px 0px \
40px;border:none;padding:0px"><div><div><div><font face="courier new, \
monospace">StdErr: QWidget::paintEngine: Should no longer be \
called</font></div></div></div><div><div><div><font face="courier new, \
monospace">QPainter::begin: Paint device returned engine == 0, type: \
1</font></div></div></div></blockquote><div dir="ltr"><div><br></div><div>The same \
happens if I try to send that event to a new QWidget with Qt.Desktop  </div><div>set \
as windowFlag (which doesn&#39;t call the paintEvent itself anyway).<br>Creating a \
new QWidget with the QDesktopWidget as a parent doesn&#39;t work \
either.</div><div><br></div><div>I seem to remember that it was (is?) possible to do \
it using Gtk along with Cairo,  </div><div>but that was more than 5 years \
ago.</div><div><br></div><div>Does anyone know if it&#39;s possible to draw on the \
root window on X11 via Qt or,</div><div>at least, \
Python?</div><div><br></div><div>Thanks,</div><div>Maurizio</div><div><br></div>-- \
<br><div dir="ltr" class="gmail_signature">È difficile avere una convinzione precisa \
quando si parla delle ragioni del cuore. - &quot;Sostiene Pereira&quot;, Antonio \
Tabucchi<br><a href="http://www.jidesk.net" \
target="_blank">http://www.jidesk.net</a></div></div></div></div>


[Attachment #6 (text/plain)]

_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
https://www.riverbankcomputing.com/mailman/listinfo/pyqt


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic