summaryrefslogtreecommitdiff
path: root/vcl/osx
AgeCommit message (Collapse)Author
2023-10-20tdf#157565 show tooltip if any parent window is the key windowPatrick Luby
Commit b69db38a38b09e158e8d46d8b717db85860ca874 caused tooltips to fail to appear if their immediate parent window was not the key window. So, look through the parent window's parent windows and, if any of those windows are the kwy window, show the tooltip. Change-Id: Icf1aed1144fdeac03b4b208de8ed8ee2db8ad4a0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158212 Tested-by: Jenkins Reviewed-by: Patrick Luby <plubius@neooffice.org>
2023-10-14Add NUMBERSIGN key handler.Gökay Şatır
German keyboard layout has number sign key. Users can print number sign without using modification keys. So this key can be assigned a shortcut. Subscript is assigned to CTRL + NUMBERSIGN. Below PR is used as reference when adding the new key handler: https://gerrit.libreoffice.org/c/core/+/86713 Signed-off-by: Gökay Şatır <gokaysatir@collabora.com> Change-Id: I340dc47764e9200d2477f8db740a629f62f48004 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157554 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> (cherry picked from commit 1db8f6d484b884301a7d3673f4d05478e28cd853) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157959 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-09-19The name is macOS since 2016Andras Timar
Change-Id: I9f2011e1f9619652b4ed417f135451d8ccfe90bc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157033 Tested-by: Jenkins Reviewed-by: Andras Timar <andras.timar@collabora.com>
2023-09-12attempt to fix macos jenkins hangs - part 3Patrick Luby
oox::xls::WorkbookFragment::finalizeImport() calls AquaSalInstance::DoYield() with bWait set to true. But since unit tests generally have no expected user generated events, we can end up blocking and waiting forever so don't block and wait when running unit tests. Change-Id: I14cfdb88f04b82f49e8c15e554e5c4b4053e77b3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156826 Tested-by: Jenkins Reviewed-by: Patrick Luby <plubius@neooffice.org>
2023-09-10attempt to fix macos jenkins hangs - part 2Patrick Luby
Commit a1174a5f1e312ebb98c3941d35287a8ffcb368e9 attempts to fix sporadic blocking and waiting when fetching a native event so use the same fix in AquaSalInstance::AnyInput() just to be safe. Change-Id: I1505b6089f11be825bd13e0219a305159dfc324f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156803 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins Reviewed-by: Patrick Luby <plubius@neooffice.org>
2023-09-10attempt to fix macos jenkins hangsNoel Grandin
I see sporadic hangs, and the backtrace indicates that the process is locked up inside _nextEventMatchingEventMask. Try an alternative formulation of this method. Change-Id: Id8d7631bb0421cfb3c91a673ea14c0fe458c6f28 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156794 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-08-09vcl: Organize CoreText font code a bitKhaled Hosny
The code was all over the place with classes split between files or grouped in some files and I couldn’t make a head or tail of it. Move each class to a dedicated source/header file. Change-Id: I35daa05b4684c13339c637819dc30fa47a60cf65 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155503 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@libreoffice.org>
2023-08-08loplugin:redundantfcastStephan Bergmann
Change-Id: I6b19cbd146de479754b9e8833076ed7f077c87f2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155443 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-08-02split Point/Size/Rectangle into AbsoluteScreenPixel* typesNoel Grandin
to attempt to make it obvious in code what kind of coordinate system we are dealing with. The idea is that by doing this, the compile-time type checking will flush out inconsistencies between different code. I started with vcl::Window::OutputToAbsoluteScreenPixel and worked outwards from there. Change-Id: Ia967d7a0bb38886695f3a761b85c8b9340ddb1c0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154676 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-07-24tdf#155414 include system "reduce animation" preferencesPatrick Luby
Allow the system's "reduce animation" preferences to disable the Calc animated border when copying a selection of cells. Also, fix failure to stop the animated border when a copy action is performed in a different document by cancelling the animated border. This transferable has lost ownership of the system clipboard so, in essence, the previous copy action that created this transferable has been cancelled. Change-Id: I4da6d557c5dbf653c38a99eb7a16d961843a41d6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154752 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Reviewed-by: Patrick Luby <plubius@neooffice.org>
2023-06-26attempted fix for sporadic hang on macosNoel Grandin
Change-Id: I75d624eb98a87cb15f41be02631205cb86d7d270 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153618 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-06-20loplugin:cstylecastStephan Bergmann
Change-Id: I32e3e9bff261f95010582c6e5e2d22abb725f402 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153311 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-06-16tdf#146626 catch IndexOutOfBoundsException when fetching accessible childrenPatrick Luby
com::sun::star::accessibility::XAccessibleContext::getAccessibleChild() can throw an IndexOutOfBoundsException exception even when fetching with an index that is positive and less than the value returned by a call to the accessible context's getAccessibleChildCount() method so put every getAccessibleChild() call in a try/catch block. Note: this is actually expected behavior even though it is rare. For example, accessibility::AccessibleTextHelper_Impl::getAccessibleChild() uses the following code snippet to throw such an exception: if( 0 > i || i >= getAccessibleChildCount() || GetTextForwarder().GetParagraphCount() <= i ) In the case of tdf#146626, getAccessibleChildCount() returns 22 but getAccessibleChild(1) throws such an exception due to the last condition in the above code snippet. Change-Id: If974afb7b9178faa99b91dcd79eb5f169bbfe13e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153160 Tested-by: Jenkins Reviewed-by: Patrick Luby <plubius@neooffice.org>
2023-06-13tdf#155376 weakly cache ScAccessibleCellNoel Grandin
the macOS accessibility framework repeatedly queries and enumerates all of the visible cells. Every time this happens we create a new set of ScAccessibleCell, which then live until the application shuts down, which then causes a very slow shutdown. So I fix the problem by caching the ScAccessibleCell so we return the same one for a given cell position. Of course, this begs the question of why the ScAccessibleCell objects are not dying when we create new ones, which means we have some kind of leak or lifecycle problem somewhere, but anyhow, this is a fairly simple and comprehensive fix. Change-Id: Id2765236ac4524f490a51b56268fb8038612fd43 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152932 Tested-by: Jenkins Reviewed-by: Patrick Luby <plubius@neooffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-06-12Fix hanging when selecting a column or row in CalcPatrick Luby
When a Calc column is selected, the child count will be at least a million. Constructing that many C++ Calc objects takes several minutes even on a fast Silicon Mac so apply the maximum table cell limit here. Change-Id: I4e3ebf9fdf7367620313e4e10dd0918de9d6bffb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152853 Tested-by: Jenkins Reviewed-by: Patrick Luby <plubius@neooffice.org>
2023-06-07Partial fix tdf#155376 use NSAccessibilityElement instead of NSViewPatrick Luby
On macOS, accessibility is implemented by creating a native NSView for each C++ accessible element. The problem with using an NSView for each element is that NSViews are very slow to add to or remove from an NSWindow once the number of NSViews is more than a thousand or so. Fortunately, Apple added a protocol that allows adding a native accessible element using the lightweight NSAccessiblityElement class. The topmost NSAccessiblityElement elements are connected to the single SalFrameView in each NSWindow but since NSAccessiblityElements are not NSViews, they are not connected to any of NSWindow's event or draw dispatching. This makes NSAccessiblityElements significantly faster to add to or remove from an NSWindow with no apparent loss in functionality. Note: this change is a subset of the LibreOffice 4.4 code changes that I wrote for NeoOffice. Change-Id: I408108d57217db407512dfa3457fe26d2ab455de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152717 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Patrick Luby <plubius@neooffice.org>
2023-06-02reduce memory overhead of AquaA11yWrapperNoel Grandin
we can allocate this internally, which reduces the number of heap allocations we need to do Change-Id: Id5298e70b6816cd65d8285ceea846dc8e9e4b39d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152489 Reviewed-by: Patrick Luby <plubius@neooffice.org> Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-05-29Related tdf#tdf155376 fix minor memory leaksPatrick Luby
Change-Id: I9cdc5fb38ffba113e3d069d9d766dbe1a82c492d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152352 Tested-by: Jenkins Reviewed-by: Patrick Luby <plubius@neooffice.org> (cherry picked from commit 7ae89a2ad89c9e7702fbd2b31269ee4c61fe5bcb) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152316
2023-05-29Partial fix tdf#146626 Catch uncaught DisposedExceptionPatrick Luby
Fix crash due to an uncaught DisposedException thrown by SwAccessibleParagraph::getTextRange() by using the same try/catch block in -[A11yWrapper accessibilityAttributeValue:] in -[A11yWrapper accessibilityAttributeValue:forParameter]. Change-Id: Ifcaec3eb2d76f32bddc56a1242f6d86f8b90f782 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152361 Tested-by: Jenkins Reviewed-by: Patrick Luby <plubius@neooffice.org> (cherry picked from commit f8cc6f960e8aeb37547d447fed2b2c6e6ddc02e3) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152317
2023-05-28Use getXWeak in vclMike Kaganski
Change-Id: I665c9dc8c4f9cc4a996d9bf990cbfa33822bd07f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150885 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-05-23Resolves tdf#145080 - Use accent color for focused cellHeiko Tietze
Accent color added but effectively working only on macOS See inline comments for gtk, qt, and win Change-Id: I1e4a729331735683921f94b27bb2bb02555c0165 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151887 Tested-by: Jenkins Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
2023-05-10tdf#152173 Don't display tooltip windows when mousing over non-key windowsPatrick Luby
Don't display tooltips when mousing over non-key windows even if the application is active as the tooltip window will pull the non-key window in front of the key window. Change-Id: I425b9af09de0272ebee84a218e2e5ae8c200a4e5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151646 Tested-by: Jenkins Reviewed-by: Patrick Luby <plubius@neooffice.org>
2023-05-04tdf#152173 Don't display tooltip windows when application is inactivePatrick Luby
Starting with macOS 13 Ventura, inactive applications receive mouse move events so when LibreOffice is inactive, a mouse move event causes a tooltip to be displayed. Since the tooltip window is attached to its parent window (to ensure that the tooltip is above the parent window), displaying a tooltip pulls the parent window in front of the windows of all other inactive applications. Change-Id: I35caf480a8afb42694957a4a6c2bec20be591ef3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151394 Tested-by: Jenkins Reviewed-by: Patrick Luby <plubius@neooffice.org>
2023-04-14add a way to resolve if dark mode (explicit or auto) is activeCaolán McNamara
Change-Id: Ie0d4e0c3cd5d19cf6337ec79d30ae7c877cffd82 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150394 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-04-13Related: tdf#153374 Don't release autoreleased attributeNamesPatrick Luby
Also, return an autoreleased empty array instead of a retained array. Change-Id: I5f494b301dbae859486d6bc4874112b714022b60 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150307 Tested-by: Jenkins Reviewed-by: Patrick Luby <plubius@neooffice.org>
2023-04-12tdf#154708 Preserve selection for repeating Shift-arrow on Japanese keyboardPatrick Luby
Skip the posting of SalEvent::ExtTextInput and SalEvent::EndExtTextInput events for private use area characters. Change-Id: I6fa5dedacefc5d9dd671f607786deb999f5e4c6a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150248 Tested-by: Jenkins Reviewed-by: Patrick Luby <plubius@neooffice.org>
2023-03-29tdf#149805 tdf#151677 tdf#152217 tdf#154043 tdf#153458 tdf#153800 Revert ↵Michael Weghorn
"VCL expect ... correct frame size for native menubars" This reverts commit afc828b9833b7a612369e95606ba56d41ef2c369 Date: Sat May 28 23:47:21 2022 +0200 VCL expect correct frame size for native menubars ... and renove the wrong framesize hack in the Qt backend because it caused several regressions and unfortunately the commit also doesn't fix all of the bugs mentioned in its commit message (while some previous patch sets of the change did address more, yet had other issues, s.a. the discussion in the commit's Gerrit change [1]). While e.g. the drag and drop issues reported in tdf#153458 and tdf#153800 could be fixed by translating the event position using `mapToParent()` (as is done in `QtWidget::fillSalAbstractMouseEvent` with the above commit in place), I currently don't see how to address the other issues and the overall direction of the change is not fully clear to me at this point. (There are also other pending changes in the relation change still pending in Gerrit that would presumably need more work/analysis.) After all, it seems the best way forward to revert the commit for now. This also reverts the follow-up commit commit 25da92004038c03c0feedf373e8038e7ee3e0c37 Date: Thu Jul 21 11:33:02 2022 +0200 Make JunitTest_toolkit_unoapi_1 succeed again on macOS that fixed a test failure introduced by the above commit. Luckily, there seem to be no follow-up commits that depend on this and the commits can be reverted cleanly without the need to resolve any conflicts manually. This reverts commit 25da92004038c03c0feedf373e8038e7ee3e0c37. This reverts commit afc828b9833b7a612369e95606ba56d41ef2c369. [1] https://gerrit.libreoffice.org/c/core/+/135082 Change-Id: I4c099ad7de8cbbad10da391ede4770d8c748fbde Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149495 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-03-14Related tdf#129547 and tdf#154136: add COLON keyJulien Nabet
Change-Id: I17978dbb100fbfa6f6ddbbbdf96872076bc2a289 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86713 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-03-11Use a matching dark icon theme on auto picking icon theme from fallbacksCaolán McNamara
explicitly use: breeze/breeze_dark for plasma sukapura/sukapura_dark for macOS colibre/colibre_dark for win originally we only had one dark theme so in a dark theme there was only one option available, but there's now a bunch to choose from. In practice nothing changes here because breeze_dark is the current (as originally only) dark mode fallback for gnome and win/osx name an explicit something"_dark" in their platform specific bits Change-Id: I13fdfe586cec30b5a9770dc80c9bdcc6a57d04a5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148650 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2023-03-10Reset dark mode colors in HITheme controls after printingPatrick Luby
In dark mode, after an NSPrintOperation has completed, macOS draws HITheme controls with light mode colors so reset all dark mode colors when an NSWindow gains focus. Change-Id: Ifdbb7d2eff8157ed0d711cf975c2ad1fdcf63495 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148570 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Patrick Luby <plubius@neooffice.org>
2023-02-09loplugin:staticaccessStephan Bergmann
Change-Id: I24aa6b773f13b5d9924fbc867090ab9bf8c42045 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146681 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-02-08tdf#153229 use bestMatchFromAppearancesWithNames to take user pref into accountCaolán McNamara
so user's override of system is taken into account for the icon theme. Change-Id: I02a9bf67eb6a3406f0e60bea58387e2e7457c995 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146669 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-02-08tdf#153229 add a switch to override honoring system dark modeCaolán McNamara
Change-Id: Iafb6182e05dc65d20d0809476ee58908f7426d39 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146597 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-01-26tdf#147342 Notify Skia that the window's backing properties changedPatrick Luby
Change-Id: I4185a240a2ca6df1c92e86ff9950f86234d4ace8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146142 Tested-by: Jenkins Reviewed-by: Patrick Luby <plubius@neooffice.org>
2023-01-20tdf#148453 Fix crash by turning off optimization for Objective-C selectorPatrick Luby
The default attributes sequence sometimes crashes when it is released but only when compiler optimization is enabled, so disable optimization for the +[AquaA11yTextAttributesWrapper createAttributedStringForElement] selector. Also, disabling optimization by itself is apparently not enough to stop the crashing. Acquiring the solar mutex during native accessibility calls is also needed. Native accessibility calls are called from native input sources in [NSApp nextEventMatchingMask:untilDate:inMode:dequeue:]. Since AquaSalInstance::DoYield() releases the solar mutex before calling [NSApp nextEventMatchingMask:untilDate:inMode:dequeue:], we need to always acquire the solar mutex during all NSAccessibility selectors (both the old informal protocol and the newer formal protocol) that we implement. Change-Id: I9b715e17e9c5a32b7ce28815e288b2af236c3cc6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145742 Tested-by: Jenkins Reviewed-by: Patrick Luby <plubius@neooffice.org>
2023-01-17Related: tdf#42437 Skip special press-and-hold handling for action keysPatrick Luby
Pressing and holding action keys such as arrow keys must not be handled like pressing and holding a character key as it will insert unexpected text. Change-Id: I6beaff265e6cae30337b025791692ff67b760ff8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145689 Tested-by: Jenkins Reviewed-by: Patrick Luby <plubius@neooffice.org>
2023-01-17loplugin:casttovoid ("unnecessary cast to void")Stephan Bergmann
Change-Id: Ic891e3ea72e7946a9088ab77ba561d0f1c9b77e2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145673 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-01-13Related: tdf#152703 Eliminate potential blocking during live resizePatrick Luby
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 <plubius@neooffice.org>
2023-01-11rename BitmapEx::GetAlpha to GetAlphaMaskNoel Grandin
to ease the reading of code related to an upcoming patch to convert transparency to alpha, since there is already a GetAlpha in Color. Change-Id: I1af0f8f6dd94acfe4673c8556c7aff6c20da3f7a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145209 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-01-10tdf#152648 Handle overflow when multiplying rows and columnsPatrick Luby
Change-Id: I1f3b4853fb6e6a66e74e798d6594342c84d5a695 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145245 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-01-09loplugin:fakeboolStephan Bergmann
Change-Id: Idf69f13c3e8ab94ac04d83c9a0d171cddc399a10 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145213 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-01-06Fix typoAndrea Gelmini
Change-Id: Ie90862c12a441ddf0b325baee920b91704b05e77 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145112 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-01-05Related: tdf#152703 Prevent possible hang when live resizing a windowPatrick Luby
Application::Reschedule() can potentially display a modal dialog which will cause a hang so temporarily disable live resize by clampiing the window's minimum and maximum sizes to the current frame size which in Application::Reschedule(). Also, eliminate flickering during live resizing of a window when using Skia/Metal. When in live resize, the SkiaSalGraphicsImpl class does not detect that the window size has changed until after the flush has been called so call checkSurface() to recreate the SkSurface if needed before flushing. Flushing had to be moved during [self windowDidResize:] to eliminate flicker. Flushing in [self displayIfNeeded] does not eliminate flicker so apparently [self windowDidResize:] is called earlier. Change-Id: Id3de838d2e17fee85cb583b6c4e862b571d47142 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145053 Tested-by: Jenkins Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-01-04tdf#152703 Force relayout during live resizing of windowPatrick Luby
During a live resize, macOS floods the application with windowDidResize: notifications so sending a paint event does not trigger redrawing with the new size. Instead, force relayout by dispatching all pending internal events and firing any pending timers. Also, force a repaint of the window after live resizing ends by reposting this notification so that [self windowDidResize:] will be called at least once after live resizing ends. Change-Id: I9d93108c989418bab6d80c7f6afaccc1daaa746e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145042 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-01-03loplugin:fakeboolStephan Bergmann
Change-Id: I0d03e29e6290a0e7945b80538efa6b0467d37fad Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144981 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-01-03Related: tdf#152703 Eliminate empty window with Skia/Metal while resizingPatrick Luby
The window will clear its background in [SalFrameWindow displayIfNeeded] so when Skia/Metal is enabled, explicitly flush the Skia graphics to the window during live resizing or else nothing will be drawn until after live resizing has ended. Also, when Skia/Metal is enabled, rapidly resizing a window has a noticeable amount of flicker so don't send any paint events during live resizing. Also, it appears that most of the LibreOffice layouts do not change their layout much during live resizing so apply this change when Skia is not enabled to ensure consistent behavior whether Skia is enabled or not. Change-Id: If6423faa72529b9de8735e04e69c9511aceb2276 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144979 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-12-23tdf#150177 Limit minimum blink cursor ratePatrick Luby
This bug occurs when the values for NSTextInsertionPointBlinkPeriodOn or NSTextInsertionPointBlinkPeriodOff are set to zero or close to zero. LibreOffice becomes very sluggish opening documents when either is set at 100 milliseconds or less so set the blink rate to the maximum of 500 milliseconds, NSTextInsertionPointBlinkPeriodOn, and NSTextInsertionPointBlinkPeriodOff. Change-Id: I953bddda757f8514221ac5cd9c04bd749a994fda Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144775 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-12-23Fix typoAndrea Gelmini
Change-Id: Ie67ae711e6fe0348ddde1fb5d3ac8798fc37c8aa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144776 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-12-22tdf#42437 Enable press-and-hold special character input methodPatrick Luby
The first step to enable this input method is to always return a valid selected range location. -[NSResponder interpretKeyEvents:] will not call [self firstRectForCharacterRange:actualRange:] if the selected range location is NSNotFound so that is what was disabling display of the press-and-hold input method popup. Once [self firstRectForCharacterRange:actualRange:] is called, emulate the press-and-hold behavior of the TextEdit application by setting the marked text to the last key down event's characters. The characters will already have been committed by the special character input method so set the mbTextInputWantsNonRepeatKeyDown flag to indicate that the characters need to be deleted if the input method replaces the committed characters. Also, emulate the press-and-hold behavior of the TextEdit application by committing any uncommitted text when either the escape or the return key is pressed while the press-and-hold input method popup is displayed. Lastly, handle repeat key events by explicitly inserting the text if there is no uncommitted text before -[NSResponder interpretKeyEvents:] is called. Change-Id: I104b3d64a8c66fef3a5a1cec0fba1daa553cd9a4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144630 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-12-22Fix typoAndrea Gelmini
Change-Id: I50fc85e0ae8d75275fd1746c5e4aebe7e186cac8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144035 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>