Strange gray lines in DrRacket editor

144 views
Skip to first unread message

jarosla...@gmail.com

unread,
Sep 9, 2017, 4:22:37 PM9/9/17
to Racket Users

Recently I installed racket 6.10 (Windows version) on my new laptop (OS is Windows 10 Creators Update) and I noticed strange gray boxes when writing programs in the DrRacket editor (see picture attached).
I assume it's related to my  DPI settings which is set to 125% in the Display settings dialog, and the resolution is set to 1920 x 1080 which is equal to real resolution on my 14' laptop screen.

Since other apps on the same machine don't exhibit any display problems, i suppose this is a bug in DrRacket so I report it here in the hope that it will be resolved in the new version of DrRacket.

Best regards,
Jaroslaw Modry


gray_lines.png

Luis Sanjuán

unread,
Sep 11, 2017, 4:24:25 AM9/11/17
to Racket Users
I really think it is caused by your dpi. Maybe you are suffering from other similar annoyances too like pixelated icons. Check with no scaling, if things work fine, it is nothing related to DrRacket, and artifacts like those you mention could appear on other apps too. You have still several options, though, to get readable text without tweaking scaling. Maybe you can investigate about updates of your graphic drivers for your OS. Another good option is to use a lower resolution for your display.

I have recently fixed exactly the same problem on my Linux 13.3'' laptop by doing the latter, in particular by adding a resolution of 1600x900. It wasn't detected by default but on Linux we can create custom resolutions with ease.

jarosla...@gmail.com

unread,
Sep 11, 2017, 5:59:51 AM9/11/17
to Racket Users
The thing is I don't have any problems with other applications, they all look good. The gray lines (or "boxes") seems to appear only in DrRacket, mainly when some part of text is selected (i.e. when it's background is gray) - the irritating lines shows in moment when I move cursor from the grayed line to the next line.
I know that those lines don't appear when I change DPI back to 100% (I already tried that), but I really want to leave my DPI setting to 125% because of other applications (if I do, everything is too small - i found 125% works best for me).

Best regards,
Jaroslaw Modry 

Luis Sanjuán

unread,
Sep 11, 2017, 10:01:17 AM9/11/17
to Racket Users
Fair enough. But absence of artifacts in apps you are using right now doesn't discard the same issue to show up in other apps. Google for 'display artifacts dpi scaling' or something like that. You'll see that this kind of problem is actually prevalent.

DrRacket (or underlying libraries) may and probably should improve. So this is a right place to report. Given the current proliferation of HiDPI displays it is of great concern.

I just suggested a temporary workaround, the same I've applied myself, till the OS, drivers or apps are able to fix it.

Luis Sanjuán

unread,
Sep 16, 2017, 7:48:43 AM9/16/17
to Racket Users
Hi, Jaroslaw

Something you could try/investigate is scaling per app on Windows. It seems that last Windows releases allow something along those lines. I cannot verify it, though:

http://news.kynosarges.org/2017/04/16/dpi-settings-in-windows-10-creators-update/

Another workaround that some users on Unix systems may find helpful and doesn't involve changing display resolutions, or dealing with xrandr, or something like that is to set text scaling as they like for everything in the Desktop Environment, but make DrRacket override that setting when running via the environment variable PLT_DISPLAY_BACKING_SCALE set to 1. This actually reverts the general dpi setting and so fixes artifacts:

https://docs.racket-lang.org/gui/windowing-overview.html#%28part._display-resolution%29

Luis Sanjuán

unread,
Sep 21, 2017, 5:02:31 AM9/21/17
to Racket Users
Hi again, Jaroslaw and everyone concerned.

I have investigated a bit further on this issue. This is a quick report of my findings thus far. If I can provide more useful information, I'll do it in a new post.

To summarize what I have found.

1. Artifacts are still there, though mitigated, even after applying the last proposed workarounds.
2. At least on Unix systems, the issue seems to be completely fixed by falling back to GTK2.

More details.

* Basic Machine description

Platform: Dell XPS 13 9360. Graphics: Iris Plus Graphics 640 driven by the i915 module (default chipset settings)

OS: Ubuntu 16.04.3 (Linux kernel: 4.10.0-33-generic)

* Description of the issue

Ghosting lines and/or little squares screen artifacts appears on the drracket canvas while scrolling. Much more prominent when text is scaled and/or when graphical objects like comment boxes are included in the code.

* Fix

On Unix systems, falling back to GTK2 when running drracket seems to completely fix the issue:

PLT_GTK2=1 drracket

Jaroslaw, I don't know about Windows but if you can do something like this when running drracket, you may fix the problem by now.

Neil Van Dyke

unread,
Sep 21, 2017, 6:09:57 AM9/21/17
to Luis Sanjuán, Racket Users
One possibility is that Racket was working with GTK3 before, but GTK3
broke that (or broke your GTK3 theme) in a newer version.  I've heard
developer complaints about this, and about engineering culture changes
and politics.

Firefox might be a good example to look at.  Some URLs that don't
involve cursing or intrigue:
https://wiki.archlinux.org/index.php/firefox#Firefox_looks_bad_with_GTK.2B_.3E.3D3.20
https://bugzilla.mozilla.org/show_bug.cgi?id=1268234

I no longer have a good long-term recommendation for open source desktop
GUI toolkits; maybe next year.  For now, I go to some trouble to use
GTK2 apps whenever possible.

The good news: for most of us developers using Racket on GNU/Linux, one
nice side-effect of the Racket cross-platform desktop GUI stuff is that
we don't have to decide whether to code for GTK2/GTK3/Qt/etc. -- we can
shift all that pain onto Matthew, et al. :)

Hendrik Boom

unread,
Sep 21, 2017, 9:27:21 AM9/21/17
to racket...@googlegroups.com
On Thu, Sep 21, 2017 at 06:09:53AM -0400, Neil Van Dyke wrote:
> One possibility is that Racket was working with GTK3 before, but GTK3 broke
> that (or broke your GTK3 theme) in a newer version.  I've heard developer
> complaints about this, and about engineering culture changes and politics.
>
> Firefox might be a good example to look at.  Some URLs that don't involve
> cursing or intrigue:
> https://wiki.archlinux.org/index.php/firefox#Firefox_looks_bad_with_GTK.2B_.3E.3D3.20
> https://bugzilla.mozilla.org/show_bug.cgi?id=1268234
>
> I no longer have a good long-term recommendation for open source desktop GUI
> toolkits; maybe next year.  For now, I go to some trouble to use GTK2 apps
> whenever possible.

Is anyone still maintaining GTK2?

I've heard good things about Qt and FLTK, but have no experience with them.

-- hendrik
Reply all
Reply to author
Forward
0 new messages