Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXi Yan2019-03-28 12:10:44 -0400
committerXi Yan2019-03-28 12:28:19 -0400
commit6f3efbaa1889e62f73b78c7a2c551b6b3208df78 (patch)
treeaaae44807d16c869a395ca1b90b2690768b35d34
parentcdf280bd9520d91fcd43cc3099c9764296278945 (diff)
downloadeclipse.platform.swt-6f3efbaa1889e62f73b78c7a2c551b6b3208df78.tar.gz
eclipse.platform.swt-6f3efbaa1889e62f73b78c7a2c551b6b3208df78.tar.xz
eclipse.platform.swt-6f3efbaa1889e62f73b78c7a2c551b6b3208df78.zip
Bug 541376 - [GTK4] Replace signals which have been removed
Move 'change-value' signal from GtkScrollBar to be handled by 'scroll-child' in GtkScrollWindow. Change-Id: I66663f26ed718e492114a00bc048ea288ee722cc Signed-off-by: Xi Yan <xixiyan@redhat.com>
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java5
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ScrollBar.java3
2 files changed, 7 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java
index 3ee0242de6..36c42bcdd0 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java
@@ -919,6 +919,11 @@ long gtk_realize (long widget) {
long gtk_scroll_child (long widget, long scrollType, long horizontal) {
/* Stop GTK scroll child signal for canvas */
OS.g_signal_stop_emission_by_name (widget, OS.scroll_child);
+ if (GTK.GTK4) {
+ // GtkScrollBar moved out of GtkRange, get GtkScrollType from this signal instead
+ if (horizontalBar != null ) horizontalBar.detail = (int) scrollType;
+ if (verticalBar != null) verticalBar.detail = (int) scrollType;
+ }
return 1;
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ScrollBar.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ScrollBar.java
index abdedc58f0..6c58e7978d 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ScrollBar.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ScrollBar.java
@@ -599,12 +599,13 @@ long gtk_event_after (long widget, long gdkEvent) {
@Override
void hookEvents () {
super.hookEvents ();
- OS.g_signal_connect_closure (handle, OS.change_value, display.getClosure (CHANGE_VALUE), false);
OS.g_signal_connect_closure (adjustmentHandle, OS.value_changed, display.getClosure (VALUE_CHANGED), false);
if (GTK.GTK4) {
// GTK4: event-after replaced with generic event
OS.g_signal_connect_closure_by_id (handle, display.signalIds [EVENT], 0, display.getClosure (EVENT), false);
+ // GTK4: change-value moved to gtk_scroll_child in Composite
} else {
+ OS.g_signal_connect_closure (handle, OS.change_value, display.getClosure (CHANGE_VALUE), false);
OS.g_signal_connect_closure_by_id (handle, display.signalIds [BUTTON_PRESS_EVENT], 0, display.getClosure (BUTTON_PRESS_EVENT), false);
OS.g_signal_connect_closure_by_id (handle, display.signalIds [EVENT_AFTER], 0, display.getClosure (EVENT_AFTER), false);
}

Back to the top