Opened 11 years ago

Last modified 11 years ago

#4414 closed defect

Object Chooser of an activity gets over other activities — at Version 1

Reported by: manuq Owned by: manuq
Priority: High Milestone:
Component: Sugar Version: 0.98.x
Severity: Major Keywords: r+, olpc-test-pending
Cc: erikos Distribution/OS: Unspecified
Bug Status: Assigned

Description (last modified by manuq)

TestCase

  • open imageviewer from scratch
  • click the + button in the center of the canvas
  • Switch to other activities

The Object Chooser should be tied to the activity that opens it, as a dialog window.

This traceback appears in the log:

Traceback (most recent call last):
  File "/home/manuq/sugar-build/install/lib/python2.7/site-packages/jarabe/journal/objectchooser.py", line 103, 
    self.set_transient_for(parent)
  File "/usr/lib64/python2.7/site-packages/gi/types.py", line 47, in function
    return info.invoke(*args, **kwargs)
TypeError: argument parent: Expected Gtk.Window, but got gi.repository.GdkX11.X11Window

Change History (2)

comment:1 Changed 11 years ago by manuq

  • Description modified (diff)
  • Summary changed from TypeError opening the object-chooser to Object Chooser of an activity gets over other activities

The consequence of set_transient_for() failing with a TypeError is that the Object Chooser of an activity is displayed over other activities and also over the Journal.

It fails because the Gtk.Window is passed from toolkit to the shell through DBUS as an integer, the XID of the X11Window (GdkWindow). It is sent in toolkit's ObjectChooser and catched in shell's JournalActivityDBusService . So at the other side we have a GdkWindow.

So I've found that calling the method with the same name in the Gdk.Window fixes the issue. There is no error in the log, and the Object Chooser acts as a dialog, attached to the activity Window.
http://developer.gnome.org/gdk/stable/gdk-Windows.html#gdk-window-set-transient-for

Patch attached.

Note: See TracTickets for help on using tickets.