replace some x11 compositor checks with calls to util function

This commit is contained in:
Mike Blumenkrantz 2015-07-01 16:25:45 -04:00
parent a597b53f4c
commit 2d3c43a39c
4 changed files with 20 additions and 20 deletions

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -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();
}