Changeset View
Changeset View
Standalone View
Standalone View
backends/xrandr/xrandrscreen.cpp
Show All 10 Lines | |||||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * | ||
13 | * Lesser General Public License for more details. * | 13 | * Lesser General Public License for more details. * | ||
14 | * * | 14 | * * | ||
15 | * You should have received a copy of the GNU Lesser General Public * | 15 | * You should have received a copy of the GNU Lesser General Public * | ||
16 | * License along with this library; if not, write to the Free Software * | 16 | * License along with this library; if not, write to the Free Software * | ||
17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * | 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * | ||
18 | *************************************************************************************/ | 18 | *************************************************************************************/ | ||
19 | | ||||
20 | #include "xrandrscreen.h" | 19 | #include "xrandrscreen.h" | ||
21 | #include "xrandrconfig.h" | 20 | | ||
22 | #include "screen.h" | | |||
23 | #include "config.h" | 21 | #include "config.h" | ||
22 | #include "screen.h" | ||||
23 | #include "xrandrconfig.h" | ||||
24 | #include "../xcbwrapper.h" | ||||
24 | 25 | | |||
25 | #include <QX11Info> | 26 | #include <QX11Info> | ||
26 | 27 | | |||
27 | #include "../xcbwrapper.h" | | |||
28 | | ||||
29 | XRandRScreen::XRandRScreen(XRandRConfig *config) | 28 | XRandRScreen::XRandRScreen(XRandRConfig *config) | ||
30 | : QObject(config) | 29 | : QObject(config) | ||
31 | { | 30 | { | ||
32 | XCB::ScreenSize size(XRandR::rootWindow()); | 31 | XCB::ScreenSize size(XRandR::rootWindow()); | ||
33 | m_maxSize = QSize(size->max_width, size->max_height); | 32 | m_maxSize = QSize(size->max_width, size->max_height); | ||
34 | m_minSize = QSize(size->min_width, size->min_height); | 33 | m_minSize = QSize(size->min_width, size->min_height); | ||
35 | update(); | 34 | update(); | ||
36 | } | 35 | } | ||
Show All 21 Lines | |||||
58 | KScreen::ScreenPtr XRandRScreen::toKScreenScreen() const | 57 | KScreen::ScreenPtr XRandRScreen::toKScreenScreen() const | ||
59 | { | 58 | { | ||
60 | KScreen::ScreenPtr kscreenScreen(new KScreen::Screen); | 59 | KScreen::ScreenPtr kscreenScreen(new KScreen::Screen); | ||
61 | kscreenScreen->setId(m_id); | 60 | kscreenScreen->setId(m_id); | ||
62 | kscreenScreen->setMaxSize(m_maxSize); | 61 | kscreenScreen->setMaxSize(m_maxSize); | ||
63 | kscreenScreen->setMinSize(m_minSize); | 62 | kscreenScreen->setMinSize(m_minSize); | ||
64 | kscreenScreen->setCurrentSize(m_currentSize); | 63 | kscreenScreen->setCurrentSize(m_currentSize); | ||
65 | 64 | | |||
66 | XCB::ScopedPointer<xcb_randr_get_screen_resources_reply_t> screenResources(XRandR::screenResources()); | 65 | XCB::ScopedPointer<xcb_randr_get_screen_resources_reply_t> | ||
66 | screenResources(XRandR::screenResources()); | ||||
67 | kscreenScreen->setMaxActiveOutputsCount(screenResources->num_crtcs); | 67 | kscreenScreen->setMaxActiveOutputsCount(screenResources->num_crtcs); | ||
68 | 68 | | |||
69 | return kscreenScreen; | 69 | return kscreenScreen; | ||
70 | } | 70 | } | ||
71 | 71 | | |||
72 | void XRandRScreen::updateKScreenScreen(KScreen::ScreenPtr &screen) const | 72 | void XRandRScreen::updateKScreenScreen(KScreen::ScreenPtr &screen) const | ||
73 | { | 73 | { | ||
74 | screen->setCurrentSize(m_currentSize); | 74 | screen->setCurrentSize(m_currentSize); | ||
75 | } | 75 | } |