vcl/inc/osx/vclnsapp.h | 3 +++ vcl/osx/salframe.cxx | 3 ++- vcl/osx/vclnsapp.mm | 12 ++++++++++++ vcl/source/outdev/line.cxx | 16 ++++++++++++++++ 4 files changed, 33 insertions(+), 1 deletion(-)
New commits: commit 534d43ac5b51c57c01f275d6ecb320ee9e51000a Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Fri Nov 25 11:41:33 2022 +0000 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Fri Nov 25 15:45:27 2022 +0100 ofz#53349 Timeout Change-Id: I9381aa819dadd823b9e71212f7dd14ea0047ef5f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143295 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/vcl/source/outdev/line.cxx b/vcl/source/outdev/line.cxx index d8a2822160c7..b6750ac9a41c 100644 --- a/vcl/source/outdev/line.cxx +++ b/vcl/source/outdev/line.cxx @@ -338,6 +338,22 @@ void OutputDevice::drawLine( basegfx::B2DPolyPolygon aLinePolyPolygon, const Lin *this); } + if(!bDone) + { + static const bool bFuzzing = utl::ConfigManager::IsFuzzing(); + if (bFuzzing) + { + const basegfx::B2DRange aRange(basegfx::utils::getRange(aFillPolyPolygon)); + if (aRange.getMaxX() - aRange.getMinX() > 0x10000000 + || aRange.getMaxY() - aRange.getMinY() > 0x10000000) + { + SAL_WARN("vcl.gdi", "drawLine, skipping suspicious range of: " + << aRange << " for fuzzing performance"); + bDone = true; + } + } + } + if(!bDone) { for(auto const& rB2DPolygon : std::as_const(aFillPolyPolygon)) commit e10e5981ca020af11d25d5756964c95d51dd1535 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Fri Nov 25 09:57:45 2022 +0000 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Fri Nov 25 15:45:14 2022 +0100 tdf#152183 update settings when dark/light system mode toggled Change-Id: I2273d79d2703ebd7a021bdca1737f5fb9fa9bc32 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143284 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/vcl/inc/osx/vclnsapp.h b/vcl/inc/osx/vclnsapp.h index 5cf8582c3771..e3329f554c7e 100644 --- a/vcl/inc/osx/vclnsapp.h +++ b/vcl/inc/osx/vclnsapp.h @@ -47,6 +47,9 @@ class AquaSalFrame; -(NSApplicationPrintReply)application: (NSApplication *) app printFiles:(NSArray *)files withSettings: (NSDictionary *)printSettings showPrintPanels:(BOOL)bShowPrintPanels; -(NSApplicationTerminateReply)applicationShouldTerminate: (NSApplication *) app; -(void)applicationWillTerminate: (NSNotification *) aNotification; +-(void)observeValueForKeyPath: (NSString*) keyPath ofObject:(id)object + change: (NSDictionary<NSKeyValueChangeKey, id>*)change + context: (void*)context; -(void)systemColorsChanged: (NSNotification*) pNotification; -(void)screenParametersChanged: (NSNotification*) pNotification; -(void)scrollbarVariantChanged: (NSNotification*) pNotification; diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx index 76635cf9f270..df6413a8fe65 100644 --- a/vcl/osx/salframe.cxx +++ b/vcl/osx/salframe.cxx @@ -1260,8 +1260,9 @@ SAL_WNODEPRECATED_DECLARATIONS_PUSH return; SAL_WNODEPRECATED_DECLARATIONS_POP - StyleSettings aStyleSettings = rSettings.GetStyleSettings(); + [NSAppearance setCurrentAppearance: mpNSView.effectiveAppearance]; + StyleSettings aStyleSettings = rSettings.GetStyleSettings(); bool bUseDarkMode(false); NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults]; diff --git a/vcl/osx/vclnsapp.mm b/vcl/osx/vclnsapp.mm index ee848375cedb..d31b41b5f1e6 100644 --- a/vcl/osx/vclnsapp.mm +++ b/vcl/osx/vclnsapp.mm @@ -79,6 +79,9 @@ { [NSWindow setAllowsAutomaticWindowTabbing:NO]; } + + // listen to dark mode change + [NSApp addObserver:self forKeyPath:@"effectiveAppearance" options: 0 context: nil]; } -(void)sendEvent:(NSEvent*)pEvent @@ -327,6 +330,15 @@ return aReply; } +-(void)observeValueForKeyPath: (NSString*) keyPath ofObject:(id)object + change: (NSDictionary<NSKeyValueChangeKey, id>*)change + context: (void*)context +{ + [super observeValueForKeyPath:keyPath ofObject:object change:change context:context]; + if ([keyPath isEqualToString:@"effectiveAppearance"]) + [self systemColorsChanged: nil]; +} + -(void)systemColorsChanged: (NSNotification*) pNotification { (void)pNotification;