summaryrefslogtreecommitdiffstats
path: root/krandr/randr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'krandr/randr.cpp')
-rw-r--r--krandr/randr.cpp60
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));