Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#4903 closed defect (fixed)

view source has no scroll bar

Reported by: quozl Owned by:
Priority: Normal Milestone: Unspecified
Component: Sugar Version: Git as of bugdate
Severity: Major Keywords:
Cc: Distribution/OS: OLPC
Bug Status: New

Description

The view source dialog has no scroll bar for files that extend beyond the visible screen.

Occurs on Sugar 0.107.0 and 0.106.0 with Fedora 18.

Does not occur with Sugar 0.106.1 with Fedora 20, nor with Sugar 0.106.0 on Ubuntu 14.04.3.

Attachments (2)

Screenshot of _Moon_.png (140.7 KB) - added by quozl 8 years ago.
view source, on top of moon, with no scroll bar
Screenshot of _Moon_.2.png (138.8 KB) - added by ignacio 8 years ago.
Viewsource with scrollbars (f18 sugar0.107 xo-1) (ignacio patch applied)

Download all attachments as: .zip

Change History (15)

Changed 8 years ago by quozl

view source, on top of moon, with no scroll bar

comment:1 Changed 8 years ago by SAMdroid

Can not reproduce on fc24 rawhide from git latest. However, my screen is wayyy wider than the code, so maybe the scroll bars are hiding when it needs horizontal space? Is the screen size the same in your tests?

comment:2 Changed 8 years ago by quozl

Thanks, good idea.

On Fedora 18, the tests that fail are with 1200x900. I've not tried Fedora 18 with a wider screen.

One can also click in the text editor and scroll by keyboard.

The separator can be dragged to the left, exposing more of the text editor, but not a scroll bar.

comment:3 Changed 8 years ago by ignacio

It's weird, they should be there. Anyway I will look this
https://github.com/sugarlabs/sugar/blob/master/src/jarabe/view/viewsource.py#L266

Is there any xo image with 0.107.0 that I can use for test?

comment:4 Changed 8 years ago by SAMdroid

Can not reproduce on xo 4 with olpc os 14 with sugar 0.107.0.olpc. Tested with terminal and moon.

NOTE: View source for moon does show scroll bars, sugar to quit and restart

@ignacio, you can update by downaloading all of the rpms, works on olpc os 13 or 14 I think, something like:

sudo su
wget \
http://rpmdropbox.laptop.org/f18/sugar-cp-power-0.106.1-1.fc18.noarch.rpm \
http://rpmdropbox.laptop.org/f18/sugar-cp-datetime-0.106.1-1.fc18.noarch.rpm \
http://rpmdropbox.laptop.org/f18/sugar-cp-backup-0.106.1-1.fc18.noarch.rpm \
http://rpmdropbox.laptop.org/f18/sugar-cp-frame-0.106.1-1.fc18.noarch.rpm \
http://rpmdropbox.laptop.org/f18/sugar-cp-modemconfiguration-0.106.1-1.fc18.noarch.rpm \
http://rpmdropbox.laptop.org/f18/sugar-cp-language-0.106.1-1.fc18.noarch.rpm \
http://rpmdropbox.laptop.org/f18/sugar-cp-updater-0.106.1-1.fc18.noarch.rpm \
http://rpmdropbox.laptop.org/f18/sugar-cp-webaccount-0.106.1-1.fc18.noarch.rpm \
http://rpmdropbox.laptop.org/f18/sugar-cp-network-0.106.1-1.fc18.noarch.rpm \
http://rpmdropbox.laptop.org/f18/sugar-cp-background-0.106.1-1.fc18.noarch.rpm \
http://rpmdropbox.laptop.org/f18/sugar-0.106.1-1.fc18.noarch.rpm \
http://rpmdropbox.laptop.org/f18/sugar-toolkit-gtk3-0.106.1-1.fc18.armv7hl.rpm
rpm -U sugar*
service olpc-dm restart

But s/0.106.1-1.fc18/0.107.0.olpc.1-1/g

comment:5 Changed 8 years ago by quozl

Yes, on Fedora 20 view source causes X server to abort. But that's not what this ticket was raised for. For this ticket, I'm talking about Fedora 18. For the moment I'm adding it to release notes.

comment:6 Changed 8 years ago by quozl

"Great Scott!" -- Dr. Emmett Brown, Back to the Future.

When reproducing on Fedora 18, at the instant the View Source key is pressed while viewing the Calculate help in the Help activity, shell.log receives these lines:

(main.py:1997): Gtk-WARNING **: gtk_scrolled_window_add(): cannot add non scrollable widget use gtk_scrolled_window_add_with_viewport() instead
(main.py:1997): Gtk-CRITICAL **: gtk_scrollable_get_vscroll_policy: assertion `GTK_IS_SCROLLABLE (scrollable)' failed
(main.py:1997): Gtk-CRITICAL **: gtk_scrollable_get_hscroll_policy: assertion `GTK_IS_SCROLLABLE (scrollable)' failed
(main.py:1997): Gtk-CRITICAL **: gtk_scrollable_get_vscroll_policy: assertion `GTK_IS_SCROLLABLE (scrollable)' failed
(main.py:1997): Gtk-CRITICAL **: gtk_scrollable_get_hscroll_policy: assertion `GTK_IS_SCROLLABLE (scrollable)' failed
(main.py:1997): Gtk-CRITICAL **: gtk_scrollable_get_vscroll_policy: assertion `GTK_IS_SCROLLABLE (scrollable)' failed
(main.py:1997): Gtk-CRITICAL **: gtk_scrollable_get_hscroll_policy: assertion `GTK_IS_SCROLLABLE (scrollable)' failed
(main.py:1997): Gtk-CRITICAL **: gtk_scrollable_get_vscroll_policy: assertion `GTK_IS_SCROLLABLE (scrollable)' failed
(main.py:1997): Gtk-CRITICAL **: gtk_scrollable_get_hscroll_policy: assertion `GTK_IS_SCROLLABLE (scrollable)' failed

Which means that the code is assuming an object is scrolled when it is not. That gives a reason why there are no scroll bars.

Reverting 4be3f9e fixes the problem. See my revert diff if you need to try it or patch a deployment build.

(Also, on Fedora 20, reverting 4be3f9e fixes the X server abort and quit and restart of Sugar. It turns out this is one of the causes of olpc:12872 (desktop instability). Debugging and tracing of the X server shows the client had sent impossible parameters in drawing operations. It seems 4be3f9e made GTK+ send impossible parameters. I'm very happy with this accidental discovery!)

Now, the 4be3f9e patch was a fix for #4273 by @ignacio and @godiard.

@ignacio, it seems from tests by you and Sam that this problem relates to the version of GTK+, so is there a way to rewrite your patch for #4273 that works on Fedora 18 GTK+? Is the object hierarchy strictly correct according to GTK+ requirements? I'm not sure I'm reading the hierarchy properly. I welcome your thoughts.

comment:7 Changed 8 years ago by SAMdroid

+1 for rewriting that patch

Did you actually find what part of the patch caused the issue that sent the bad operations?

comment:8 Changed 8 years ago by ignacio

@quozl , @SAMdroid

I will rewrite it, but anyway, we should find why it's not working..

Maybe
https://github.com/sugarlabs/sugar/blob/master/src/jarabe/view/viewsource.py#L710
Change it to:
https://developer.gnome.org/pygtk/stable/class-gtkscrolledwindow.html#method-gtkscrolledwindow--add-with-viewport

self.add_with_viewport ? (can you test it?, I dont have fedora 18 here)

comment:9 Changed 8 years ago by ignacio

Yep. The scrollbars are back (found a XO-1 with fedora 18 and olpc os 13.2.5) replaced the two instances of:

class name(Gtk.ScrolledWindow):
inside it:

self.add(x)

with:

self.add_with_viewport(x)

and I don't see crashes.
will upload a patch in few mins

comment:10 Changed 8 years ago by ignacio

Not really perfect, sometimes it show the scrollbars and sometimes you need to click to generate the toolbars.

http://fpaste.org/286123/46481287/

Changed 8 years ago by ignacio

Viewsource with scrollbars (f18 sugar0.107 xo-1) (ignacio patch applied)

comment:11 Changed 8 years ago by quozl

Thanks.

On Fedora 18, scroll bars are shown. I've not seen them missing, but you have, so I wonder why. Have you a way to reproduce that?

On Fedora 20, the X server still terminates with Driver failed PrepareAccess on a pinned pixmap, which is not as good as reverting the #4273 patch.

It seems the cause of the problem is the GtkBox inside the GtkScrolledWindow, so I've tested various fixes and after about three hours, made a pull request https://github.com/sugarlabs/sugar/pull/603

comment:12 Changed 8 years ago by SAMdroid

  • Resolution set to fixed
  • Status changed from new to closed

comment:13 Changed 8 years ago by quozl

Is in 0.107.1

Note: See TracTickets for help on using tickets.