Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 481485

Summary: [GTK3.10+] Paint listener for button/label does not work
Product: [Eclipse Project] Platform Reporter: Michael Thonhauser <michael.thonhauser>
Component: SWTAssignee: Eric Williams <ericwill>
Status: VERIFIED FIXED QA Contact: Eric Williams <ericwill>
Severity: normal    
Priority: P3 CC: ericwill
Version: 4.6   
Target Milestone: 4.8 M6   
Hardware: PC   
OS: Linux   
See Also: https://git.eclipse.org/r/116615
https://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=2b94e7b384e944a78a368863074b86d6cfecabcd
Whiteboard:
Bug Depends on:    
Bug Blocks: 494883, 516839    
Attachments:
Description Flags
Example snippet
none
Example snippet showing a button
none
Snippet rendered with GTK2
none
Snippet rendered with GTK3 none

Description Michael Thonhauser CLA 2015-11-05 04:55:07 EST
Created attachment 257748 [details]
Example snippet

If I add a paint listener to a button, which draws text, the text is not displayed if running with environment SWT_GTK3 = 1.
Comment 1 Eric Williams CLA 2015-11-05 09:05:11 EST
Just to clarify: when you click the button is the text supposed to be drawn?

This is the behaviour I am seeing:

GTK3: A label ("label") in the top left corner, and the SWT version in the middle of the window (for me it displays "4608"). Clicking the button doesn't trigger anything.

GTK2: Same as GTK3 except there is no text with the SWT version in the middle of the window. There is a label "button" on the top right corner of the button. Clicking the button doesn't do anything.

Is this the expected behaviour?
Comment 2 Michael Thonhauser CLA 2015-11-05 09:39:12 EST
Created attachment 257757 [details]
Example snippet showing a button
Comment 3 Michael Thonhauser CLA 2015-11-05 09:40:27 EST
Created attachment 257758 [details]
Snippet rendered with GTK2
Comment 4 Michael Thonhauser CLA 2015-11-05 09:40:52 EST
Created attachment 257759 [details]
Snippet rendered with GTK3
Comment 5 Michael Thonhauser CLA 2015-11-05 09:44:06 EST
(In reply to Eric Williams from comment #1)
> Just to clarify: when you click the button is the text supposed to be drawn?
> 
> This is the behaviour I am seeing:
> 
> GTK3: A label ("label") in the top left corner, and the SWT version in the
> middle of the window (for me it displays "4608"). Clicking the button
> doesn't trigger anything.
> 
> GTK2: Same as GTK3 except there is no text with the SWT version in the
> middle of the window. There is a label "button" on the top right corner of
> the button. Clicking the button doesn't do anything.
The text was hidden, if you resize the window the text should be displayed. But as I stated below, this is not the problem of this bug, but my mistake to attach the "wrong" snippet.
> 
> Is this the expected behaviour?

Sorry, I added the wrong snippet. I just uploaded a new simplified version and two screenshots how the button is rendered on GTK2 / GTK3.

I want the text "Button" to be displayed on the button, this is not the case for GTK3. I have no click event added to the button, so there should be no change or action excuted.
Comment 6 Eric Williams CLA 2015-11-05 13:09:25 EST
(In reply to Michael Thonhauser from comment #5)
> Sorry, I added the wrong snippet. I just uploaded a new simplified version
> and two screenshots how the button is rendered on GTK2 / GTK3.

No problem, I can reproduce the issue on my machine now using Eclipse 4.6, GTK3.18, and Fedora 23.
Comment 7 Eric Williams CLA 2018-01-31 14:49:19 EST
This bug affects Label as well.
Comment 9 Eric Williams CLA 2018-02-02 13:48:53 EST
(In reply to Eclipse Genie from comment #8)
> Gerrit change https://git.eclipse.org/r/116615 was merged to [master].
> Commit:
> http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/
> ?id=2b94e7b384e944a78a368863074b86d6cfecabcd

Patch is in master now, as well as the accompanying bug snippet.
Comment 10 Eric Williams CLA 2018-03-06 10:03:16 EST
Verified in I20180305-2000.