diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2013-01-09 16:37:06 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2013-01-09 16:37:06 -0600 |
commit | e9b3f195e2d568e25b8b73810503518e4e7f8480 (patch) | |
tree | 0e11dba628e359cd1145f1ddd63786a351a50cb8 /krandr/randr.cpp | |
parent | 511779841007afca5231e6c69e996eba0295eaae (diff) | |
download | tdelibs-e9b3f195e2d568e25b8b73810503518e4e7f8480.tar.gz tdelibs-e9b3f195e2d568e25b8b73810503518e4e7f8480.zip |
Add monitor hotplug notification support to TDE hardware devices library
Fix spurious xcalib pipe error notifications
Fix krandr available resolution detection
Diffstat (limited to 'krandr/randr.cpp')
-rw-r--r-- | krandr/randr.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/krandr/randr.cpp b/krandr/randr.cpp index 2da9b4520..e118549e2 100644 --- a/krandr/randr.cpp +++ b/krandr/randr.cpp @@ -85,8 +85,9 @@ public: RandRScreenPrivate() : config(0L) {}; ~RandRScreenPrivate() { - if (config) + if (config) { XRRFreeScreenConfigInfo(config); + } } XRRScreenConfiguration* config; @@ -108,8 +109,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)); @@ -141,9 +143,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)); |