[Beremiz-devel] Bug Report: shadow effect on Windows

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[Beremiz-devel] Bug Report: shadow effect on Windows

Thiago Rodrigues Alves
The latest Beremiz code isn’t redrawing dialogs and panels causing a shadow effect when options are changed. This is most particularly visible on the debug panel, when a variable is removed, its last state remains on the panel, and when new variables are added they are added on top of the “shadow” of the removed variable making it really confusing and hard to read.

This doesn’t happen on Linux. I tested the same Beremiz code on a Ubuntu VM and it worked fine. Tested on Python 2.7.16 (latest 2.7 version) on Windows 7 and Windows 10, same bug happens.

PS: the version from the windows installer available on beremiz.org does not have this problem, however the code from that version is quite old.

_______________________________________________
Beremiz-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/beremiz-devel
skv
Reply | Threaded
Open this post in threaded view
|

Re: [Beremiz-devel] Bug Report: shadow effect on Windows

skv
Administrator
Hi Thiago,

On 19-04-13 09:41, Thiago Rodrigues Alves wrote:
> The latest Beremiz code isn’t redrawing dialogs and panels causing a
> shadow effect when options are changed. This is most particularly
> visible on the debug panel, when a variable is removed, its last
> state remains on the panel, and when new variables are added they
> are added on top of the “shadow” of the removed variable making it
> really confusing and hard to read.
Do you use latest version from beremiz/automforge?
Some time ago Edouard told me about similar regresssion on Windows, but AFAIK
that problem is already solved.
I've just checked latest code on Windows XP with wxPython 3.0 and I
don't see behavior your describe.

> This doesn’t happen on Linux. I tested the same Beremiz code on a
> Ubuntu VM and it worked fine. Tested on Python 2.7.16 (latest 2.7
> version) on Windows 7 and Windows 10, same bug happens.


> PS: the version from the windows installer available on beremiz.org
> does not have this problem, however the code from that version is
> quite old.
True, this is very old version. We need create nightly build to make
it easier to test/use latest Beremiz on Windows. This is on my TODO list.

--
Best regards,
Andrey Skvortsov


_______________________________________________
Beremiz-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/beremiz-devel

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [Beremiz-devel] Bug Report: shadow effect on Windows

Thiago Rodrigues Alves
In reply to this post by Thiago Rodrigues Alves
This is the latest code (I got it from automforge on 4/16/19). I didn't test it on Windows XP, but on Windows 7 and Windows 10 (both 32-bit) that behavior is clearly seen on every dialog, and specifically on the debug panel, where things change all the time. I managed to fix it by comparing the old code from beremiz installer and the most recent code from automforge. 

What happens is that when EVT_PAINT is triggered, the new code calls self.Refresh(), while the older code calls self.DrawView(). I believe that self.Refresh() is more efficient than redrawing the whole view every time, and although self.Refresh() works well under Linux (tested on Ubuntu and Debian with different WDMs), this method is not working on Windows. The self.Refresh() only brings new data in, but doesn't clear the previous data. Therefore, for now my fix is just to add a simple:

if os.name == 'nt':
    self.DrawView()
else:
    self.Refresh()

for every EVT_PAINT triggered. More specifically, I added this to DebugVariablePanel and BlockPreviewDialog. This fixes the problem on both platforms. I don't know if there are more EVT_PAINT events in other classes. Also, maybe a better approach would be to fix self.Refresh() so that it works on both platforms. I will take a look at that and see what I can do.


On Thu, Apr 18, 2019 at 7:10 AM <[hidden email]> wrote:
Send Beremiz-devel mailing list submissions to
        [hidden email]

To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.sourceforge.net/lists/listinfo/beremiz-devel
or, via email, send a message with subject or body 'help' to
        [hidden email]

You can reach the person managing the list at
        [hidden email]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beremiz-devel digest..."


Today's Topics:

   1. Re: Bug Report: shadow effect on Windows (Andrey Skvortsov)


----------------------------------------------------------------------

Message: 1
Date: Wed, 17 Apr 2019 20:47:11 +0300
From: Andrey Skvortsov <[hidden email]>
Cc: [hidden email]
Subject: Re: [Beremiz-devel] Bug Report: shadow effect on Windows
Message-ID: <[hidden email]>
Content-Type: text/plain; charset="utf-8"

Hi Thiago,

On 19-04-13 09:41, Thiago Rodrigues Alves wrote:
> The latest Beremiz code isn?t redrawing dialogs and panels causing a
> shadow effect when options are changed. This is most particularly
> visible on the debug panel, when a variable is removed, its last
> state remains on the panel, and when new variables are added they
> are added on top of the ?shadow? of the removed variable making it
> really confusing and hard to read.
Do you use latest version from beremiz/automforge?
Some time ago Edouard told me about similar regresssion on Windows, but AFAIK
that problem is already solved.
I've just checked latest code on Windows XP with wxPython 3.0 and I
don't see behavior your describe.

> This doesn?t happen on Linux. I tested the same Beremiz code on a
> Ubuntu VM and it worked fine. Tested on Python 2.7.16 (latest 2.7
> version) on Windows 7 and Windows 10, same bug happens.


> PS: the version from the windows installer available on beremiz.org
> does not have this problem, however the code from that version is
> quite old.
True, this is very old version. We need create nightly build to make
it easier to test/use latest Beremiz on Windows. This is on my TODO list.

--
Best regards,
Andrey Skvortsov
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available

------------------------------



------------------------------

Subject: Digest Footer

_______________________________________________
Beremiz-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/beremiz-devel


------------------------------

End of Beremiz-devel Digest, Vol 100, Issue 8
*********************************************


_______________________________________________
Beremiz-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/beremiz-devel
skv
Reply | Threaded
Open this post in threaded view
|

Re: [Beremiz-devel] Bug Report: shadow effect on Windows

skv
Administrator
On 19-04-18 09:55, Thiago Rodrigues Alves wrote:
> This is the latest code (I got it from automforge on 4/16/19). I didn't
> test it on Windows XP, but on Windows 7 and Windows 10 (both 32-bit) that
> behavior is clearly seen on every dialog, and specifically on the debug
> panel, where things change all the time.
I'll try to check Windows 10 on weekend.
That's really sad, that the same code that's working on Windows XP
stopped working on Windows 10. :-/


> I managed to fix it by comparing
> the old code from beremiz installer and the most recent code from
> automforge.
BTW do you know bisect? (https://www.selenic.com/mercurial/hg.1.html#hg%20bisect)
you can use it to get commit revision, that caused regression very quickly.
But it's not needed in that case. We already found it.

> What happens is that when EVT_PAINT is triggered, the new code calls
> self.Refresh(), while the older code calls self.DrawView(). I believe that
> self.Refresh() is more efficient than redrawing the whole view every time,
> and although self.Refresh() works well under Linux (tested on Ubuntu and
> Debian with different WDMs), this method is not working on Windows. The
> self.Refresh() only brings new data in, but doesn't clear the previous
> data. Therefore, for now my fix is just to add a simple:
>
> if os.name == 'nt':
>     self.DrawView()
> else:
>     self.Refresh()
I'd like to avoid such platform dependencies.
self.DrawView IIRC is called in EVT_PAINT handler.
The code was rewritten, because it stopped working in GNU/Linux on
Wayland.


> for every EVT_PAINT triggered. More specifically, I added this to
> DebugVariablePanel and BlockPreviewDialog. This fixes the problem on both
> platforms. I don't know if there are more EVT_PAINT events in other
> classes. Also, maybe a better approach would be to fix self.Refresh() so
> that it works on both platforms. I will take a look at that and see what I
> can do.

Thank for trying to help.

>
> On Thu, Apr 18, 2019 at 7:10 AM <[hidden email]>
> wrote:
>
> > Send Beremiz-devel mailing list submissions to
> >         [hidden email]
> >
> > To subscribe or unsubscribe via the World Wide Web, visit
> >         https://lists.sourceforge.net/lists/listinfo/beremiz-devel
> > or, via email, send a message with subject or body 'help' to
> >         [hidden email]
> >
> > You can reach the person managing the list at
> >         [hidden email]
> >
> > When replying, please edit your Subject line so it is more specific
> > than "Re: Contents of Beremiz-devel digest..."
> >
> >
> > Today's Topics:
> >
> >    1. Re: Bug Report: shadow effect on Windows (Andrey Skvortsov)
> >
Could you please change to normal subscription and not digest?
Answering to digest mails breaks discussion threads on mailing list!


> > ----------------------------------------------------------------------
> >
> > Message: 1
> > Date: Wed, 17 Apr 2019 20:47:11 +0300
> > From: Andrey Skvortsov <[hidden email]>
> > Cc: [hidden email]
> > Subject: Re: [Beremiz-devel] Bug Report: shadow effect on Windows
> > Message-ID: <[hidden email]>
> > Content-Type: text/plain; charset="utf-8"
> >
> > Hi Thiago,
> >
> > On 19-04-13 09:41, Thiago Rodrigues Alves wrote:
> > > The latest Beremiz code isn?t redrawing dialogs and panels causing a
> > > shadow effect when options are changed. This is most particularly
> > > visible on the debug panel, when a variable is removed, its last
> > > state remains on the panel, and when new variables are added they
> > > are added on top of the ?shadow? of the removed variable making it
> > > really confusing and hard to read.
> > Do you use latest version from beremiz/automforge?
> > Some time ago Edouard told me about similar regresssion on Windows, but
> > AFAIK
> > that problem is already solved.
> > I've just checked latest code on Windows XP with wxPython 3.0 and I
> > don't see behavior your describe.
> >
> > > This doesn?t happen on Linux. I tested the same Beremiz code on a
> > > Ubuntu VM and it worked fine. Tested on Python 2.7.16 (latest 2.7
> > > version) on Windows 7 and Windows 10, same bug happens.
> >
> >
> > > PS: the version from the windows installer available on beremiz.org
> > > does not have this problem, however the code from that version is
> > > quite old.
> > True, this is very old version. We need create nightly build to make
> > it easier to test/use latest Beremiz on Windows. This is on my TODO list.
> >
> > --
> > Best regards,
> > Andrey Skvortsov
> > -------------- next part --------------
> > A non-text attachment was scrubbed...
> > Name: signature.asc
> > Type: application/pgp-signature
> > Size: 833 bytes
> > Desc: not available
> >
> > ------------------------------
> >
> >
> >
> > ------------------------------
> >
> > Subject: Digest Footer
> >
> > _______________________________________________
> > Beremiz-devel mailing list
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/beremiz-devel
> >
> >
> > ------------------------------
> >
> > End of Beremiz-devel Digest, Vol 100, Issue 8
> > *********************************************
> >

> _______________________________________________
> Beremiz-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/beremiz-devel


--
Best regards,
Andrey Skvortsov


_______________________________________________
Beremiz-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/beremiz-devel

signature.asc (849 bytes) Download Attachment