Community
Participate
Working Groups
This patch uses gtk_widget_get_allocation instead of GTK_WIDGET_WIDTH GTK_WIDGET_HEIGH GTK_WIDGET_X and GTK_WIDGET_Y, thus avoiding compilation warnings when G_SEAL_ENABLE flag is defined: http://fedorapeople.org/gitweb?p=aspektor/public_git/eclipse.platform.swt.git;a=commit;h=e2eec58f5a7bca2908e0116758c3fe8312d273e1
(In reply to comment #0) > This patch uses gtk_widget_get_allocation instead of GTK_WIDGET_WIDTH > GTK_WIDGET_HEIGH GTK_WIDGET_X and GTK_WIDGET_Y, thus avoiding compilation > warnings when G_SEAL_ENABLE flag is defined: > > > http://fedorapeople.org/gitweb?p=aspektor/public_git/eclipse.platform.swt. > git;a=commit;h=e2eec58f5a7bca2908e0116758c3fe8312d273e1 Unfortunately, yesterday fedorapeople stopped supporting "gitweb", so some links are not active anymore. The patch is available from here: http://fedorapeople.org/cgit/aspektor/public_git/eclipse.platform.swt.git/commit/?h=gtk_widget_get_allocation__
Thanks for the patch! Pushed to eclipse.org http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=195c35fb4aaf6777b97d64fa53ba79208d6d54ee with a minor correction in the naming of the native function http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=9ef4324d53b9a731c1016f0319ea780ff7e16145
The change in Combo.java seems unrelated to the patch. Is it necessary?
Should we add a helper for gtk_widget_get_allocation(). One reason not to do it is that we could avoid the creation of the GtkAllocation object for the <2.18 code path, but most of the code in master is not taking advantage of that anyways. Another reason is that sometimes we only need the width so we would be getting x,y,height for nothing in the old code path (it probably does not matter). The big advantage of the helper is that it makes the code cleaner.
Regarding code in Combo: No it's not necessary and probably I shouldn't put it, as it is better to use GtkRequisition object instead of constants which are mostly deprecated, so when you have time, please revert this change, or I can release patch myself that reverts these changes if you like. Sorry for this confusion. Anatoly
(In reply to comment #5) > Regarding code in Combo: > > so when you have time, please revert this change, or I can release patch Reverted the changes in Combo.java - http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=58b1e1bc94f63d5d1638e502924a79642df3a55a
(In reply to comment #5) > Regarding code in Combo: > > No it's not necessary and probably I shouldn't put it, as it is better to > use GtkRequisition object instead of constants which are mostly deprecated, > so when you have time, please revert this change, or I can release patch > myself that reverts these changes if you like. > > Sorry for this confusion. > > Anatoly Take a look at this comment to see why we reach in to get the requisition of the widget: https://bugs.eclipse.org/bugs/show_bug.cgi?id=374754#add_comment
Bug in Sash widget caused by previous patch: If you run ControlExample, Sash won't work, because one case of gtk_widget_allocation is missed. Please apply this patch to solve the bug: http://fedorapeople.org/cgit/aspektor/public_git/eclipse.platform.swt.git/commit/?h=gtk_widget_get_allocation__ Sorry for the confusion.
Thanks. Pushed to eclipse.org. http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=c355f6891c71dea091557f57d6c197397a859867
Added helper. http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=9effcc166dfa61e54b0f9bb76b17f1175f53b69b With this helper it is easy to check whether we are still calling the GTK_WIDGET_X,Y,W,H and I found places were the original patch was wrong: 1) Composite.moveChildren() - call to gtk_widget_get_allocation() to get width,height overwrites the x,y value set just before the if (end of the method) 2) Buton.setBounds() - gtk_widget_get_allocation() called more then needed 3) ToolItem.resizeHandle() - still used GTK_WIDGET_X/GTK_WIDGET_Y 4) Control.setBounds() - gtk_widget_get_allocation() called more then needed