discomfitor pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=2d3c43a39c47a5620280e06bebe5f89a5791ad56

commit 2d3c43a39c47a5620280e06bebe5f89a5791ad56
Author: Mike Blumenkrantz <zm...@osg.samsung.com>
Date:   Wed Jul 1 16:25:45 2015 -0400

    replace some x11 compositor checks with calls to util function
---
 src/bin/e_dpms.c        | 10 +++++-----
 src/bin/e_grabinput.c   | 18 +++++++++---------
 src/bin/e_hints.c       |  4 ++--
 src/bin/e_screensaver.c |  8 ++++----
 4 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/src/bin/e_dpms.c b/src/bin/e_dpms.c
index 5678e74..595f264 100644
--- a/src/bin/e_dpms.c
+++ b/src/bin/e_dpms.c
@@ -29,7 +29,7 @@ e_dpms_update(void)
      {
         _e_dpms_enabled = enabled;
 #ifndef HAVE_WAYLAND_ONLY
-        if (e_comp->comp_type == E_PIXMAP_TYPE_X)
+        if (e_comp_util_has_x())
           ecore_x_dpms_enabled_set(enabled);
 #endif
      }
@@ -58,7 +58,7 @@ e_dpms_update(void)
         changed = EINA_TRUE;
      }
 #ifndef HAVE_WAYLAND_ONLY
-   if (e_comp->comp_type == E_PIXMAP_TYPE_X)
+   if (e_comp_util_has_x())
      {
         if (changed) ecore_x_dpms_timeouts_set(standby, suspend, off);
      }
@@ -74,7 +74,7 @@ e_dpms_force_update(void)
    enabled = ((e_config->screensaver_enable) &&
               (!e_config->mode.presentation));
 #ifndef HAVE_WAYLAND_ONLY
-   if (e_comp->comp_type == E_PIXMAP_TYPE_X)
+   if (e_comp_util_has_x())
      ecore_x_dpms_enabled_set(enabled);
 #endif
    if (!enabled) return;
@@ -87,7 +87,7 @@ e_dpms_force_update(void)
         off += 7;
      }
 #ifndef HAVE_WAYLAND_ONLY
-   if (e_comp->comp_type != E_PIXMAP_TYPE_X) return;
+   if (!e_comp_util_has_x()) return;
    ecore_x_dpms_timeouts_set(standby + 10, suspend + 10, off + 10);
    ecore_x_dpms_timeouts_set(standby, suspend, off);
 #endif
@@ -149,7 +149,7 @@ e_dpms_init(void)
        (E_EVENT_DESK_SHOW, _e_dpms_handler_desk_show_cb, NULL);
 
 #ifndef HAVE_WAYLAND_ONLY
-   if (e_comp->comp_type == E_PIXMAP_TYPE_X)
+   if (e_comp_util_has_x())
      {
         _e_dpms_enabled = ecore_x_dpms_enabled_get();
         ecore_x_dpms_timeouts_get
diff --git a/src/bin/e_grabinput.c b/src/bin/e_grabinput.c
index 01daa83..d835c01 100644
--- a/src/bin/e_grabinput.c
+++ b/src/bin/e_grabinput.c
@@ -39,7 +39,7 @@ e_grabinput_get(Ecore_Window mouse_win, int confine_mouse, 
Ecore_Window key_win)
    if (grab_mouse_win)
      {
 #ifndef HAVE_WAYLAND_ONLY
-        if (e_comp->root)
+        if (e_comp_util_has_x())
           ecore_x_pointer_ungrab();
 #else
         if (e_comp->comp_type == E_PIXMAP_TYPE_WL)
@@ -50,7 +50,7 @@ e_grabinput_get(Ecore_Window mouse_win, int confine_mouse, 
Ecore_Window key_win)
    if (grab_key_win)
      {
 #ifndef HAVE_WAYLAND_ONLY
-        if (e_comp->root)
+        if (e_comp_util_has_x())
           ecore_x_keyboard_ungrab();
 #else
         if (e_comp->comp_type == E_PIXMAP_TYPE_WL)
@@ -63,7 +63,7 @@ e_grabinput_get(Ecore_Window mouse_win, int confine_mouse, 
Ecore_Window key_win)
    if (mouse_win)
      {
 #ifndef HAVE_WAYLAND_ONLY
-        if (e_comp->root)
+        if (e_comp_util_has_x())
           {
              int ret = 0;
              if (confine_mouse)
@@ -86,7 +86,7 @@ e_grabinput_get(Ecore_Window mouse_win, int confine_mouse, 
Ecore_Window key_win)
    if (key_win)
      {
 #ifndef HAVE_WAYLAND_ONLY
-        if (e_comp->root)
+        if (e_comp_util_has_x())
           {
              int ret = 0;
 
@@ -124,7 +124,7 @@ e_grabinput_release(Ecore_Window mouse_win, Ecore_Window 
key_win)
    if (mouse_win == grab_mouse_win)
      {
 #ifndef HAVE_WAYLAND_ONLY
-        if (e_comp->root)
+        if (e_comp_util_has_x())
           ecore_x_pointer_ungrab();
 #else
         if (e_comp->comp_type == E_PIXMAP_TYPE_WL)
@@ -136,7 +136,7 @@ e_grabinput_release(Ecore_Window mouse_win, Ecore_Window 
key_win)
    if (key_win == grab_key_win)
      {
 #ifndef HAVE_WAYLAND_ONLY
-        if (e_comp->root)
+        if (e_comp_util_has_x())
           ecore_x_keyboard_ungrab();
 #else
         if (e_comp->comp_type == E_PIXMAP_TYPE_WL)
@@ -229,7 +229,7 @@ _e_grabinput_focus_do(Ecore_Window win, E_Focus_Method 
method)
 
       case E_FOCUS_METHOD_LOCALLY_ACTIVE:
 #ifndef HAVE_WAYLAND_ONLY
-        if (e_comp->root)
+        if (e_comp_util_has_x())
           {
              ecore_x_window_focus_at_time(win, ecore_x_current_time_get());
              ecore_x_icccm_take_focus_send(win, ecore_x_current_time_get());
@@ -248,7 +248,7 @@ _e_grabinput_focus_do(Ecore_Window win, E_Focus_Method 
method)
 
       case E_FOCUS_METHOD_GLOBALLY_ACTIVE:
 #ifndef HAVE_WAYLAND_ONLY
-        if (e_comp->root)
+        if (e_comp_util_has_x())
           ecore_x_icccm_take_focus_send(win, ecore_x_current_time_get());
 #else
         if (e_comp->comp_type == E_PIXMAP_TYPE_WL)
@@ -263,7 +263,7 @@ _e_grabinput_focus_do(Ecore_Window win, E_Focus_Method 
method)
 
       case E_FOCUS_METHOD_PASSIVE:
 #ifndef HAVE_WAYLAND_ONLY
-        if (e_comp->root)
+        if (e_comp_util_has_x())
           ecore_x_window_focus_at_time(win, ecore_x_current_time_get());
 #else
         if (e_comp->comp_type == E_PIXMAP_TYPE_WL)
diff --git a/src/bin/e_hints.c b/src/bin/e_hints.c
index 29f8cc1..3b5cfeb 100644
--- a/src/bin/e_hints.c
+++ b/src/bin/e_hints.c
@@ -303,7 +303,7 @@ e_hints_client_list_set(void)
    unsigned int i = 0;
    Ecore_X_Window *clients = NULL;
 
-   if (e_comp->comp_type != E_PIXMAP_TYPE_X) return;
+   if (!e_comp_util_has_x()) return;
    if (e_comp->clients)
      {
         E_Client *ec;
@@ -388,7 +388,7 @@ e_hints_active_window_set(E_Client *ec)
 #ifdef HAVE_WAYLAND_ONLY
    (void)ec;
 #else
-   if (e_comp->comp_type != E_PIXMAP_TYPE_X) return;
+   if (!e_comp_util_has_x()) return;
    if (ec && (e_pixmap_type_get(ec->pixmap) == E_PIXMAP_TYPE_X))
      ecore_x_netwm_client_active_set(e_comp->root, e_client_util_win_get(ec));
    else
diff --git a/src/bin/e_screensaver.c b/src/bin/e_screensaver.c
index 4efc8e8..583187c 100644
--- a/src/bin/e_screensaver.c
+++ b/src/bin/e_screensaver.c
@@ -83,7 +83,7 @@ e_screensaver_update(void)
         changed = EINA_TRUE;
      }
 
-   if (e_comp->comp_type == E_PIXMAP_TYPE_X)
+   if (e_comp_util_has_x())
      {
         if (changed)
           ecore_x_screensaver_set(timeout, interval, blanking, expose);
@@ -96,7 +96,7 @@ e_screensaver_force_update(void)
 {
 #ifndef HAVE_WAYLAND_ONLY
    int timeout = e_screensaver_timeout_get(EINA_TRUE);
-   if (e_comp->comp_type == E_PIXMAP_TYPE_X)
+   if (e_comp_util_has_x())
      {
         ecore_x_screensaver_set(timeout + 10,
                                 0,
@@ -440,7 +440,7 @@ E_API void
 e_screensaver_activate(void)
 {
 #ifndef HAVE_WAYLAND_ONLY
-   if (e_comp->comp_type == E_PIXMAP_TYPE_X)
+   if (e_comp_util_has_x())
      {
         ecore_x_screensaver_activate();
      }
@@ -452,7 +452,7 @@ E_API void
 e_screensaver_deactivate(void)
 {
 #ifndef HAVE_WAYLAND_ONLY
-   if (e_comp->comp_type == E_PIXMAP_TYPE_X)
+   if (e_comp_util_has_x())
      {
         ecore_x_screensaver_reset();
      }

-- 


Reply via email to