Line data Source code
1 :
2 : /* Copyright (c) 2015, Stefan.Eilemann@epfl.ch
3 : *
4 : * This library is free software; you can redistribute it and/or modify it under
5 : * the terms of the GNU Lesser General Public License version 2.1 as published
6 : * by the Free Software Foundation.
7 : *
8 : * This library is distributed in the hope that it will be useful, but WITHOUT
9 : * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
10 : * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
11 : * details.
12 : *
13 : * You should have received a copy of the GNU Lesser General Public License
14 : * along with this library; if not, write to the Free Software Foundation, Inc.,
15 : * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
16 : */
17 :
18 : #include "pipe.h"
19 :
20 : #include <QDesktopWidget>
21 : #include <eq/pipe.h>
22 :
23 : namespace eq
24 : {
25 : namespace qt
26 : {
27 0 : bool Pipe::configInit()
28 : {
29 0 : eq::Pipe* pipe = getPipe();
30 0 : if (pipe->getPixelViewport().isValid())
31 0 : return true;
32 :
33 0 : QDesktopWidget desktop;
34 0 : const uint32_t device = getPipe()->getDevice();
35 : const int qtScreen =
36 0 : device == LB_UNDEFINED_UINT32 ? desktop.primaryScreen() : int(device);
37 0 : const QRect rect = desktop.availableGeometry(qtScreen);
38 :
39 0 : pipe->setPixelViewport(
40 0 : PixelViewport(rect.x(), rect.y(), rect.width(), rect.height()));
41 0 : return true;
42 : }
43 : }
44 30 : }
|