summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2013-08-02 11:04:21 +0100
committerDeon Thomas <PrinceAMD.Elive@gmail.com>2013-08-02 10:44:12 -0400
commit9566fe746ecbc53be54ddc32fadec982dfde6fa9 (patch)
tree0525be574066b926d3a2d3b86f013440f0413419
parente998dc38cf2ce15f3caaafd64405344cce607a13 (diff)
Backport: c48e7d2 :: When we have finished creating all monitors, if there is only One monitor existing, then disable the ability to toggle the indicator.
NB: This is for silly people who (for whatever reason) decide that it's a good idea to try and turn off their Only monitor. NB: Fixes Phab Ticket T257 Signed-off-by: Chris Michael <cp.michael@samsung.com> Signed-off-by: Deon Thomas <PrinceAMD.Elive@gmail.com>
-rw-r--r--src/modules/conf_randr/e_smart_randr.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/modules/conf_randr/e_smart_randr.c b/src/modules/conf_randr/e_smart_randr.c
index c0df86ebc..7156c0f68 100644
--- a/src/modules/conf_randr/e_smart_randr.c
+++ b/src/modules/conf_randr/e_smart_randr.c
@@ -174,7 +174,9 @@ e_smart_randr_monitors_create(Evas_Object *obj)
174 Ecore_X_Window root = 0; 174 Ecore_X_Window root = 0;
175 Evas_Coord gx = 0, gy = 0, gw = 0, gh = 0; 175 Evas_Coord gx = 0, gy = 0, gw = 0, gh = 0;
176 Ecore_X_Randr_Output *outputs; 176 Ecore_X_Randr_Output *outputs;
177 int noutputs = 0; 177 Evas_Object *mon;
178 Eina_List *l = NULL;
179 int noutputs = 0, count = 0;
178 180
179 LOGFN(__FILE__, __LINE__, __FUNCTION__); 181 LOGFN(__FILE__, __LINE__, __FUNCTION__);
180 182
@@ -205,7 +207,6 @@ e_smart_randr_monitors_create(Evas_Object *obj)
205 /* loop these outputs */ 207 /* loop these outputs */
206 for (i = 0; i < noutputs; i++) 208 for (i = 0; i < noutputs; i++)
207 { 209 {
208 Evas_Object *mon;
209 Ecore_X_Randr_Crtc crtc = 0; 210 Ecore_X_Randr_Crtc crtc = 0;
210 Evas_Coord mw = 0, mh = 0, crtcx = 0, crtcy = 0; 211 Evas_Coord mw = 0, mh = 0, crtcx = 0, crtcy = 0;
211 Evas_Coord cx = 0, cy = 0, cw = 0, ch = 0; 212 Evas_Coord cx = 0, cy = 0, cw = 0, ch = 0;
@@ -332,6 +333,17 @@ e_smart_randr_monitors_create(Evas_Object *obj)
332 333
333 free(outputs); 334 free(outputs);
334 } 335 }
336
337 /* check if we have only one monitor. If so, we will disable the
338 * indicator toggle so dumb people cannot turn off their only monitor */
339 count = eina_list_count(sd->monitors);
340 EINA_LIST_FOREACH(sd->monitors, l, mon)
341 {
342 if (count > 1)
343 e_smart_monitor_indicator_available_set(mon, EINA_TRUE);
344 else
345 e_smart_monitor_indicator_available_set(mon, EINA_FALSE);
346 }
335} 347}
336 348
337void 349void