Opened 8 years ago

Closed 7 years ago

#13229 closed defect (outdated)

StyledTextCtrl does not render correctly under Ubuntu 11.04

Reported by: thomir Owned by:
Priority: high Milestone: 3.0.0
Component: wxGTK Version: 2.8.11
Keywords: ubuntu wxStyledTextCtrl Cc:
Blocked By: Blocking:
Patch: no

Description

The StyledTextCtrl component does not render correctly under Ubuntu 11.04 - When scrolling down through a document using the mouse, large grey horizontal bars appear at the bottom of the control.

This problem can be reproduced with the wxDemo application, in both the StyledTextCtrl and StyledTextCtrl_2 examples.

This bug manifests itself in several packages, including the editra editor, as can be seen here:

http://code.google.com/p/editra/issues/detail?id=648

That bug report contains a screenshot as well.

Change History (11)

comment:1 Changed 8 years ago by juliansmart

I can confirm that this happens with DialogBlocks too, a C++ application.

What seems to be happening is there is a ghost horizontal scrollbar, replaced by Ubuntu with a thinner bar. The place where the scrollbar would normally be is not rendered and as you scroll, that piece of window is moved up and appears as grey stripes.

The rendering problem extends to the wxSTC border at the bottom left (a piece of border is not being drawn) so this would imply a fairly severe breakage of GTK+ thanks to the new scrollbars.

We need to look at other custom windows that have a horizontal scrollbar. Interestingly, the 'scroll' sample does not have this problem, so there is obviously some optimization in wxSTC that is provoking it.

Assuming gitg is not a wxGTK application, it appears to affect regular GTK+ apps too:

http://www.mail-archive.com/ubuntu-bugs@lists.ubuntu.com/msg2927396.html

comment:2 Changed 8 years ago by juliansmart

In ScintillaWX.cpp there's a call to ScrollWindow, which does physical scrolling - I think this is the problem. Well, it shouldn't be a problem, but it's clearly broken by the new scrollbar behaviour. See also gdk_window_scroll called by gtk_pizza_scroll in win_gtk.c.

A quick fix to wxSTC would probably be to avoid calling ScrollWindow and refresh the whole window instead, but this would of course make scrolling slower.

comment:3 follow-up: Changed 8 years ago by juliansmart

If you replace the lines

stc->ScrollWindow(0, dy);
stc->Update();

with

stc->Refresh();

in ScintiallWX.cpp (ScrollText) then the glitches are gone, and performance doesn't seem noticeably worse. However, there are still 'ghost' vertical and horizontal scrollbars, which may be as a result of the scrollbars being independently managed by the implementation (instead of using wxScrolledWindow). Possibly. I hate those new scrollbars - dang hard to get hold of.

comment:4 in reply to: ↑ 3 Changed 8 years ago by bartonc

Per my post to the wxPython users

The key is in the OS env var calledLIBOVERLAY_SCROLLBAR

http://groups.google.com/group/wxpython-users/browse_thread/thread/24c7e2e3574e8094/1d16af61c86f6069?lnk=gst&q=Natty+11.4#1d16af61c86f6069

With

LIBOVERLAY_SCROLLBAR=0

The old scrollbars return and the ghost issue goes away. Tested on 2.8.12 and 2.9.2.

Replying to juliansmart:

If you replace the lines stc->ScrollWindow(0, dy); stc->Update(); with stc->Refresh(); in ScintiallWX.cpp (ScrollText) then the glitches are gone, and performance doesn't seem noticeably worse. However, there are still 'ghost' vertical and horizontal scrollbars, which may be as a result of the scrollbars being independently managed by the implementation (instead of using wxScrolledWindow). Possibly. I hate those new scrollbars - dang hard to get hold of.

comment:5 Changed 8 years ago by vadz

  • Component changed from wxPython to wxGTK
  • Milestone set to 3.0

I wonder if we can force LIBOVERLAY_SCROLLBAR to 0 on application startup (e.g. during wx initialization) ourselves? It's not a proper solution, of course, but unless we find out why doesn't it work (and I have no idea about where to start looking as, AFAIK, Ubuntu doesn't bother publishing anything detailing the consequences of their UI changes for developers anywhere (of course, one could expect that code using GTK+ would just continue to work if only the UI changes but this is apparently too much to ask)) this would still be better than the current situation.

comment:6 Changed 8 years ago by juliansmart

FYI I've verified that if I set LIBOVERLAY_SCROLLBAR to "0" in the application constructor (not OnInit, which is too late), all scrollbars are shown normally.

If we did this within wxWidgets, I wonder if we might discourage Ubuntu from fixing the underlying problem...

comment:7 Changed 8 years ago by vadz

  • Keywords Ubuntu added

It seems the problem in gitg (which definitely doesn't use wx) is fixed in latest (pre) release of Ubuntu so maybe wx applications work with it too? Could anyone please test this?

comment:8 follow-up: Changed 8 years ago by bartonc

Just a note:
This is purely Ubuntu 11.04. I became so frustrated with the whole mess that:::

# Python 2.7.1 (r271:86832, Apr 12 2011, 16:16:18)
[GCC 4.6.0 20110331 (Red Hat 4.6.0-2)]
# wxPython 2.8.12.0, Boa Constructor 1.7.2.9
# Type "copyright", "credits" or "license" for more information.

print "Fedora FC15; right out of the repos!"

I'll build 2.9.x here soon.

My work on Boa Constructor is no longer hindered by poor performance, etc.

comment:9 in reply to: ↑ 8 Changed 8 years ago by bartonc

# Python 2.7.1 (r271:86832, Apr 12 2011, 16:16:18)
[GCC 4.6.0 20110331 (Red Hat 4.6.0-2)]
# wxPython 2.9.2.1, Boa Constructor 1.7.2.9
# Type "copyright", "credits" or "license" for more information.

print "Fedora Core 15"

Fedora Core 15

Replying to bartonc:

Just a note:
This is purely Ubuntu 11.04. I became so frustrated with the whole mess that:::

# Python 2.7.1 (r271:86832, Apr 12 2011, 16:16:18)
[GCC 4.6.0 20110331 (Red Hat 4.6.0-2)]
# wxPython 2.8.12.0, Boa Constructor 1.7.2.9
# Type "copyright", "credits" or "license" for more information.

print "Fedora FC15; right out of the repos!"

I'll build 2.9.x here soon.

My work on Boa Constructor is no longer hindered by poor performance, etc.

comment:10 Changed 8 years ago by vadz

  • Keywords ubuntu wxStyledTextCtrl added; Ubuntu StyledTextCtrl removed

[No changes, just harmonizing the tags]

comment:11 Changed 7 years ago by vadz

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

Works for me in 12.04 in the stc sample. Please reopen if anybody can still reproduce it.

P.S. The new Ubuntu scrollbars are abominably inconvenient to use, no idea how do people stand for it.

Note: See TracTickets for help on using tickets.