Welcome to NeoOffice developer notes and announcements
NeoOffice
Developer notes and announcements
 
 

This website is an archive and is no longer active
NeoOffice announcements have moved to the NeoOffice News website


Support
· Forums
· NeoOffice Support
· NeoWiki


Announcements
· Twitter @NeoOffice


Downloads
· Download NeoOffice


  
NeoOffice :: View topic - Can't Select After Locked file is Duplicated
Can't Select After Locked file is Duplicated
 
   NeoOffice Forum Index -> NeoOffice Releases
View previous topic :: View next topic  
Author Message
Lorinda
Captain Mifune


Joined: Jun 20, 2006
Posts: 2051
Location: Midwest, USA

PostPosted: Tue Oct 25, 2011 5:35 pm    Post subject: Can't Select After Locked file is Duplicated

Part of Lion's Versions feature, which NeoOffice supports, is the automatic locking of files that haven't been opened in a certain period of time (by default 2 weeks). Once a file is locked, if you attempt to make changes, a dialog box opens telling you the file is locked, and offering to let you unlock or duplicate the file. I have discovered that if I duplicate a file, I cannot select text in that file until I have saved, closed, and reopened it. Here are the steps to duplicate:

-Open a NeoOffice file that has not been edited in two weeks (I was opening odt files)
-When the warning dialog appears, click "duplicate"
-Type a few changes (I don't know if this step is necessary, but it's what I've been doing)
-Attempt to select some text; it won't work
-Save file
-Close file
-Reopen file: selection now works.

Lorinda
Back to top
Lorinda
Captain Mifune


Joined: Jun 20, 2006
Posts: 2051
Location: Midwest, USA

PostPosted: Tue Oct 25, 2011 5:38 pm    Post subject:

Hmm....waiting a few minutes seems to work as well as saving, closing, and reopening. Or maybe it's changing the focus. I left a problematic document open while I made the above post. When I went back to the document, I found that I could select text.

Lorinda
Back to top
pluby
The Architect
The Architect


Joined: Jun 16, 2003
Posts: 11949

PostPosted: Tue Oct 25, 2011 5:57 pm    Post subject:

From what I can tell, after you choose to unlock the document in the native dialog the actual unlocking steps that Mac OS X does are done asynchronous. Usually, that asynchronous unlocking occurs very soon after the dialog closes so when you start trying to edit the original document, NeoOffice's queries to Mac OS X say that the file is unlocked.

In your case, it sounds like either Mac OS X took an extraordinarily long time before it executed the unlocking steps or the unlocking process failed.

Has this problem only occurred once or has it occurred more than once? If more than once, can you launch the /Applications/Utilities/Console application and search through the Console window for any messages that start with "soffice.bin"?

Patrick
Back to top
Lorinda
Captain Mifune


Joined: Jun 20, 2006
Posts: 2051
Location: Midwest, USA

PostPosted: Tue Oct 25, 2011 7:26 pm    Post subject:

Patrick,

It's happened at least twice, with two different documents that had been automatically locked due to the length of time since I last edited them. The first time was yesterday, I think. I searched the Console log entries for the time frame when it happened tonight, and found no notes for "soffice.bin"

Lorinda
Back to top
pluby
The Architect
The Architect


Joined: Jun 16, 2003
Posts: 11949

PostPosted: Tue Oct 25, 2011 8:48 pm    Post subject:

I will look at the code and tomorrow I will post a debug patch so that we can see what the state of things are when Mac OS X unlocks the document.

Patrick
Back to top
pluby
The Architect
The Architect


Joined: Jun 16, 2003
Posts: 11949

PostPosted: Tue Oct 25, 2011 9:58 pm    Post subject:

Just to be sure that I understand what happens correctly, you are able to type text in the duplicate document but not select text, right? In other words, the duplicate document that is created is fully editable except that nothing can be selected until the newly created document is saved and reopened. Or is the breakage more subtle than that?

Patrick
Back to top
Lorinda
Captain Mifune


Joined: Jun 20, 2006
Posts: 2051
Location: Midwest, USA

PostPosted: Wed Oct 26, 2011 4:35 am    Post subject:

That's right. Although either waiting a while or shifting focus to another app (not sure which) also seems to resolve the issue.

Lorinda
Back to top
pluby
The Architect
The Architect


Joined: Jun 16, 2003
Posts: 11949

PostPosted: Wed Oct 26, 2011 8:43 am    Post subject:

One more question: when this problem occurs, can you select text by pressing the Command-A keys? I ask this because after looking at the code, I think that the cause of this problem is not in the new Lion code but is in our existing drag and drop code.

The reason that I think this is because when you select the Duplicate button, what happens is that we create a temporary file and silently invoke the OpenOffice.org's "save as" code to save a copy of the file to the temporary file. Then we open the temporary file in NeoOffice.

The temporary file is just like any other document that you open so my feeling is that mouse dragging are getting mishandled if the new document window opens when some unknown action is occurring and, apparently, changing focus resets our dragging code.

The question is what is that unknown action? Do you remember if you were starting to drag the mouse in the original window when the duplicate document opened?

Patrick
Back to top
Lorinda
Captain Mifune


Joined: Jun 20, 2006
Posts: 2051
Location: Midwest, USA

PostPosted: Wed Oct 26, 2011 2:29 pm    Post subject:

Command-A doesn't work at first, either (even when typing does). But after several seconds (sorry, I wasn't counting), it does work. It looks like there's a lag. I had tried dragging, then Command A a couple of times, then started typing, when all of a sudden everything in the document disappeared, replaced with the last couple of letters I had been typing.

So it's tracking typing "real-time," but there's a significant delay before it registers command-A or dragging to select. Shift-arrows don't work to select, either during that delay. But, if I wait for a few seconds, the text I tried to select will suddenly appear as highlighted.

In my testing today, I did NOT try to select anything in the original file. I began to type, and that's when I was given the option to duplicate the file.

Lorinda
Back to top
pluby
The Architect
The Architect


Joined: Jun 16, 2003
Posts: 11949

PostPosted: Wed Oct 26, 2011 5:06 pm    Post subject:

Lorinda wrote:
So it's tracking typing "real-time," but there's a significant delay before it registers command-A or dragging to select. Shift-arrows don't work to select, either during that delay. But, if I wait for a few seconds, the text I tried to select will suddenly appear as highlighted.


These details are very good information. I will look at the event dispatching code to see if our code or Java is reordering events. It sounds like the pattern is most key events are getting posted to the event queue before and queued mouse events or key events with a modifier key pressed (Command, Shift, or other).

Patrick
Back to top
pluby
The Architect
The Architect


Joined: Jun 16, 2003
Posts: 11949

PostPosted: Wed Oct 26, 2011 6:57 pm    Post subject:

I have posted the following debug patch that will print out each key and mouse drag event that is dispatched by Java.

The output from this debug patch will be voluminous so I would recommend running NeoOffice from the Terminal using the following command:

Code:
/Applications/NeoOffice.app/Contents/MacOS/soffice.bin


Then, copy the last 100 or so lines immediately from the Terminal immediately after the problem appears and post those lines.

Here is the link to the debug patch:

Intel:
http://joe.neooffice.org/test/NeoOffice-3.2.1-Patch-1-Test-2-Debug-1-Intel.dmg

Patrick
Back to top
Lorinda
Captain Mifune


Joined: Jun 20, 2006
Posts: 2051
Location: Midwest, USA

PostPosted: Wed Oct 26, 2011 7:24 pm    Post subject:

Now, of course, I can't reproduce this!

Either:

-something in the debug patch fixed the issue or
-It was a problem with only one of my machines. I THOUGHT I'd seen this behavior on both of my MacBook Pros, but I can't be absolutely certain of my memory on this point. Earlier today, I was working on the Mac I keep at work, and verified the bug. I was home by the time I saw the debug patch, and installed it on my other machine. I'll try to find time to install this patch and check things out on the other machine tomorrow.

Lorinda
Back to top
Lorinda
Captain Mifune


Joined: Jun 20, 2006
Posts: 2051
Location: Midwest, USA

PostPosted: Thu Oct 27, 2011 10:01 am    Post subject:

This is getting really bizarre. I'm back at work, where my other Mac is, and decided I should verify the bug before applying the debug patch. And the issue I reported the other day is gone! There's a very slight delay in selecting text (like a fraction of a second), but nothing like I experienced before.

This has me perplexed, because I had reproduced the reported error several times (including in response to your questions), and I can't think of anything that has changed on my machines since then. (I haven't even rebooted).

I'll let you know if it comes back.

Lorinda
Back to top
pluby
The Architect
The Architect


Joined: Jun 16, 2003
Posts: 11949

PostPosted: Thu Oct 27, 2011 10:16 am    Post subject:

Lorinda wrote:
This has me perplexed, because I had reproduced the reported error several times (including in response to your questions), and I can't think of anything that has changed on my machines since then. (I haven't even rebooted).


Maybe the code changes in the last test patch before the debug patch has fixed this issue. To test that theory, can you install the following test patch? This test patch is the same as the debug patch that you installed but without all of the debug output:

Intel:
http://joe.neooffice.org/test/NeoOffice-3.2.1-Patch-1-Test-2-Intel.dmg

The only change in the above test patch is a fix for an OpenOffice.org font name matching bug so if your problem reappears, then we know that the slowdown from the debug code is making the problem disappear.

Patrick
Back to top
Lorinda
Captain Mifune


Joined: Jun 20, 2006
Posts: 2051
Location: Midwest, USA

PostPosted: Thu Oct 27, 2011 10:21 am    Post subject:

Note that I have not applied the debug patch to Neo on this computer; my apologies if I didn't state that clearly enough. Given my experience yesterday on my other Mac, I wanted to verify the bug before I applied the debug patch, and that's when I discovered it had disappeared.

Do you still want me to try the newest test patch?

Lorinda
Back to top
Display posts from previous:   
   NeoOffice Forum Index -> NeoOffice Releases All times are GMT - 7 Hours
Goto page 1, 2  Next
Page 1 of 2

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Powered by phpBB © 2001, 2005 phpBB Group

All logos and trademarks in this site are property of their respective owner. The comments are property of their posters, all the rest © Planamesa Inc.
NeoOffice is a registered trademark of Planamesa Inc. and may not be used without permission.
PHP-Nuke Copyright © 2005 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.