Hexadecimal WINDOWID breaks w3m-img

Bug #1625614 reported by Paride Legovini
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Sakura
Fix Released
Low
David Gómez

Bug Description

The w3m-img browser has the ability to show images in a terminal. This is used for example by the ranger[1] file manager to preview image files (see [2] for an example). This works fine in xterm, but does not work with sakura. It turns out that xterm saves the WINDOWID variable as a decimal numer:

$ echo $WINDOWID
67108879

while sakura as a hexadecimal number:

$ echo $WINDOWID
0x3e00003

Converting WINDOWID from hexadecimal to decimal, for example like this:

$ export WINDOWID=$(($WINDOWID))
$ echo $WINDOWID
65011715

fixes the issue: w3m-img works fine in sakura too. Permanently fixing this should be as easy as changing sakura.c:2800 from

gchar *winidstr = g_strdup_printf ("0x%x", winid);

to

gchar *winidstr = g_strdup_printf ("%d", winid);

Please consider applying this simple patch.
The credit for the workaround goes to [3].

[1] http://ranger.nongnu.org/
[2] http://ranger.nongnu.org/screenshots/w3mimgpreview.png
[3] http://msnu.de/ranger/2016-03-15-ranger-image-preview-with-sakura.html

Revision history for this message
David Gómez (dabisu) wrote :

Thanks, fix added.

Changed in sakura:
status: New → Fix Committed
assignee: nobody → David Gómez (dabisu)
importance: Undecided → Low
David Gómez (dabisu)
Changed in sakura:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.