Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2010-11

strange bug in source editor, disappearing scroll bar

3 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Bernd Kreuss

please compare these two screen shots:

http://imagebin.org/121695
http://imagebin.org/121699

Pay attention to the scrollbar and the sunken border around the edit area. All I did was pressing enter on this line. If I remove the line break again it will reappear, as often as I want. It does not happen when I move it to a new edit window. It will happen again if I restart lazarus. It happens only on windows.

I suddenly found this strange behavior *only* on this particular file today after I made some changes (in a different place!). The scrollbar re-appeared after switching line numbers off and on again but only until I tried to scroll, it flickered half a second and the disappeared again.

It was *pure* coincidence that I found this one line that seems to trigger it because it was initially broken after the Result:= and I wanted to break it after the then. Then I noticed that it would trigger this strange bug (or make it go away if it is on one line).

Tomorrow I will do some more experiments, maybe I can make it reliably reproducible so I have some more substance for a bug report. If needed I can share the original file that triggers the bug, the project is open source.

Bernd.

Reply by email

Martin
to Bernd Kreuss
Bernd Kreuss wrote 11 lines
please compare these two screen shots: http://imagebin.org/121695 http://imagebin.org/121699 Pay attention to the scrollbar and the sunken border around the edit area. All I did was pressing enter on this line. If I remove the line break again it will reappear, as often as I want. It does not happen when I move it to a new edit window. It will happen again if I restart lazarus. It happens only on windows.

There seem to issues.

* If scrollbars a present, then synedit for some reason alos draws a border around the client area( just 1 or pixel).

* But the bigger issue is the missing repaint of the area where the scrollbar should be.
This seems a new issue.
I noticed it a similar thing myself on single time, and couldn't reproduce it yet.

In my case I had a small area at the bottom of the synedit, that was not repainted. (the area where a hoirzental scrollbar could have been). \in my case it was not expected to be there. (but may have been there before). In my case the error disapeared, by resizing the window. My suspicion in my case is that the client area was not updated by the lcl, and synedit could not know it had to draw there.

if it is a missing update of the client area, then it is lcl, and may affect other components too.?

I cant do anything at present as I am away over the week.

I recommend to put some debugln code into :
1) \SynEdit.UpdateScrollbars .
at least to output some log msg when synedit actually sets the visibilty of the scrollbar => so we know if synedit did hide them, or the lcl

2) also put debugln into the resize mesage handler, in synedit. so you know if a resize msg was received. including the size of the clientrect

Martin

Reply by email

Bernd Kreuss
to Martin
Martin wrote 9 lines
I cant do anything at present as I am away over the week. I recommend to put some debugln code into : 1) \SynEdit.UpdateScrollbars . at least to output some log msg when synedit actually sets the visibilty of the scrollbar => so we know if synedit did hide them, or the lcl 2) also put debugln into the resize mesage handler, in synedit. so you know if a resize msg was received. including the size of the clientrect

After recompiling Lazarus it does not happen anymore. It happened with two different win32 snapshots (with 2.5.1 compiler) that I downloaded but after re-building Lazarus it is gone, I tried a few different compiler options with and without optimizations but I could not reproduce it anymore.

It didn't look like a simple repaint problem, It looked more like it was re-calculating the height of the scroll area, for half a second after i pressed enter on this line the scrollbar slider rapidly moved up and down a few pixels and also changed size (like it would look when you rapidly insert and remove items in a list) and then it disappeared.

When using the hide/show line numbers method to trigger the bug and started scrolling with the scrollbar slider (click the slider and drag it) the whole scrollbar did flicker and was visible only when moving the mouse but it scrolled correctly. After releasing the button i could not click it anymore.

** It looks like it is hidden when it should be shown and shown during the re-calculation when when it should be hidden. **

Since it is gone after re-compiling it might also be a compiler bug.

(similar to the one that recently gave me headaches when it messed up the implicit casting of Boolean to LongBool, False suddenly became True sometimes, depending on what happened to be in the eax register before.)

Reply by email