[gnome-desktop/randr-transformations: 2/2] RANDR - handle transformations in clone mode as well



commit 498e1ed292047a896029338eb3619ca1a8315316
Author: David Reveman <dreveman novell com>
Date:   Tue Jan 26 15:25:17 2010 -0600

    RANDR - handle transformations in clone mode as well
    
    Signed-off-by: Federico Mena Quintero <federico novell com>

 libgnome-desktop/gnome-rr-config.c |   18 +++++++++++-------
 1 files changed, 11 insertions(+), 7 deletions(-)
---
diff --git a/libgnome-desktop/gnome-rr-config.c b/libgnome-desktop/gnome-rr-config.c
index 19705bf..0c58f37 100644
--- a/libgnome-desktop/gnome-rr-config.c
+++ b/libgnome-desktop/gnome-rr-config.c
@@ -545,6 +545,8 @@ gnome_rr_config_new_current (GnomeRRScreen *screen)
 	    
 	    if (crtc && mode)
 	    {
+		int width, height;
+
 		output->on = TRUE;
 		
 		gnome_rr_crtc_get_position (crtc, &output->x, &output->y);
@@ -554,12 +556,17 @@ gnome_rr_config_new_current (GnomeRRScreen *screen)
 		output->rotation = gnome_rr_crtc_get_current_rotation (crtc);
 		gnome_rr_crtc_get_current_transform (crtc, &output->transform);
 
+		width = (int) (output->transform.transform[0][0] *
+			       output->width + 0.5);
+		height = (int) (output->transform.transform[1][1] *
+				output->height + 0.5);
+
 		if (output->x == 0 && output->y == 0) {
 			if (clone_width == -1) {
-				clone_width = output->width;
-				clone_height = output->height;
-			} else if (clone_width == output->width &&
-				   clone_height == output->height) {
+				clone_width = width;
+				clone_height = height;
+			} else if (clone_width == width &&
+				   clone_height == height) {
 				config->clone = TRUE;
 			}
 		}
@@ -893,10 +900,7 @@ make_outputs (GnomeRRConfig *config)
 	{
 	    g_assert (first_on);
 
-	    new->width = first_on->width;
-	    new->height = first_on->height;
 	    new->rotation = first_on->rotation;
-	    new->transform = first_on->transform;
 	    new->x = 0;
 	    new->y = 0;
 	}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]