Bug 442445 - comand line option '-sourceposition' does not work correctly
comand line option '-sourceposition' does not work correctly
Product: Fedora
Classification: Fedora
Component: xdvik (Show other bugs)
x86_64 Linux
low Severity medium
: ---
: ---
Assigned To: Jonathan Underwood
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2008-04-14 16:19 EDT by Jiri Cerny
Modified: 2008-07-21 12:50 EDT (History)
2 users (show)

See Also:
Fixed In Version: 22.84.13-19
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-07-21 12:50:41 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
output of two xdvi -unique -debug client,src commands (2.59 KB, text/plain)
2008-04-15 03:17 EDT, Jiri Cerny
no flags Details
output of working xdvi -unique -debug client,src commands (2.06 KB, text/plain)
2008-04-15 04:17 EDT, Patrice Dumas
no flags Details
output of xwininfo for the first xdvi window (741 bytes, text/plain)
2008-04-15 04:46 EDT, Jiri Cerny
no flags Details
patch correcting the problem (1.21 KB, patch)
2008-04-17 03:46 EDT, Jiri Cerny
no flags Details | Diff

  None (edit)
Description Jiri Cerny 2008-04-14 16:19:22 EDT
Description of problem:
As described in the manual of xdvi:
"-sourceposition: ....
In addition, when run with this argument (and the -nofork option is not given,
which see), xdvi will always return immediately: if it finds another instance of
xdvi already showing dvi_file, then it will cause that instance to raise its
window and move to the given place in the dvi file; otherwise it will start up
its own instance in the background......" 

This worked in F8, but now, everytime a new window is opened, which is very
annoying. The option '-unique' has the same problem.

Version-Release number of selected component (if applicable):
rpm -q xdvik

How reproducible: always

Steps to Reproduce:
1.xdvi -unique somedvifile.dvi
2.xdvi -unique somedvifile.dvi
3.two windows are opened instead of one.
Comment 1 Patrice Dumas 2008-04-14 16:24:55 EDT
I cannot reproduce it on my x386 box, with -unique it reloads in the same window.
Comment 2 Jiri Cerny 2008-04-15 03:17:22 EDT
Created attachment 302412 [details]
output of two xdvi -unique -debug client,src commands
Comment 3 Jiri Cerny 2008-04-15 03:18:37 EDT
I can reproduce it always. I attached to the bug output of two successive xdvi
commands with some debugging enabled. Maybe it helps. 
Comment 4 Patrice Dumas 2008-04-15 04:15:56 EDT
I tried the same, and upon inspection of the logs, it seems that the issue is in
x_util.c:1142: CLIENT: Checking window ffffffffffffffe9
x_util.c:1152: CLIENT: Window ffffffffffffffe9: doesn't exist any more, deleting
x_util.c:284: CLIENT: No "xdvi windows" property found
(during the first run).

I attach my logs for a case that works.
Comment 5 Patrice Dumas 2008-04-15 04:17:49 EDT
Created attachment 302419 [details]
output of working xdvi -unique -debug client,src commands
Comment 6 Patrice Dumas 2008-04-15 04:29:02 EDT
Maybe you could launch xwininfo and click on the first xdvi window, look at the
window id and report back the comparison with x_util.c:1142: CLIENT: Checking
window ffffffffffffffe9.
Comment 7 Jiri Cerny 2008-04-15 04:46:53 EDT
Created attachment 302424 [details]
output of xwininfo for the first xdvi window

As you see, the window id looks quite normal. It is not ffffffffffffe9
Comment 8 Jonathan Underwood 2008-04-15 18:35:49 EDT
Um. Struggling to reproduce this locally. I am wondering if this could be a
window manager bug - Jiri, what WM are you using?
Comment 9 Jiri Cerny 2008-04-16 03:31:14 EDT
metacity-2.22.0-2.fc9.x86_64. I do not believe it is metacity, since xwininfo
works, but I am really no expert. 

To be sure that it is not related my personal configuration, I have created a
new user on current rawhide. The problem is completely reproducible also by this
new user (with standard gnome desktop)
Comment 10 Jiri Cerny 2008-04-16 08:40:39 EDT
I was trying to play with the code. What I do not understand is  the following.
If I add on the begining of the function get_window_id in x_utils.c the
following line 

fprintf(stderr, "DEBUGING: %02x %02x %02x %02x\n",

I get DEBUGING: ffffffe8 01 00 04
I am not a professional programmer, but why printing char produces something
like ffffffe8. 
Comment 11 Jiri Cerny 2008-04-17 03:46:26 EDT
Created attachment 302722 [details]
patch correcting the problem

This (very unprofessional) patch makes my problem disappear. The window id is
non longer fffffffffe9 and, what is more important, -unique switch works.
Comment 12 Jonathan Underwood 2008-04-17 19:07:00 EDT
Hm, ok, thanks for digging a little deeper with this - I'll have a careful look
over the weekend.
Comment 13 Jonathan Underwood 2008-04-27 19:24:15 EDT
Have done a build with Jiri's patch applied:


Please test that (assuming it completes successfully). I'll push an update for
F-9 if this fix is good.

Comment 14 Jiri Cerny 2008-04-28 02:56:51 EDT
The above build works for me. Thanks a lot. 
Comment 15 Fedora Update System 2008-04-30 06:09:39 EDT
xdvik-22.84.13-19.fc9 has been submitted as an update for Fedora 9
Comment 16 Fedora Update System 2008-05-13 11:31:34 EDT
xdvik-22.84.13-19.fc9 has been pushed to the Fedora 9 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update xdvik'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F9/FEDORA-2008-3710
Comment 17 Bug Zapper 2008-05-14 05:26:32 EDT
Changing version to '9' as part of upcoming Fedora 9 GA.
More information and reason for this action is here:
Comment 18 Fedora Update System 2008-05-21 07:07:34 EDT
xdvik-22.84.13-19.fc9 has been pushed to the Fedora 9 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.