diff options
author | Xi Yan | 2018-08-15 17:56:41 +0000 |
---|---|---|
committer | Eric Williams | 2018-08-16 12:40:48 +0000 |
commit | 946848efb11da8e1f7c8bef5c837522ef5588c55 (patch) | |
tree | b10a14cff5073dfb7de63d297c9085b236aff7b9 | |
parent | f53473360b7626aa7d7c80ead1f2da46e15351ce (diff) | |
download | eclipse.platform.swt-946848efb11da8e1f7c8bef5c837522ef5588c55.tar.gz eclipse.platform.swt-946848efb11da8e1f7c8bef5c837522ef5588c55.tar.xz eclipse.platform.swt-946848efb11da8e1f7c8bef5c837522ef5588c55.zip |
Bug 534229 - [GTK 3.22] assertion size >= 0 failed on GtkCheckButton on
standard error
When size of GtkCheckButton and GtkRadioButton is set larger than the
visible container size, assertion size >= 0 error gets generated. Only
resize SwtFixed handle for GtkCheckButton and GtkRadioButton.
Tested with Run/Debug page in Window -> Preferences, and new Eclipse
Application configuration page.
Change-Id: I28fb465202dcd40bcc2e4a4778b60c70f0906ebd
Signed-off-by: Xi Yan <xixiyan@redhat.com>
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java index ca8aa54ebb..6af2e14f69 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java @@ -641,14 +641,20 @@ public void removeSelectionListener (SelectionListener listener) { @Override void resizeHandle (int width, int height) { - super.resizeHandle (width, height); - /* - * Feature in GTK, GtkCheckButton and GtkRadioButton allocate - * only the minimum size necessary for its child. This causes the child - * alignment to fail. The fix is to set the child size to the size - * of the button. - */ - if (!GTK.GTK3) { + if (GTK.GTK3) { + if ((style & (SWT.CHECK | SWT.RADIO)) != 0 && (style & SWT.WRAP) == 0) { + OS.swt_fixed_resize (GTK.gtk_widget_get_parent (topHandle()), topHandle(), width, height); + } else { + super.resizeHandle(width, height); + } + } else { + super.resizeHandle (width, height); + /* + * Feature in GTK, GtkCheckButton and GtkRadioButton allocate + * only the minimum size necessary for its child. This causes the child + * alignment to fail. The fix is to set the child size to the size + * of the button. + */ if ((style & (SWT.CHECK | SWT.RADIO)) != 0) { GTK.gtk_widget_set_size_request (boxHandle, width, -1); } |