Opened 9 years ago

Closed 6 years ago

#2291 closed defect (fixed)

XO-1 On 0.90-precursor build, Object Chooser can not open object entry

Reported by: mikus Owned by: alsroot
Priority: Unspecified by Maintainer Milestone: Unspecified
Component: Sugar Version: 0.90.x
Severity: Blocker Keywords: olpc-0.90
Cc: bernie, tonyforster Distribution/OS: Fedora
Bug Status: New

Description

XO-1 build os1 (F14) - sugar-0.89.8
Launched ImageViewer-14 from Home View. It opened Object Chooser. Clicked on icon for external USB stick - was shown entry of .JPG file on that stick. Clicked on that entry (in Object Chooser). Nothing happened. Took system dump (and saved Activity's output).

Had same "failure to open" when from ImageViewer clicking on an entry (via Object Chooser) of an object in Journal. Had same "failure to open" when from Jukebox-19 clicking on an entry (via Object Chooser) of a file on an USB stick.

When I did not use Object Chooser, but went to Journal View, and from there clicked on an entry for a .PNG file present in Journal -- ImageViewer was launched, and displayed that image.


Note: This was an experimental XO-1 F14 build. I could not determine whether Object Chooser had been notified of my click (and failed to act properly), or whether Object Chooser failed to receive the notification (of my click) that it expected.

Attachments (5)

logs.CSN748018FB.2010-09-04.21-49-33.tar.bz2 (405.8 KB) - added by mikus 9 years ago.
XO-1 build os1 (F14) - System dump after Object Chooser did not open object
Image.log (3.1 KB) - added by mikus 9 years ago.
XO-1 build os1 (F14) - Output from ImageViewer Activity
logs.CSN748018FB.2010-09-06.04-14-06.tar.bz2 (391.2 KB) - added by mikus 9 years ago.
XO-1 build os1 (F14) - System dump after Object Chooser three times successfully opened an object
Text clipping.txt (75.5 KB) - added by tonyforster 9 years ago.
float/int errors in icon.py
Text clipping msgbox.txt (2.4 KB) - added by tonyforster 9 years ago.
error log, yes/no dialog

Download all attachments as: .zip

Change History (38)

Changed 9 years ago by mikus

XO-1 build os1 (F14) - System dump after Object Chooser did not open object

Changed 9 years ago by mikus

XO-1 build os1 (F14) - Output from ImageViewer Activity

comment:1 follow-up: Changed 9 years ago by sascha_silbe

  • Component changed from untriaged to journal
  • Owner set to alsroot
  • Severity changed from Unspecified to Major

From shell.log:

Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/jarabe/journal/objectchooser.py", line 190, in __button_release_event_cb
    pos = tree_view.get_path_at_pos(event.x, event.y)
TypeError: integer argument expected, got float

This smells like a GTK bug or at least API change. Can you try wrapping event.x and event.y in int(), please?

comment:2 in reply to: ↑ 1 Changed 9 years ago by mikus

Replying to sascha_silbe:

This smells like a GTK bug or at least API change. Can you try wrapping event.x and event.y in int(), please?

That was it. I changed that line in journal/objectchooser.py to

    pos = tree_view.get_path_at_pos(int(event.x), int(event.y))

and now successfully (with Object Chooser) had ImageViewer open an object from Journal, had ImageViewer open a file on USB, and had Jukebox access a file on USB (Jukebox had problems - but that will eventually be another ticket).

Thank you.

Changed 9 years ago by mikus

XO-1 build os1 (F14) - System dump after Object Chooser three times successfully opened an object

comment:3 Changed 9 years ago by sascha_silbe

  • Bug Status changed from Unconfirmed to New
  • Cc bernie added
  • Distribution/OS changed from OLPC to Fedora

Doesn't happen on Debian Squeeze, so it's more related to Fedora (probably GTK update) than Sugar 0.90.

comment:4 Changed 9 years ago by erikos

  • Severity changed from Major to Blocker

I think this one is important to fix, marking it a blocker for 0.90.

comment:5 follow-ups: Changed 9 years ago by alsroot

Have the same gtk version as f14 (2.20) but all mentioned test cases are ok (recent Gentoo).

comment:6 in reply to: ↑ 5 Changed 9 years ago by alsroot

Replying to alsroot:

Have the same gtk version as f14 (2.20) but all mentioned test cases are ok (recent Gentoo).

2.20 is in f13, so my gtk is not the same version as in f14

comment:7 in reply to: ↑ 5 Changed 9 years ago by alsroot

Replying to alsroot:

.. but all mentioned test cases are ok (recent Gentoo).

Except #2362 #1814

comment:8 Changed 9 years ago by erikos

Similar thing:

/home/erikos/sugar-jhbuild/install/lib/python2.6/site-packages/sugar/graphics/icon.py:145: DeprecationWarning: integer argument expected, got float
  info = theme.lookup_icon(self.icon_name, size, 0)
/home/erikos/sugar-jhbuild/install/lib/python2.6/site-packages/sugar/graphics/icon.py:279: DeprecationWarning: integer argument expected, got float
  surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, width, height)

Will hit us in 2.21.

comment:9 Changed 9 years ago by erikos

So looks like Python 2.7 has changed the severity and raises now an error where it only warned before. Tomeu checked that the functions in question in gtk and pygtk have not changed for years.

comment:10 Changed 9 years ago by erikos

We hit the following change described in that bug. From Porting to Python 2.7.

comment:11 follow-up: Changed 9 years ago by sascha_silbe

The real question is: why do we get a float (inside the event) if we're supposed to pass an int ourself? This API asymmetry is a bug IMO.

comment:12 in reply to: ↑ 11 Changed 9 years ago by tomeu

Replying to sascha_silbe:

The real question is: why do we get a float (inside the event) if we're supposed to pass an int ourself? This API asymmetry is a bug IMO.

From here, the reason seems to be that some input devices such as tablets can give coordinates in sub-pixel units while the screen will be always represented in single pixels:

http://developer.gnome.org/doc/GGAD/sec-gdkevent.html

comment:13 Changed 9 years ago by erikos

"Coordinates are given as doubles rather than integers, because some input devices such as graphics tablets have sub-pixel resolution. For most purposes, you will want to cast the doubles to integers. pressure, xtilt, and ytilt are also special features of some input devices; they can be ignored almost all the time."

comment:14 follow-up: Changed 9 years ago by erikos

After discussing with Tomeu I did push the cast for the objectchooser for now:

http://git.sugarlabs.org/projects/sugar/repos/mainline/commits/02826bbce77a88ed41bc319d8215dcdc45d1c462

FWIW, we have been doing the cast already at other places:

src/jarabe/journal/listview.py:505:        pos = tree_view.get_path_at_pos(int(event.x), int(event.y))
../sugar-toolkit/src/sugar/graphics/palettewindow.py:902:            path, column_, x_, y_ = tree_view.get_path_at_pos(int(event.x),
../sugar-toolkit/src/sugar/graphics/palettewindow.py:937:            path, column_, x_, y_ = tree_view.get_path_at_pos(int(event.x),
../sugar-toolkit/src/sugar/graphics/palettewindow.py:950:        pos = self._tree_view.get_path_at_pos(int(event_x), int(event_y))

comment:15 in reply to: ↑ 14 Changed 9 years ago by sascha_silbe

Replying to erikos:

After discussing with Tomeu I did push the cast for the objectchooser for now:

http://git.sugarlabs.org/projects/sugar/repos/mainline/commits/02826bbce77a88ed41bc319d8215dcdc45d1c462

From the docs both Tomeu and you have quoted this seems to be The Right Thing to do, so we can probably close this ticket.
The API asymmetry does make some sense, nicely summarised by Tomeu.

comment:17 Changed 9 years ago by erikos

Other occurrences:

#2406 Browse
#2363 Physics

comment:19 follow-up: Changed 9 years ago by tonyforster

Related to this and #2406 more integer/float errors in icon.py, no noticable loss of functionality, hard to reproduce but quite frequent, log attached

Changed 9 years ago by tonyforster

float/int errors in icon.py

comment:20 Changed 9 years ago by tonyforster

  • Cc tonyforster added

comment:21 follow-up: Changed 9 years ago by tonyforster

Easy to generate these int/float errors by swapping between neighbourhood, friends, home and activities views, mostly, then sometimes not. Also these keyboard keys sometimes stop working till reboot but the frame still works. Hard to reproduce. May be related.

comment:22 in reply to: ↑ 19 ; follow-up: Changed 9 years ago by erikos

Replying to tonyforster:

Related to this and #2406 more integer/float errors in icon.py, no noticable loss of functionality, hard to reproduce but quite frequent, log attached

Those are fixed by the new sugar-toolkit rpm from: http://koji.fedoraproject.org/koji/buildinfo?buildID=199033

If you can test that rpm (rpm -U sugar) and raise the Karma at https://admin.fedoraproject.org/updates/sugar-0.90.2-1.fc14,sugar-toolkit-0.90.1-1.fc14?_csrf_token=64ce20f9230dd1cd0bebc3e2b9172595f0cebbd9 that would be great.

comment:23 in reply to: ↑ 21 ; follow-up: Changed 9 years ago by erikos

Replying to tonyforster:

Easy to generate these int/float errors by swapping between neighbourhood, friends, home and activities views, mostly, then sometimes not. Also these keyboard keys sometimes stop working till reboot but the frame still works. Hard to reproduce. May be related.

Tony, you probably mean #2415? At least that is what I have seen. If you have more information, "when does it happen", "what triggers it", "what machine you are using "XO-1 or XO-1.5" would be great.

comment:24 in reply to: ↑ 23 Changed 9 years ago by tonyforster

Replying to erikos:

Replying to tonyforster:

Easy to generate these int/float errors by swapping between neighbourhood, friends, home and activities views, mostly, then sometimes not. Also these keyboard keys sometimes stop working till reboot but the frame still works. Hard to reproduce. May be related.

Tony, you probably mean #2415? At least that is what I have seen. If you have more information, "when does it happen", "what triggers it", "what machine you are using "XO-1 or XO-1.5" would be great.

Thanks. Yes, the view keys looks like its #2415. Hardware is xo1, os15. Will comment at #2415 if I can reliably reproduce it.

comment:25 in reply to: ↑ 22 ; follow-up: Changed 9 years ago by tonyforster

Replying to erikos:

Replying to tonyforster:

Related to this and #2406 more integer/float errors in icon.py, no noticable loss of functionality, hard to reproduce but quite frequent, log attached

Those are fixed by the new sugar-toolkit rpm from: http://koji.fedoraproject.org/koji/buildinfo?buildID=199033

If you can test that rpm (rpm -U sugar) and raise the Karma at https://admin.fedoraproject.org/updates/sugar-0.90.2-1.fc14,sugar-toolkit-0.90.1-1.fc14?_csrf_token=64ce20f9230dd1cd0bebc3e2b9172595f0cebbd9 that would be great.

Thanks, I would need a fair bit of guidance before I could test the rpm.

comment:26 in reply to: ↑ 25 ; follow-up: Changed 9 years ago by erikos

Replying to tonyforster:

Replying to erikos:

Replying to tonyforster:

Related to this and #2406 more integer/float errors in icon.py, no noticable loss of functionality, hard to reproduce but quite frequent, log attached

Those are fixed by the new sugar-toolkit rpm from: http://koji.fedoraproject.org/koji/buildinfo?buildID=199033

If you can test that rpm (rpm -U sugar) and raise the Karma at https://admin.fedoraproject.org/updates/sugar-0.90.2-1.fc14,sugar-toolkit-0.90.1-1.fc14?_csrf_token=64ce20f9230dd1cd0bebc3e2b9172595f0cebbd9 that would be great.

Thanks, I would need a fair bit of guidance before I could test the rpm.

To install an rpm do: http://lists.sugarlabs.org/archive/sugar-devel/2010-October/027566.html

The Karma points are to indicate that a test was successful, 3 Karma points are needed by a package to get from testing into stable. You have to create an account in order to comment at bodhi, the Fedora package interface.

I doing a new XO-1 build atm (containing the rpm), but uploading will take a while, so... :)

comment:27 in reply to: ↑ 26 Changed 9 years ago by tonyforster

Replying to erikos:

Replying to tonyforster:

Replying to erikos:

Replying to tonyforster:

Related to this and #2406 more integer/float errors in icon.py, no noticable loss of functionality, hard to reproduce but quite frequent, log attached

Those are fixed by the new sugar-toolkit rpm from: http://koji.fedoraproject.org/koji/buildinfo?buildID=199033

If you can test that rpm (rpm -U sugar) and raise the Karma at https://admin.fedoraproject.org/updates/sugar-0.90.2-1.fc14,sugar-toolkit-0.90.1-1.fc14?_csrf_token=64ce20f9230dd1cd0bebc3e2b9172595f0cebbd9 that would be great.

Thanks, I would need a fair bit of guidance before I could test the rpm.

To install an rpm do: http://lists.sugarlabs.org/archive/sugar-devel/2010-October/027566.html

The Karma points are to indicate that a test was successful, 3 Karma points are needed by a package to get from testing into stable. You have to create an account in order to comment at bodhi, the Fedora package interface.

I doing a new XO-1 build atm (containing the rpm), but uploading will take a while, so... :)

Thanks, installed the rpm (I think). Errors on view change are gone but they were intermittent before. Successfully ran an object chooser (in TurtleArt) selecting from journal and USB but I hadn't looked at the error before patching. #2406 bug is still there and this is said to be the same bug!

Looked at the karma link but couldn't see anything sugary on that page (it did redirect to a shorter url)

comment:28 Changed 9 years ago by tonyforster

retract previous comment on karma, link works from bugs.sugarlabs must be mangled in the email notification, still I shouldn't raise the karma because I have no reliable test case

comment:29 Changed 9 years ago by tonyforster

More int/float errors on Browse, on a yes no dialog box
OS15 XO1 and have applied sugar-toolkit rpm from: http://koji.fedoraproject.org/koji/buildinfo?buildID=199033
log attached

Changed 9 years ago by tonyforster

error log, yes/no dialog

comment:30 Changed 9 years ago by tonyforster

oops, previous crash was unrelated to float/int started a new ticket #2431

comment:31 Changed 9 years ago by tonyforster

  • Keywords olpc-0.90 added

comment:32 Changed 6 years ago by dnarvaez

  • Component changed from journal to sugar

comment:33 Changed 6 years ago by dnarvaez

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