core.git: vcl/inc vcl/osx vcl/source
vcl/inc/svdata.hxx |1 vcl/osx/salframeview.mm | 92 +++ vcl/osx/salinst.cxx |4 + vcl/osx/saltimer.cxx |4 - vcl/source/app/scheduler.cxx |2 5 files changed, 59 insertions(+), 44 deletions(-) New commits: commit 62baf23796132d6c0e17ae1ff37c3b9ee0556cf0 Author: Patrick Luby AuthorDate: Tue Nov 5 19:51:55 2024 -0500 Commit: Patrick Luby CommitDate: Mon Nov 11 01:17:25 2024 +0100 tdf#163764 Force pending timers to run after marked text changes During native dictation, waiting for the next native event is blocked while dictation runs in a loop within a native callback. Because of this, LibreOffice's painting timers won't fire until dictation is cancelled or the user pauses speaking. So, force any pending timers to fire after the marked text changes. Also, remove the fix for OpenOffice bug 106901 as causes any key down events to cancel dictation and removing the fix does not appear to cause the original crashing bug to reoccur. Note: inserting a character from the system Character Viewer window causes dictation to stop responding and the only way I have found to restart dictation is by toggling dictation off and then back on again. This same behavior occurs in Apple's TextEdit application so this appears to be a macOS bug. Change-Id: Iad2b54870ff1a315f2f71d72bef24af3cea808e6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176100 Reviewed-by: Michael Weghorn Tested-by: Jenkins Reviewed-by: Patrick Luby diff --git a/vcl/inc/svdata.hxx b/vcl/inc/svdata.hxx index a839b4276959..c332894e1fc8 100644 --- a/vcl/inc/svdata.hxx +++ b/vcl/inc/svdata.hxx @@ -274,6 +274,7 @@ struct ImplSVWinData boolmbNoDeactivate = false; // true: do not execute Deactivate boolmbNoSaveFocus = false; // true: menus must not save/restore focus boolmbIsLiveResize = false; // true: skip waiting for events and low priority timers +boolmbIsWaitingForNativeEvent = false; // true: code is executing via a native callback while waiting for the next native event }; typedef std::vector< std::pair< OUString, FieldUnit > > FieldUnitStringList; diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm index 681567f3a5fa..9bdfa8d9f239 100644 --- a/vcl/osx/salframeview.mm +++ b/vcl/osx/salframeview.mm @@ -212,6 +212,32 @@ static void updateWinDataInLiveResize(bool bInLiveResize) } } +static void freezeWindowSizeAndReschedule( NSWindow *pWindow ) +{ +if ( pWindow ) +{ +// Application::Reschedule() can potentially display a modal +// dialog which will cause a hang so temporarily disable any +// resizing by clamping the window's minimum and maximum sizes +// to the current frame size which in Application::Reschedule(). +bool bIsLiveResize = ImplGetSVData()->mpWinData->mbIsLiveResize; +NSSize aMinSize = [pWindow minSize]; +NSSize aMaxSize = [pWindow maxSize]; +if ( bIsLiveResize ) +{ +NSRect aFrame = [pWindow frame]; +[pWindow setMinSize:aFrame.size]; +[pWindow setMaxSize:aFrame.size]; +} +Application::Reschedule( true ); +if ( bIsLiveResize ) +{ +[pWindow setMinSize:aMinSize]; +[pWindow setMaxSize:aMaxSize]; +} +} +} + @interface NSResponder (SalFrameWindow) -(BOOL)accessibilityIsIgnored; @end @@ -454,18 +480,7 @@ static void updateWinDataInLiveResize(bool bInLiveResize) // not trigger redrawing with the new size. // Instead, force relayout by dispatching all pending internal // events and firing any pending timers. -// Also, Application::Reschedule() can potentially display a -// modal dialog which will cause a hang so temporarily disable -// live resize by clamping the window's minimum and maximum sizes -// to the current frame size which in Application::Reschedule(). -NSRect aFrame = [self frame]; -NSSize aMinSize = [self minSize]; -NSSize aMaxSize = [self maxSize]; -[self setMinSize:aFrame.size]; -[self setMaxSize:aFrame.size]; -Application::Reschedule( true ); -[self setMinSize:aMinSize]; -[self setMaxSize:aMaxSize]; +freezeWindowSizeAndReschedule( self ); if ( ImplGetSVData()->mpWinData->mbIsLiveResize ) { @@ -1931,36 +1946,11 @@ static void updateWinDataInLiveResize(bool bInLiveResize) mbNeedSpecialKeyHandle = true; } -// FIXME: -// #i106901# -// if we come here outside of mbInKeyInput, this is likely to be because -// of the keyboard viewer. For unknown reasons ha
core.git: vcl/inc vcl/osx vcl/source vcl/unx vcl/win
vcl/inc/salinst.hxx|2 ++ vcl/osx/service_entry.cxx |2 +- vcl/source/app/salvtables.cxx |7 +++ vcl/source/components/dtranscomp.cxx |4 ++-- vcl/unx/generic/dtrans/X11_service.cxx |2 +- vcl/unx/gtk3/gtkinst.cxx |2 +- vcl/win/dtrans/WinClipboard.cxx|2 +- 7 files changed, 15 insertions(+), 6 deletions(-) New commits: commit 828b26bdc22743974655d64dada69e154159435a Author: Noel Grandin AuthorDate: Tue Jul 16 13:40:03 2024 +0200 Commit: Noel Grandin CommitDate: Tue Jul 16 16:03:08 2024 +0200 use generic clipboard when running UI tests rather than the system clipboard, which makes no sense, since then the tests interfere with each other Change-Id: I911e88f5547dfc4f3558b9ed3ef670cef4903420 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170574 Tested-by: Jenkins Reviewed-by: Xisco Fauli Reviewed-by: Noel Grandin diff --git a/vcl/inc/salinst.hxx b/vcl/inc/salinst.hxx index ca6a6920bf76..45c031db30ae 100644 --- a/vcl/inc/salinst.hxx +++ b/vcl/inc/salinst.hxx @@ -214,6 +214,8 @@ public: // Note: we cannot make this a global variable, because it might be initialised BEFORE the putenv() call in cppunittester. static bool IsRunningUnitTest() { return getenv("LO_TESTNAME") != nullptr; } +static bool IsRunningUITest(); + // both must be implemented, if the VCL plugin needs to run via system event loop virtual bool DoExecute(int &nExitCode); virtual void DoQuit(); diff --git a/vcl/osx/service_entry.cxx b/vcl/osx/service_entry.cxx index 849e73a77dcd..a970b6a65917 100644 --- a/vcl/osx/service_entry.cxx +++ b/vcl/osx/service_entry.cxx @@ -38,7 +38,7 @@ using namespace ::com::sun::star::datatransfer::clipboard; uno::Reference< XInterface > AquaSalInstance::CreateClipboard( const Sequence< Any >& i_rArguments ) { -if ( Application::IsHeadlessModeEnabled() || IsRunningUnitTest() ) +if ( Application::IsHeadlessModeEnabled() || IsRunningUnitTest() || IsRunningUITest() ) return SalInstance::CreateClipboard( i_rArguments ); SalData* pSalData = GetSalData(); diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 353f3ecfb285..67ac9f971a63 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -180,6 +180,13 @@ void SalInstance::DoQuit() std::abort(); } +// static +bool SalInstance::IsRunningUITest() +{ +static const bool bRunningUITest = getenv("LIBO_TEST_UNIT"); +return bRunningUITest; +} + SalTimer::~SalTimer() COVERITY_NOEXCEPT_FALSE {} void SalBitmap::DropScaledCache() diff --git a/vcl/source/components/dtranscomp.cxx b/vcl/source/components/dtranscomp.cxx index 49cb61eb37fa..9c052468aaef 100644 --- a/vcl/source/components/dtranscomp.cxx +++ b/vcl/source/components/dtranscomp.cxx @@ -446,7 +446,7 @@ Reference< XInterface > SalInstance::CreateDragSource(const SystemEnvData* pSysE { // We run unit tests in parallel, which is a problem when touching a shared resource // the system clipboard, so rather use the dummy GenericClipboard. -if (Application::IsHeadlessModeEnabled() || IsRunningUnitTest()) +if (Application::IsHeadlessModeEnabled() || IsRunningUnitTest() || IsRunningUITest()) return getXWeak(new vcl::GenericDragSource()); return ImplCreateDragSource(pSysEnv); } @@ -459,7 +459,7 @@ uno::Reference SalInstance::ImplCreateDropTarget(const SystemEn Reference< XInterface > SalInstance::CreateDropTarget(const SystemEnvData* pSysEnv) { // see SalInstance::CreateDragSource -if (Application::IsHeadlessModeEnabled() || IsRunningUnitTest()) +if (Application::IsHeadlessModeEnabled() || IsRunningUnitTest() || IsRunningUITest()) return getXWeak(new vcl::GenericDropTarget()); return ImplCreateDropTarget(pSysEnv); } diff --git a/vcl/unx/generic/dtrans/X11_service.cxx b/vcl/unx/generic/dtrans/X11_service.cxx index 73c0487370c7..19f8b20fda05 100644 --- a/vcl/unx/generic/dtrans/X11_service.cxx +++ b/vcl/unx/generic/dtrans/X11_service.cxx @@ -47,7 +47,7 @@ Sequence< OUString > x11::Xdnd_dropTarget_getSupportedServiceNames() css::uno::Reference< XInterface > X11SalInstance::CreateClipboard( const Sequence< Any >& arguments ) { -if ( IsRunningUnitTest() ) +if ( IsRunningUnitTest() || IsRunningUITest() ) return SalInstance::CreateClipboard( arguments ); SelectionManager& rManager = SelectionManager::get(); diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx index aaf69e92d186..698f2dbe1575 100644 --- a/vcl/unx/gtk3/gtkinst.cxx +++ b/vcl/unx/gtk3/gtkinst.cxx @@ -1578,7 +1578,7 @@ void VclGtkClipboard::removeClipboardListener( const Reference< datatransfer::cl Reference< XInterface > GtkInstance::CreateClipboard(const Sequence< Any >& arguments) { -if ( IsRunningUnitTest() ) +if ( IsRunningUnitTest() || IsRunningUITest()
[Libreoffice-commits] core.git: vcl/inc vcl/osx vcl/source
vcl/inc/osx/salframeview.h |6 +++ vcl/inc/osx/salinst.h|1 vcl/inc/svdata.hxx |1 vcl/osx/salframeview.mm | 77 +++ vcl/osx/salinst.cxx | 14 ++- vcl/osx/saltimer.cxx |4 +- vcl/source/app/scheduler.cxx |7 +++ 7 files changed, 92 insertions(+), 18 deletions(-) New commits: commit fed429e4f6f437997aa6a88e2d071f58aa00ee34 Author: Patrick Luby AuthorDate: Sun Jan 8 14:41:24 2023 -0500 Commit: Patrick Luby CommitDate: Fri Jan 13 14:10:00 2023 + Related: tdf#152703 Eliminate potential blocking during live resize Some events and timers call Application::Reschedule() or Application::Yield() so don't block and wait for events when a window is in live resize. Also, only native events and timers need to be dispatched to redraw the window so skip dispatching user events when a window is in live resize. Lastly, only higher priority tasks need to be fired to redraw the window so skip firing potentially long-running tasks, such as the Writer idle layout timer, when a window is in live resize. Change-Id: I5d449caa432399e836b8e59781e5cc53af718873 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145211 Tested-by: Jenkins Reviewed-by: Patrick Luby diff --git a/vcl/inc/osx/salframeview.h b/vcl/inc/osx/salframeview.h index 7ec995b26c18..6242f3d4146a 100644 --- a/vcl/inc/osx/salframeview.h +++ b/vcl/inc/osx/salframeview.h @@ -29,8 +29,12 @@ enum class SalEvent; AquaSalFrame* mpFrame; id mDraggingDestinationHandler; BOOLmbInLiveResize; +BOOLmbInWindowDidResize; +NSTimer*mpLiveResizeTimer; } -(id)initWithSalFrame: (AquaSalFrame*)pFrame; +-(void)clearLiveResizeTimer; +-(void)dealloc; -(BOOL)canBecomeKeyWindow; -(void)displayIfNeeded; -(void)windowDidBecomeKey: (NSNotification*)pNotification; @@ -63,6 +67,8 @@ enum class SalEvent; -(void)endExtTextInput; -(void)endExtTextInput:(EndExtTextInputFlags)nFlags; + +-(void)windowDidResizeWithTimer:(NSTimer *)pTimer; @end @interface SalFrameView : AquaA11yWrapper diff --git a/vcl/inc/osx/salinst.h b/vcl/inc/osx/salinst.h index 1e6fce7092fd..8811fa3c9c72 100644 --- a/vcl/inc/osx/salinst.h +++ b/vcl/inc/osx/salinst.h @@ -89,7 +89,6 @@ public: int mnActivePrintJobs; osl::Mutex maUserEventListMutex; osl::Condition maWaitingYieldCond; -boolmbIsLiveResize; boolmbNoYieldLock; boolmbTimerProcessed; diff --git a/vcl/inc/svdata.hxx b/vcl/inc/svdata.hxx index 3651eb3bce61..06d0aeb9b9af 100644 --- a/vcl/inc/svdata.hxx +++ b/vcl/inc/svdata.hxx @@ -269,6 +269,7 @@ struct ImplSVWinData StartAutoScrollFlagsmnAutoScrollFlags = StartAutoScrollFlags::NONE; // auto scroll flags boolmbNoDeactivate = false; // true: do not execute Deactivate boolmbNoSaveFocus = false; // true: menus must not save/restore focus +boolmbIsLiveResize = false; // true: skip waiting for events and low priority timers }; typedef std::vector< std::pair< OUString, FieldUnit > > FieldUnitStringList; diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm index 4833af8fda9e..b14d87eb7a37 100644 --- a/vcl/osx/salframeview.mm +++ b/vcl/osx/salframeview.mm @@ -170,6 +170,8 @@ static AquaSalFrame* getMouseContainerFrame() { mDraggingDestinationHandler = nil; mbInLiveResize = NO; +mbInWindowDidResize = NO; +mpLiveResizeTimer = nil; mpFrame = pFrame; NSRect aRect = { { static_cast(pFrame->maGeometry.x()), static_cast(pFrame->maGeometry.y()) }, { static_cast(pFrame->maGeometry.width()), static_cast(pFrame->maGeometry.height()) } }; @@ -210,6 +212,22 @@ static AquaSalFrame* getMouseContainerFrame() return static_cast(pNSWindow); } +-(void)clearLiveResizeTimer +{ +if ( mpLiveResizeTimer ) +{ +[mpLiveResizeTimer invalidate]; +[mpLiveResizeTimer release]; +mpLiveResizeTimer = nil; +} +} + +-(void)dealloc +{ +[self clearLiveResizeTimer]; +[super dealloc]; +} + -(AquaSalFrame*)getSalFrame { return mpFrame; @@ -318,12 +336,29 @@ static AquaSalFrame* getMouseContainerFrame() (void)pNotification; SolarMutexGuard aGuard; +if ( mbInWindowDidResize ) +return; + +mbInWindowDidResize = YES; + if( mpFrame && AquaSalFrame::isAlive( mpFrame ) ) { mpFrame->UpdateFrameGeometry(); mpFrame->CallCallback( SalEvent::Resize, nullptr ); bool bInLiveResize = [self inLiveResize]; +ImplSVData* pSVData = ImplGetSVData(); +assert( pSVData ); +
[Libreoffice-commits] core.git: vcl/inc vcl/osx vcl/source
vcl/inc/osx/salframe.h |2 -- vcl/inc/salframe.hxx |4 vcl/osx/salframe.cxx |9 - vcl/source/window/dialog.cxx |3 --- 4 files changed, 18 deletions(-) New commits: commit 0ffbaecea3316a5c723f6e0eb7250611b5d0f3d7 Author: Noel Grandin AuthorDate: Sat Apr 25 21:16:53 2020 +0200 Commit: Noel Grandin CommitDate: Sat Apr 25 22:30:34 2020 +0200 tf#131549 No titlebar on modal dialogs on macOS regression from commit e5230535877e30c3b874495e8794faa3a42d8017 Date: Tue Mar 17 21:34:21 2020 +0200 simplify ORefVector code where a half-finished patch of mine snuck into another patch. Change-Id: I01f59a9d451f4535197d3abd7b37bfdbc8461c15 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92901 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/vcl/inc/osx/salframe.h b/vcl/inc/osx/salframe.h index 60b4e82f2540..3d0f19f418a0 100644 --- a/vcl/inc/osx/salframe.h +++ b/vcl/inc/osx/salframe.h @@ -163,8 +163,6 @@ public: void UpdateFrameGeometry(); -virtual void BeginSheet(SalFrame* pSheetFrame) const override; - // trigger painting of the window void SendPaintEvent( const tools::Rectangle* pRect = nullptr ); diff --git a/vcl/inc/salframe.hxx b/vcl/inc/salframe.hxx index bc1127d1989b..b83138e29d40 100644 --- a/vcl/inc/salframe.hxx +++ b/vcl/inc/salframe.hxx @@ -259,10 +259,6 @@ public: return false; } -/** only does anything on MACOSX where it indicates to the OS that this window is a modal-dialog - * and should be displayed using the special sheet mode */ -virtual void BeginSheet(SalFrame* /*pSheetWindow*/) const {} - // return true to indicate tooltips are shown natively, false otherwise virtual boolShowTooltip(const OUString& /*rHelpText*/, const tools::Rectangle& /*rHelpArea*/) { diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx index b2990d3ede17..6f7a395522cf 100644 --- a/vcl/osx/salframe.cxx +++ b/vcl/osx/salframe.cxx @@ -1822,13 +1822,4 @@ void AquaSalFrame::EndSetClipRegion() // shadow is invalidated when view gets drawn again } -void AquaSalFrame::BeginSheet(SalFrame* pSheetFrame) const -{ -NSWindow* pSheetNSWindow = static_cast(pSheetFrame)->mpNSWindow; -//[mpNSWindow beginSheet:pSheetNSWindow]; -//beginSheet(mpNSWindow]; - -[mpNSWindow beginSheet:pSheetNSWindow completionHandler:nil ]; -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx index 34d38021a73f..9ea561abe64f 100644 --- a/vcl/source/window/dialog.cxx +++ b/vcl/source/window/dialog.cxx @@ -966,9 +966,6 @@ bool Dialog::ImplStartExecute() // FIXME: no layouting, workaround some clipping issues ImplAdjustNWFSizes(); -if (mpDialogParent) -mpDialogParent->ImplGetFrame()->BeginSheet(ImplGetFrame()); // only does anything on macOS - css::uno::Reference< css::uno::XComponentContext > xContext( comphelper::getProcessComponentContext()); bool bForceFocusAndToFront(officecfg::Office::Common::View::NewDocumentHandling::ForceFocusAndToFront::get(xContext)); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: vcl/inc vcl/osx vcl/source
vcl/inc/osx/salinst.h |3 ++- vcl/inc/salinst.hxx |1 + vcl/osx/salinst.cxx | 30 +++--- vcl/osx/salmenu.cxx |9 + vcl/osx/vclnsapp.mm | 16 vcl/source/app/svmain.cxx |6 +- 6 files changed, 52 insertions(+), 13 deletions(-) New commits: commit 284a7f60fff72c4d8c011ff60ea2e40163cd25c3 Author: Jan-Marek Glogowski AuthorDate: Thu Jan 3 13:45:16 2019 +0100 Commit: Jan-Marek Glogowski CommitDate: Fri Jan 11 05:20:11 2019 +0100 OSX Re-Introduce NSApplicationMain usage This restores the nested NSApplicationMain and default run loop usage. Without it the Java AWT integration will start its own event loop, effectively blocking any non-system event processing. Reproducible via "Tools - Macros - Organize Macros - BeanShell... - LibreOffice Macros - HelloWorld - helloworld.bsh - Edit". The blocking can be prevented by overriding NSApplication::run and running our own event loop using Application::Execute. But this still doesn't show the Java AWT editor window and I couldn't find any information how to fix this. Since OSX now is a VCL plugin, this can't restore the old hook mechanism, but instead adds a new function to SalInstance. SalInstance initialization happens at InitVCL() start just a little bit later in the call stack. Somehow NSApplicationMain manages to run the Java VM in an extra thread, so it doesn't block the main loop. Probably this could also be handled by LO starting the JVM as a thread. Further information for an implementation eventually can be found in the "Technical Note TN2147" "JNI Development on Mac OS X." Change-Id: I04a0c2bf7949571f1b678ada9ab3592e0fe30c1f Regression-from: 925e2edb6f3f8fffcff9eddb31ed18bc77e2a690 Reviewed-on: https://gerrit.libreoffice.org/65836 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski diff --git a/vcl/inc/osx/salinst.h b/vcl/inc/osx/salinst.h index 18b8de8cfc7f..edece53b6bea 100644 --- a/vcl/inc/osx/salinst.h +++ b/vcl/inc/osx/salinst.h @@ -91,6 +91,7 @@ public: virtual ~AquaSalInstance() override; virtual void AfterAppInit() override; +virtual bool SVMainHook(int *) override; virtual SalFrame* CreateChildFrame( SystemParentData* pParent, SalFrameStyleFlags nStyle ) override; virtual SalFrame* CreateFrame( SalFrame* pParent, SalFrameStyleFlags nStyle ) override; @@ -145,7 +146,7 @@ public: void endedPrintJob() { mnActivePrintJobs--; } // event subtypes for NSApplicationDefined events -static const short AppEndLoopEvent= 1; +static const short AppExecuteSVMain = 1; static const short AppStartTimerEvent = 10; static const short YieldWakeupEvent = 20; static const short DispatchTimerEvent = 30; diff --git a/vcl/inc/salinst.hxx b/vcl/inc/salinst.hxx index f48cca4136e2..e35cd78df4fb 100644 --- a/vcl/inc/salinst.hxx +++ b/vcl/inc/salinst.hxx @@ -89,6 +89,7 @@ public: //called directly after Application::Init virtual voidAfterAppInit() {} +virtual boolSVMainHook(int*) { return false; } // Frame // DisplayName for Unix ??? diff --git a/vcl/osx/salinst.cxx b/vcl/osx/salinst.cxx index c92b621a023c..f0f470545138 100644 --- a/vcl/osx/salinst.cxx +++ b/vcl/osx/salinst.cxx @@ -81,6 +81,7 @@ extern "C" { using namespace std; using namespace ::com::sun::star; +static int* gpnInit = nullptr; static NSMenu* pDockMenu = nil; static bool bLeftMain = false; @@ -328,8 +329,6 @@ VCLPLUG_OSX_PUBLIC SalInstance* create_SalInstance() ImplGetSVData()->maNWFData.mbProgressNeedsErase = true; ImplGetSVData()->maNWFData.mnStatusBarLowerRightOffset = 10; -[NSApp finishLaunching]; - return pInst; } } @@ -386,9 +385,14 @@ void AquaSalInstance::handleAppDefinedEvent( NSEvent* pEvent ) if ( pTimer ) pTimer->handleStartTimerEvent( pEvent ); break; -case AppEndLoopEvent: +case AppExecuteSVMain: +{ +int nRet = ImplSVMain(); +if (gpnInit) +*gpnInit = nRet; [NSApp stop: NSApp]; break; +} case DispatchTimerEvent: { AquaSalInstance *pInst = GetSalData()->mpInstance; @@ -958,5 +962,25 @@ NSImage* CreateNSImage( const Image& rImage ) return pImage; } +bool AquaSalInstance::SVMainHook(int* pnInit) +{ +gpnInit = pnInit; + +OUString aExeURL, aExe; +osl_getExecutableFile( &aExeURL.pData ); +osl_getSystemPathFromFileURL( aExeURL.pData, &aExe.pData ); +OString aByteExe( OUStringToOString( aExe, osl_getThreadTextEncoding() ) ); + +#ifdef DEBUG +aByteExe += OString ( " NSAccessibilityDebugLogLevel 1" ); +const char* pArgv[] = { aByteExe.getStr(), NULL }; +NSApplicationMain( 3, pArgv ); +#else +const char* pArgv[] = { aByteExe.getStr(), nullptr }; +NSApplica
[Libreoffice-commits] core.git: vcl/inc vcl/osx vcl/source
vcl/inc/osx/salframe.h |3 -- vcl/osx/salnativewidgets.cxx | 46 --- vcl/source/app/scheduler.cxx |1 3 files changed, 50 deletions(-) New commits: commit c76160c6e23f8a4e8d60068b7054591f238cbc9f Author: Tor Lillqvist AuthorDate: Tue Nov 27 10:16:27 2018 +0200 Commit: Tor Lillqvist CommitDate: Tue Nov 27 10:35:01 2018 +0200 tdf#114839: Drop ancient AquaBlinker crack Most probably that was related to "pulsating" buttons that haven't been used since 10.9. Whether the code even worked (made buttons pulsate) on 10.9 anyway is unclear. Much of the code in this file uses various HITheme (Carbon?) API that as far as I know is long since deprecated and undocumented. It's weird that it still compiles, and that it doesn't get caught by the private API use checking when submitting to the the Mac App Store, in the LibreOffice Vanilla case. This change reduces the busy looping in Dialog::Execute() even when nothing happens (no user input, no mouse movement) when displaying a dialog. Change-Id: I9c62db608f637aa5d8493176feb2873f6426fd00 diff --git a/vcl/inc/osx/salframe.h b/vcl/inc/osx/salframe.h index c1a55269b517..4d34b3375167 100644 --- a/vcl/inc/osx/salframe.h +++ b/vcl/inc/osx/salframe.h @@ -42,7 +42,6 @@ class AquaSalFrame; class AquaSalTimer; class AquaSalInstance; class AquaSalMenu; -class AquaBlinker; typedef struct SalFrame::SalPointerState SalPointerState; @@ -87,8 +86,6 @@ public: CGMutablePathRefmrClippingPath; // used for "shaping" std::vector< CGRect > maClippingRects; -std::list maBlinkers; - tools::Rectangle maInvalidRect; InputContextFlags mnICOptions; diff --git a/vcl/osx/salnativewidgets.cxx b/vcl/osx/salnativewidgets.cxx index d89fecf1681e..0026d68a0dbd 100644 --- a/vcl/osx/salnativewidgets.cxx +++ b/vcl/osx/salnativewidgets.cxx @@ -44,45 +44,6 @@ #endif -class AquaBlinker : public Timer -{ -AquaSalFrame* mpFrame; -tools::Rectangle maInvalidateRect; - -AquaBlinker( AquaSalFrame* pFrame, const tools::Rectangle& rRect ) -: Timer( "AquaBlinker" ) -, mpFrame( pFrame ) -, maInvalidateRect( rRect ) -{ -mpFrame->maBlinkers.push_back( this ); -} - -public: -static void Blink( AquaSalFrame*, const tools::Rectangle&, int nTimeout = 80 ); - -virtual void Invoke() override -{ -if( AquaSalFrame::isAlive( mpFrame ) && mpFrame->mbShown ) -{ -mpFrame->maBlinkers.remove( this ); -mpFrame->SendPaintEvent( &maInvalidateRect ); -} -delete this; -} -}; - -void AquaBlinker::Blink( AquaSalFrame* pFrame, const tools::Rectangle& rRect, int nTimeout ) -{ -// prevent repeated paints from triggering themselves all the time -auto isRepeated = std::any_of(pFrame->maBlinkers.begin(), pFrame->maBlinkers.end(), -[&rRect](AquaBlinker* pBlinker) { return pBlinker->maInvalidateRect == rRect; }); -if( isRepeated ) -return; -AquaBlinker* pNew = new AquaBlinker( pFrame, rRect ); -pNew->SetTimeout( nTimeout ); -pNew->Start(); -} - // Helper returns an HIRect static HIRect ImplGetHIRectFromRectangle(tools::Rectangle aRect) @@ -514,13 +475,6 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType, // avoid clipping when focused rc.origin.x += FOCUS_RING_WIDTH/2; rc.size.width -= FOCUS_RING_WIDTH; - -if( nState & ControlState::DEFAULT ) -{ -AquaBlinker::Blink( mpFrame, buttonRect ); -// show correct animation phase -aPushInfo.animation.time.current = CFAbsoluteTimeGetCurrent(); -} } else aPushInfo.kind = kThemeBevelButton; diff --git a/vcl/source/app/scheduler.cxx b/vcl/source/app/scheduler.cxx index e647cab8de65..bdcb3fddafad 100644 --- a/vcl/source/app/scheduler.cxx +++ b/vcl/source/app/scheduler.cxx @@ -151,7 +151,6 @@ next_priority: // TODO: shutdown these timers before Scheduler de-init // TODO: remove Task from static object if ( pTask->GetDebugName() && ( false -|| !strcmp( pTask->GetDebugName(), "AquaBlinker" ) || !strcmp( pTask->GetDebugName(), "desktop::Desktop m_firstRunTimer" ) || !strcmp( pTask->GetDebugName(), "DrawWorkStartupTimer" ) || !strcmp( pTask->GetDebugName(), "editeng::ImpEditEngine aOnlineSpellTimer" ) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: vcl/inc vcl/osx vcl/source
vcl/inc/salinst.hxx |4 vcl/osx/salinst.cxx |3 +++ vcl/source/app/svmain.cxx |4 3 files changed, 11 insertions(+) New commits: commit 8bd289c43c34ab9258f4b08a0f3f6143dc710e4e Author: Tor Lillqvist Date: Thu Feb 22 12:40:26 2018 +0200 tdf#103690: Set up notifications only after VCL has been initialised On some Macs, it seems that LibreOffice (or any app?) gets an NSApplicationDidChangeScreenParametersNotification as soon as it has started and asked for such a notification. Our handler for that notification assumes that VCL is initialised. Thus we should not ask for such notifications before VCL has been initialised. I could not reproduce the reported crash with an unmodified LibreOffice, only after inserting a sleep after the notifications had been set up. But I am fairly sure this change fixes the problem. Change-Id: I18d342eb7dc0c77cb7fc8623756bead65a1bd329 Reviewed-on: https://gerrit.libreoffice.org/50164 Tested-by: Jenkins Reviewed-by: Tor Lillqvist diff --git a/vcl/inc/salinst.hxx b/vcl/inc/salinst.hxx index 1eadc7ac382f..600f8ddfb8b3 100644 --- a/vcl/inc/salinst.hxx +++ b/vcl/inc/salinst.hxx @@ -205,6 +205,10 @@ void DeInitSalData(); // called from Application-Dtor void InitSalMain(); +#ifdef MACOSX +void postInitVCLinitNSApp(); +#endif + #endif // INCLUDED_VCL_INC_SALINST_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/osx/salinst.cxx b/vcl/osx/salinst.cxx index 48eafa5eac1a..e008357b3641 100644 --- a/vcl/osx/salinst.cxx +++ b/vcl/osx/salinst.cxx @@ -157,7 +157,10 @@ static void initNSApp() // activate our delegate methods [NSApp setDelegate: NSApp]; +} +void postInitVCLinitNSApp() +{ [[NSNotificationCenter defaultCenter] addObserver: NSApp selector: @selector(systemColorsChanged:) name: NSSystemColorsDidChangeNotification diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx index 500eb3060c19..f44fd566aabc 100644 --- a/vcl/source/app/svmain.cxx +++ b/vcl/source/app/svmain.cxx @@ -187,6 +187,10 @@ int ImplSVMain() bool bInit = isInitVCL() || InitVCL(); +#ifdef MACOSX +postInitVCLinitNSApp(); +#endif + if( bInit ) { // call application main ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: vcl/inc vcl/osx vcl/source vcl/unx vcl/win
vcl/inc/fontattributes.hxx |2 -- vcl/inc/salwtype.hxx |2 -- vcl/inc/unx/gtk/gtkframe.hxx |2 -- vcl/inc/unx/printergfx.hxx |6 +- vcl/inc/unx/saldata.hxx |1 - vcl/inc/unx/salframe.h |3 --- vcl/inc/unx/wmadaptor.hxx|8 vcl/inc/window.h |3 --- vcl/osx/salframeview.mm |6 -- vcl/source/edit/vclmedit.cxx |5 - vcl/source/filter/wmf/winmtf.hxx |1 - vcl/source/filter/wmf/winwmf.cxx |2 -- vcl/source/font/fontattributes.cxx |2 -- vcl/source/fontsubset/cff.cxx| 24 vcl/source/gdi/pdfwriter_impl.cxx| 32 vcl/source/gdi/pdfwriter_impl.hxx|7 +-- vcl/source/outdev/font.cxx |4 ++-- vcl/source/window/menubarwindow.cxx | 34 ++ vcl/source/window/menubarwindow.hxx |1 - vcl/source/window/settings.cxx |4 ++-- vcl/source/window/window.cxx | 11 --- vcl/unx/generic/app/i18n_cb.cxx |2 -- vcl/unx/generic/app/i18n_ic.cxx |6 -- vcl/unx/generic/app/saldata.cxx |1 - vcl/unx/generic/app/wmadaptor.cxx|3 --- vcl/unx/generic/print/bitmap_gfx.cxx | 22 +++--- vcl/unx/generic/print/common_gfx.cxx |3 --- vcl/unx/generic/print/text_gfx.cxx |2 +- vcl/unx/generic/window/salframe.cxx | 24 ++-- vcl/unx/gtk/gtksalframe.cxx | 19 ++- vcl/unx/gtk/salnativewidgets-gtk.cxx |4 vcl/unx/gtk3/gtk3gtkframe.cxx|7 --- vcl/win/window/salframe.cxx |4 33 files changed, 36 insertions(+), 221 deletions(-) New commits: commit 1ac18c60bb280855cfcc8d92886709cd6db35118 Author: Noel Grandin Date: Thu Jun 23 14:10:31 2016 +0200 loplugin:singlevalfields in vcl(part2) Change-Id: I4782c6f6d3d090ba0f9e29af8afdd7d88aa2d382 Reviewed-on: https://gerrit.libreoffice.org/26598 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/vcl/inc/fontattributes.hxx b/vcl/inc/fontattributes.hxx index faca6a8..fcd2fa8 100644 --- a/vcl/inc/fontattributes.hxx +++ b/vcl/inc/fontattributes.hxx @@ -42,7 +42,6 @@ public: FontItalic GetItalic() const { return meItalic; } FontPitch GetPitch() const{ return mePitch; } FontWidth GetWidthType() const{ return meWidthType; } -TextAlign GetAlignment() const{ return meAlign; } rtl_TextEncodingGetCharSet() const { return meCharSet; } boolIsSymbolFont() const{ return mbSymbolFlag; } @@ -86,7 +85,6 @@ private: FontPitch mePitch;// Pitch Type FontWidth meWidthType;// Width Type FontItalic meItalic; // Slant Type -TextAlign meAlign;// Text alignment rtl_TextEncodingmeCharSet; // RTL_TEXTENCODING_SYMBOL or RTL_TEXTENCODING_UNICODE boolmbSymbolFlag; // Is font a symbol? diff --git a/vcl/inc/salwtype.hxx b/vcl/inc/salwtype.hxx index 2a45616..75fae73 100644 --- a/vcl/inc/salwtype.hxx +++ b/vcl/inc/salwtype.hxx @@ -161,12 +161,10 @@ struct SalWheelMouseEvent struct SalExtTextInputEvent { -sal_uInt64 mnTime; // Time in ms, when event is created OUStringmaText; // Text const ExtTextInputAttr* mpTextAttr; // Text-Attribute sal_Int32 mnCursorPos;// Cursor-Position sal_uInt8 mnCursorFlags; // EXTTEXTINPUT_CURSOR_xxx -boolmbOnlyCursor; // true: Only Cursor-Position has been changed }; struct SalExtTextInputPosEvent diff --git a/vcl/inc/unx/gtk/gtkframe.hxx b/vcl/inc/unx/gtk/gtkframe.hxx index ff5c454..30c0743 100644 --- a/vcl/inc/unx/gtk/gtkframe.hxx +++ b/vcl/inc/unx/gtk/gtkframe.hxx @@ -180,7 +180,6 @@ class GtkSalFrame : public SalFrame GdkNativeWindow m_aForeignParentWindow; GdkWindow* m_pForeignTopLevel; GdkNativeWindow m_aForeignTopLevelWindow; -Pixmap m_hBackgroundPixmap; SalFrameStyleFlags m_nStyle; SalExtStyle m_nExtStyle; GtkSalFrame*m_pParent; @@ -381,7 +380,6 @@ public: GdkNativeWindow getForeignParentWindow() const { return m_aForeignParentWindow; } GdkWindow* getForeignTopLevel() const { return m_pForeignTopLevel; } GdkNativeWindow getForeignTopLevelWindow() const { return m_aForeignTopLevelWindow; } -Pixmap getBackgroundPixmap() cons
[Libreoffice-commits] core.git: vcl/inc vcl/osx vcl/source
vcl/inc/svmain.hxx| 30 ++ vcl/osx/salinst.cxx |1 + vcl/source/app/svmain.cxx |4 +--- vcl/source/app/svmainhook.cxx |4 4 files changed, 36 insertions(+), 3 deletions(-) New commits: commit 57ecf341a42866c8ed207768603a379173961c71 Author: Stephan Bergmann Date: Mon Apr 7 13:41:06 2014 +0200 Clean up ImplSVMainHook declaration Change-Id: I51d7eac6160a3c3abc96733fa30fdcbb41bb5509 diff --git a/vcl/inc/svmain.hxx b/vcl/inc/svmain.hxx new file mode 100644 index 000..6ea93fa --- /dev/null +++ b/vcl/inc/svmain.hxx @@ -0,0 +1,30 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_VCL_INC_SVMAIN_HXX +#define INCLUDED_VCL_INC_SVMAIN_HXX + +#include + +// #i47888# allow for alternative initialization as required for e.g. MacOSX +bool ImplSVMainHook( int* ); + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/osx/salinst.cxx b/vcl/osx/salinst.cxx index fce9e95..4414bef 100644 --- a/vcl/osx/salinst.cxx +++ b/vcl/osx/salinst.cxx @@ -46,6 +46,7 @@ #include "print.h" #include "impbmp.hxx" #include "salimestatus.hxx" +#include "svmain.hxx" #include diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx index f0277ea..f5b05fe 100644 --- a/vcl/source/app/svmain.cxx +++ b/vcl/source/app/svmain.cxx @@ -52,6 +52,7 @@ #include "salinst.hxx" #include "salwtype.hxx" #include "svdata.hxx" +#include "svmain.hxx" #include "dbggui.hxx" #include "accmgr.hxx" #include "idlemgr.hxx" @@ -180,9 +181,6 @@ int ImplSVMain() int SVMain() { -// #i47888# allow for alternative initialization as required for e.g. MacOSX -extern bool ImplSVMainHook( int* ); - int nRet; if( !Application::IsConsoleOnly() && ImplSVMainHook( &nRet ) ) return nRet; diff --git a/vcl/source/app/svmainhook.cxx b/vcl/source/app/svmainhook.cxx index 1f2ba0d..4974cff 100644 --- a/vcl/source/app/svmainhook.cxx +++ b/vcl/source/app/svmainhook.cxx @@ -17,6 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include + +#include + #ifndef MACOSX // MacOSX implementation of ImplSVMainHook is in osx/salinst.cxx ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits