View Issue Details

IDProjectCategoryView StatusLast Update
0034002LazarusLCLpublic2018-09-11 14:40
ReporterMIS5 Assigned ToDmitry Boyarintsev  
PrioritynormalSeverityminorReproducibilitysometimes
Status resolvedResolutionfixed 
Platformmacos lazarus trunk 
Product Version1.8.5 (SVN) 
Summary0034002: toolbars content disapears
DescriptionWhen window is maximized toolbar content disapears

http://forum.lazarus.freepascal.org/index.php/topic,41930.0.html
Steps To ReproduceToolbars on a Panel aligned to top. When window is maximized using the green apple button - the content of the toolbars disappear.

Additional Information"GetMem" in the forum post could duplicate error like this when I asked if other could duplicate:

"Yes I can. Just open OPM then go to the toolbar in the bottom. Suddenly the content of the toolbar disappear, then appears back again but at a higher position. If you move the mouse some of the buttons are redrawn, but not all of them."

...

I am not sure if related, but the tabs in a TPageControl (aligned just below the tpanel containing the toolbars in my own test case) has a paint problem when the window gets maximized (top half is whitish color) - but that is resolved by clicking the tabs.
TagsNo tags attached.
Fixed in Revision
LazTarget-
WidgetsetCocoa
Attached Files

Relationships

parent of 0034196 resolvedDmitry Boyarintsev ExcludeClipRect is ignored 
parent of 0034197 resolvedDmitry Boyarintsev BitBlt/SetWindowOrgEx problem in Cocoa 

Activities

Dmitry Boyarintsev

2018-07-20 04:32

developer   ~0109581

needed: revision number
and
sample project

MIS5

2018-07-20 19:03

reporter   ~0109590

Hi Dmitry

SVN Revision 58553

I am working hard on creating a demo project.

I see it all the time in my own project, but trying to duplicate it in a demo project is hard. (Tried many hours)

I have tried / trying investigating if related to actions, imagelist content, resizing etc. - so far not been able to pinpoint it except I think one trigger is happening at some point *after* a resize event.

I hope maybe @GetMem from forum thread can provide example.

Maybe here is some events I can place a breakpoint at...

Dmitry Boyarintsev

2018-07-20 19:15

developer   ~0109591

Start removing components from the project, until the bug disappears. (or until there’s nothing else to remove)

You will either get the minimal project
or
Find the conflicting combination

MIS5

2018-07-22 00:36

reporter   ~0109614

Last edited: 2018-07-22 00:37

View 2 revisions

Here is a demo project which demonstrates multiple issues. It uses Mac/Cocoa fpcupdeluxe "trunk" and there is no real code in this project.

....

1) Demonstrates toolbuttons becoming invisible until clicked (just click on the top toolbar to expose them)

2) Demonstrates TPageControl tabsheets misdrawn until clicked

3) Demonstrates TEdit looking very weird with black background until clicked

4) Demonstrates some captions/labels etc. are drawn upside down some places

...

To see all issues simply
- run project
- doubleclick window title bar (minimizes to dock)
- open from mac dock.

There are more ways to trigger above errors, but the above is the easiest to make all the problems visible in one go :)

...

I will try simplify the case further - but I am just so happy I finally managed to make a test case that demonstrates the issue and wanted to upload it now.

MIS5

2018-07-22 00:37

reporter  

case1.zip (136,474 bytes)

Dmitry Boyarintsev

2018-07-22 07:48

developer   ~0109615

the problem seems to be caused by the presence of VirtualStringTree
try to set both VirtualStingTree visibility to false and try the project again.

MIS5

2018-07-22 09:18

reporter   ~0109619

Hi Dimitry

It seems you are right.

I will try report this as a bug there as well...

And I will reference this bug report since I can not tell at present if this a bug in Virtual Treeview or because of Virtual Treeview "pushes" or uses rare features in Cocoa implementation.

MIS5

2018-07-22 11:22

reporter   ~0109628

@Dimitry - let me know if you need me to test any solution or similar.

At this point I have submitted it as a bug/issue all relevant places for virtual treeview.

If this is a case of Cocoa implemention in Lazarus still being Alpha/Beta or it is virtualstringtree / virtual treeview "misusing" Cocoa I can not say :)

Dmitry Boyarintsev

2018-07-22 16:44

developer   ~0109637

The issue is with Cocoa implementation of graphics functions. More specifically - clipping area.
It’s not virtualtree bug

MIS5

2018-07-31 13:30

reporter   ~0109780

Last edited: 2018-07-31 13:30

View 2 revisions

I have not yet learned the internals of the LCL or Cocoa for that matter, but I will be happy to test. (I may also try pick up documentation on the LCL design and how each widgetset is implemented, but I think it will take some time.) Meanwhile, maybe "severity" should be upgraded from "minor", but tha is of course my subjective opinion :)

The maintainer of Lazarus Virtual Treeview wrote back
https://github.com/blikblum/VirtualTreeView-Lazarus/issues/8

"VirtualTreeView does not uses cocoa directly, just LCL and lclextensions."

"The way to go is to isolate the API that is broken and fix it."

"If you want to isolate code from lclextensions, compile with USE_DELPHICOMPAT directive disabled (VTConfig.inc)"

So it seems you have reached the same conclusion.

MIS5

2018-08-16 01:18

reporter   ~0110065

Just for reference, I have tested on latest trunk and the problem(s) still seem to be there.

MIS5

2018-08-22 13:50

reporter   ~0110229

Last edited: 2018-08-22 13:50

View 2 revisions

For reference I have tried duplicate the problem manually without using virtual treeview, but so far unsuccessful:


I tried two demos that *appears* to work on Cocoa - a when least standalone:

1)
https://forum.lazarus.freepascal.org/index.php/topic,36871.msg246309.html#msg246309
called SpriteTest2.Zip and it uses copyrect, mask, union

2)
https://forum.lazarus.freepascal.org/index.php/topic,36871.msg246790.html#msg246790
Same thread, Mr.Madguy code listed uses intersect, fillrect, cliprect

MIS5

2018-08-26 14:04

reporter   ~0110316

For what it is worth :

There is a new virtual treeview version out
https://github.com/blikblum/VirtualTreeView-Lazarus/tree/lazarus-v5
which allows to complile with USE_DELPHICOMPAT define commented out

The clipping problem remains unsolved though, but it means VT can be compiled without lcl-extensions which may be an advantage in locating the issue.

MIS5

2018-08-28 00:13

reporter   ~0110334

Last edited: 2018-08-28 00:15

View 2 revisions

The maintainer of virtual tree view provided two demos testing ExcludeClipRect and BitBlt/SetWindowOrgEx and I believe both demonstrates a problem with Lazarus/Cocoa. Details:

1)
In the past this was fixed for Carbon LCL related to virtual treeview
https://bugs.freepascal.org/view.php?id=28689 / http://bugs.freepascal.org/view.php?id=25564 (latter contains demo)
He suggests trying the attached demo on the Cocoa LCL implementation.

Bug? Lazarus/Cocoa: Seems seems to yield different results than other platforms with the BitBlt/SetWindowOrgEx demo


2)
He suggest trying this ExcludeClipRect demo:
https://bitbucket.org/blikblum/pascal-demos/src/16fc10cb12ed7a9fb1c4793bd592efb8ca198a9f/lazarus/LCLTests/ExcludeClipRect/?at=master

Bug? Lazarus/Cocoa: Seems ExcludeClipRect is ignored

...

I have attached screenshots

The original discussion on GitHub:
https://github.com/blikblum/VirtualTreeView-Lazarus/issues/8

MIS5

2018-08-28 00:13

reporter  

BitBltSetWindowOrgEx.png (21,505 bytes)   
BitBltSetWindowOrgEx.png (21,505 bytes)   

MIS5

2018-08-28 00:14

reporter  

ExcludeClipRect.png (20,083 bytes)   
ExcludeClipRect.png (20,083 bytes)   

MIS5

2018-09-01 09:54

reporter  

MIS5

2018-09-04 22:58

reporter   ~0110501

Last edited: 2018-09-05 13:46

View 2 revisions

For what it is worth there has been made separate bug reports for:

ExcludeClipRect = https://bugs.freepascal.org/view.php?id=34196
SetWindowOrgEx = https://bugs.freepascal.org/view.php?id=34197

MIS5

2018-09-05 13:46

reporter   ~0110513

Much better demo uploaded - simply do as the demo file name suggets "toggle-vtv-visible-then-reisze.zip" and see all the problems.

After a continued amount of testing in this discussion thread: https://github.com/blikblum/VirtualTreeView-Lazarus/issues/8

It seems fixing the two reported issues will have a *high chance* of solving all the issues.

Dmitry Boyarintsev

2018-09-06 05:43

developer   ~0110529

the contents of the toolbar no longer disappears

please test and close if ok

MIS5

2018-09-11 14:28

reporter   ~0110655

Last edited: 2018-09-11 14:40

View 5 revisions

Testing against toggle-vtv-visible-then-reisze.zip shows the issues remain unsolved :(

...

I can see the demo app for the ExcludeClipRect child but report https://bugs.freepascal.org/view.php?id=34196 appears to be solved now

...

However, the reason I do not believe ExcludeClipRect is fixed yet is:

The toggle-vtv-visible-then-reisze.zip demo will work if ExcludeClipRect is replaced by a complete dummy function (!)

The Lazarus maintainter of virtual reeview for Lazarus applied the "dummy exclupdecliprect" fix for testing:
https://github.com/blikblum/VirtualTreeView-Lazarus/issues/8#issuecomment-418730214

Issue History

Date Modified Username Field Change
2018-07-18 13:34 MIS5 New Issue
2018-07-20 04:32 Dmitry Boyarintsev LazTarget => -
2018-07-20 04:32 Dmitry Boyarintsev Note Added: 0109581
2018-07-20 04:32 Dmitry Boyarintsev Assigned To => Dmitry Boyarintsev
2018-07-20 04:32 Dmitry Boyarintsev Status new => feedback
2018-07-20 19:03 MIS5 Note Added: 0109590
2018-07-20 19:03 MIS5 Status feedback => assigned
2018-07-20 19:15 Dmitry Boyarintsev Note Added: 0109591
2018-07-22 00:36 MIS5 Note Added: 0109614
2018-07-22 00:37 MIS5 File Added: case1.zip
2018-07-22 00:37 MIS5 Note Edited: 0109614 View Revisions
2018-07-22 07:48 Dmitry Boyarintsev Note Added: 0109615
2018-07-22 09:18 MIS5 Note Added: 0109619
2018-07-22 11:22 MIS5 Note Added: 0109628
2018-07-22 16:44 Dmitry Boyarintsev Note Added: 0109637
2018-07-31 13:30 MIS5 Note Added: 0109780
2018-07-31 13:30 MIS5 Note Edited: 0109780 View Revisions
2018-08-16 01:18 MIS5 Note Added: 0110065
2018-08-22 13:50 MIS5 Note Added: 0110229
2018-08-22 13:50 MIS5 Note Edited: 0110229 View Revisions
2018-08-26 14:04 MIS5 Note Added: 0110316
2018-08-28 00:13 MIS5 Note Added: 0110334
2018-08-28 00:13 MIS5 File Added: BitBltSetWindowOrgEx.png
2018-08-28 00:14 MIS5 File Added: ExcludeClipRect.png
2018-08-28 00:15 MIS5 Note Edited: 0110334 View Revisions
2018-09-01 09:54 MIS5 File Added: toggle-vtv-visible-then-reisze.zip
2018-09-04 22:58 MIS5 Note Added: 0110501
2018-09-05 13:46 MIS5 Note Added: 0110513
2018-09-05 13:46 MIS5 Note Edited: 0110501 View Revisions
2018-09-06 05:06 Dmitry Boyarintsev Relationship added parent of 0034196
2018-09-06 05:07 Dmitry Boyarintsev Relationship added parent of 0034197
2018-09-06 05:43 Dmitry Boyarintsev Note Added: 0110529
2018-09-06 05:43 Dmitry Boyarintsev Status assigned => resolved
2018-09-06 05:43 Dmitry Boyarintsev Resolution open => fixed
2018-09-11 14:28 MIS5 Note Added: 0110655
2018-09-11 14:32 MIS5 Note Edited: 0110655 View Revisions
2018-09-11 14:38 MIS5 Note Edited: 0110655 View Revisions
2018-09-11 14:39 MIS5 Note Edited: 0110655 View Revisions
2018-09-11 14:40 MIS5 Note Edited: 0110655 View Revisions