Opened 13 years ago

Closed 12 years ago

#29659 closed defect (worksforme)

gtk3 is broken on macs(all versions)

Reported by: krugomvolki@… Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 1.9.2
Keywords: Cc:
Port: gtk3

Description (last modified by mf2k (Frank Schima))

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

Change History (3)

comment:1 Changed 13 years ago by mf2k (Frank Schima)

Description: modified (diff)
Owner: changed from macports-tickets@… to singingwolfboy@…

In the future, please use WikiFormatting and the Preview button to check. Also please Cc the maintainer(s). I have fixed these for you.

comment:2 Changed 12 years ago by jmroot (Joshua Root)

Owner: changed from singingwolfboy@… to macports-tickets@…

-> nomaintainer

Is this still an issue with 3.0.12?

comment:3 Changed 12 years ago by neverpanic (Clemens Lang)

Resolution: worksforme
Status: newclosed

Works for me.

Note: See TracTickets for help on using tickets.