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

Bug 445539

Summary: DateTime GtkCalendar not selectable if vertical fill is used.
Product: [Eclipse Project] Platform Reporter: Leo Ufimtsev <lufimtse>
Component: ScriptingAssignee: Leo Ufimtsev <lufimtse>
Status: RESOLVED FIXED QA Contact:
Severity: minor    
Priority: P3 CC: akurtakov
Version: 4.4   
Target Milestone: ---   
Hardware: PC   
OS: Linux-GTK   
Whiteboard:

Description Leo Ufimtsev CLA 2014-09-30 14:32:56 EDT
In GTK3.0 - 3.10.9 (and maybe higher). 

If you launch ControlExample, navigate to "DateTime", select SWT.CALENDAR and check "Vertical fill", then the days shift to the bottom and they become un-selectable. 

To be more precise, any days outside the 'preferred' size of the Caledar become un-selectable. 

This is due to a gtk3 bug:
https://bug737670.bugzilla-attachments.gnome.org/attachment.cgi?id=287470

E.g Screenshot:
https://bug737670.bugzilla-attachments.gnome.org/attachment.cgi?id=287470

This currently occurs in the latest SWT Master. 

I've written a workaround as part of:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=394534
(the fix was to override the setBounds(..) method in DateTime and prevent vertical sizing beyond preferred size).
(you can search the code for 'TAG_GTK_CALENDAR_VERTICAL_FILL_WORKAROUND_394534' to find the spot)

But once the problem is fixed on the gtk-side, it should be corrected on the SWT side also.
Comment 1 Leo Ufimtsev CLA 2014-10-06 10:12:00 EDT
Bug was fixed upsteam in gtk. 

Once available, need to compile new gtk, test and add some code to stop the workaround after the fixed gtk version.
Comment 2 Leo Ufimtsev CLA 2014-10-06 10:30:16 EDT
Note to self:
 - fix available in GTK 3.14.2
 - The fix should be available in master maybe around 20th October 2014
Comment 3 Leo Ufimtsev CLA 2014-10-08 10:45:42 EDT
Note to self:
Added the upper version into the fix:
int fixedGtkVersion = OS.VERSION(3, 14, 2);
if (isCalendar() && OS.GTK3 && (OS.GTK_VERSION < fixedGtkVersion)) {
  //Workaround 

So beyond that version it uses native size again. 

But need to test eventually when 3.14.2 is available to verify fix.
Comment 4 Leo Ufimtsev CLA 2014-10-24 13:50:03 EDT
Fixed on gtk side. Added conditional in swt code also.