Unity.ActivationResponse does not work properly for python scopes

Reported by Mark Tully on 2011-11-22
26
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Unity
Undecided
Unassigned
libunity
Low
Unassigned
gobject-introspection (Ubuntu)
Undecided
Unassigned
libunity (Ubuntu)
Undecided
Unassigned
Precise
Undecided
Unassigned
Quantal
Undecided
Unassigned
vala (Ubuntu)
Undecided
Unassigned

Bug Description

[Test Case]

1) Run `python -c "from gi.repository import Unity; print Unity.ActivationResponse.new(Unity.HandledType.SHOW_DASH, '')"`
2) The command shouldn't cause a segmentation fault

[Regression Potential]
Besides gir not working, nothing else comes to mind.

====Original Report====

When attempting to use a custom activation of a lens result in a scope written in python, Unity.ActivationResponse does not work as advertised at https://wiki.ubuntu.com/Unity/Lenses#Handling_Activation, which suggests that the line Unity.ActivationResponse.new(Unity.HandledType.SHOW_DASH) should pass a response to keep the dash open. Instead, an error in generated suggesting that a second argument needs to be passed to the function. On adding a second argument, the error further suggests that it needs to be a string. On using a string, the following error is generated:

TypeError: can't convert return value to desired type
 ../pathtolens/lens.py:100: Warning: g_object_get_qdata: assertion G_IS_OBJECT (object)' failed GObject.MainLoop().run()
 ../pathtolens/lens.py:100: Warning: g_object_set_qdata_full: assertionG_IS_OBJECT (object)' failed GObject.MainLoop().run()
 ../pathtolens/lens.py:100: Warning: g_object_unref: assertion `G_IS_OBJECT (object)' failed GObject.MainLoop().run()

Similar errors are generated when using other "Unity.Handletype"s (although using NOT_HANDLED only produces the TypeError part, not any of the warnings.)

This issue is also described at http://askubuntu.com/questions/78826/cant-get-activate-uri-signal-working-when-making-a-lens

Related branches

Bilal Akhtar (bilalakhtar) wrote :

Looks like a proper and confirmed bug, but is GObject Introspection to blame for this one?

Changed in unity:
status: New → Incomplete
Changed in unity (Ubuntu):
status: New → Incomplete
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gobject-introspection (Ubuntu):
status: New → Confirmed
Michal Hruby (mhr3) on 2012-05-30
Changed in libunity:
status: New → Confirmed
importance: Undecided → Medium
importance: Medium → Low
Michal Hruby (mhr3) wrote :

As the askubuntu question suggests: "ret = Unity.ActivationResponse(handled=Unity.HandledType.HIDE_DASH,goto_uri='')" works as a workaround.

Florian Diesch (diesch) wrote :

The attachement is a replacement for /usr/share/pyshared/gi/overrides/Unity.py that fixes this and in addition lets you use the more Pythonic "ret = Unity.ActivationResponse(Unity.HandledType.HIDE_DASH, uri)" (without named args)

The 'uri' args is optional in both versions and defaults to ''

Michal Hruby (mhr3) wrote :

Attaching a patch which if applied to libunity generated Unity-5.0.gir file will produce a correct typelib and fix the crash.

description: updated

The attachment "libunity-5-12-gir.patch" of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-reviewers team please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

tags: added: patch
Changed in libunity:
status: Confirmed → Fix Committed
description: updated
Changed in libunity (Ubuntu):
status: New → Fix Committed
Didier Roche (didrocks) on 2012-06-20
no longer affects: unity (Ubuntu)
Changed in gobject-introspection (Ubuntu Precise):
status: New → Invalid
no longer affects: gobject-introspection (Ubuntu Precise)
Changed in unity:
status: Incomplete → Fix Released
Changed in libunity (Ubuntu):
status: Fix Committed → Invalid
Changed in libunity (Ubuntu Precise):
status: New → Triaged
no longer affects: vala (Ubuntu Precise)
Changed in vala (Ubuntu):
status: New → Triaged
Didier Roche (didrocks) wrote :

we have the newer vala in quantal which contains the right fix (but too dangerous for precise)

Changed in gobject-introspection (Ubuntu):
status: Confirmed → Fix Released
Changed in vala (Ubuntu):
status: Triaged → Fix Released
Changed in libunity (Ubuntu):
status: Invalid → Triaged
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package libunity - 5.12.0-0ubuntu2

---------------
libunity (5.12.0-0ubuntu2) quantal; urgency=low

  * debian/patches/fix_893688.patch:
    - fix the Unity-5.0.gir file to produce a correct typelib (LP: #893688)
  * debian/rules:
    - added the quilt patching method to dh rules
  * debian/control:
    - added quilt dependency
    - direct Vcs-Bzr to the right canonical branch (lp:ubuntu/libunity)
 -- Didier Roche <email address hidden> Mon, 25 Jun 2012 12:27:30 +0200

Changed in libunity (Ubuntu):
status: Triaged → Fix Released
Changed in libunity (Ubuntu Precise):
status: Triaged → Fix Committed
status: Fix Committed → Fix Released

Hello Mark, or anyone else affected,

Accepted libunity into precise-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/libunity/5.12.0-0ubuntu1.1 in a few hours and then in the -proposed repository. Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you please change the bug tag from verification-needed to verification-done. If it does not, change the tag to verification-failed. In either case details of your testing will help us make a better decision. Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in libunity (Ubuntu Precise):
status: Fix Released → In Progress
status: In Progress → Fix Committed
tags: added: verification-needed
Sebastien Bacher (seb128) wrote :

verified, the update fixes the issue

tags: added: verification-done
removed: verification-needed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package libunity - 5.12.0-0ubuntu1.1

---------------
libunity (5.12.0-0ubuntu1.1) precise-proposed; urgency=low

  * debian/patches/fix_893688.patch:
    - fix the Unity-5.0.gir file to produce a correct typelib (LP: #893688)
  * debian/rules:
    - added the quilt patching method to dh rules
  * debian/control:
    - added quilt dependency
    - direct Vcs-Bzr to the right branch
 -- Lukasz 'sil2100' Zemczak <email address hidden> Mon, 25 Jun 2012 11:02:07 +0200

Changed in libunity (Ubuntu Precise):
status: Fix Committed → Fix Released
Michal Hruby (mhr3) on 2012-10-03
Changed in libunity:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers