bugGNU TeXmacs - Bugs: bug #18492, safely-close-window silently...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #18492: safely-close-window silently ignores unsaved buffers

Submitted by:  Felix Breuer <fbreuer>
Submitted on:  Fri 08 Dec 2006 11:30:18 PM UTC  
 
Category: User InterfacePriority: 5 - Normal
Item Group: ErrorStatus: Fixed
Privacy: PublicAssigned to: None
Originator Name: Open/Closed: Closed
Release: Release: None
Fixed Release: NoneFixed Release: 
Keywords: 

Fri 09 Mar 2012 11:12:18 AM UTC, comment #2:

Old & fixed ==> closed

Miguel de Benito <mdbenito>
Project Member
Sat 09 Dec 2006 12:07:25 AM UTC, comment #1:

The attached patch implements Norbert's suggestions and fixes the bug.

(file #11489)

Felix Breuer <fbreuer>
Project Member
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.

Felix Breuer <fbreuer>
Project Member

 

Attached Files
file #11489:  nr_windows.patch added by fbreuer (745B - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by mdbenito (Posted a comment)
  • -unavailable- added by fbreuer (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 09 Mar 2012 11:12:18 AM UTCmdbenitoOpen/ClosedAccepted=>Closed
    Mon 18 Dec 2006 07:24:25 PM UTCfbreuerOpen/ClosedOpen=>Accepted
    Sat 09 Dec 2006 12:07:25 AM UTCfbreuerAttached File-=>Added nr_windows.patch, #11489
      StatusConfirmed=>Fixed

    Back to the top


    Powered by Savane 3.1-cleanup1