aboutsummaryrefslogtreecommitdiffstats
path: root/legacy/elementary/src/lib/elm_win.c
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-07-21 11:39:32 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-07-21 11:39:32 +0900
commit057611a7e45dd0d33dea93104729cf6fd6bf9767 (patch)
tree2d2933e77b01e627536747ec9f496de5476073d7 /legacy/elementary/src/lib/elm_win.c
parentdbus warn-- (diff)
downloadefl-057611a7e45dd0d33dea93104729cf6fd6bf9767.tar.gz
elm win noblank property added - to disable screen blanking/saving
@feature this adds a per-window property of "noblank". this implies turning offf the screensaver whenever there is a window visible with this property set on it. only x11 support atm.
Diffstat (limited to 'legacy/elementary/src/lib/elm_win.c')
-rw-r--r--legacy/elementary/src/lib/elm_win.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/legacy/elementary/src/lib/elm_win.c b/legacy/elementary/src/lib/elm_win.c
index 8bd0d44973..59dfc0e16b 100644
--- a/legacy/elementary/src/lib/elm_win.c
+++ b/legacy/elementary/src/lib/elm_win.c
@@ -213,6 +213,7 @@ struct _Elm_Win_Data
Eina_Bool maximized : 1;
Eina_Bool skip_focus : 1;
Eina_Bool floating : 1;
+ Eina_Bool noblank : 1;
};
static const char SIG_DELETE_REQUEST[] = "delete,request";
@@ -309,6 +310,33 @@ _elm_win_first_frame_do(void *data, Evas *e EINA_UNUSED, void *event_info EINA_U
}
static void
+_win_noblank_eval(void)
+{
+ Eina_List *l;
+ Evas_Object *obj;
+ int noblanks = 0;
+
+#ifdef HAVE_ELEMENTARY_X
+ EINA_LIST_FOREACH(_elm_win_list, l, obj)
+ {
+ ELM_WIN_DATA_GET(obj, sd);
+
+ if (sd->x.xwin)
+ {
+ if ((sd->noblank) && (!sd->iconified) && (!sd->withdrawn) &&
+ evas_object_visible_get(obj))
+ noblanks++;
+ }
+ }
+ if (noblanks > 0) ecore_x_screensaver_supend();
+ else ecore_x_screensaver_resume();
+#endif
+#ifdef HAVE_ELEMENTARY_WAYLAND
+ // XXX: no wl implementation of this yet - maybe higher up at prop level
+#endif
+}
+
+static void
_elm_win_state_eval(void *data EINA_UNUSED)
{
Eina_List *l;
@@ -398,6 +426,7 @@ _elm_win_state_eval(void *data EINA_UNUSED)
}
}
}
+ _win_noblank_eval();
}
static void
@@ -3360,6 +3389,22 @@ _elm_win_type_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
return sd->type;
}
+EOLIAN static void
+_elm_win_noblank_set(Eo *obj EINA_UNUSED, Elm_Win_Data *pd, Eina_Bool noblank)
+{
+ noblank = !!noblank;
+ if (pd->noblank == noblank) return;
+ pd->noblank = noblank;
+ _win_noblank_eval();
+}
+
+EOLIAN static Eina_Bool
+_elm_win_noblank_get(Eo *obj EINA_UNUSED, Elm_Win_Data *pd)
+{
+ return pd->noblank;
+}
+
+
EAPI Evas_Object *
elm_win_util_standard_add(const char *name,
const char *title)