View Issue Details

IDProjectCategoryView StatusLast Update
0037105LazarusLCLpublic2020-05-29 16:34
Reporterbarlone Assigned ToBart Broersma  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version2.1 (SVN) 
Target Version2.2Fixed in Version2.2 
Summary0037105: Win32: TBitBtn does not show Caption and Glyph without using manifest in resources
DescriptionAppear only under Windows with Win32 widgetset. Screenshot attached.
Steps To Reproduce1. Create new application, drop TBitBtn on it, set any Kind and Caption
2. BEFORE saving project unset "Use resource manifest" in project parameters
3. Run project
TagsNo tags attached.
Fixed in Revisionr63227
LazTarget-
WidgetsetWin32/Win64
Attached Files

Relationships

related to 0036678 resolvedBart Broersma BitButton leaks GDI objects / 多次打开窗体关闭后bitbtn异常 

Activities

barlone

2020-05-18 16:56

reporter  

screenshot.png (71,850 bytes)   
screenshot.png (71,850 bytes)   

Bart Broersma

2020-05-18 20:14

developer   ~0122908

I cannot reproduce that with Lazarus 2.1.0 r62605 FPC 3.2.0 i386-win32-win32/win64.
I tested with a TBitBtn with Kind = bkOK and all the rest as default.
I can see both the glyph and the caption.

barlone

2020-05-19 10:21

reporter   ~0122926

Thanks for the response, Bart.

Did you unset "Use manifest resource (and enable theames)" before saving and run the project?

TSpeedButton work fine for me (screenshot attached).
screenshot-2.png (79,727 bytes)   
screenshot-2.png (79,727 bytes)   

Bart Broersma

2020-05-19 14:22

developer   ~0122931

Last edited: 2020-05-19 14:23

View 2 revisions

Yes, I did uncheck that setting.
I can see the difference in appearance when I run the project, so I know that setting has takern effect.
(Actually: building the project saves the project, so saving it before is not necessary)

I did not test other combinations of ButtonKind and glyphs and/or captions (default or not) though.
Also, IIRC there is a setting for TBitButtons that controls wether or not the glyphs are shown (look in the OI, I don't have Lazarus at hand now).

barlone

2020-05-19 18:49

reporter   ~0122936

I`ve update FPC, all LCL and Lazarus code from trunk, rebuild IDE, try compile to 64bit - result is same

Serge Anvarov

2020-05-19 21:00

reporter   ~0122940

Reproduce.
x64. FPC 3.3.1. Lazarus 2.1.0 r63021. Windows 7.
Put TBitBtn in new application. Uncheck "use manifest" - TBitBtn does not show Caption. Changing Kind or Caption - it still doesn't show.
In Lazarus 2.0.8 work right.

Bart Broersma

2020-05-24 11:04

developer   ~0123029

Last edited: 2020-05-24 11:06

View 2 revisions

I cannot reproduce that with Lazarus 2.1.0 r62605 FPC 3.2.0 i386-win32-win32/win64, now compiled for win64.
So, at least we know revision that still works.

B.t.w. I cannot run Lazarus with fpc trunk due to 0037034.

Bart Broersma

2020-05-24 11:17

developer   ~0123030

Last edited: 2020-05-24 11:33

View 3 revisions

I can confirm this also with r63179 fpc 3.2.0RC1 compiled for Win64 and for Win32.
So, now it can be bisected.

Bart Broersma

2020-05-24 14:20

developer   ~0123031

Last edited: 2020-05-24 14:43

View 2 revisions

Guilty revision is r62947: LCL-Win32: BitButton leaks GDI objects. Issue 0036678, patch from Anton Kavalenka.
That patch deletes NewBitmap regardless of the state of ThemeServices.
When ThemeServices is not available only OldBitMap should be destroyed AFAICS.

The necessary DeleteObject already was called in the branch where ThemeServices.Available is True.

Bart Broersma

2020-05-25 22:54

developer   ~0123066

I think for now we should revert r62947, since this is way more serious than the associated 0036678, which seems to have been unnoticed for at least 14 years (the affected codepath was already present in r7388).

Anton Kavalenka

2020-05-26 16:42

reporter   ~0123075

Last edited: 2020-05-26 17:25

View 6 revisions

Without GDI object releasing the application would work for 1hr-8hr depending on amount of buttons and then ends up crashing entire GDI because GDI resources are limited and shared.

see the patch in parent issue https://bugs.freepascal.org/view.php?id=36678#c123076

Bart Broersma

2020-05-26 23:59

developer   ~0123085

Applied second patch by Anton in associated issue 0036678.
Please test and close if OK.

barlone

2020-05-29 16:34

reporter   ~0123128

thanks, it work for me

Issue History

Date Modified Username Field Change
2020-05-18 16:56 barlone New Issue
2020-05-18 16:56 barlone File Added: screenshot.png
2020-05-18 20:14 Bart Broersma Note Added: 0122908
2020-05-19 10:21 barlone Note Added: 0122926
2020-05-19 10:21 barlone File Added: screenshot-2.png
2020-05-19 14:22 Bart Broersma Note Added: 0122931
2020-05-19 14:23 Bart Broersma Note Edited: 0122931 View Revisions
2020-05-19 18:49 barlone Note Added: 0122936
2020-05-19 21:00 Serge Anvarov Note Added: 0122940
2020-05-24 11:04 Bart Broersma Note Added: 0123029
2020-05-24 11:06 Bart Broersma Note Edited: 0123029 View Revisions
2020-05-24 11:17 Bart Broersma Status new => confirmed
2020-05-24 11:17 Bart Broersma LazTarget => -
2020-05-24 11:17 Bart Broersma Note Added: 0123030
2020-05-24 11:17 Bart Broersma Note Edited: 0123030 View Revisions
2020-05-24 11:33 Bart Broersma Note Edited: 0123030 View Revisions
2020-05-24 14:20 Bart Broersma Note Added: 0123031
2020-05-24 14:21 Bart Broersma Assigned To => Juha Manninen
2020-05-24 14:21 Bart Broersma Status confirmed => assigned
2020-05-24 14:37 Juha Manninen Relationship added related to 0036678
2020-05-24 14:43 Bart Broersma Note Edited: 0123031 View Revisions
2020-05-25 22:54 Bart Broersma Note Added: 0123066
2020-05-26 16:42 Anton Kavalenka Note Added: 0123075
2020-05-26 16:48 Anton Kavalenka Note Edited: 0123075 View Revisions
2020-05-26 16:49 Anton Kavalenka Note Edited: 0123075 View Revisions
2020-05-26 17:19 Anton Kavalenka Note Edited: 0123075 View Revisions
2020-05-26 17:25 Anton Kavalenka Note Edited: 0123075 View Revisions
2020-05-26 17:25 Anton Kavalenka Note Edited: 0123075 View Revisions
2020-05-26 22:31 Juha Manninen Assigned To Juha Manninen => Bart Broersma
2020-05-26 23:59 Bart Broersma Status assigned => resolved
2020-05-26 23:59 Bart Broersma Resolution open => fixed
2020-05-26 23:59 Bart Broersma Fixed in Revision => r63227
2020-05-26 23:59 Bart Broersma Widgetset Win32/Win64 => Win32/Win64
2020-05-26 23:59 Bart Broersma Note Added: 0123085
2020-05-26 23:59 Bart Broersma Fixed in Version => 2.2
2020-05-26 23:59 Bart Broersma Target Version => 2.2
2020-05-26 23:59 Bart Broersma Widgetset Win32/Win64 => Win32/Win64
2020-05-29 16:34 barlone Status resolved => closed
2020-05-29 16:34 barlone Note Added: 0123128