[KDE/Mac] Review Request 126291: initial implementation of a platform plugin for OS X (WIP)
René J.V. Bertin
rjvbertin at gmail.com
Fri Mar 4 19:19:02 UTC 2016
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/126291/
-----------------------------------------------------------
(Updated March 4, 2016, 8:19 p.m.)
Review request for KDE Software on Mac OS X and KDE Frameworks.
Changes
-------
This revision has a more complete (as complete as possible?) internal WId registry feature. WIds on OS X are tricky in that they do not usually correspond to `NSWindow` instances but instead to an `NSView` instance. As such there is no guarantee to receive any kind of notification when the NSView is created, which (I think) means that one has to take stock of an application's windows and views at certain times like during appropriate calls to KWindowSystem.
With these latest modifications, the `kwindowsystem_threadtest` autotest completes successfully, but only when doing an explicit action after `m_widget->show()` that causes the widget to be displayed (basically, the equivalent of a call to `XSync()`).
Repository: kwindowsystem
Description
-------
KWindowSystem has been lacking a platform plugin for OS X. This RR presents a "backport" of the modified KDE4 KWindowSystem implementation that has been used in the MacPorts kdelibs4 port for the last 2 or 3 (or more) years.
I have made some initial steps to remove deprecated Carbon API calls, but this is clearly a work in progress.
Open questions include
- is there any justification to run an event handler (or Cocoa observer) to keep track of running applications, possibly even listing all their open windows?
- is there any use for the Qt event listener framework (cf. the NETEventFilter in the X11 plugin)? I haven't yet had time to try to figure out what this "could be good for", and am very open to suggestions in this departments.
- one application for such an event filter would be a listener that catches the opening and closing of all windows by the running process, and keeps track of their `WId`s. A new method could then be added (to `KWindowInfo`?) to distinguish `WId`s created by the running application from "foreign" ones (useful also on Wayland and MS Windows).
`KWindowSystem::setMainWindow` should become a front for payload provided by the plugins. I'll leave that to the regular/official maintainer(s) of this framework.
This code could probably do with *lots* of comments; I'll try to add them as questions about this or that bit of code arise.
Diffs (updated)
-----
autotests/CMakeLists.txt 65ed8d4
autotests/kwindowsystem_threadtest.cpp a142bae
src/debug_p.h 5ef8996
src/debug_p.cpp 72abfb7
src/kwindowsystem.cpp 407a67d
src/platforms/osx/CMakeLists.txt 4fc3347
src/platforms/osx/cocoa.json PRE-CREATION
src/platforms/osx/kkeyserver.cpp 3ddb921
src/platforms/osx/kwindowinfo.cpp e8555bb
src/platforms/osx/kwindowinfo.mm PRE-CREATION
src/platforms/osx/kwindowinfo_mac_p.h c8f307e
src/platforms/osx/kwindowinfo_p_cocoa.h PRE-CREATION
src/platforms/osx/kwindowsystem.cpp 1758829
src/platforms/osx/kwindowsystem_mac_p.h PRE-CREATION
src/platforms/osx/kwindowsystem_macobjc.mm PRE-CREATION
src/platforms/osx/kwindowsystem_p_cocoa.h PRE-CREATION
src/platforms/osx/plugin.h PRE-CREATION
src/platforms/osx/plugin.cpp PRE-CREATION
Diff: https://git.reviewboard.kde.org/r/126291/diff/
Testing
-------
On OS X 10.9.5 with Qt 5.5.1 and frameworks 5.16.0 .
Thanks,
René J.V. Bertin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-mac/attachments/20160304/05859d4f/attachment.html>
More information about the kde-mac
mailing list