Fri 08 Dec 2006 11:30:18 PM UTC, original submission:
Norbert Nemec on the ML:
If some open buffer contains images (either linked or inserted), the variable 'nr_windows', declared in src/Window/X/x_loop.cpp and modified
by the constructors and the destructor of 'x_window_rep' (in fiel
src/Window/X/x_window.cpp) is 1 larger than it should be.
The result: if only one TeXmacs window is open, (get-nr-windows) returns
2 and the function safely-kill-window (in
TeXmacs/procs/texmacs/texmacs/tm-server.scm) does not check for unsaved
buffers.
In other words: If the last texmacs window is closed using the X button
of the window manager (or Alt-F4 - my usual method of closing windows)
unsaved buffers are silently closed without saving.
Could others please confirm the problem:
- create file
- insert image
- do not save file
- a) File|Close TeXmacs should correctly ask for confirmation
b) View|Close Window should erraneously quit without asking for
confirmation (alternatively click the X button in the frame or press
Alt-F4, depending on the Window manager)
His solution:
in src/Window/X/x_drawable.cpp, routine x_drawable_rep::image
a dummy window is created to be used by ghostscript.
This window is also counted by nr_windows, confusing the check in
safely-kill-window.
This problem should be fairly trivial to fix by adding
nr_windows--;
right after creating this dummy window. The value of nr_windows seems to be only used to check whether any real windows are still open, so the dummy should actually never be counted.
|