Opened 13 years ago
Last modified 12 years ago
#29659 closed defect
gtk3 is broken on macs(all versions) — at Initial Version
Reported by: | krugomvolki@… | Owned by: | macports-tickets@… |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 1.9.2 |
Keywords: | Cc: | ||
Port: | gtk3 |
Description
copy&paste, drag-n-drop are broken on mac port of gtk3 due to null or uninitialized pointers being dereferenced
how to reproduce: build gtk3 with +no_x11 +quartz variants, run gtk3-demo, select "clipboard" demo. try to paste text by pressing the button "paste" and see warning in console: assertion GDK_IS_DISPLAY(...) failed. text in not inserted in the text field; try to drag an image at the bottom of window, program crashes with bus error. last 2 calls in call stack are: #0 0x006c605a in gtk_style_context_save (context=0x14) at gtkstylecontext.c:1727 #1 0x007b099e in gtk_drag_highlight_draw (widget=0x14, cr=0x24a160, data=0x0) at gtkdnd-quartz.c:352
in order to fix these bugs, the following functions must be patched: gtk_clipboard_wait_for_contents() in gtk/gtkclipboard-quartz.c
selection_data = g_slice_new0 (GtkSelectionData); selection_data->selection = clipboard->selection; selection_data->target = target; FIX: set display!!!!! selection_data->display=clipboard->display;
and
selection_data = _gtk_quartz_get_selection_data_from_pasteboard
(clipboard->pasteboard,
target, clipboard->selection);
FIX: set display!!!!! if(selection_data)selection_data->display=clipboard->display;
in gtk/gtkdnd-quartz.c, gtk_style_context_save()
GtkStyleContext *context; FIX: initialize pointer before using it!!!! GtkStyleContext *context=gtk_widget_get_style_context (widget); gtk_style_context_save (context);
after these patches, i've got gtk3 working properly on mac os 10.5 see also: https://bugzilla.gnome.org/show_bug.cgi?id=651224