[ xdvi-Bugs-2841005 ] Bounding boxes never shown for forward search

"SourceForge.net" <[email protected]>
Newsgroups gmane.comp.tex.xdvi.devel
Message-ID <[email protected]>
Bugs item #2841005, was opened at 2009-08-20 12:10
Message generated for change (Comment added) made by slygent
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=377580&aid=2841005&group_id=23164

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: X interface
Group: incorrect behaviour
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Guy (slygent)
Assigned to: Nobody/Anonymous (nobody)
Summary: Bounding boxes never shown for forward search

Initial Comment:
Using forward search from emacs used to show boxes around area searched to, but I don't have this behaviour any more. Could be related to bug 418215? Ctrl-x and Ctrl-click work perfectly, while Ctrl-v doesn't. Changing highlight colour doesn't work (and other features that use highlight colour, e.g. ruler, do work).

xdvik version 22.84.16 (Xaw toolkit)

----------------------------------------------------------------------

>Comment By: Guy (slygent)
Date: 2009-08-23 13:58

Message:
OK perhaps it is the XDrawRectangle command, because I saw a foreground
colour (black) line on the left of the "special" text the first time, and
highlight colour (red) the second time. At least I can see where the
relevant text is now :) What next?

----------------------------------------------------------------------

Comment By: Stefan Ulrich (stefanulrich)
Date: 2009-08-23 12:44

Message:
really strange. The next line would be the XDrawRectangle command. Maybe
there's something wrong with that function? Could you try the following
code in dvi-draw.c:

		XPoint points[2];
		points[0] = ul;
		points[1] = ll;
		fprintf(stderr, "drawing at: %d, %d, %d, %d\n",
			min_x, min_y, max_x, max_y);
		XDrawLines(DISP, mane.win, globals.gc.fore, points, 2,
CoordModeOrigin);
		/*
		XDrawRectangle(DISP, mane.win, globals.gc.high,
			       min_x, min_y, max_x - min_x, max_y - min_y);
		*/

Do you see a line then? What if you replace globals.gc.fore with
globals.gc.high? 

----------------------------------------------------------------------

Comment By: Guy (slygent)
Date: 2009-08-23 11:58

Message:
"drawing at" comes last after everything else, especially SETCHAR commands

Adding the delay you suggested let me see letters being put down one at a
time... And when it's over, nothing happening. I see the "drawing bbox"
command and the like being printed in the console, but nothing happening in
the application. Is there another debugging option I can turn on to see
what is happening?

----------------------------------------------------------------------

Comment By: Stefan Ulrich (stefanulrich)
Date: 2009-08-23 10:21

Message:
And if you run xdvi with 
-sync -debug dvi
does the "drawing at: ...." occur after the SETCHAR... commands?

Another thing to try: in read_events in texk/xdvik/events.c, replace:

    for (;;) {
	globals.ev.ctr = event_freq;

by:

    for (;;) {
	sleep(1);
	globals.ev.ctr = event_freq;

recompile, and run this on your minimal example file - this will make
drawing really slow, and you might see something, e.g. if the box is drawn
and then disappears again.

----------------------------------------------------------------------

Comment By: Guy (slygent)
Date: 2009-08-21 22:28

Message:
currwin.win == mane.win; -1
currwin.win == mane.win; -1
currwin.win == mane.win; 0
drawing bbox
drawing box 0
drawing at: 136, 128, 286, 652

The first two lines appear when xdvi starts from the console, and the last
four when I attempt a forward search. Did I mention that the xdvi window
doesn't gain focus when I attempt a forward search? I don't know if that's
important, or even if this was always the normal behaviour... Reverse
search from xdvik does return focus to the editor though.

----------------------------------------------------------------------

Comment By: Stefan Ulrich (stefanulrich)
Date: 2009-08-21 20:05

Message:
At this point it's probably best to add more debugging code; I've attached
a diff for texk/xdvik/dvi-draw.c, could you please apply it with:

cd texk/xdvik
patch < diffs

then recompile, do another forward search for your minimal DVI file and
send me the output? It should print something for every redraw/expose
event.

----------------------------------------------------------------------

Comment By: Guy (slygent)
Date: 2009-08-20 21:17

Message:
X -version :

X.Org X Server 1.5.2
Release Date: 10 October 2008
X Protocol Version 11, Revision 0
Build Operating System: openSUSE SUSE LINUX
Current Operating System: Linux otter-laptop 2.6.27.25-0.1-default #1 SMP
2009-07-01 15:37:09 +0200 i686
Build Date: 02 July 2009  08:02:13AM

        Before reporting problems, check http://wiki.x.org
        to make sure that you have the latest version.
Module Loader present


Underline was shown correctly in the TOC in the dvi once I used a \label
macro under the \section macro... Forcing a window redraw in the in the way
you suggested doesn't work though. Any more ideas?

----------------------------------------------------------------------

Comment By: Stefan Ulrich (stefanulrich)
Date: 2009-08-20 21:04

Message:
OK, there's nothing wrong with the source specials in that file, so it's a
problem in xdvik itself. Could you experiment a bit with window redraw
events, e.g. drag a window partly over the region where you would expect
the bounding box to see if that makes the box appear? What's the output of
"X -version"?

Another thing you could check is if the underlines for hyperlinks which
are implemented similarly work: for the following example file, is the
"Test" section entry in the TOC underlined?

\documentclass{article}
\usepackage{hyperref}
\begin{document}
\tableofcontents

\section{Test}
test
\end{document}


----------------------------------------------------------------------

Comment By: Guy (slygent)
Date: 2009-08-20 20:20

Message:
I've uploaded a simple DVI file where I can confirm that backward search
and forward search work but nothing is shown in the latter case.

I did compile xdvik myself, but only because the binary supplied with
openSUSE didn't work either...

Thanks for your help so far!

----------------------------------------------------------------------

Comment By: Stefan Ulrich (stefanulrich)
Date: 2009-08-20 19:08

Message:
> I'm afraid to say that this is happening for all dvi files here.
just to make sure that it's not the source specials, please just send me
one - e.g. a very small one consisting of 2 paragraphs, for which
'backward' search works and 'forward search' doesn't show the markers.

Did you compile xdvik yourself?


----------------------------------------------------------------------

Comment By: Guy (slygent)
Date: 2009-08-20 16:56

Message:
To be honest I don't remember when this behaviour changed... and I'm afraid
to say that this is happening for all dvi files here. Perhaps I should try
compile with motif as a workaround?

----------------------------------------------------------------------

Comment By: Stefan Ulrich (stefanulrich)
Date: 2009-08-20 16:31

Message:
> You mean "events" instead of "event", right?
Right. The output doesn't show a problem - what changed in your system
from the time when highlighting still worked? Could you send me a sample
DVI file that shows the problem?

----------------------------------------------------------------------

Comment By: Guy (slygent)
Date: 2009-08-20 14:21

Message:
You mean "events" instead of "event", right? Using "events":

Debugging option: "src,events" = "src", debug: 8192                       
        
Debugging option: "events" = "events", debug: 8208                        
        
KPATHSEA_DEBUG = 128                                                      
        
main.c:439: EVENT: watching: new file opened successfully.                
        
xdvik 22.84.16 (Xaw toolkit), kpathsea: kpathsea version 3.5.7            
        
configured with: ppi=600 shrink=9 mfmode=<NONE> alt_font=cmr10 paper=a4   
        
--- G_depth: 24                                                           
        
XtAppAddTimeOut: 100 msecs                                                
        
events.c:4577: set_timer                                                  
        
=======after set_timer; timers:                                           
        
timer 0x8315480: 1250774182                                               
        
=======                                                                   
        
=======XtAppAddTimeOut; timers:                                           
        
timer 0x8315480: 1250774182                                               
        
=======                                                                   
        
dvi-init.c:1146: EVENT: Created temp file: |/tmp/xdvi-hHeAa0|             
        

=======beginning of cancel_timer; timers:
timer 0x8315480: 1250774182              
=======                                  
events.c:4621: cancel_timer 0x810d604 from 0x8315480
=======XtRemoveTimeOut; timers:                     
=======
events.c:4877: read_events 262143
events.c:4928: (flaky) sig_flags = 0
events.c:4877: read_events 262142
events.c:5320: EVENT: globals.ev.flags: 8199; ev_newpage: 8192, ev_newdoc:
65536, ev_reload: 32768

events.c:5323: EVENT: EV_NEWPAGE | ...
events.c:5387: EVENT: redraw_page()
events.c:4877: read_events 262112
events.c:4877: read_events 262142
events.c:5320: EVENT: globals.ev.flags: 8199; ev_newpage: 8192, ev_newdoc:
65536, ev_reload: 32768

events.c:5323: EVENT: EV_NEWPAGE | ...
events.c:5387: EVENT: redraw_page()
events.c:4877: read_events 262143
util.c:1386: SRC: checking filename "pstricks.pro"
util.c:1416: SRC: Trying globals.dvi_file.dirname:
"/home/otter/HD/docs/phd/rssbpaper/pstricks.pro"
util.c:1459: SRC: trying kpathsearch for filename "pstricks.pro" from
/home/otter/HD/docs/phd/rssbpaper/
util.c:1478: SRC: Found file:
`/usr/share/texmf/dvips/pstricks/pstricks.pro'
util.c:1386: SRC: checking filename "pst-dots.pro"
util.c:1416: SRC: Trying globals.dvi_file.dirname:
"/home/otter/HD/docs/phd/rssbpaper/pst-dots.pro"
util.c:1459: SRC: trying kpathsearch for filename "pst-dots.pro" from
/home/otter/HD/docs/phd/rssbpaper/
util.c:1478: SRC: Found file:
`/usr/share/texmf/dvips/pstricks/pst-dots.pro'
util.c:1386: SRC: checking filename "pst-node.pro"
util.c:1416: SRC: Trying globals.dvi_file.dirname:
"/home/otter/HD/docs/phd/rssbpaper/pst-node.pro"
util.c:1459: SRC: trying kpathsearch for filename "pst-node.pro" from
/home/otter/HD/docs/phd/rssbpaper/
util.c:1478: SRC: Found file:
`/usr/share/texmf/dvips/pstricks/pst-node.pro'
events.c:4877: read_events 262112
events.c:5117: EVENT: Redraw 539 x 714 at (0, 0) (base=0,0) **** This is
the first line after I use forward search
events.c:4877: read_events 262143
events.c:4877: read_events 262142
events.c:5320: EVENT: globals.ev.flags: 3; ev_newpage: 8192, ev_newdoc:
65536, ev_reload: 32768

events.c:4877: read_events 262142
events.c:5320: EVENT: globals.ev.flags: 65; ev_newpage: 8192, ev_newdoc:
65536, ev_reload: 32768

x_util.c:91: SRC: test_scroll vertically: -171
x_util.c:108: SRC: test_scroll horizontally: -411
events.c:4877: read_events 262142
events.c:5320: EVENT: globals.ev.flags: 8193; ev_newpage: 8192, ev_newdoc:
65536, ev_reload: 32768

events.c:5323: EVENT: EV_NEWPAGE | ...
events.c:5387: EVENT: redraw_page()
events.c:4877: read_events 262143
events.c:4877: read_events 262143
events.c:4877: read_events 262143
events.c:4877: read_events 262143
events.c:4877: read_events 262143
events.c:4877: read_events 262143
events.c:4877: read_events 262143
events.c:5117: EVENT: Redraw 539 x 714 at (0, 0) (base=0,0)
events.c:5121: EVENT: Cursor: 0
events.c:4877: read_events 262143
events.c:4877: read_events 262142
events.c:5320: EVENT: globals.ev.flags: 3; ev_newpage: 8192, ev_newdoc:
65536, ev_reload: 32768

events.c:4877: read_events 262142



----------------------------------------------------------------------

Comment By: Stefan Ulrich (stefanulrich)
Date: 2009-08-20 13:07

Message:
Bug with Ctrl-v fixed in v. 1.403 of events.c

----------------------------------------------------------------------

Comment By: Stefan Ulrich (stefanulrich)
Date: 2009-08-20 12:55

Message:
I can reproduce the problem with Ctrl-v, there's a bug in the handling of
this event, but not with the bounding boxes. Could you post the output of
doing a forward search with "xdvi -debug 'src,event'"?

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=377580&aid=2841005&group_id=23164

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.