@bugfix: Fix building for WAYLAND_ONLY by using the proper define

sed -i 's/WAYLAND_ONLY/HAVE_WAYLAND_ONLY/g'

Signed-off-by: Chris Michael <cp.michael@samsung.com>
devs/discomfitor/eo
Chris Michael 9 years ago
parent 13509d6dcc
commit 915f8f0613
  1. 6
      src/bin/Makefile.mk
  2. 4
      src/bin/e.h
  3. 6
      src/bin/e_actions.c
  4. 2
      src/bin/e_alert.c
  5. 4
      src/bin/e_atoms.c
  6. 11
      src/bin/e_backlight.c
  7. 24
      src/bin/e_bindings.c
  8. 11
      src/bin/e_canvas.c
  9. 9
      src/bin/e_client.c
  10. 6
      src/bin/e_client.h
  11. 6
      src/bin/e_comp.c
  12. 5
      src/bin/e_comp_object.c
  13. 12
      src/bin/e_comp_wl.c
  14. 9
      src/bin/e_comp_wl.h
  15. 2
      src/bin/e_desk.c
  16. 6
      src/bin/e_desklock.c
  17. 2
      src/bin/e_dialog.c
  18. 45
      src/bin/e_dnd.c
  19. 10
      src/bin/e_dpms.c
  20. 13
      src/bin/e_entry.c
  21. 26
      src/bin/e_fm.c
  22. 4
      src/bin/e_focus.c
  23. 4
      src/bin/e_grab_dialog.c
  24. 20
      src/bin/e_grabinput.c
  25. 89
      src/bin/e_hints.c
  26. 2
      src/bin/e_hints.h
  27. 3
      src/bin/e_includes.h
  28. 4
      src/bin/e_int_client_prop.c
  29. 6
      src/bin/e_main.c
  30. 4
      src/bin/e_module.c
  31. 4
      src/bin/e_mouse.c
  32. 34
      src/bin/e_pixmap.c
  33. 29
      src/bin/e_pointer.c
  34. 4
      src/bin/e_scale.c
  35. 6
      src/bin/e_screensaver.c
  36. 10
      src/bin/e_signals.c
  37. 5
      src/bin/e_win.c
  38. 2
      src/bin/e_xkb.c
  39. 12
      src/modules/conf_bindings/e_int_config_acpibindings.c
  40. 2
      src/modules/conf_display/e_int_config_desklock.c
  41. 6
      src/modules/conf_theme/e_int_config_scale.c
  42. 6
      src/modules/fileman/e_fwin.c
  43. 2
      src/modules/fileman/e_fwin_nav.c
  44. 10
      src/modules/pager/e_mod_main.c
  45. 6
      src/modules/pager16/e_mod_main.c
  46. 2
      src/modules/tiling/e_mod_tiling.c
  47. 8
      src/modules/winlist/e_winlist.c
  48. 2
      src/modules/wizard/page_150.c
  49. 4
      src/modules/wl_desktop_shell/e_mod_main.c

@ -212,6 +212,7 @@ enlightenment_src = \
src/bin/e_about.c \
src/bin/e_acpi.c \
src/bin/e_actions.c \
src/bin/e_alert.c \
src/bin/e_atoms.c \
src/bin/e_auth.c \
src/bin/e_backlight.c \
@ -239,9 +240,9 @@ src/bin/e_deskenv.c \
src/bin/e_desklock.c \
src/bin/e_deskmirror.c \
src/bin/e_dialog.c \
src/bin/e_dnd.c \
src/bin/e_dpms.c \
src/bin/e_desktop_editor.c \
src/bin/e_dnd.c \
src/bin/e_entry.c \
src/bin/e_entry_dialog.c \
src/bin/e_env.c \
@ -360,6 +361,7 @@ src/bin/e_widget_textblock.c \
src/bin/e_widget_toolbar.c \
src/bin/e_widget_toolbook.c \
src/bin/e_win.c \
src/bin/e_xkb.c \
src/bin/e_xinerama.c \
src/bin/e_zoomap.c \
src/bin/e_zone.c \
@ -367,10 +369,8 @@ $(ENLIGHTENMENTHEADERS)
if ! HAVE_WAYLAND_ONLY
enlightenment_src += \
src/bin/e_alert.c \
src/bin/e_comp_x.c \
src/bin/e_randr.c \
src/bin/e_xkb.c \
src/bin/e_xsettings.c
endif

@ -122,6 +122,10 @@ void *alloca (size_t);
# include <E_Hal.h>
# endif
# ifdef HAVE_WAYLAND
# include <Ecore_Wayland.h>
# endif
# ifdef EAPI
# undef EAPI
# endif

@ -2837,17 +2837,23 @@ ACT_FN_GO(kbd_layout, )
errno = 0;
x = strtoul(params, NULL, 10);
if (errno || (x > eina_list_count(e_config->xkb.used_layouts) - 1)) return;
#ifndef HAVE_WAYLAND_ONLY
e_xkb_layout_set(eina_list_nth(e_config->xkb.used_layouts, x));
#endif
}
ACT_FN_GO(kbd_layout_next, __UNUSED__)
{
#ifndef HAVE_WAYLAND_ONLY
e_xkb_layout_next();
#endif
}
ACT_FN_GO(kbd_layout_prev, __UNUSED__)
{
#ifndef HAVE_WAYLAND_ONLY
e_xkb_layout_prev();
#endif
}
ACT_FN_GO(module_enable, )

@ -19,6 +19,7 @@ e_alert_shutdown(void)
EAPI void
e_alert_composite_win(Ecore_X_Window root, Ecore_X_Window comp)
{
#ifndef HAVE_WAYLAND_ONLY
Ecore_X_Atom composite_win;
composite_win = ecore_x_atom_get("_E_COMP_WINDOW");
@ -27,6 +28,7 @@ e_alert_composite_win(Ecore_X_Window root, Ecore_X_Window comp)
ecore_x_window_prop_property_del(root, composite_win);
else
ecore_x_window_prop_card32_set(root, composite_win, &comp, 1);
#endif
}
EAPI void

@ -1,6 +1,7 @@
#include "e.h"
/* Atoms */
#ifndef HAVE_WAYLAND_ONLY
EAPI Ecore_X_Atom E_ATOM_MANAGED = 0;
EAPI Ecore_X_Atom E_ATOM_ZONE = 0;
EAPI Ecore_X_Atom E_ATOM_DESK = 0;
@ -12,11 +13,13 @@ EAPI Ecore_X_Atom E_ATOM_WINDOW_STATE = 0;
EAPI Ecore_X_Atom E_ATOM_WINDOW_STATE_CENTERED = 0;
EAPI Ecore_X_Atom E_ATOM_DESKTOP_FILE = 0;
EAPI Ecore_X_Atom E_ATOM_ZONE_GEOMETRY = 0;
#endif
/* externally accessible functions */
EINTERN int
e_atoms_init(void)
{
#ifndef HAVE_WAYLAND_ONLY
const char *atom_names[] = {
"__E_WINDOW_MANAGED",
"__E_WINDOW_ZONE",
@ -44,6 +47,7 @@ e_atoms_init(void)
E_ATOM_WINDOW_STATE_CENTERED = atoms[8];
E_ATOM_DESKTOP_FILE = atoms[9];
E_ATOM_ZONE_GEOMETRY = atoms[10];
#endif
return 1;
}

@ -21,7 +21,7 @@ static void _e_backlight_update(E_Zone *zone);
static void _e_backlight_set(E_Zone *zone, double val);
static Eina_Bool _bl_anim(void *data, double pos);
static Eina_Bool bl_avail = EINA_TRUE;
#ifndef WAYLAND_ONLY
#ifndef HAVE_WAYLAND_ONLY
static Eina_Bool xbl_avail = EINA_FALSE;
#endif
#ifdef HAVE_EEZE
@ -47,7 +47,7 @@ e_backlight_init(void)
eeze_init();
#endif
#ifndef WAYLAND_ONLY
#ifndef HAVE_WAYLAND_ONLY
if (e_comp_get(NULL)->man->root)
xbl_avail = ecore_x_randr_output_backlight_available();
#endif
@ -197,7 +197,7 @@ static void
_e_backlight_update(E_Zone *zone)
{
double x_bl = -1.0;
#ifndef WAYLAND_ONLY
#ifndef HAVE_WAYLAND_ONLY
Ecore_X_Window root;
Ecore_X_Randr_Output *out;
int i, num = 0;
@ -254,8 +254,11 @@ _e_backlight_update(E_Zone *zone)
static void
_e_backlight_set(E_Zone *zone, double val)
{
#ifdef WAYLAND_ONLY
#ifdef HAVE_WAYLAND_ONLY
if (0)
{
return;
}
#else
if (sysmode == MODE_RANDR)
{

@ -381,12 +381,14 @@ e_bindings_mouse_grab(E_Binding_Context ctxt, Ecore_X_Window win)
{
if (_e_bindings_context_match(binding->ctxt, ctxt))
{
#ifndef HAVE_WAYLAND_ONLY
ecore_x_window_button_grab(win, binding->button,
ECORE_X_EVENT_MASK_MOUSE_DOWN |
ECORE_X_EVENT_MASK_MOUSE_UP |
ECORE_X_EVENT_MASK_MOUSE_MOVE,
e_bindings_modifiers_to_ecore_convert(binding->mod),
binding->any_mod);
#endif
}
}
}
@ -401,8 +403,10 @@ e_bindings_mouse_ungrab(E_Binding_Context ctxt, Ecore_X_Window win)
{
if (_e_bindings_context_match(binding->ctxt, ctxt))
{
#ifndef HAVE_WAYLAND_ONLY
ecore_x_window_button_ungrab(win, binding->button,
e_bindings_modifiers_to_ecore_convert(binding->mod), binding->any_mod);
#endif
}
}
}
@ -589,8 +593,12 @@ e_bindings_key_grab(E_Binding_Context ctxt, Ecore_X_Window win)
if (_e_bindings_context_match(binding->ctxt, ctxt))
{
if (e_bindings_key_allowed(binding->key))
ecore_x_window_key_grab(win, binding->key,
e_bindings_modifiers_to_ecore_convert(binding->mod), binding->any_mod);
{
#ifndef HAVE_WAYLAND_ONLY
ecore_x_window_key_grab(win, binding->key,
e_bindings_modifiers_to_ecore_convert(binding->mod), binding->any_mod);
#endif
}
}
}
}
@ -606,8 +614,12 @@ e_bindings_key_ungrab(E_Binding_Context ctxt, Ecore_X_Window win)
if (_e_bindings_context_match(binding->ctxt, ctxt))
{
if (e_bindings_key_allowed(binding->key))
ecore_x_window_key_ungrab(win, binding->key,
e_bindings_modifiers_to_ecore_convert(binding->mod), binding->any_mod);
{
#ifndef HAVE_WAYLAND_ONLY
ecore_x_window_key_ungrab(win, binding->key,
e_bindings_modifiers_to_ecore_convert(binding->mod), binding->any_mod);
#endif
}
}
}
}
@ -1176,10 +1188,12 @@ e_bindings_wheel_grab(E_Binding_Context ctxt, Ecore_X_Window win)
else if (binding->z > 0)
button = 7;
}
#ifndef HAVE_WAYLAND_ONLY
if (button != 0)
ecore_x_window_button_grab(win, button,
ECORE_X_EVENT_MASK_MOUSE_DOWN,
e_bindings_modifiers_to_ecore_convert(binding->mod), binding->any_mod);
#endif
}
}
}
@ -1208,9 +1222,11 @@ e_bindings_wheel_ungrab(E_Binding_Context ctxt, Ecore_X_Window win)
else if (binding->z > 0)
button = 7;
}
#ifndef HAVE_WAYLAND_ONLY
if (button != 0)
ecore_x_window_button_ungrab(win, button,
e_bindings_modifiers_to_ecore_convert(binding->mod), binding->any_mod);
#endif
}
}
}

@ -148,12 +148,13 @@ e_canvas_new(Ecore_Window win, int x, int y, int w, int h,
{
Ecore_Evas *ee = NULL;
#ifdef WAYLAND_ONLY
#ifdef HAVE_WAYLAND_ONLY
ee = ecore_evas_wayland_shm_new(NULL, win, x, y, w, h, 0);
if (ee)
{
ecore_evas_override_set(ee, override);
if (win_ret) *win_ret = ecore_evas_wayland_window_get(ee);
if (win_ret)
*win_ret = ecore_wl_window_id_get(ecore_evas_wayland_window_get(ee));
}
#else
switch (e_comp_get(NULL)->comp_type)
@ -173,7 +174,11 @@ e_canvas_new(Ecore_Window win, int x, int y, int w, int h,
if (ee)
{
ecore_evas_override_set(ee, override);
if (win_ret) *win_ret = (Ecore_Window)ecore_evas_wayland_window_get(ee);
if (win_ret)
{
*win_ret =
ecore_wl_window_id_get(ecore_evas_wayland_window_get(ee));
}
}
break;
# endif

@ -2676,12 +2676,14 @@ e_client_mouse_move(E_Client *ec, Evas_Point *output)
e_object_ref(E_OBJECT(ec));
e_comp_object_frame_icon_geometry_get(ec->frame, &x, &y, &w, &h);
#ifndef HAVE_WAYLAND_ONLY
client_drag = e_drag_new(ec->zone->comp,
output->x, output->y,
drag_types, 1, ec, -1,
NULL,
_e_client_cb_drag_finished);
e_drag_resize(client_drag, w, h);
#endif
o = e_client_icon_add(ec, client_drag->evas);
if (!o)
{
@ -2689,10 +2691,12 @@ e_client_mouse_move(E_Client *ec, Evas_Point *output)
o = evas_object_rectangle_add(client_drag->evas);
evas_object_color_set(o, 255, 255, 255, 255);
}
#ifndef HAVE_WAYLAND_ONLY
e_drag_object_set(client_drag, o);
e_drag_start(client_drag,
output->x + (ec->drag.x - x),
output->y + (ec->drag.y - y));
#endif
}
ec->drag.start = 0;
}
@ -3574,8 +3578,13 @@ e_client_fullscreen(E_Client *ec, E_Fullscreen policy)
else if (e_config->mode.presentation)
evas_object_layer_set(ec->frame, E_LAYER_CLIENT_TOP);
#ifndef HAVE_WAYLAND_ONLY
if ((eina_list_count(ec->comp->zones) > 1) ||
(policy == E_FULLSCREEN_RESIZE) || (!ecore_x_randr_query()))
#else
if ((eina_list_count(ec->comp->zones) > 1) ||
(policy == E_FULLSCREEN_RESIZE))
#endif
{
evas_object_geometry_set(ec->frame, ec->zone->x, ec->zone->y, ec->zone->w, ec->zone->h);
}

@ -290,7 +290,7 @@ struct E_Client
unsigned char changed : 1;
unsigned char user_selected : 1;
Eina_Stringshare *name;
} border;
} border;
struct
{
@ -389,9 +389,9 @@ struct E_Client
unsigned int desktop;
Eina_Stringshare *name;
Eina_Stringshare *icon_name;
#ifdef E_COMP_X_H
Ecore_X_Icon *icons;
#endif
int num_icons;
unsigned int user_time;
unsigned char opacity;

@ -726,7 +726,11 @@ _e_comp_shapes_update_job(E_Comp *c)
}
#endif
}
#ifndef HAVE_WAYLAND_ONLY
ecore_x_window_shape_input_rectangles_set(c->win, (Ecore_X_Rectangle*)exr, i);
#endif
#ifdef SHAPE_DEBUG
E_FREE_LIST(rl, free);
printf("\n");
@ -1127,7 +1131,7 @@ e_comp_init(void)
}
}
#endif
#ifndef WAYLAND_ONLY
#ifndef HAVE_WAYLAND_ONLY
if (!e_comp_x_init()) return EINA_FALSE;
#endif
#ifdef HAVE_WAYLAND_CLIENTS

@ -224,7 +224,10 @@ _e_comp_object_cb_signal_bind(void *data, Evas_Object *obj EINA_UNUSED, const ch
{
E_Comp_Object *cw = data;
if (e_dnd_active() || (!cw->ec)) return;
if (!cw->ec) return;
#ifndef HAVE_WAYLAND_ONLY
if (e_dnd_active()) return;
#endif
e_bindings_signal_handle(E_BINDING_CONTEXT_WINDOW, E_OBJECT(cw->ec),
emission, source);
}

@ -314,7 +314,7 @@ e_comp_wl_init(void)
goto err;
}
#ifndef WAYLAND_ONLY
#ifndef HAVE_WAYLAND_ONLY
/* setup keymap_change event handler */
_e_wl_comp->kbd_handler =
ecore_event_handler_add(ECORE_X_EVENT_XKB_STATE_NOTIFY,
@ -344,7 +344,7 @@ e_comp_wl_init(void)
}
wl_event_loop_dispatch(_e_wl_comp->wl.loop, 0);
#ifndef WAYLAND_ONLY
#ifndef HAVE_WAYLAND_ONLY
/* add an idler for deferred shell module loading */
_module_idler = ecore_idler_add(_e_comp_wl_cb_module_idle, NULL);
#endif
@ -355,7 +355,7 @@ err:
/* remove kbd handler */
if (_e_wl_comp->kbd_handler)
ecore_event_handler_del(_e_wl_comp->kbd_handler);
#ifndef WAYLAND_ONLY
#ifndef HAVE_WAYLAND_ONLY
/* remove the module idler */
if (_module_idler) ecore_idler_del(_module_idler);
#endif
@ -423,13 +423,13 @@ e_comp_wl_shutdown(void)
e_module_disable(mod);
}
#ifdef WAYLAND_ONLY
#ifdef HAVE_WAYLAND_ONLY
EAPI int
e_comp_wl_input_read(int fd EINA_UNUSED, unsigned int mask EINA_UNUSED, void *data)
{
E_Wayland_Compositor *wl_comp = data;
wl_event_loop_dispatch(wl_comp->wl.input_loop, 0);
wl_event_loop_dispatch(wl_comp->wl.loop, 0);
return 1;
}
#endif
@ -1975,7 +1975,7 @@ _e_comp_wl_input_keymap_get(void)
names.layout = strdup(kbd_layout->name);
}
#ifndef WAYLAND_ONLY
#ifndef HAVE_WAYLAND_ONLY
/* if we are running under X11, try to get the xkb rule names atom */
if (getenv("DISPLAY"))
{

@ -6,7 +6,12 @@
# define WL_HIDE_DEPRECATED
# include <pixman.h>
/* NB: Turn off shadow warnings for Wayland includes */
# pragma GCC diagnostic ignored "-Wshadow"
# include <wayland-server.h>
# pragma GCC diagnostic pop
# include <xkbcommon/xkbcommon.h>
/* headers for terminal support */
@ -473,7 +478,7 @@ struct _E_Wayland_Compositor
E_Wayland_Shell_Interface shell_interface;
#ifdef WAYLAND_ONLY
#ifdef HAVE_WAYLAND_ONLY
Eina_Bool focus : 1;
unsigned int output_pool;
@ -592,7 +597,7 @@ extern EAPI E_Wayland_Compositor *_e_wl_comp;
EAPI Eina_Bool e_comp_wl_init(void);
EINTERN void e_comp_wl_shutdown(void);
#ifdef WAYLAND_ONLY
#ifdef HAVE_WAYLAND_ONLY
EAPI int e_comp_wl_input_read(int fd EINA_UNUSED, unsigned int mask EINA_UNUSED, void *data);
#endif

@ -892,9 +892,11 @@ _e_desk_hide_begin(E_Desk *desk, int dx, int dy)
static void
_e_desk_window_profile_change_protocol_set(void)
{
#ifndef HAVE_WAYLAND_ONLY
Eina_List *l = NULL;
E_Manager *man;
EINA_LIST_FOREACH(e_manager_list(), l, man)
ecore_x_e_window_profile_supported_set(man->root, e_config->use_desktop_window_profile);
#endif
}

@ -420,12 +420,14 @@ _e_desklock_cb_idle_poller(void *data __UNUSED__)
{
if ((e_config->desklock_autolock_idle) && (!e_config->mode.presentation))
{
double idle, max;
double idle = 0.0, max;
/* If a desklock is already up, bail */
if ((_e_custom_desklock_exe) || (_e_desklock_state)) return ECORE_CALLBACK_RENEW;
#ifndef HAVE_WAYLAND_ONLY
idle = ecore_x_screensaver_idle_time_get();
#endif
max = e_config->desklock_autolock_idle_timeout;
if (_e_desklock_ask_presentation_count > 0)
max *= (1 + _e_desklock_ask_presentation_count);
@ -491,7 +493,9 @@ _e_desklock_ask_presentation_no_increase(void *data __UNUSED__, E_Dialog *dia)
blanking = e_config->screensaver_blanking;
expose = e_config->screensaver_expose;
#ifndef HAVE_WAYLAND_ONLY
ecore_x_screensaver_set(timeout, interval, blanking, expose);
#endif
e_object_del(E_OBJECT(dia));
}

@ -222,10 +222,12 @@ EAPI void
e_dialog_parent_set(E_Dialog *dia, E_Win *win)
{
if (!dia) return;
#ifndef HAVE_WAYLAND_ONLY
if (win)
ecore_x_icccm_transient_for_set(dia->win->evas_win, win->evas_win);
else
ecore_x_icccm_transient_for_unset(dia->win->evas_win);
#endif
ecore_evas_modal_set(dia->win->ecore_evas, !!win);
}

@ -17,6 +17,7 @@ static Eina_Bool _e_dnd_cb_key_down(void *data, int type, void *event);
static Eina_Bool _e_dnd_cb_key_up(void *data, int type, void *event);
static Eina_Bool _e_dnd_cb_mouse_up(void *data, int type, void *event);
static Eina_Bool _e_dnd_cb_mouse_move(void *data, int type, void *event);
#ifndef HAVE_WAYLAND_ONLY
static Eina_Bool _e_dnd_cb_event_dnd_enter(void *data, int type, void *event);
static Eina_Bool _e_dnd_cb_event_dnd_leave(void *data, int type, void *event);
static Eina_Bool _e_dnd_cb_event_dnd_position(void *data, int type, void *event);
@ -25,6 +26,7 @@ static Eina_Bool _e_dnd_cb_event_dnd_finished(void *data, int type, void *e
static Eina_Bool _e_dnd_cb_event_dnd_drop(void *data, int type, void *event);
static Eina_Bool _e_dnd_cb_event_dnd_selection(void *data, int type, void *event);
static Eina_Bool _e_dnd_cb_event_hide(void *data, int type, Ecore_X_Event_Window_Hide *ev);
#endif
/* local subsystem globals */
@ -108,13 +110,18 @@ e_dnd_init(void)
_type_xds = eina_stringshare_add("XdndDirectSave0");
_type_text_x_moz_url = eina_stringshare_add("text/x-moz-url");
_type_enlightenment_x_file = eina_stringshare_add("enlightenment/x-file");
#ifndef HAVE_WAYLAND_ONLY
_text_atom = ecore_x_atom_get("text/plain");
#endif
_drop_win_hash = eina_hash_int32_new(NULL);
_drop_handlers_responsives = eina_hash_int32_new(NULL);
E_LIST_HANDLER_APPEND(_event_handlers, ECORE_EVENT_MOUSE_BUTTON_UP, _e_dnd_cb_mouse_up, NULL);
E_LIST_HANDLER_APPEND(_event_handlers, ECORE_EVENT_MOUSE_MOVE, _e_dnd_cb_mouse_move, NULL);
E_LIST_HANDLER_APPEND(_event_handlers, ECORE_EVENT_KEY_DOWN, _e_dnd_cb_key_down, NULL);
E_LIST_HANDLER_APPEND(_event_handlers, ECORE_EVENT_KEY_UP, _e_dnd_cb_key_up, NULL);
#ifndef HAVE_WAYLAND_ONLY
E_LIST_HANDLER_APPEND(_event_handlers, ECORE_X_EVENT_XDND_ENTER, _e_dnd_cb_event_dnd_enter, NULL);
E_LIST_HANDLER_APPEND(_event_handlers, ECORE_X_EVENT_XDND_LEAVE, _e_dnd_cb_event_dnd_leave, NULL);
E_LIST_HANDLER_APPEND(_event_handlers, ECORE_X_EVENT_XDND_POSITION, _e_dnd_cb_event_dnd_position, NULL);
@ -123,13 +130,14 @@ e_dnd_init(void)
E_LIST_HANDLER_APPEND(_event_handlers, ECORE_X_EVENT_XDND_DROP, _e_dnd_cb_event_dnd_drop, NULL);
E_LIST_HANDLER_APPEND(_event_handlers, ECORE_X_EVENT_SELECTION_NOTIFY, _e_dnd_cb_event_dnd_selection, NULL);
E_LIST_HANDLER_APPEND(_event_handlers, ECORE_X_EVENT_WINDOW_HIDE, _e_dnd_cb_event_hide, NULL);
E_LIST_HANDLER_APPEND(_event_handlers, ECORE_EVENT_KEY_DOWN, _e_dnd_cb_key_down, NULL);
E_LIST_HANDLER_APPEND(_event_handlers, ECORE_EVENT_KEY_UP, _e_dnd_cb_key_up, NULL);
#endif
EINA_LIST_FOREACH(e_comp_list(), l, c)
e_drop_xdnd_register_set(c->ee_win, 1);
#ifndef HAVE_WAYLAND_ONLY
_action = ECORE_X_ATOM_XDND_ACTION_PRIVATE;
#endif
return 1;
}
@ -204,7 +212,9 @@ e_drag_new(E_Comp *comp, int x, int y,
_drag_list = eina_list_append(_drag_list, drag);
#ifndef HAVE_WAYLAND_ONLY
ecore_x_window_shadow_tree_flush();
#endif
_drag_win_root = drag->comp->man->root;
@ -269,14 +279,18 @@ e_drag_start(E_Drag *drag, int x, int y)
E_Drop_Handler *h;
if (_drag_win) return 0;
#ifndef HAVE_WAYLAND_ONLY
_drag_win = ecore_x_window_input_new(drag->comp->win,
drag->comp->man->x, drag->comp->man->y,
drag->comp->man->w, drag->comp->man->h);
_drag_win_root = drag->comp->man->root;
ecore_x_window_show(_drag_win);
#endif
_drag_win_root = drag->comp->man->root;
if (!e_grabinput_get(_drag_win, 1, _drag_win))
{
#ifndef HAVE_WAYLAND_ONLY
ecore_x_window_free(_drag_win);
#endif
return 0;
}
if (!drag->object)
@ -317,23 +331,29 @@ e_drag_start(E_Drag *drag, int x, int y)
EAPI int
e_drag_xdnd_start(E_Drag *drag, int x, int y)
{
#ifndef HAVE_WAYLAND_ONLY
Ecore_X_Atom actions[] = {
ECORE_X_DND_ACTION_MOVE, ECORE_X_DND_ACTION_PRIVATE,
ECORE_X_DND_ACTION_COPY, ECORE_X_DND_ACTION_ASK,
ECORE_X_DND_ACTION_LINK
};
#endif
const Eina_List *l;
E_Drop_Handler *h;
if (_drag_win) return 0;
#ifndef HAVE_WAYLAND_ONLY
_drag_win = ecore_x_window_input_new(drag->comp->win,
drag->comp->man->x, drag->comp->man->y,
drag->comp->man->w, drag->comp->man->h);
ecore_x_window_show(_drag_win);
#endif
if (!e_grabinput_get(_drag_win, 1, _drag_win))
{
#ifndef HAVE_WAYLAND_ONLY
ecore_x_window_free(_drag_win);
#endif
return 0;
}
if (!drag->object)
@ -366,10 +386,12 @@ e_drag_xdnd_start(E_Drag *drag, int x, int y)
h->entered = 0;
}
#ifndef HAVE_WAYLAND_ONLY
ecore_x_dnd_aware_set(_drag_win, 1);
ecore_x_dnd_types_set(_drag_win, drag->types, drag->num_types);
ecore_x_dnd_actions_set(_drag_win, actions, 5);
ecore_x_dnd_begin(_drag_win, drag->data, drag->data_size);
#endif
_drag_current = drag;
return 1;
@ -385,6 +407,7 @@ e_drop_handler_xds_set(E_Drop_Handler *handler, Eina_Bool (*cb)(void *data, cons
EAPI void
e_drop_xds_update(Eina_Bool enable, const char *value)
{
#ifndef HAVE_WAYLAND_ONLY
Ecore_X_Window xwin;
char buf[PATH_MAX + 8];
char *file;
@ -411,6 +434,7 @@ e_drop_xds_update(Eina_Bool enable, const char *value)
}
else
ecore_x_window_prop_property_del(xwin, ECORE_X_ATOM_XDND_DIRECTSAVE0);
#endif
}
EAPI E_Drop_Handler *
@ -502,13 +526,17 @@ e_drop_xdnd_register_set(Ecore_Window win, int reg)
{
if (!eina_hash_find(_drop_win_hash, &win))
{
#ifndef HAVE_WAYLAND_ONLY
ecore_x_dnd_aware_set(win, 1);
#endif
eina_hash_add(_drop_win_hash, &win, (void *)1);
}
}
else
{
#ifndef HAVE_WAYLAND_ONLY
ecore_x_dnd_aware_set(win, 0);
#endif
eina_hash_del(_drop_win_hash, &win, (void *)1);
}
return 1;
@ -959,10 +987,12 @@ _e_drag_end(int x, int y)
e_grabinput_release(_drag_win, _drag_win);
while (_drag_current->type == E_DRAG_XDND)
{
#ifndef HAVE_WAYLAND_ONLY
if (!(dropped = ecore_x_dnd_drop()))
{
if (win == e_comp_get(NULL)->ee_win) break;
}
#endif
if (_drag_current->cb.finished)
_drag_current->cb.finished(_drag_current, dropped);
_drag_current->cb.finished = NULL;
@ -1117,9 +1147,11 @@ _e_drag_free(E_Drag *drag)
for (i = 0; i < drag->num_types; i++)
eina_stringshare_del(drag->types[i]);
free(drag);
#ifndef HAVE_WAYLAND_ONLY
ecore_x_window_free(_drag_win);
_drag_win = 0;
ecore_x_window_shadow_tree_flush();
#endif
_drag_win = 0;
}
static Eina_Bool
@ -1171,13 +1203,16 @@ _e_dnd_cb_mouse_move(void *data __UNUSED__, int type __UNUSED__, void *event)
if (ev->window != _drag_win) return ECORE_CALLBACK_PASS_ON;
#ifndef HAVE_WAYLAND_ONLY
if (!_xdnd)
_e_drag_update(_drag_win_root, ev->x, ev->y,
_action ?: ECORE_X_ATOM_XDND_ACTION_PRIVATE);
#endif
return ECORE_CALLBACK_PASS_ON;
}
#ifndef HAVE_WAYLAND_ONLY
static Eina_Bool
_e_dnd_cb_event_dnd_enter(void *data __UNUSED__, int type __UNUSED__, void *event)
{
@ -1380,7 +1415,6 @@ _e_dnd_cb_event_dnd_drop(void *data __UNUSED__, int type __UNUSED__, void *event
E_FREE(_xdnd);
}
}
return ECORE_CALLBACK_PASS_ON;
}
@ -1442,4 +1476,5 @@ _e_dnd_cb_event_dnd_selection(void *data __UNUSED__, int type __UNUSED__, void *
E_FREE(_xdnd);
return ECORE_CALLBACK_PASS_ON;
}
#endif

@ -28,7 +28,9 @@ e_dpms_update(void)
if (_e_dpms_enabled != enabled)
{
_e_dpms_enabled = enabled;
#ifndef HAVE_WAYLAND_ONLY
ecore_x_dpms_enabled_set(enabled);
#endif
}
if (!enabled) return;
@ -54,7 +56,9 @@ e_dpms_update(void)
_e_dpms_timeout_off = off;
changed = EINA_TRUE;
}
#ifndef HAVE_WAYLAND_ONLY
if (changed) ecore_x_dpms_timeouts_set(standby, suspend, off);
#endif
}
EAPI void
@ -65,7 +69,9 @@ e_dpms_force_update(void)
enabled = ((e_config->screensaver_enable) &&
(!e_config->mode.presentation));
#ifndef HAVE_WAYLAND_ONLY
ecore_x_dpms_enabled_set(enabled);
#endif
if (!enabled) return;
if (e_config->screensaver_enable)
@ -75,8 +81,10 @@ e_dpms_force_update(void)
suspend += 6;
off += 7;
}
#ifndef HAVE_WAYLAND_ONLY
ecore_x_dpms_timeouts_set(standby + 10, suspend + 10, off + 10);
ecore_x_dpms_timeouts_set(standby, suspend, off);
#endif
}
static Eina_Bool
@ -134,9 +142,11 @@ e_dpms_init(void)
_e_dpms_handler_desk_show = ecore_event_handler_add
(E_EVENT_DESK_SHOW, _e_dpms_handler_desk_show_cb, NULL);
#ifndef HAVE_WAYLAND_ONLY
_e_dpms_enabled = ecore_x_dpms_enabled_get();
ecore_x_dpms_timeouts_get
(&_e_dpms_timeout_standby, &_e_dpms_timeout_suspend, &_e_dpms_timeout_off);
#endif
e_dpms_force_update();

@ -534,6 +534,7 @@ _e_entry_mouse_down_cb(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *o
static Eina_Bool
_e_entry_x_selection_notify_handler(void *data, int type __UNUSED__, void *event)
{
#ifndef HAVE_WAYLAND_ONLY
Evas_Object *entry;
E_Entry_Smart_Data *sd;
Ecore_X_Event_Selection_Notify *ev;
@ -563,7 +564,7 @@ _e_entry_x_selection_notify_handler(void *data, int type __UNUSED__, void *event
}
}
}
#endif
return ECORE_CALLBACK_PASS_ON;
}
@ -595,9 +596,11 @@ _e_entry_x_selection_update(Evas_Object *entry)
if (sd->password_mode)
return;
#ifndef HAVE_WAYLAND_ONLY
text = edje_object_part_text_selection_get(sd->entry_object, ENTRY_PART_NAME);
if (text)
ecore_x_selection_primary_set(xwin, text, strlen(text) + 1);
#endif
}
static void
@ -623,6 +626,7 @@ _entry_paste_request_signal_cb(void *data,
else
xwin = win->evas_win;
#ifndef HAVE_WAYLAND_ONLY
if (emission[sizeof("ntry,paste,request,")] == '1')
{
ecore_x_selection_primary_request(xwin,
@ -633,6 +637,7 @@ _entry_paste_request_signal_cb(void *data,
ecore_x_selection_clipboard_request(xwin,
ECORE_X_SELECTION_TARGET_UTF8_STRING);
}
#endif
}
static void
@ -812,9 +817,11 @@ _e_entry_smart_add(Evas_Object *object)
_entry_recalc_size(object);
#ifndef HAVE_WAYLAND_ONLY
sd->selection_handler =
ecore_event_handler_add(ECORE_X_EVENT_SELECTION_NOTIFY,
_e_entry_x_selection_notify_handler, object);
#endif
}
static void
@ -976,7 +983,9 @@ _e_entry_cb_copy(void *data, E_Menu *m __UNUSED__, E_Menu_Item *mi __UNUSED__)
xwin = c->ee_win;
}
}
#ifndef HAVE_WAYLAND_ONLY
ecore_x_selection_clipboard_set(xwin, range, strlen(range) + 1);
#endif
}
}
@ -1005,7 +1014,9 @@ _e_entry_cb_paste(void *data, E_Menu *m __UNUSED__, E_Menu_Item *mi __UNUSED__)
xwin = c->ee_win;
}
}
#ifndef HAVE_WAYLAND_ONLY
ecore_x_selection_clipboard_request(xwin, ECORE_X_SELECTION_TARGET_UTF8_STRING);
#endif
}
static void

@ -6500,6 +6500,7 @@ _e_fm_drop_menu_queue(Evas_Object *e_fm, void *args, int op)
if (!vol->mounted)
{
/* this should get picked up by the post-mount callback */
#ifndef HAVE_WAYLAND_ONLY
switch (op)
{
case 0: //copy
@ -6514,6 +6515,7 @@ _e_fm_drop_menu_queue(Evas_Object *e_fm, void *args, int op)
mop->action = ECORE_X_ATOM_XDND_ACTION_LINK;
break;
}
#endif
return EINA_TRUE;
}
switch (op)
@ -6621,6 +6623,7 @@ _e_fm2_cb_dnd_selection_notify_post_mount(E_Volume *vol)
if (mp)
{
mop->args = e_util_string_append_quoted(mop->args, &mop->size, &mop->length, mp);
#ifndef HAVE_WAYLAND_ONLY
if (mop->action == ECORE_X_ATOM_XDND_ACTION_ASK)
continue;
else if (mop->action == ECORE_X_ATOM_XDND_ACTION_MOVE)
@ -6629,6 +6632,7 @@ _e_fm2_cb_dnd_selection_notify_post_mount(E_Volume *vol)
e_fm2_client_file_copy(ic->sd->obj, mop->args);
else if (mop->action == ECORE_X_ATOM_XDND_ACTION_LINK)
e_fm2_client_file_symlink(ic->sd->obj, mop->args);
#endif
}
else
e_util_dialog_show(_("Error"), _("The recent DND operation requested for '%s' has failed."), vol->label ? : vol->udi);
@ -6763,6 +6767,7 @@ _e_fm2_cb_dnd_selection_notify(void *data, const char *type, void *event)
((f - fp - 1 > 0) && (!strncmp(sd->realpath, fp, f - fp - 1)))) &&
((size_t)(f - fp - 1) == strlen(sd->realpath)))
{
#ifndef HAVE_WAYLAND_ONLY
if ((e_drop_handler_action_get() == ECORE_X_ATOM_XDND_ACTION_MOVE) || (sd->config->view.link_drop))
{
lnk = EINA_TRUE;
@ -6770,10 +6775,12 @@ _e_fm2_cb_dnd_selection_notify(void *data, const char *type, void *event)
goto end;
memerr = EINA_TRUE; // prevent actual file move op
}
#endif
}
}
if (!fsel)
{
#ifndef HAVE_WAYLAND_ONLY
if (e_drop_handler_action_get() == ECORE_X_ATOM_XDND_ACTION_COPY)
{
/* most likely someone is trying to dnd some text to us */
@ -6782,6 +6789,7 @@ _e_fm2_cb_dnd_selection_notify(void *data, const char *type, void *event)
isel = eina_list_append(isel, strdup(fp));
ecore_thread_global_data_add("efm_text_uri_list", isel, (Eina_Free_Cb)e_util_string_list_free, 0);
}
#endif
/* no files, abort! */
return;
}
@ -6932,6 +6940,7 @@ _e_fm2_cb_dnd_selection_notify(void *data, const char *type, void *event)
if (sd->drop_icon->mount_timer) ecore_timer_reset(sd->drop_icon->mount_timer);
else sd->drop_icon->mount_timer = ecore_timer_add(15., (Ecore_Task_Cb)_e_fm2_cb_dnd_selection_notify_post_mount_timer, sd->drop_icon);
#ifndef HAVE_WAYLAND_ONLY
if ((e_drop_handler_action_get() == ECORE_X_ATOM_XDND_ACTION_ASK) ||
((sd->config->view.link_drop) || (!sd->drop_icon)))
/* this here's some buuuullshit */
@ -6939,6 +6948,7 @@ _e_fm2_cb_dnd_selection_notify(void *data, const char *type, void *event)
else if (e_drop_handler_action_get() == ECORE_X_ATOM_XDND_ACTION_MOVE)
/* set copy if we're over a device */
e_drop_handler_action_set(ECORE_X_ATOM_XDND_ACTION_COPY);
#endif
mop = e_fm2_device_mount_op_add(sd->drop_icon->mount, args, size, length);
mop->ic = sd->drop_icon;
mop->mnt = sd->drop_icon->mount;
@ -7031,6 +7041,7 @@ _e_fm2_cb_dnd_selection_notify(void *data, const char *type, void *event)
{
Eina_Bool do_lnk = EINA_FALSE, do_move = EINA_FALSE, do_copy = EINA_FALSE;
#ifndef HAVE_WAYLAND_ONLY
if (e_drop_handler_action_get() == ECORE_X_ATOM_XDND_ACTION_COPY)
{
lnk = EINA_TRUE;
@ -7061,6 +7072,7 @@ _e_fm2_cb_dnd_selection_notify(void *data, const char *type, void *event)
e_fm2_client_file_copy(sd->obj, args);
else if (do_move)
e_fm2_client_file_move(sd->obj, args);
#endif
if ((!do_lnk) && (!do_copy) && (!do_move))
{
e_fm2_drop_menu(sd->obj, args);
@ -7404,7 +7416,8 @@ _e_fm2_cb_drag_finished(E_Drag *drag, int dropped __UNUSED__)
static void
_e_fm_drag_key_down_cb(E_Drag *drag, Ecore_Event_Key *e)
{
if (!strncmp(e->key, "Alt", 3))
#ifndef HAVE_WAYLAND_ONLY
if (!strncmp(e->keyname, "Alt", 3))
{
ecore_x_dnd_source_action_set(ECORE_X_ATOM_XDND_ACTION_ASK);
e_drop_handler_action_set(ECORE_X_ATOM_XDND_ACTION_ASK);
@ -7440,11 +7453,13 @@ _e_fm_drag_key_down_cb(E_Drag *drag, Ecore_Event_Key *e)
edje_object_signal_emit(drag->object, "e,state,copy", "e");
}
}
#endif
}
static void
_e_fm_drag_key_up_cb(E_Drag *drag, Ecore_Event_Key *e)
{
#ifndef HAVE_WAYLAND_ONLY
Ecore_X_Atom act = ECORE_X_ATOM_XDND_ACTION_MOVE;
/* Default action would be move. ;) */
@ -7457,6 +7472,7 @@ _e_fm_drag_key_up_cb(E_Drag *drag, Ecore_Event_Key *e)
ecore_x_dnd_source_action_set(act);
e_drop_handler_action_set(act);
#endif
edje_object_signal_emit(drag->object, "e,state,move", "e");
}
@ -7631,8 +7647,9 @@ _e_fm2_cb_icon_mouse_move(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNU
d->x = ic->sd->x, d->y = ic->sd->y;
else
d->x = ic->x + ic->sd->x - ic->sd->pos.x, d->y = ic->y + ic->sd->y - ic->sd->pos.y;
#ifndef HAVE_WAYLAND_ONLY
e_drop_handler_action_set(ECORE_X_ATOM_XDND_ACTION_MOVE);
#endif
e_drag_object_set(d, layout ?: o);
if (layout)
{
@ -10299,7 +10316,9 @@ _e_fm2_icon_entry_widget_add(E_Fm2_Icon *ic)
ic->entry_widget = e_widget_entry_add(e, NULL, NULL, NULL, NULL);
evas_object_event_callback_add(ic->entry_widget, EVAS_CALLBACK_KEY_DOWN,
_e_fm2_icon_entry_widget_cb_key_down, ic);
#ifndef HAVE_WAYLAND_ONLY
evas_event_feed_mouse_out(evas_object_evas_get(ic->obj), ecore_x_current_time_get(), NULL);
#endif
if (c)
e_comp_grab_input(c, 0, 1);
ic->keygrab = !!c;
@ -10312,8 +10331,9 @@ _e_fm2_icon_entry_widget_add(E_Fm2_Icon *ic)
e_widget_entry_select_all(ic->entry_widget);
ic->sd->iop_icon = ic;
ic->sd->typebuf.disabled = EINA_TRUE;
#ifndef HAVE_WAYLAND_ONLY
evas_event_feed_mouse_in(e, ecore_x_current_time_get(), NULL);
#endif
return ic->entry_widget;
}

@ -69,9 +69,11 @@ e_focus_event_focus_in(E_Client *ec)
if (!ec->button_grabbed) return;
e_bindings_mouse_ungrab(E_BINDING_CONTEXT_WINDOW, e_client_util_pwin_get(ec));
e_bindings_wheel_ungrab(E_BINDING_CONTEXT_WINDOW, e_client_util_pwin_get(ec));
#ifndef HAVE_WAYLAND_ONLY
ecore_x_window_button_ungrab(e_client_util_pwin_get(ec), 1, 0, 1);
ecore_x_window_button_ungrab(e_client_util_pwin_get(ec), 2, 0, 1);
ecore_x_window_button_ungrab(e_client_util_pwin_get(ec), 3, 0, 1);
#endif
e_bindings_mouse_grab(E_BINDING_CONTEXT_WINDOW, e_client_util_pwin_get(ec));
e_bindings_wheel_grab(E_BINDING_CONTEXT_WINDOW, e_client_util_pwin_get(ec));
ec->button_grabbed = 0;
@ -86,6 +88,7 @@ e_focus_event_focus_out(E_Client *ec)
(!e_config->always_click_to_focus))
{
if (ec->button_grabbed) return;
#ifndef HAVE_WAYLAND_ONLY
ecore_x_window_button_grab(e_client_util_pwin_get(ec), 1,
ECORE_X_EVENT_MASK_MOUSE_DOWN |
ECORE_X_EVENT_MASK_MOUSE_UP |
@ -98,6 +101,7 @@ e_focus_event_focus_out(E_Client *ec)
ECORE_X_EVENT_MASK_MOUSE_DOWN |
ECORE_X_EVENT_MASK_MOUSE_UP |
ECORE_X_EVENT_MASK_MOUSE_MOVE, 0, 1);
#endif
ec->button_grabbed = 1;
}
}

@ -72,7 +72,9 @@ _e_grab_dialog_free(E_Grab_Dialog *eg)
if (eg->grab_win)
{
e_grabinput_release(eg->grab_win, eg->grab_win);
#ifndef HAVE_WAYLAND_ONLY
ecore_x_window_free(eg->grab_win);
#endif
}
E_FREE_LIST(eg->handlers, ecore_event_handler_del);
@ -137,9 +139,11 @@ e_grab_dialog_show(E_Win *parent, Eina_Bool is_mouse, Ecore_Event_Handler_Cb key
e_object_del_attach_func_set(E_OBJECT(eg->dia), _e_grab_dialog_dia_del);
e_win_delete_callback_set(eg->dia->win, _e_grab_dialog_delete);
#ifndef HAVE_WAYLAND_ONLY
eg->grab_win = ecore_x_window_input_new(c->man->root, 0, 0, 1, 1);
ecore_x_window_show(eg->grab_win);
e_grabinput_get(eg->grab_win, 0, eg->grab_win);
#endif
eg->key = key;
eg->mouse = mouse;

@ -40,12 +40,16 @@ e_grabinput_get(Ecore_Window mouse_win, int confine_mouse, Ecore_Window key_win)
if (e_comp_get(NULL)->comp_type != E_PIXMAP_TYPE_X) return 1;
if (grab_mouse_win)
{
#ifndef HAVE_WAYLAND_ONLY
ecore_x_pointer_ungrab();
#endif
grab_mouse_win = 0;
}
if (grab_key_win)
{
#ifndef HAVE_WAYLAND_ONLY
ecore_x_keyboard_ungrab();
#endif
grab_key_win = 0;
focus_win = 0;
}
@ -53,15 +57,18 @@ e_grabinput_get(Ecore_Window mouse_win, int confine_mouse, Ecore_Window key_win)
{
int ret = 0;
#ifndef HAVE_WAYLAND_ONLY
if (confine_mouse)
ret = ecore_x_pointer_confine_grab(mouse_win);
else
ret = ecore_x_pointer_grab(mouse_win);
#endif