Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#4414 closed defect (fixed)

Object Chooser of an activity gets over other activities

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

Attachments (2)

0001-Fix-Object-Chooser-windows-not-attached-to-activity-.patch (1.4 KB) - added by manuq 11 years ago.
Patch
0001-ObjectChooser-make-ObjectChooser-transient-for-the-p.patch (1.7 KB) - added by erikos 11 years ago.
ObjectChooser: make ObjectChooser transient for the parent window

Download all attachments as: .zip

Change History (9)

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.

comment:2 Changed 11 years ago by manuq

  • Cc erikos added
  • Keywords r? added

comment:3 follow-up: Changed 11 years ago by Rach4d

  • Severity changed from Unspecified to Minor

Changed 11 years ago by erikos

ObjectChooser: make ObjectChooser transient for the parent window

comment:4 Changed 11 years ago by erikos

  • Keywords r+ added; r? removed

The patch is good, but the description was not fully correct, imho. I rewrote it and attached a new patch.

Please push it to master and cherry-pick to sucrose-0.98 if you agree.

comment:5 in reply to: ↑ 3 Changed 11 years ago by erikos

  • Bug Status changed from Unconfirmed to Assigned
  • Priority changed from Unspecified by Maintainer to High
  • Severity changed from Minor to Major
  • Version changed from Unspecified to 0.98.x

Replying to Rach4d:

Helping with keeping the bug database up to date is appreciated but please do not change severity unless you know what you are doing.

comment:6 Changed 11 years ago by manuq

  • Keywords olpc-test-pending added
  • Resolution set to fixed
  • Status changed from new to closed

Thanks for the input, your description is the right one. Pushed and cherry-picked as f6ba32ce .

comment:7 Changed 11 years ago by dnarvaez

  • Milestone 1.0 deleted

Milestone 1.0 deleted

Note: See TracTickets for help on using tickets.