diff options
author | aspektor <aspektor@redhat.com> | 2012-09-14 18:06:33 -0400 |
---|---|---|
committer | aspektor <aspektor@redhat.com> | 2012-09-14 18:06:33 -0400 |
commit | e488fe926810c2ed31c4218f8de2d3a45ed6c2f8 (patch) | |
tree | 1cd1316d99d53a5f2613b96fa0094aeb8e260bf7 /bundles/org.eclipse.swt/Eclipse SWT | |
parent | 581453749640c1d130107d787c034295f9ba07ba (diff) | |
parent | 8690a7560fff2719b578c6e53fe8945b5f15f15c (diff) | |
download | eclipse.platform.swt-master.tar.gz eclipse.platform.swt-master.tar.xz eclipse.platform.swt-master.zip |
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT')
4 files changed, 35 insertions, 4 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java index d4326cdebb..d7f8ab56ee 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java @@ -205,9 +205,9 @@ void createHandle (int index) { gtk_widget_set_has_window (fixedHandle, true); if ((style & SWT.SEPARATOR) != 0) { if ((style & SWT.HORIZONTAL)!= 0) { - handle = OS.gtk_hseparator_new (); + handle = gtk_separator_new (OS.GTK_ORIENTATION_HORIZONTAL); } else { - handle = OS.gtk_vseparator_new (); + handle = gtk_separator_new (OS.GTK_ORIENTATION_VERTICAL); } if (handle == 0) error (SWT.ERROR_NO_HANDLES); } else { @@ -584,4 +584,18 @@ void showWidget () { if (frameHandle != 0) OS.gtk_widget_show (frameHandle); if (labelHandle != 0) OS.gtk_widget_show (labelHandle); } + +int /*long*/ gtk_separator_new (int orientation) { + int /*long*/ separator = 0; + if (OS.GTK_VERSION >= OS.VERSION (3, 0, 0)) { + separator = OS.gtk_separator_new (orientation); + } else { + if (orientation == OS.GTK_ORIENTATION_HORIZONTAL) { + separator = OS.gtk_hseparator_new (); + } else { + separator = OS.gtk_vseparator_new (); + } + } + return separator; +} } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Sash.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Sash.java index 3dfad2887d..dbc04e8c55 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Sash.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Sash.java @@ -298,7 +298,7 @@ int /*long*/ gtk_key_press_event (int /*long*/ widget, int /*long*/ eventPtr) { int /*long*/ window = gtk_widget_get_window (handle); int grabMask = OS.GDK_POINTER_MOTION_MASK | OS.GDK_BUTTON_RELEASE_MASK; int /*long*/ gdkCursor = cursor != null ? cursor.handle : defaultCursor; - int ptrGrabResult = OS.gdk_pointer_grab (window, false, grabMask, window, gdkCursor, OS.GDK_CURRENT_TIME); + int ptrGrabResult = gdk_pointer_grab (window, OS.GDK_OWNERSHIP_NONE, false, grabMask, window, gdkCursor, OS.GDK_CURRENT_TIME); /* The event must be sent because its doit flag is used. */ Event event = new Event (); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tracker.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tracker.java index 9d16684e8f..17f929b3db 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tracker.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tracker.java @@ -368,7 +368,7 @@ public boolean getStippled () { boolean grab () { int /*long*/ cursor = this.cursor != null ? this.cursor.handle : 0; - int result = OS.gdk_pointer_grab (window, false, OS.GDK_POINTER_MOTION_MASK | OS.GDK_BUTTON_RELEASE_MASK, window, cursor, OS.GDK_CURRENT_TIME); + int result = gdk_pointer_grab (window, OS.GDK_OWNERSHIP_NONE, false, OS.GDK_POINTER_MOTION_MASK | OS.GDK_BUTTON_RELEASE_MASK, window, cursor, OS.GDK_CURRENT_TIME); return result == OS.GDK_GRAB_SUCCESS; } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java index 5161141007..89ae3596b4 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java @@ -1849,6 +1849,23 @@ int /*long*/ gtk_box_new (int orientation, boolean homogeneous, int spacing) { return box; } +int gdk_pointer_grab (int /*long*/ window, int grab_ownership, boolean owner_events, int event_mask, int /*long*/ confine_to, int /*long*/ cursor, int time_) { + if (OS.GTK_VERSION >= OS.VERSION (3, 0, 0)) { + int /*long*/ display = 0; + if( window != 0) { + display = OS.gdk_window_get_display (window); + } else { + window = OS.gdk_get_default_root_window (); + display = OS.gdk_window_get_display (window); + } + int /*long*/ device_manager = OS.gdk_display_get_device_manager (display); + int /*long*/ pointer = OS.gdk_device_manager_get_client_pointer (device_manager); + return OS.gdk_device_grab (pointer, window, grab_ownership, owner_events, event_mask, cursor, time_); + } else { + return OS.gdk_pointer_grab (window, owner_events, event_mask, confine_to, cursor, time_); + } +} + /** * Returns a string containing a concise, human-readable * description of the receiver. |