Review Request 122270: port kcminit away from kdelibs4support

Thomas Lübking thomas.luebking at gmail.com
Wed Jan 28 11:46:43 GMT 2015



> On Jan. 27, 2015, 6:59 vorm., Martin Gräßlin wrote:
> > startkde/kcminit/main.cpp, lines 250-254
> > <https://git.reviewboard.kde.org/r/122270/diff/1/?file=345342#file345342line250>
> >
> >     I do not like this. If the only need is to check whether it's X11 multi-head, it should open an xcb_connection_t - if that fails we don't have an X-Server. If it succeeds we can check the number of screens.
> 
> Nick Shaforostoff wrote:
>     understood, but the question remains: is kcminit the best place to do multihead-related stuff?
> 
> Thomas Lübking wrote:
>     It's required by KApplication and while that's in kde4support, it's still there (as well as KDE4 clients)
>     So "yes, we need that everywhere" - for now.
>     
>     Clients seem to default the env to false, so uncoditionally setting it true is wrong for sure.
>     
>     It'd rather be "multihead = (screenCount > 1);" (ignoring the ini) what however would be a feature loss.
>     
>     
>     => Proposal
>     users should be able to pre-control the variable in eg. ~/.kde/env (or wherever the Plasma 2 equivalent is)
>     If the variable is set to false, it remains like that.
>     If not (ie. it's not set or set true resp. anything but 0/false) it becomes true if the screen count > 1
>     
>     Spares the ini lookup, but I don't think you get around 
>     
>     xcb_connection_t *c;
>     int screen_count = xcb_setup_roots_length(xcb_get_setup(c));
>     
>     without risking to really break stuff (the suggested approach still causes a transitional break)
> 
> Nick Shaforostoff wrote:
>     reading ini file is not more than 0.5 second with 'cold cache'. getting rid of kdelibs4support for kcminit is 2 seconds gain.
>     direct xcb request would require copying some 30 lines of code from xcp qpa plugin (= a no go).
> 
> Martin Gräßlin wrote:
>     > direct xcb request would require copying some 30 lines of code from xcp qpa plugin
>     
>     that should be less and can be done without copying code form xcb qpa. Feel free to look at kwin/main_x11.cpp to see how it can be done. As I did the port to xcb I can safely grant a relicense if that's needed.
> 
> Nick Shaforostoff wrote:
>     aree you talking about this code?
>       int primaryScreen = 0;
>       xcb_connection_t *c = xcb_connect(nullptr, &primaryScreen);
>       const int number_of_screens = xcb_setup_roots_length(xcb_get_setup(c));
>       xcb_connect(c);
>     
>     its results differ from QGuiApplication::screens().size().
>     
>     for me it still returns 1 when i have external monitor connected to my laptop. see
>     void QXcbConnection::updateScreens()
>     in src/plugins/platforms/xcb/qxcbconnection.cpp

unless my memory is really broken, qga::screens returns a list of "panels", ie. also for the normal xrandr setup.
on your multiscreen setup, does the running kwin operate on both screens and eg. allow you to move a window from one screen to another?


- Thomas


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


On Jan. 28, 2015, 12:47 vorm., Nick Shaforostoff wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/122270/
> -----------------------------------------------------------
> 
> (Updated Jan. 28, 2015, 12:47 vorm.)
> 
> 
> Review request for kde-workspace, Aleix Pol Gonzalez, Martin Gräßlin, and Lukáš Tinkl.
> 
> 
> Repository: plasma-workspace
> 
> 
> Description
> -------
> 
> Now kcminit is linked with less libraries -> startup time improved
> 
> I also suggest always setting KDE_MULTIHEAD=true to eliminate ini file access during startup and to be able to stop linking against QtGui
> 
> 
> Diffs
> -----
> 
>   startkde/kcminit/CMakeLists.txt ffae38c 
>   startkde/kcminit/main.h 1140b77 
>   startkde/kcminit/main.cpp 4724323 
> 
> Diff: https://git.reviewboard.kde.org/r/122270/diff/
> 
> 
> Testing
> -------
> 
> compiled, ran 'kcminit --list' and kcminit AAA
> 
> 
> Thanks,
> 
> Nick Shaforostoff
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20150128/8e544975/attachment.htm>


More information about the kde-core-devel mailing list