summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>2013-08-19 10:32:34 +0300
committerFridrich Strba <fridrich@documentfoundation.org>2013-08-19 10:32:20 +0000
commit7aa6eaa8b27aea6d52875d1a7d7994b3ca3e5904 (patch)
tree155461c0671f721202418430909bce3c3e2dec93
parentc373d4a7807581459a474ffc0a277d0d6c00447a (diff)
fdo#39007: Brute force fix: Unlink a potential restorecount.plist file
It is not completely clear to me whether we really still might be leaving such files around. After all, we do tell our NSWindows to not be restorable... Norbert's code in AquaSalFrame::initWindowAndView(). On the other hand, Cocoa does seem to create the file and keep it around for a short while before removing it (in responce to our setRestorable:NO calls?), so there is a slight time window where if LO crashes, the file will be left around. Such a file might also be around from an older LO version, or manually planted there by somebody wanting to reproduce the bug... Of course, the *real* fix for this problem would be to make LO a *proper* Cocoa document centric application, that would use NSDocument, NSApplication etc like native applications are supposed to, and that *would* handle window restoration the Cocoa way. I.e., work with the system instead of against it. Maybe some day, but obviously not here in this branch. (cherry picked from commit bd507a0d093b7d5239992440a40d0a7453b38207) Change-Id: I9ed058130ddddf49cf0221d899bef3e2654589c7 Reviewed-on: https://gerrit.libreoffice.org/5509 Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org> Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
-rw-r--r--vcl/Library_vcl.mk4
-rw-r--r--vcl/aqua/source/app/salinst.cxx2
2 files changed, 6 insertions, 0 deletions
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index 0669590312f5..4e3df9b8d12c 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -356,6 +356,10 @@ $(eval $(call gb_Library_add_cxxflags,vcl,\
$(gb_OBJCXXFLAGS) \
))
+$(eval $(call gb_Library_add_defs,vcl,\
+ -DMACOSX_BUNDLE_IDENTIFIER=\"$(MACOSX_BUNDLE_IDENTIFIER)\" \
+))
+
ifeq ($(ENABLE_CORETEXT),YES)
$(eval $(call gb_Library_add_defs,vcl,\
diff --git a/vcl/aqua/source/app/salinst.cxx b/vcl/aqua/source/app/salinst.cxx
index 5f033f2236d4..790b987e71af 100644
--- a/vcl/aqua/source/app/salinst.cxx
+++ b/vcl/aqua/source/app/salinst.cxx
@@ -197,6 +197,8 @@ static void initNSApp()
sal_Bool ImplSVMainHook( int * pnInit )
{
+ unlink([[NSString stringWithFormat:@"%@/Library/Saved Application State/%s.savedState/restorecount.plist", NSHomeDirectory(), MACOSX_BUNDLE_IDENTIFIER] UTF8String]);
+
gpnInit = pnInit;
bNoSVMain = false;