Created attachment 139358 [details] Sample event listener. Steps to reproduce: 1) Apply the attached patch. 2) Start Writer. 3) Go to tools -> customize -> keyboard, and assign the hello world python macro to e.g. F4. 4) Close the dialog and press F4. 5) Switch away to some other window and switch back: notice that there is 1 activate and 1 deactivate hit in the callback, as expected. 6) Change the font color using the toolbar's color picker popup. Expected result: event listener is not invoked during color selection. Actual result: event listener gets spurious windowDeactivated/windowActivated events. Additional info: - this worked in LO 5.2, bad in LO 5.3. git bisect points out 43bc3031483d172eccd72c3804e2d4fc2ef37de4, but that one just changed Writer to behave the same way as Impress - why Impress emits focus events is due to accessibility, it was done for https://bz.apache.org/ooo/show_bug.cgi?id=118707 Not emitting the events means it's not possible to select a color with the keyboard (bad for accessibility), emitting the events is bad for UNO API compatibility. A middle ground can be to still change focus, but suppress the invocation of UNO API listeners.
Created attachment 139361 [details] Python-only reproducer for bibisect purposes. The original patch is backtrace-friendly since the listener is in C++. This version is bibisect-friendly as it's all Python.
Miklos Vajna committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=250ad9311a613d9b4e1cf5cf5fdaf33d9b326220 tdf#115227 svtools: suppress UNO notifications for color selectors It will be available in 6.1.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Maxim Monastirsky committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=3ecf542af410536d64d217c71002799bbe48b9c3 Different approach for tdf#115227 It will be available in 6.1.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
I think this resolves the currently known problems.