aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristopher Michael <cp.michael@samsung.com>2013-02-19 10:59:44 +0000
committerChristopher Michael <cpmichael1@comcast.net>2013-02-19 10:59:44 +0000
commit994586d5095aefd439d716ce6671c7ac90a3ea84 (patch)
tree7863db0eb25d42cdd916c3d49ba7b9bc133c68a2 /src
parenteec7305dfc0832ed439dc6646e10039a0f5e2db1 (diff)
downloadenlightenment-994586d5095aefd439d716ce6671c7ac90a3ea84.tar.gz
enlightenment-994586d5095aefd439d716ce6671c7ac90a3ea84.tar.xz
enlightenment-994586d5095aefd439d716ce6671c7ac90a3ea84.zip
Add code to handle when cloning monitors so that the size, mode and
orient of each will match (NB: This is required by XRandR in order for cloning to be successful). Signed-off-by: Christopher Michael <cp.michael@samsung.com> SVN revision: 84212
Diffstat (limited to 'src')
-rw-r--r--src/modules/conf_randr/e_smart_monitor.c39
1 files changed, 37 insertions, 2 deletions
diff --git a/src/modules/conf_randr/e_smart_monitor.c b/src/modules/conf_randr/e_smart_monitor.c
index 3b1596f5e..af0f3e85a 100644
--- a/src/modules/conf_randr/e_smart_monitor.c
+++ b/src/modules/conf_randr/e_smart_monitor.c
@@ -5,7 +5,7 @@
#define RESIZE_FUZZ 80
#define ROTATE_FUZZ 45
-#define BG_DBG 1
+//#define BG_DBG 1
/* local structure */
typedef struct _E_Smart_Data E_Smart_Data;
@@ -124,6 +124,9 @@ struct _E_Smart_Data
/* mini representation when cloned */
Evas_Object *o_clone;
+
+ /* record what changed */
+ E_Smart_Monitor_Changes changes;
};
/* smart function prototypes */
@@ -364,7 +367,6 @@ e_smart_monitor_output_set(Evas_Object *obj, Ecore_X_Randr_Output output)
/* set monitor name */
edje_object_part_text_set(sd->o_frame, "e.text.name", name);
- printf("Created Monitor %s For Crtc %d\n", name, sd->crtc.id);
/* free any memory allocated from ecore_x_randr */
free(name);
@@ -491,6 +493,39 @@ e_smart_monitor_clone_set(Evas_Object *obj, Evas_Object *parent)
evas_object_hide(obj);
+ /* check if parent is larger */
+ if ((psd->current.w > sd->current.w) ||
+ (psd->current.h > sd->current.h))
+ {
+ /* NB: X RandR does not allow clones of different size or mode.
+ * They both must match. Because of that, if the parent is
+ * larger, then we need to resize the parent down and set the mode */
+
+ /* set the parent mode to this mode */
+ psd->current.mode = sd->current.mode;
+ psd->current.orient = sd->current.orient;
+ psd->current.w = sd->current.w;
+ psd->current.h = sd->current.h;
+
+ _e_smart_monitor_resolution_set(psd, psd->current.w, psd->current.h);
+ evas_object_grid_pack(psd->grid.obj, parent,
+ psd->current.x, psd->current.y,
+ psd->current.w, psd->current.h);
+ }
+ else if ((sd->current.w > psd->current.w) ||
+ (sd->current.h > psd->current.h))
+ {
+ sd->current.mode = psd->current.mode;
+ sd->current.orient = psd->current.orient;
+ sd->current.w = psd->current.w;
+ sd->current.h = psd->current.h;
+
+ _e_smart_monitor_resolution_set(sd, sd->current.w, sd->current.h);
+ evas_object_grid_pack(sd->grid.obj, obj,
+ sd->current.x, sd->current.y,
+ sd->current.w, sd->current.h);
+ }
+
_e_smart_monitor_coord_virtual_to_canvas(sd, sd->current.w, sd->current.h, &fw, &fh);
if (fw < 1) fw = (sd->current.w / 10);
if (fh < 1) fh = (sd->current.h / 10);