Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 383818 Details for
Bug 521308
<dev-java/swt-4.3: Crashes and errors with newer Glib/GTK+ versions
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
fix crashes,errors,warnings with newer Glib and GTK+ versions
0002-fix-compatibility-with-newer-gtk-glib.patch (text/plain), 8.34 KB, created by
Matthias Dahl
on 2014-08-27 15:09:27 UTC
(
hide
)
Description:
fix crashes,errors,warnings with newer Glib and GTK+ versions
Filename:
MIME Type:
Creator:
Matthias Dahl
Created:
2014-08-27 15:09:27 UTC
Size:
8.34 KB
patch
obsolete
>Backport of commit 8a770faaa4942f4e1cde0428ab3348bcc4c88e3f from master to fix >several warnings and errors with newer GTK+ and Glib versions. > >See >https://bugs.eclipse.org/bugs/show_bug.cgi?id=383189 > >--- a/src/org/eclipse/swt/widgets/Combo.java 2014-08-27 16:24:13.215660644 +0200 >+++ b/src/org/eclipse/swt/widgets/Combo.java 2014-08-27 16:39:05.819984334 +0200 >@@ -341,7 +341,7 @@ void clearText () { > > public Point computeSize (int wHint, int hHint, boolean changed) { > checkWidget (); >- if ((style & SWT.READ_ONLY) != 0 || menuHandle != 0) { >+ if ((style & SWT.READ_ONLY) != 0) { > return computeNativeSize (handle, wHint, hHint, changed); > } > if (wHint != SWT.DEFAULT && wHint < 0) wHint = 0; >@@ -441,8 +441,10 @@ void createHandle (int index) { > if (OS.GTK_VERSION < OS.VERSION (2, 8, 0)) { > OS.gtk_widget_size_request(handle, new GtkRequisition()); > } >- if (popupHandle != 0) findMenuHandle (); >- findButtonHandle (); >+ menuHandle = findMenuHandle (); >+ if (menuHandle != 0) OS.g_object_ref (menuHandle); >+ buttonHandle = findButtonHandle (); >+ if (buttonHandle != 0) OS.g_object_ref (buttonHandle); > /* > * Feature in GTK. By default, read only combo boxes > * process the RETURN key rather than allowing the >@@ -526,7 +528,7 @@ long /*int*/ findPopupHandle (long /*int > } > > >-void findButtonHandle() { >+long /*int*/ findButtonHandle() { > /* > * Feature in GTK. There is no API to query the button > * handle from a combo box although it is possible to get the >@@ -534,32 +536,33 @@ void findButtonHandle() { > * fix is to walk the combo tree and find the first child that is > * an instance of button. > */ >+ long /*int*/ result = 0; > OS.gtk_container_forall (handle, display.allChildrenProc, 0); > if (display.allChildren != 0) { > long /*int*/ list = display.allChildren; > while (list != 0) { > long /*int*/ widget = OS.g_list_data (list); > if (OS.GTK_IS_BUTTON (widget)) { >- buttonHandle = widget; >- OS.g_object_ref (buttonHandle); >+ result = widget; > break; > } >- list = OS.g_list_next (list); > } > OS.g_list_free (display.allChildren); > display.allChildren = 0; > } >+ return result; > } > >-void findMenuHandle() { >+long /*int*/ findMenuHandle() { >+ if (popupHandle == 0) return 0; >+ long /*int*/ result = 0; > OS.gtk_container_forall (popupHandle, display.allChildrenProc, 0); > if (display.allChildren != 0) { > long /*int*/ list = display.allChildren; > while (list != 0) { > long /*int*/ widget = OS.g_list_data (list); > if (OS.G_OBJECT_TYPE (widget) == OS.GTK_TYPE_MENU ()) { >- menuHandle = widget; >- OS.g_object_ref (menuHandle); >+ result = widget; > break; > } > list = OS.g_list_next (list); >@@ -567,6 +570,7 @@ void findMenuHandle() { > OS.g_list_free (display.allChildren); > display.allChildren = 0; > } >+ return result; > } > > void fixModal (long /*int*/ group, long /*int*/ modalGroup) { >@@ -607,7 +611,6 @@ long /*int*/ fontHandle () { > } > > long /*int*/ focusHandle () { >- if ((style & SWT.READ_ONLY) != 0 && buttonHandle != 0) return buttonHandle; > if (entryHandle != 0) return entryHandle; > return super.focusHandle (); > } >@@ -629,9 +632,20 @@ void hookEvents () { > OS.g_signal_connect_closure (entryHandle, OS.activate, display.closures [ACTIVATE], false); > OS.g_signal_connect_closure (entryHandle, OS.populate_popup, display.closures [POPULATE_POPUP], false); > } >- int eventMask = OS.GDK_POINTER_MOTION_MASK | OS.GDK_BUTTON_PRESS_MASK | >- OS.GDK_BUTTON_RELEASE_MASK; >- long /*int*/ [] handles = new long /*int*/ [] {buttonHandle, entryHandle, menuHandle}; >+ >+ hookEvents(new long /*int*/ [] {buttonHandle, entryHandle, menuHandle}); >+ >+ long /*int*/ imContext = imContext (); >+ if (imContext != 0) { >+ OS.g_signal_connect_closure (imContext, OS.commit, display.closures [COMMIT], false); >+ int id = OS.g_signal_lookup (OS.commit, OS.gtk_im_context_get_type ()); >+ int blockMask = OS.G_SIGNAL_MATCH_DATA | OS.G_SIGNAL_MATCH_ID; >+ OS.g_signal_handlers_block_matched (imContext, blockMask, id, 0, 0, 0, entryHandle); >+ } >+} >+ >+void hookEvents(long /*int*/ [] handles) { >+ int eventMask = OS.GDK_POINTER_MOTION_MASK | OS.GDK_BUTTON_PRESS_MASK | OS.GDK_BUTTON_RELEASE_MASK; > for (int i=0; i<handles.length; i++) { > long /*int*/ eventHandle = handles [i]; > if (eventHandle != 0) { >@@ -655,17 +669,11 @@ void hookEvents () { > if (eventHandle != focusHandle ()) { > OS.g_signal_connect_closure_by_id (eventHandle, display.signalIds [EVENT_AFTER], 0, display.closures [EVENT_AFTER], false); > } >+ if (OS.G_OBJECT_TYPE (eventHandle) == OS.GTK_TYPE_MENU ()) { >+ OS.g_signal_connect_closure(eventHandle, OS.selection_done, display.closures[SELECTION_DONE], true); >+ } > } > } >- long /*int*/ imContext = imContext (); >- if (imContext != 0) { >- OS.g_signal_connect_closure (imContext, OS.commit, display.closures [COMMIT], false); >- int id = OS.g_signal_lookup (OS.commit, OS.gtk_im_context_get_type ()); >- int blockMask = OS.G_SIGNAL_MATCH_DATA | OS.G_SIGNAL_MATCH_ID; >- OS.g_signal_handlers_block_matched (imContext, blockMask, id, 0, 0, 0, entryHandle); >- } >- >- if (menuHandle != 0) OS.g_signal_connect_closure(menuHandle, OS.selection_done, display.closures[SELECTION_DONE], true); > } > > long /*int*/ imContext () { >@@ -1226,20 +1234,6 @@ long /*int*/ gtk_event_after (long /*int > OS.memmove (event, gdkEvent, GdkEvent.sizeof); > switch (event.type) { > case OS.GDK_BUTTON_PRESS: { >- if (OS.GTK_VERSION < OS.VERSION (2, 8, 0) && !selectionAdded) { >- long /*int*/ grabHandle = OS.gtk_grab_get_current (); >- if (grabHandle != 0) { >- if (OS.G_OBJECT_TYPE (grabHandle) == OS.GTK_TYPE_MENU ()) { >- menuHandle = grabHandle; >- OS.g_object_ref (menuHandle); >- OS.g_signal_connect_closure_by_id (menuHandle, display.signalIds [BUTTON_RELEASE_EVENT], 0, display.closures [BUTTON_RELEASE_EVENT], false); >- OS.g_signal_connect_closure_by_id (menuHandle, display.signalIds [BUTTON_RELEASE_EVENT], 0, display.closures [BUTTON_RELEASE_EVENT_INVERSE], true); >- OS.g_signal_connect_closure (menuHandle, OS.selection_done, display.closures [SELECTION_DONE], false); >- display.addWidget (menuHandle, this); >- selectionAdded = true; >- } >- } >- } > GdkEventButton gdkEventButton = new GdkEventButton (); > OS.memmove (gdkEventButton, gdkEvent, GdkEventButton.sizeof); > if (gdkEventButton.button == 1) { >@@ -1386,6 +1380,13 @@ long /*int*/ gtk_selection_done(long /*i > } > return 0; > } >+ >+long /*int*/ gtk_style_set (long /*int*/ widget, long /*int*/ previousStyle) { >+ setButtonHandle (findButtonHandle ()); >+ setMenuHandle (findMenuHandle ()); >+ return super.gtk_style_set (widget, previousStyle); >+} >+ > /** > * Searches the receiver's list starting at the first item > * (index 0) until an item is found that is equal to the >@@ -1726,6 +1727,34 @@ int setBounds (int x, int y, int width, > return super.setBounds (x, y, width, newHeight, move, resize); > } > >+void setButtonHandle (long /*int*/ widget) { >+ if (buttonHandle == widget) return; >+ if (buttonHandle != 0) { >+ display.removeWidget (buttonHandle); >+ OS.g_object_unref (buttonHandle); >+ } >+ buttonHandle = widget; >+ if (buttonHandle != 0) { >+ OS.g_object_ref (buttonHandle); >+ display.addWidget (buttonHandle, this); >+ hookEvents (new long /*int*/[]{buttonHandle}); >+ } >+} >+ >+void setMenuHandle (long /*int*/ widget) { >+ if (menuHandle == widget) return; >+ if (menuHandle != 0) { >+ display.removeWidget (menuHandle); >+ OS.g_object_unref (menuHandle); >+ } >+ menuHandle = widget; >+ if (menuHandle != 0) { >+ OS.g_object_ref (menuHandle); >+ display.addWidget (menuHandle, this); >+ hookEvents (new long /*int*/[]{menuHandle}); >+ } >+} >+ > void setFontDescription (long /*int*/ font) { > super.setFontDescription (font); > if (entryHandle != 0) OS.gtk_widget_modify_font (entryHandle, font);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 521308
:
383816
| 383818