diff options
author | Darrell Anderson <humanreadable@yahoo.com> | 2013-01-12 16:16:03 -0600 |
---|---|---|
committer | Darrell Anderson <humanreadable@yahoo.com> | 2013-01-12 16:16:03 -0600 |
commit | 2c10a4aac71b1e66d4e3fc0c9401e8b283e73be3 (patch) | |
tree | 15402a6a50f4dc5409f5fa3caf29ebd0d3c2dd21 /krandr/randr.cpp | |
parent | 01e9b41e1b0412e7281e9ef5c0df586bb66d8763 (diff) | |
parent | 4c9ff70f806c4e8f2f6197b94db39b5bef8c71f2 (diff) | |
download | tdelibs-2c10a4aac71b1e66d4e3fc0c9401e8b283e73be3.tar.gz tdelibs-2c10a4aac71b1e66d4e3fc0c9401e8b283e73be3.zip |
Merge branch 'master' of http://scm.trinitydesktop.org/scm/git/tdelibs
Diffstat (limited to 'krandr/randr.cpp')
-rw-r--r-- | krandr/randr.cpp | 60 |
1 files changed, 56 insertions, 4 deletions
diff --git a/krandr/randr.cpp b/krandr/randr.cpp index 3a8e77169..0300801ca 100644 --- a/krandr/randr.cpp +++ b/krandr/randr.cpp @@ -40,14 +40,63 @@ #undef INT32 #include <X11/extensions/Xrandr.h> +HotPlugRule::HotPlugRule() +{ + // +} + +HotPlugRule::~HotPlugRule() +{ + // +} + +SingleScreenData::SingleScreenData() +{ + generic_screen_detected = false; + screen_connected = false; + + current_resolution_index = 0; + current_refresh_rate_index = 0; + current_color_depth_index = 0; + + gamma_red = 0.0; + gamma_green = 0.0; + gamma_blue = 0.0; + + current_rotation_index = 0; + current_orientation_mask = 0; + has_x_flip = false; + has_y_flip = false; + supports_transformations = false; + + is_primary = false; + is_extended = false; + absolute_x_position = 0; + absolute_y_position = 0; + current_x_pixel_count = 0; + current_y_pixel_count = 0; + + has_dpms = false; + enable_dpms = false; + dpms_standby_delay = 0; + dpms_suspend_delay = 0; + dpms_off_delay = 0; +} + +SingleScreenData::~SingleScreenData() +{ + // +} + class RandRScreenPrivate { public: RandRScreenPrivate() : config(0L) {}; ~RandRScreenPrivate() { - if (config) + if (config) { XRRFreeScreenConfigInfo(config); + } } XRRScreenConfiguration* config; @@ -69,8 +118,9 @@ KDE_EXPORT RandRScreen::~RandRScreen() KDE_EXPORT void RandRScreen::loadSettings() { - if (d->config) + if (d->config) { XRRFreeScreenConfigInfo(d->config); + } d->config = XRRGetScreenInfo(tqt_xdisplay(), RootWindow(tqt_xdisplay(), m_screen)); @@ -102,9 +152,11 @@ KDE_EXPORT void RandRScreen::loadSettings() ScreenInfo *screeninfo = internal_read_screen_info(tqt_xdisplay()); XRROutputInfo *output_info = screeninfo->outputs[m_screen]->info; CrtcInfo *current_crtc = screeninfo->outputs[m_screen]->cur_crtc; - int numSizes = screeninfo->res->nmode; + int numSizes = output_info->nmode; for (int i = 0; i < numSizes; i++) { - TQSize newSize = TQSize(screeninfo->res->modes[i].width, screeninfo->res->modes[i].height); + XRRModeInfo *xrrmode; + xrrmode = internal_find_mode_by_xid (screeninfo, output_info->modes[i]); + TQSize newSize = TQSize(xrrmode->width, xrrmode->height); if (!m_pixelSizes.contains(newSize)) { m_pixelSizes.append(newSize); m_mmSizes.append(TQSize(output_info->mm_width, output_info->mm_height)); |