[KDE/Mac] Review Request 120931: [OS X] improvements to KWindowSystem

René J.V. Bertin rjvbertin at gmail.com
Sun Nov 16 15:41:32 UTC 2014



> On Nov. 15, 2014, 3:43 p.m., Thomas Lübking wrote:
> > kdeui/windowmanagement/kwindowsystem_mac.cpp, line 418
> > <https://git.reviewboard.kde.org/r/120931/diff/2/?file=328516#file328516line418>
> >
> >     anything that hinders from making kwindowsystem_mac.cpp kwindowsystem_mac.mm directly?
> 
> René J.V. Bertin wrote:
>     Yes, whatever it is that determines whether a header must be processed by moc doesn't pick up that fact in a .mm file.
>     I admit I haven't even tried to figure out where this logic lives because it's obviously incomplete (but also something I don't feel confident to start tweaking with the risk of breaking everything).
> 
> Thomas Lübking wrote:
>     set(kwindowsystem_mac_MOC_HDRS kwindowsystem_mac_p.h)
>     qt4_wrap_cpp(kwindowsystem_mac_MOC_SRCS ${kwindowsystem_mac_MOC_HDRS})
>     
>     then add ${kwindowsystem_mac_MOC_SRCS} to kdeui_LIB_SRCS
> 
> René J.V. Bertin wrote:
>     that'd be kwindowsystem.h, actually. kwindowsystem_mac_p.h will disappear if/when we can do with a single file.
> 
> René J.V. Bertin wrote:
>     @Thomas: your
>     
>     ```
>     set(kwindowsystem_mac_MOC_HDRS kwindowsystem_mac_p.h)
>     qt4_wrap_cpp(kwindowsystem_mac_MOC_SRCS ${kwindowsystem_mac_MOC_HDRS})
>     
>     then add ${kwindowsystem_mac_MOC_SRCS} to kdeui_LIB_SRCS
>     ```
>     
>     adapted to
>     
>     ```
>         set(kwindowsystem_mac_MOC_HDRS windowmanagement/kwindowsystem.h)
>         qt4_wrap_cpp(kwindowsystem_mac_MOC_SRCS ${kwindowsystem_mac_MOC_HDRS})
>     
>         set(kdeui_LIB_SRCS ${kdeui_LIB_SRCS} windowmanagement/kwindowsystem_mac.mm
>                                              windowmanagement/kwindowinfo_mac.cpp
>                                              ${kwindowsystem_mac_MOC_HDRS})
>     ```
>     
>     generates a moc file `build/kdeui/windowmanagement/moc_kwindowsystem.cxx` instead of `build/kdeui/moc_kwindowsystem.cpp` which is not found when doing `#include "moc_kwindowsystem.cxx"` in kwindowsystem_mac.mm ... I must be missing something?
> 
> Thomas Lübking wrote:
>     not ${kwindowsystem_mac_MOC_HDRS}, add ${kwindowsystem_mac_MOC_SRCS} and don't try to include it from other sources.
> 
> René J.V. Bertin wrote:
>     Indeed, I noticed that the include line should (probably) read `#include "kwindowsystem.moc"`, but I don't get the difference between `add ${kwindowsystem_mac_MOC_SRCS}` and what I'm doing. kdeui_LIB_SRCS is clearly being set in cumulative fashion, so my statement *is* an add??
> 
> Thomas Lübking wrote:
>     *NO* include line whatsowever.
>     qt4_wrap_cpp(kwindowsystem_mac_MOC_SRCS ${kwindowsystem_mac_MOC_HDRS}) generates moc sources from ${kwindowsystem_mac_MOC_HDRS} ("windowmanagement/moc_kwindowsystem.cxx" from "windowmanagement/kwindowsystem.h" in this trivial case)
>     You then need to add them to the build sources,
>     set(kdeui_LIB_SRCS ${kdeui_LIB_SRCS} windowmanagement/kwindowsystem_mac.mm windowmanagement/kwindowinfo_mac.cpp ${kwindowsystem_mac_MOC_HDRS})
>     translates to
>     set(kdeui_LIB_SRCS ${kdeui_LIB_SRCS} windowmanagement/kwindowsystem_mac.mm windowmanagement/kwindowinfo_mac.cpp windowmanagement/moc_kwindowsystem.cxx)
>     
>     You're bypassing the entire "guess moc from includes" automoc system, which apparently fails for Objective-C

This is taking me too much time. I've tried both your version and

```
    set(kwindowsystem_mac_MOC_HDRS windowmanagement/kwindowsystem.h windowmanagement/kwindowsystem_mac_p.h)
    qt4_wrap_cpp(kwindowsystem_mac_MOC_SRCS ${kwindowsystem_mac_MOC_HDRS})
    set(kdeui_LIB_SRCS ${kdeui_LIB_SRCS} windowmanagement/kwindowsystem_mac.mm
                                         windowmanagement/kwindowinfo_mac.cpp
                                         ${kwindowsystem_mac_MOC_SRCS})
```

and both fail to generate whatever file needs to be there to add a few symbols among which `KWindowSystem::windowAdded`. Of course the link goes through fine as long as I don't remove the kwindowsystem.moc file created with the CMakeLists.txt file as described here.
Curiously, when I reverted back to that approach I got a moc_kwindowsystem_mac_p.cpp file which hadn't been generated before.
Check the comments for `EXPERIMENTAL_WINDOW_TRACKING`: apparently I'm not the first person who's having trouble here.


- René J.V.


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/120931/#review70399
-----------------------------------------------------------


On Nov. 15, 2014, 12:04 a.m., René J.V. Bertin wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/120931/
> -----------------------------------------------------------
> 
> (Updated Nov. 15, 2014, 12:04 a.m.)
> 
> 
> Review request for KDE Software on Mac OS X and kdelibs.
> 
> 
> Repository: kdelibs
> 
> 
> Description
> -------
> 
> This is an attempt to improve the Mac-specific implementation of the `KWindowSystem` class.
> For convenience and future-proofness (and also because I like the language) I converted `kwindowsystem_mac.cpp` to ObjC++, i.e. `kwindowsystem_mac.mm`, and added the AppKit framework in the CMakeFile.
> 
> Much of the code in this file is hardly better than gentle hacking, but that probably concerns the functions that are of least interest on a platform where KDE doesn't do session management.
> 
> I should probably update the "not yet implemented" debug statements (to "unsupported"), and I might have another look at kwindowinfo_mac.cpp too.
> 
> 
> Diffs
> -----
> 
>   kdeui/CMakeLists.txt 1454790 
>   kdeui/tests/kwindowtest.cpp b4012d7 
>   kdeui/windowmanagement/kwindowsystem_mac.cpp 4200237 
>   kdeui/windowmanagement/kwindowsystem_mac_p.h PRE-CREATION 
>   kdeui/windowmanagement/kwindowsystem_macobjc.mm PRE-CREATION 
> 
> Diff: https://git.reviewboard.kde.org/r/120931/diff/
> 
> 
> Testing
> -------
> 
> On OS X 10.6.8, mostly with the updated kwindowtest utility (which calls KWindowSystem functions when clicking the Open button in its toolbar).
> Also tested on Mac OS X 10.9.4 rebuilding kdelibs from scratch.
> 
> 
> Thanks,
> 
> René J.V. Bertin
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-mac/attachments/20141116/ec27d932/attachment-0001.html>


More information about the kde-mac mailing list