Opened 7 years ago

Closed 4 years ago

#4307 closed defect (fixed)

clipboard.set_with_data/set_with_owner is not introspectable

Reported by: godiard Owned by: erikos
Priority: Urgent Milestone: Unspecified
Component: Sugar Version: Unspecified
Severity: Unspecified Keywords: regression
Cc: manuq, godiard, garnacho, dsd Distribution/OS: Unspecified
Bug Status: Resolved

Description

This is the second part of ticket #3903

The upstream ticket is [1]

We use set_with_data in sugar:

[sugar-build sugar]$ grep -r set_with_data * --include=*.py
src/jarabe/journal/palettes.py: clipboard.set_with_data([('text/uri-list', 0, 0)],
src/jarabe/frame/clipboardicon.py: if not x_clipboard.set_with_data(targets,


and in activities:

[gonzalo@nautilus honey]$ grep -r set_with_data * --include=*.py
chat/mainline/chat/box.py: if not clipboard.set_with_data(targets,
record/mainline/record.py: gtk.Clipboard().set_with_data([('text/uri-list', 0, 0)], self._clipboard_get, self._clipboard_clear, tmp_path)
speak/mainline/chatbox.py: if not clipboard.set_with_data(targets,

I couldn't find uses of set_with_owner

[1] https://bugzilla.gnome.org/show_bug.cgi?id=656312

Attachments (4)

0001-get_mime_description-use-Gio-from-dynamic-bindings-S.patch (1.2 KB) - added by manuq 7 years ago.
Patch for the crash, was because we were mixing static and dynamic bindings, calling 'import gio' in the toolkit.
0001-ClipboardIcon-API-fixes-for-the-Gtk.Clipboard-set_wi.patch (2.3 KB) - added by manuq 7 years ago.
Patch with API fixes for the Gtk.Clipboard set_with_data get_func callback
paste3.log (59.3 KB) - added by manuq 7 years ago.
Log for the steps described in 12
0001-Clipboard-Menu-remove-progress-bar-part-of-4307.patch (2.5 KB) - added by erikos 7 years ago.
Clipboard-Menu-remove-progress-bar

Download all attachments as: .zip

Change History (35)

comment:1 Changed 7 years ago by erikos

  • Component changed from untriaged to sugar
  • Owner set to erikos

comment:3 in reply to: ↑ 2 Changed 7 years ago by manuq

Replying to erikos:

Building upstream patches:

gtk3 rpm: http://arm.koji.fedoraproject.org/koji/taskinfo?taskID=1298348

pygobject3 rpm: http://arm.koji.fedoraproject.org/koji/taskinfo?taskID=1298351

pygobject build failed :/

comment:4 Changed 7 years ago by garnacho

the gi/Makefile.am change in the upstream patch is completely bogus, there's now an updated patch in https://bugzilla.gnome.org/show_bug.cgi?id=656312

comment:6 Changed 7 years ago by erikos

Traceback when trying to 'keep' a clipboard entry.

#0  0x42ee84ac in setup_context (registry=<synthetic pointer>, module=<synthetic pointer>, lineno=<synthetic pointer>, filename=<synthetic pointer>, stack_level=1)
    at /usr/src/debug/Python-2.7.3/Python/_warnings.c:449
#1  do_warn (message=message@entry="g_object_set_property: assertion `G_IS_VALUE (value)' failed", category=category@entry=<type at remote 0xab194c4>, stack_level=stack_level@entry=1)
    at /usr/src/debug/Python-2.7.3/Python/_warnings.c:594
#2  0x42ee89a5 in PyErr_WarnEx (category=category@entry=<type at remote 0xab194c4>, text=text@entry=0xaa41498 "g_object_set_property: assertion `G_IS_VALUE (value)' failed", 
    stack_level=stack_level@entry=1) at /usr/src/debug/Python-2.7.3/Python/_warnings.c:720
#3  0xadfe3f13 in _log_func (log_domain=log_domain@entry=0xb70c5ee4 "GLib-GObject", log_level=log_level@entry=G_LOG_LEVEL_CRITICAL, message=message@entry=
    0xaa41498 "g_object_set_property: assertion `G_IS_VALUE (value)' failed", user_data=0xab194c4) at gobjectmodule.c:2353
#4  0xb6fb1d78 in g_logv (log_domain=log_domain@entry=0xb70c5ee4 "GLib-GObject", log_level=log_level@entry=G_LOG_LEVEL_CRITICAL, format=format@entry=
    0xb70203b6 "%s: assertion `%s' failed", args=args@entry=0xbffd2c3c "\276\216\f\267\341~\f\267d\325\v\267") at gmessages.c:945
#5  0xb6fb1f13 in g_log (log_domain=log_domain@entry=0xb70c5ee4 "GLib-GObject", log_level=log_level@entry=G_LOG_LEVEL_CRITICAL, format=format@entry=
    0xb70203b6 "%s: assertion `%s' failed") at gmessages.c:1003
#6  0xb6fb1f5d in g_return_if_fail_warning (log_domain=log_domain@entry=0xb70c5ee4 "GLib-GObject", pretty_function=pretty_function@entry=0xb70c8ebe "g_object_set_property", expression=
    0xb70c7ee1 "G_IS_VALUE (value)") at gmessages.c:1012
#7  0xb70a1baf in g_object_set_property (object=object@entry=0xa9f3228, property_name=0xa7d1713 "buddy", value=value@entry=0xbffd2d0c) at gobject.c:2132
#8  0xb694c4bd in apply_cell_attributes (renderer=0xa9f3228, info=0xa9e6a20, data=data@entry=0xbffd2d8c) at gtkcellarea.c:1277
#9  0xb6f9a222 in g_hash_table_foreach (hash_table=0xa9ee018, func=func@entry=0xb694c390 <apply_cell_attributes>, user_data=user_data@entry=0xbffd2d8c) at ghash.c:1524
#10 0xb694c345 in gtk_cell_area_real_apply_attributes (area=0xaa05918, tree_model=0xac10460, iter=0xa9e7ea0, is_expander=0, is_expanded=0) at gtkcellarea.c:1313
#11 0xb6951e5b in gtk_cell_area_box_apply_attributes (area=0xaa05918, tree_model=tree_model@entry=0xac10460, iter=iter@entry=0xa9e7ea0, is_expander=is_expander@entry=0, is_expanded=0)
    at gtkcellareabox.c:1317
#12 0xb6a3262b in _gtk_marshal_VOID__OBJECT_BOXED_BOOLEAN_BOOLEANv (closure=0xa4cc390, return_value=0x0, instance=0xaa05918, 
    args=0xbffd310c "`\004\301\n\340", <incomplete sequence \375\277>, marshal_data=0xb6951e10, n_params=4, param_types=0xa4cc420) at gtkmarshalers.c:4960
#13 0xb7098857 in g_type_class_meta_marshalv (closure=closure@entry=0xa4cc390, return_value=return_value@entry=0x0, instance=instance@entry=0xaa05918, 
    args=args@entry=0xbffd310c "`\004\301\n\340", <incomplete sequence \375\277>, marshal_data=marshal_data@entry=0x5c, n_params=n_params@entry=4, param_types=param_types@entry=
    0xa4cc420) at gclosure.c:997
#14 0xb709a1d1 in _g_closure_invoke_va (closure=closure@entry=0xa4cc390, return_value=return_value@entry=0x0, instance=instance@entry=0xaa05918, 
    args=args@entry=0xbffd310c "`\004\301\n\340", <incomplete sequence \375\277>, n_params=n_params@entry=4, param_types=0xa4cc420) at gclosure.c:840
#15 0xb70b34f7 in g_signal_emit_valist (instance=instance@entry=0xaa05918, signal_id=signal_id@entry=358, detail=detail@entry=0, 
    var_args=var_args@entry=0xbffd310c "`\004\301\n\340", <incomplete sequence \375\277>) at gsignal.c:3211
#16 0xb70b3eb3 in g_signal_emit (instance=instance@entry=0xaa05918, signal_id=358, detail=detail@entry=0) at gsignal.c:3356
#17 0xb694e06e in gtk_cell_area_apply_attributes (area=0xaa05918, tree_model=tree_model@entry=0xac10460, iter=iter@entry=0xbffd32e0, is_expander=is_expander@entry=0, 
    is_expanded=is_expanded@entry=0) at gtkcellarea.c:2362
#18 0xb6b6b2c6 in gtk_tree_view_column_cell_set_cell_data (tree_column=tree_column@entry=0xaa053e0, tree_model=0xac10460, iter=iter@entry=0xbffd32e0, is_expander=0, is_expanded=0)
    at gtktreeviewcolumn.c:2872
#19 0xb6b4ffad in validate_row (tree_view=tree_view@entry=0xa4d22f8, tree=0xaa50820, node=0xac0ab00, iter=iter@entry=0xbffd32e0, path=path@entry=0xa9f4460) at gtktreeview.c:6104
#20 0xb6b55b7d in validate_visible_area (tree_view=0xa4d22f8) at gtktreeview.c:6320
#21 do_presize_handler (tree_view=0xa4d22f8) at gtktreeview.c:6783
#22 0xb6b55ccc in presize_handler_callback (data=0xa4d22f8) at gtktreeview.c:6806
#23 0xb682873e in gdk_threads_dispatch (data=data@entry=0xac11090) at gdk.c:788
#24 0xb6fa75e0 in g_idle_dispatch (source=source@entry=0xac42000, callback=0xb6828700 <gdk_threads_dispatch>, user_data=0xac11090) at gmain.c:4806
#25 0xb6faa393 in g_main_dispatch (context=0x9e49ab8, context@entry=0xa43a8e0) at gmain.c:2715
#26 g_main_context_dispatch (context=context@entry=0x9e49ab8) at gmain.c:3219
#27 0xb6faa730 in g_main_context_iterate (context=0x9e49ab8, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3290
#28 0xb6faab8b in g_main_loop_run (loop=loop@entry=0xa4446f8) at gmain.c:3484
#29 0xb6a2ad65 in gtk_main () at gtkmain.c:1160
#30 0x42fe061a in ffi_call_SYSV () at ../src/x86/sysv.S:64
#31 0x42fe0381 in ffi_call (cif=cif@entry=0xbffd3568, fn=fn@entry=0xb6a2acc0 <gtk_main>, rvalue=rvalue@entry=0xbffd3560, avalue=avalue@entry=0xbffd3500) at ../src/x86/ffi.c:303
#32 0xb727eed4 in g_callable_info_invoke (info=info@entry=0xa4f34c0, function=0xb6a2acc0, in_args=in_args@entry=0x0, n_in_args=n_in_args@entry=0, out_args=out_args@entry=0x0, 
    n_out_args=n_out_args@entry=0, return_value=return_value@entry=0xbffd36ac, is_method=is_method@entry=0, throws=0, error=error@entry=0xbffd3684) at girepository/gicallableinfo.c:680
#33 0xb72804a4 in g_function_info_invoke (info=info@entry=0xa4f34c0, in_args=0x0, n_in_args=0, out_args=0x0, n_out_args=0, return_value=return_value@entry=0xbffd36ac, 
---Type <return> to continue, or q <return> to quit---
    error=error@entry=0xbffd3684) at girepository/gifunctioninfo.c:274
#34 0xb72bdeda in _invoke_callable (function_ptr=0, callable_info=0xa4f34c0, cache=0xa4ffe30, state=0xbffd3688) at pygi-invoke.c:64
#35 pygi_callable_info_invoke (info=0xa4f34c0, py_args=py_args@entry=(), kwargs=kwargs@entry={}, cache=0xa4ffe30, function_ptr=function_ptr@entry=0, user_data=user_data@entry=0x0)
    at pygi-invoke.c:656
#36 0xb72bec00 in _wrap_g_callable_info_invoke (self=0xa3ffaec, py_args=(), kwargs={}) at pygi-invoke.c:679
#37 0x42eaa079 in PyCFunction_Call (func=func@entry=<built-in method invoke of gi.FunctionInfo object at remote 0xa3ffaec>, arg=arg@entry=(), kw=kw@entry={})
    at /usr/src/debug/Python-2.7.3/Objects/methodobject.c:85
#38 0x42f08497 in ext_do_call (nk=-1217093588, na=0, flags=<optimized out>, pp_stack=0xbffd3884, func=<built-in method invoke of gi.FunctionInfo object at remote 0xa3ffaec>)
    at /usr/src/debug/Python-2.7.3/Python/ceval.c:4408
#39 PyEval_EvalFrameEx (f=f@entry=Frame 0xa504e54, for file /home/erikos/sugar-build/install/lib/python2.7/site-packages/gi/types.py, line 47, in function (args=(), kwargs={}), 
    throwflag=throwflag@entry=0) at /usr/src/debug/Python-2.7.3/Python/ceval.c:2779
#40 0x42f0a049 in PyEval_EvalCodeEx (co=co@entry=0xb72f4da0, globals=globals@entry=
    {'StructMeta': <type at remote 0x9dc8e44>, 'absolute_import': <_Feature(mandatory=(2, 7, 0, 'alpha', 0), optional=(2, 5, 0, 'alpha', 1), compiler_flag=16384) at remote 0xb73c6c0c>, 'register_interface_info': <built-in function register_interface_info>, 'ObjectInfo': <type at remote 0xb72cd560>, 'Function': <function at remote 0xb72fdca4>, '__package__': 'gi', 'MetaClassHelper': <type at remote 0x9dc83c4>, '_gobject': <module at remote 0xb739bee4>, '__doc__': None, 'hook_up_vfunc_implementation': <built-in function hook_up_vfunc_implementation>, '__warningregistry__': {("g_object_set_property: assertion `G_IS_VALUE (value)' failed", <type at remote 0x9db14e4>, 47): True, ("g_value_unset: assertion `G_IS_VALUE (value)' failed", <type at remote 0x9db14e4>, 47): True}, '__builtins__': {'bytearray': <type at remote 0x42fa37a0>, 'IndexError': <type at remote 0x42fa75a0>, 'all': <built-in function all>, 'help': <_Helper at remote 0xb76cee4c>, 'vars': <built-in function vars>, 'SyntaxError': <type at remote 0x42fa722...(truncated), locals=locals@entry=0x0, args=0x9f922d0, 
    argcount=argcount@entry=0, kws=0x9f922d0, kwcount=0, defs=0x0, defcount=defcount@entry=0, closure=(<cell at remote 0xa3f78e4>,)) at /usr/src/debug/Python-2.7.3/Python/ceval.c:3330
#41 0x42f0830d in fast_function (nk=<optimized out>, na=0, n=0, pp_stack=0xbffd3a64, func=<function at remote 0xa400224>) at /usr/src/debug/Python-2.7.3/Python/ceval.c:4194
#42 call_function (oparg=<optimized out>, pp_stack=0xbffd3a64) at /usr/src/debug/Python-2.7.3/Python/ceval.c:4119
#43 PyEval_EvalFrameEx (f=
    Frame 0x9f92164, for file /home/erikos/sugar-build/install/bin/sugar-session, line 336, in main (env=<module at remote 0xb64f11f4>, data_dir='/home/erikos/.sugar/default/data', logger=<module at remote 0xb64f126c>, config=<module at remote 0xb64f165c>, sound=<module at remote 0xb64f1ac4>, intro=<module at remote 0xb64f1b24>, IntroWindow=<GObjectMeta(__module__='jarabe.intro.window', _create_profile_cb=<function at remote 0xb62a087c>, __init__=<function at remote 0xb62a080c>, __gtype_name__='SugarIntroWindow', _done_cb=<function at remote 0xb62a0844>, __gtype__=<gobject.GType at remote 0xb777bb90>, _IntroWindow__key_press_cb=<function at remote 0xb62a08b4>, __doc__=None) at remote 0x9ff353c>, client=<Client at remote 0xb634cf54>, timezone='Europe/Berlin', icons_path='/home/erikos/sugar-build/install/share/sugar/data/icons'), throwflag=throwflag@entry=0) at /usr/src/debug/Python-2.7.3/Python/ceval.c:2740
#44 0x42f087ec in fast_function (nk=163999824, na=0, n=0, pp_stack=0xbffd3bd4, func=<function at remote 0xb64ef844>) at /usr/src/debug/Python-2.7.3/Python/ceval.c:4184
#45 call_function (oparg=<optimized out>, pp_stack=0xbffd3bd4) at /usr/src/debug/Python-2.7.3/Python/ceval.c:4119
#46 PyEval_EvalFrameEx (f=f@entry=Frame 0x9c83b1c, for file /home/erikos/sugar-build/install/bin/sugar-session, line 352, in <module> (), throwflag=throwflag@entry=0)
    at /usr/src/debug/Python-2.7.3/Python/ceval.c:2740
#47 0x42f0a049 in PyEval_EvalCodeEx (co=co@entry=0xb7675578, globals=globals@entry=
    {'GLib': <DynamicGLibModule(_overrides_module=<module at remote 0xb72dcee4>, _namespace='GLib', _introspection_module=<IntrospectionModule(__name__='gi.repository.GLib', _namespace='GLib', Variant=<StructMeta(new_fixed_array=<classmethod at remote 0xb730d5e4>, new_array=<classmethod at remote 0xb730d494>, __module__='gi.repository.GLib', new_int64=<classmethod at remote 0xb730d6d4>, hash=<function at remote 0xb7307d4c>, get_uint32=<function at remote 0xb7307ca4>, new_objv=<classmethod at remote 0xb730d764>, get_uint16=<function at remote 0xb7307c6c>, get_byte=<function at remote 0xb7307844>, compare=<function at remote 0xb7307684>, get_int16=<function at remote 0xb7307a04>, new_handle=<classmethod at remote 0xb730d644>, get_int32=<function at remote 0xb7307a3c>, is_normal_form=<function at remote 0xb7307df4>, get_type=<function at remote 0xb7307bfc>, check_format_string=<function at remote 0xb7307614>, get_handle=<function at remote 0xb73079cc>, __dict__=<getset_descriptor at remote 0xb730c02c>, dup_objv=<fun...(truncated), locals=locals@entry=
    {'GLib': <DynamicGLibModule(_overrides_module=<module at remote 0xb72dcee4>, _namespace='GLib', _introspection_module=<IntrospectionModule(__name__='gi.repository.GLib', _namespace='GLib', Variant=<StructMeta(new_fixed_array=<classmethod at remote 0xb730d5e4>, new_array=<classmethod at remote 0xb730d494>, __module__='gi.repository.GLib', new_int64=<classmethod at remote 0xb730d6d4>, hash=<function at remote 0xb7307d4c>, get_uint32=<function at remote 0xb7307ca4>, new_objv=<classmethod at remote 0xb730d764>, get_uint16=<function at remote 0xb7307c6c>, get_byte=<function at remote 0xb7307844>, compare=<function at remote 0xb7307684>, get_int16=<function at remote 0xb7307a04>, new_handle=<classmethod at remote 0xb730d644>, get_int32=<function at remote 0xb7307a3c>, is_normal_form=<function at remote 0xb7307df4>, get_type=<function at remote 0xb7307bfc>, check_format_string=<function at remote 0xb7307614>, get_handle=<function at remote 0xb73079cc>, __dict__=<getset_descriptor at remote 0xb730c02c>, dup_objv=<fun...(truncated), args=args@entry=0x0, argcount=argcount@entry=0, kws=kws@entry=
    0x0, kwcount=kwcount@entry=0, defs=defs@entry=0x0, defcount=defcount@entry=0, closure=closure@entry=0x0) at /usr/src/debug/Python-2.7.3/Python/ceval.c:3330
#48 0x42f0a1c4 in PyEval_EvalCode (co=co@entry=0xb7675578, globals=globals@entry=
    {'GLib': <DynamicGLibModule(_overrides_module=<module at remote 0xb72dcee4>, _namespace='GLib', _introspection_module=<IntrospectionModule(__name__='gi.repository.GLib', _namespace='GLib', Variant=<StructMeta(new_fixed_array=<classmethod at remote 0xb730d5e4>, new_array=<classmethod at remote 0xb730d494>, __module__='gi.repository.GLib', new_int64=<classmethod at remote 0xb730d6d4>, hash=<function at remote 0xb7307d4c>, get_uint32=<function at remote 0xb7307ca4>, new_objv=<classmethod at remote 0xb730d764>, get_uint16=<function at remote 0xb7307c6c>, get_byte=<function at remote 0xb7307844>, compare=<function at remote 0xb7307684>, get_int16=<function at remote 0xb7307a04>, new_handle=<classmethod at remote 0xb730d644>, get_in---Type <return> to continue, or q <return> to quit---

comment:7 Changed 7 years ago by erikos

Steps to reproduce the above crash:

  • open Sugar
  • open Log and copy text to the clipboard
  • start another activity or open the Journal

---> Sugar crashes

So the crash we are getting from above has to do with the buddy/progress column in the Journal. If I comment that in listview.py I do not get the crash. More to investigate.

Changed 7 years ago by manuq

Patch for the crash, was because we were mixing static and dynamic bindings, calling 'import gio' in the toolkit.

comment:8 Changed 7 years ago by manuq

The above patch was pushed as 1dd2aec6 .

comment:9 follow-up: Changed 7 years ago by manuq

Now with the rpms installed and the crash fixed, on Terminal paste from the toolbar or via Ctrl-Shift-V doesn't paste. We have:

Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/jarabe/frame/clipboardicon.py", line 102, in _clipboard_data_get_cb
    if not selection.target in [target[0] for target in targets]:
AttributeError: 'SelectionData' object has no attribute 'target'

comment:10 in reply to: ↑ 9 ; follow-up: Changed 7 years ago by godiard

Replying to manuq:

Now with the rpms installed and the crash fixed, on Terminal paste from the toolbar or via Ctrl-Shift-V doesn't paste. We have:

Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/jarabe/frame/clipboardicon.py", line 102, in _clipboard_data_get_cb
    if not selection.target in [target[0] for target in targets]:
AttributeError: 'SelectionData' object has no attribute 'target'

Manuq, Check if target was not renamed to something like get_target() or similar.

I found other similar changes in the port from gtk2 to gtk3

Changed 7 years ago by manuq

Patch with API fixes for the Gtk.Clipboard set_with_data get_func callback

comment:11 in reply to: ↑ 10 Changed 7 years ago by manuq

Replying to godiard:

Manuq, Check if target was not renamed to something like get_target() or similar.

Yes, exactly Gonzalo. Some API fixes were needed, done in the recently attached patch. Now I can copy/paste in Terminal. We still have some big issues, I will report back my findings.

comment:12 Changed 7 years ago by manuq

This are the issues I see, with the attached patch applied. Steps to reproduce:

  • open Terminal
  • copy text to the clipboard (from the toolbar button or Ctrl-Shift-C)

-> pulsing icon appears with the palette opened (tracked on #4323)

  • click the activity canvas to get back focus to it
  • paste text (from the toolbar button or Ctrl-Shift-V)
  • copy text again

-> pulsing icon appears but this time looks correct, without the palette

  • now try to open the sugar frame with the mouse

-> UI doesn't respond

  • do the touch gesture to open the frame, try to touch the frame buttons

-> UI doesn't respond

Changed 7 years ago by manuq

Log for the steps described in 12

comment:13 Changed 7 years ago by manuq

Seems like a palette issue. In the log there are many:

1355866320.437424 WARNING root: Trying to position palette with invoker that's not realized.
1355866320.437424 WARNING root: Trying to position palette with invoker that's not realized.
1355866320.439290 WARNING root: Trying to position palette with invoker that's not realized.

And also:

1355866492.541456 DEBUG root: _update_open_submenu: ['org.laptop.AbiWordActivity', 'org.vpri.EtoysActivity', 'org.laptop.sugar.ReadActivity']

(sugar-session:518): Gdk-CRITICAL **: gdk_device_get_position: assertion `GDK_IS_DEVICE (device)' failed

(sugar-session:518): Gtk-CRITICAL **: gtk_window_move: assertion `GTK_IS_WINDOW (window)' failed

(sugar-session:518): Gtk-CRITICAL **: gtk_window_resize: assertion `GTK_IS_WINDOW (window)' failed

(sugar-session:518): Gdk-CRITICAL **: gdk_device_grab: assertion `GDK_IS_WINDOW (window)' failed

(sugar-session:518): Gdk-CRITICAL **: gdk_device_grab: assertion `GDK_IS_WINDOW (window)' failed
1355866492.741588 DEBUG root: ClipboardIcon._put_in_clipboard

(sugar-session:518): Gtk-CRITICAL **: _gtk_widget_captured_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed

(sugar-session:518): Gtk-CRITICAL **: _gtk_widget_captured_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed
1355866492.774330 DEBUG root: owner_change_cb

(sugar-session:518): Gtk-CRITICAL **: _gtk_widget_captured_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed

(sugar-session:518): Gtk-CRITICAL **: _gtk_widget_captured_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed

comment:14 follow-ups: Changed 7 years ago by erikos

Thanks for the patch Manuel, we have three issues actually left:

  • when adding the first item to the clipboard the Palette is shown
  • when adding the second item the UI turns unusable
  • there is an assertion error when we do set_content for the ClipboardMenu

The latter is because we do use a ClipboardMenu which is of type GtkMenu and try to use set_content which is only available for our custom Palettes (we can not mix a GTKMenu with other widgets). Since our custom Palette does not support submenus which the ClipboardMenu has we can not switch to our custom Palette neither. Maybe it is ok to remove the progress show support for now. It won't be needed for small clippings anyhow which are 99% of the cases I bet.

For the other two cases I have no good explanation yet, will investigate more.

comment:15 in reply to: ↑ 14 Changed 7 years ago by erikos

Replying to erikos:

Thanks for the patch Manuel, we have three issues actually left:

  • when adding the first item to the clipboard the Palette is shown
  • when adding the second item the UI turns unusable

This is as well an issue triggered by the Palette. When you try to add a clipping the second time you see shortly some flashing up close to the clipboard tray. And as the GTKMenu based Palette vanishes we are left in that inconsistent state. The GtkMenu based Palette does a grab of events and we seem to be stuck in that state after that. That is why we can not access the Frame with the mouse or do anything else that is mouse related.

comment:16 Changed 7 years ago by erikos

In clipboardicon.py in the contructor for the ClipboardIcon(RadioToolButton) we set "self.props.active = False" and that triggers a click event for the Palette, that is why we display the Palette when the first clipboard item gets created.

comment:17 in reply to: ↑ 14 Changed 7 years ago by manuq

Replying to erikos:

Thanks for the patch Manuel, we have three issues actually left:

  • when adding the first item to the clipboard the Palette is shown

Attached two patches at #4323 that hopefully fix this one.

comment:18 Changed 7 years ago by erikos

Ordering of the clipboard items:

  • attach clipping 1

[1]

  • attach clipping 2

1

[2]

  • attach clipping 3

1

2

[3]

  • click on clipping 1

[1]

2

3

comment:20 follow-up: Changed 7 years ago by erikos

One issue that is left to handle is the following:

  • add two clippings
  • reveal the frame
  • hover over the current active one

---> Palette is revealed

  • now move the mouse over the other one and click on it in a quick way

---> the Palette of the first item is still up, the active state of the second one is not changed, that Palette is popped up after a while (mouse over effect)

The gtkmenu based Palette does have the grab, and this blocks here. We might be able to use something like the group popdown, but that did not work in my quick check.

comment:21 follow-up: Changed 7 years ago by godiard

A little piece failing:

TestCase:

Go to the journal

Select a image

Open the palette

Select: Copy to -> Clipboard

The following error appear in shell.log

1356031402.064596 DEBUG root: get_file asked for entry with id dbus.String(u'4f8be51a-4ebd-495e-9937-c49a0d805b3b', variant_level=1)
1356031402.077829 DEBUG root: TempFilePath created dbus.String(u'/home/olpc/.sugar/default/data/4f8be51a-4ebd-495e-9937-c49a0d805b3b_eO34Rj.png')
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/jarabe/journal/palettes.py", line 316, in __copy_to_clipboard_cb
    self.__clipboard_clear_func_cb)
  File "/usr/lib/python2.7/site-packages/gi/types.py", line 47, in function
    return info.invoke(*args, **kwargs)
TypeError: set_with_data() takes exactly 5 arguments (4 given)

comment:22 in reply to: ↑ 21 Changed 7 years ago by erikos

Replying to godiard:

A little piece failing:

TestCase:

Go to the journal

Select a image

Open the palette

Select: Copy to -> Clipboard

The following error appear in shell.log

1356031402.064596 DEBUG root: get_file asked for entry with id dbus.String(u'4f8be51a-4ebd-495e-9937-c49a0d805b3b', variant_level=1)
1356031402.077829 DEBUG root: TempFilePath created dbus.String(u'/home/olpc/.sugar/default/data/4f8be51a-4ebd-495e-9937-c49a0d805b3b_eO34Rj.png')
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/jarabe/journal/palettes.py", line 316, in __copy_to_clipboard_cb
    self.__clipboard_clear_func_cb)
  File "/usr/lib/python2.7/site-packages/gi/types.py", line 47, in function
    return info.invoke(*args, **kwargs)
TypeError: set_with_data() takes exactly 5 arguments (4 given)

Thanks Gonzalo, fixed with: http://git.sugarlabs.org/sugar/mainline/commit/c62c8dab72eee975593765d8cabb799da92eb5c7

Changed 7 years ago by erikos

Clipboard-Menu-remove-progress-bar

comment:23 Changed 7 years ago by erikos

Patch attached to handle the last part of http://bugs.sugarlabs.org/ticket/4307#comment:14

comment:25 in reply to: ↑ 20 Changed 7 years ago by dsd

Replying to erikos:

One issue that is left to handle is the following:

  • add two clippings
  • reveal the frame
  • hover over the current active one

---> Palette is revealed

  • now move the mouse over the other one and click on it in a quick way

---> the Palette of the first item is still up, the active state of the second one is not changed, that Palette is popped up after a while (mouse over effect)

The gtkmenu based Palette does have the grab, and this blocks here. We might be able to use something like the group popdown, but that did not work in my quick check.

This is the one remaining issue on this bug - the others are fixed and the fixes are shipped.

It seems tricky. When the mouse moves to the second icon and the click is made, the grab from the first menu is still active. We do hit _PaletteMenuWidget._button_release_event_cb() but the click does not go any further, regardless of what that signal handler returns.

This might be the same case that can be seen in any GTK+ app under regular GNOME - open a menu (e.g. right click somewhere, or use the menu bar), then move the mouse over an unrelated toolbar icon, and left click. Your click causes the menu to close, but doesn't actually cause a click on the toolbar item.

One approach to solving this (without improving GtkMenu behaviour) might be to extend _PaletteMenuWidget._button_release_event_cb() to realise that the mouse cursor is outside of the invoker and all submenus, and therefore a click should close the current palette. Then it would also have to feed the event back into GTK+ somehow so that the event gets reprocessed now that the earlier GtkMenu grab has been destroyed.

comment:26 Changed 6 years ago by dnarvaez

  • Milestone changed from 0.98 to Unspecified

comment:27 Changed 6 years ago by dnarvaez

  • Priority changed from Urgent to Normal

comment:28 Changed 5 years ago by godiard

  • Priority changed from Normal to Urgent

The api implemented upstream is different, and this will impact us on the F20 images.
See upstream bug https://bugzilla.gnome.org/show_bug.cgi?id=656312

Increasing priority to Urgent.

comment:29 Changed 5 years ago by godiard

A patch didn't landed on gtk upstream.

I did test locally, and added a comment on upstream bug https://bugzilla.gnome.org/show_bug.cgi?id=656312#c36

comment:30 Changed 5 years ago by tch

  • Bug Status changed from Unconfirmed to Resolved

I have landed a workaround in sugar-toolkit-gtk3 present in 0.104.0, providing custom bindings to set_with_data.

https://github.com/sugarlabs/sugar/commit/b9707272f752a0fda35b3898761ab037fd5f95ac

I will close this ticket.

comment:31 Changed 4 years ago by tch

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.