Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 394422 - [ GTK+ 3] Wrong size of Slider widget
Summary: [ GTK+ 3] Wrong size of Slider widget
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.3   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 4.3 M4   Edit
Assignee: Anatoly Spektor CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 340067
  Show dependency tree
 
Reported: 2012-11-15 15:38 EST by Anatoly Spektor CLA
Modified: 2012-11-16 10:56 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Anatoly Spektor CLA 2012-11-15 15:38:36 EST
How to reproduce:

1. Open ControlExample in Gtk+ 3
2. Go to Slider Tab

 As you might see it has initially wrong size.


Problem lies in Control.ComputeNativeSize()

 In Gtk + 2:

width = OS.GTK_WIDGET_REQUISITION_WIDTH (h);
height = OS.GTK_WIDGET_REQUISITION_HEIGHT (h);

 produces size 60x15

whereas 

in Gtk+ 3

gtk_widget_size_request (h, requisition);

 produces size 20x19
Comment 1 Anatoly Spektor CLA 2012-11-15 16:59:20 EST
(In reply to comment #0)
> How to reproduce:
> 
> 1. Open ControlExample in Gtk+ 3
> 2. Go to Slider Tab
> 
>  As you might see it has initially wrong size.
> 
> 
> Problem lies in Control.ComputeNativeSize()
> 
>  In Gtk + 2:
> 
> width = OS.GTK_WIDGET_REQUISITION_WIDTH (h);
> height = OS.GTK_WIDGET_REQUISITION_HEIGHT (h);
> 
>  produces size 60x15
> 
> whereas 
> 
> in Gtk+ 3
> 
> gtk_widget_size_request (h, requisition);
> 
>  produces size 20x19

Realizing widget before computing size seems to solve the problem.

Here is the patch:

http://fedorapeople.org/cgit/aspektor/public_git/eclipse.platform.swt.git/commit/?h=394422

Please let me know what do you think.
Comment 2 Alexander Kurtakov CLA 2012-11-16 03:14:08 EST
Thanks for the patch - applied to master. http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=5ed9391060e1aab8e1f0348a337191397f8d0889