From 915f8f06131132c4e2601f45fcef369cc0c39395 Mon Sep 17 00:00:00 2001 From: Chris Michael Date: Tue, 11 Mar 2014 11:24:41 +0000 Subject: [PATCH] @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 --- src/bin/Makefile.mk | 6 +- src/bin/e.h | 4 + src/bin/e_actions.c | 6 ++ src/bin/e_alert.c | 2 + src/bin/e_atoms.c | 4 + src/bin/e_backlight.c | 11 ++- src/bin/e_bindings.c | 24 ++++- src/bin/e_canvas.c | 11 ++- src/bin/e_client.c | 9 ++ src/bin/e_client.h | 6 +- src/bin/e_comp.c | 6 +- src/bin/e_comp_object.c | 5 +- src/bin/e_comp_wl.c | 12 +-- src/bin/e_comp_wl.h | 9 +- src/bin/e_desk.c | 2 + src/bin/e_desklock.c | 6 +- src/bin/e_dialog.c | 2 + src/bin/e_dnd.c | 45 ++++++++-- src/bin/e_dpms.c | 10 +++ src/bin/e_entry.c | 13 ++- src/bin/e_fm.c | 26 +++++- src/bin/e_focus.c | 4 + src/bin/e_grab_dialog.c | 4 + src/bin/e_grabinput.c | 20 +++++ src/bin/e_hints.c | 89 +++++++++---------- src/bin/e_hints.h | 2 +- src/bin/e_includes.h | 3 +- src/bin/e_int_client_prop.c | 4 + src/bin/e_main.c | 6 ++ src/bin/e_module.c | 4 +- src/bin/e_mouse.c | 4 + src/bin/e_pixmap.c | 34 +++---- src/bin/e_pointer.c | 29 +++--- src/bin/e_scale.c | 4 +- src/bin/e_screensaver.c | 6 +- src/bin/e_signals.c | 10 +++ src/bin/e_win.c | 5 +- src/bin/e_xkb.c | 2 + .../conf_bindings/e_int_config_acpibindings.c | 12 ++- .../conf_display/e_int_config_desklock.c | 2 + src/modules/conf_theme/e_int_config_scale.c | 6 +- src/modules/fileman/e_fwin.c | 6 ++ src/modules/fileman/e_fwin_nav.c | 2 + src/modules/pager/e_mod_main.c | 10 ++- src/modules/pager16/e_mod_main.c | 6 +- src/modules/tiling/e_mod_tiling.c | 2 +- src/modules/winlist/e_winlist.c | 8 +- src/modules/wizard/page_150.c | 2 +- src/modules/wl_desktop_shell/e_mod_main.c | 4 +- 49 files changed, 378 insertions(+), 131 deletions(-) diff --git a/src/bin/Makefile.mk b/src/bin/Makefile.mk index 5aa474bdd..683c98012 100644 --- a/src/bin/Makefile.mk +++ b/src/bin/Makefile.mk @@ -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 diff --git a/src/bin/e.h b/src/bin/e.h index aca58bc95..8eac2dbc1 100644 --- a/src/bin/e.h +++ b/src/bin/e.h @@ -122,6 +122,10 @@ void *alloca (size_t); # include # endif +# ifdef HAVE_WAYLAND +# include +# endif + # ifdef EAPI # undef EAPI # endif diff --git a/src/bin/e_actions.c b/src/bin/e_actions.c index 34431ad10..068bd6592 100644 --- a/src/bin/e_actions.c +++ b/src/bin/e_actions.c @@ -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, ) diff --git a/src/bin/e_alert.c b/src/bin/e_alert.c index 330744ad1..8daa8d221 100644 --- a/src/bin/e_alert.c +++ b/src/bin/e_alert.c @@ -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 diff --git a/src/bin/e_atoms.c b/src/bin/e_atoms.c index 436a772f8..a84c7591c 100644 --- a/src/bin/e_atoms.c +++ b/src/bin/e_atoms.c @@ -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; } diff --git a/src/bin/e_backlight.c b/src/bin/e_backlight.c index f65127c82..cdf252194 100644 --- a/src/bin/e_backlight.c +++ b/src/bin/e_backlight.c @@ -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) { diff --git a/src/bin/e_bindings.c b/src/bin/e_bindings.c index cafb8eeb3..7c904b7ad 100644 --- a/src/bin/e_bindings.c +++ b/src/bin/e_bindings.c @@ -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 } } } diff --git a/src/bin/e_canvas.c b/src/bin/e_canvas.c index 03fc3a5d2..723a4c837 100644 --- a/src/bin/e_canvas.c +++ b/src/bin/e_canvas.c @@ -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 diff --git a/src/bin/e_client.c b/src/bin/e_client.c index d40c0bb00..579a4eb3b 100644 --- a/src/bin/e_client.c +++ b/src/bin/e_client.c @@ -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); } diff --git a/src/bin/e_client.h b/src/bin/e_client.h index f73d2c5da..aacb5932b 100644 --- a/src/bin/e_client.h +++ b/src/bin/e_client.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; diff --git a/src/bin/e_comp.c b/src/bin/e_comp.c index afb80c33f..8755f0832 100644 --- a/src/bin/e_comp.c +++ b/src/bin/e_comp.c @@ -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 diff --git a/src/bin/e_comp_object.c b/src/bin/e_comp_object.c index 4536f1ddf..1571a77b9 100644 --- a/src/bin/e_comp_object.c +++ b/src/bin/e_comp_object.c @@ -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); } diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c index 298846bd0..a5f30012d 100644 --- a/src/bin/e_comp_wl.c +++ b/src/bin/e_comp_wl.c @@ -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")) { diff --git a/src/bin/e_comp_wl.h b/src/bin/e_comp_wl.h index 927b1723a..f3bc3c5b6 100644 --- a/src/bin/e_comp_wl.h +++ b/src/bin/e_comp_wl.h @@ -6,7 +6,12 @@ # define WL_HIDE_DEPRECATED # include + +/* NB: Turn off shadow warnings for Wayland includes */ +# pragma GCC diagnostic ignored "-Wshadow" # include +# pragma GCC diagnostic pop + # include /* 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 diff --git a/src/bin/e_desk.c b/src/bin/e_desk.c index 28604c1da..111ba6300 100644 --- a/src/bin/e_desk.c +++ b/src/bin/e_desk.c @@ -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 } diff --git a/src/bin/e_desklock.c b/src/bin/e_desklock.c index b98aa2ae4..889a8f86e 100644 --- a/src/bin/e_desklock.c +++ b/src/bin/e_desklock.c @@ -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)); } diff --git a/src/bin/e_dialog.c b/src/bin/e_dialog.c index 91f4abe95..cb29f1046 100644 --- a/src/bin/e_dialog.c +++ b/src/bin/e_dialog.c @@ -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); } diff --git a/src/bin/e_dnd.c b/src/bin/e_dnd.c index af6aadec4..6c42ec378 100644 --- a/src/bin/e_dnd.c +++ b/src/bin/e_dnd.c @@ -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 diff --git a/src/bin/e_dpms.c b/src/bin/e_dpms.c index ab87ee9c4..ff6104565 100644 --- a/src/bin/e_dpms.c +++ b/src/bin/e_dpms.c @@ -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(); diff --git a/src/bin/e_entry.c b/src/bin/e_entry.c index 6c0eb0741..e8e0c550f 100644 --- a/src/bin/e_entry.c +++ b/src/bin/e_entry.c @@ -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 diff --git a/src/bin/e_fm.c b/src/bin/e_fm.c index 671745740..695f95cde 100644 --- a/src/bin/e_fm.c +++ b/src/bin/e_fm.c @@ -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; } diff --git a/src/bin/e_focus.c b/src/bin/e_focus.c index d5ab2d949..72bbf8f8a 100644 --- a/src/bin/e_focus.c +++ b/src/bin/e_focus.c @@ -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; } } diff --git a/src/bin/e_grab_dialog.c b/src/bin/e_grab_dialog.c index f851b2ae4..27a71af07 100644 --- a/src/bin/e_grab_dialog.c +++ b/src/bin/e_grab_dialog.c @@ -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; diff --git a/src/bin/e_grabinput.c b/src/bin/e_grabinput.c index 215c1a8ac..7910a65d9 100644 --- a/src/bin/e_grabinput.c +++ b/src/bin/e_grabinput.c @@ -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 if (!ret) return 0; grab_mouse_win = mouse_win; } if (key_win) { +#ifndef HAVE_WAYLAND_ONLY int ret = 0; ret = ecore_x_keyboard_grab(key_win); @@ -74,6 +81,7 @@ e_grabinput_get(Ecore_Window mouse_win, int confine_mouse, Ecore_Window key_win) } return 0; } +#endif grab_key_win = key_win; } return 1; @@ -85,12 +93,16 @@ e_grabinput_release(Ecore_Window mouse_win, Ecore_Window key_win) if (e_comp_get(NULL)->comp_type != E_PIXMAP_TYPE_X) return; if (mouse_win == grab_mouse_win) { +#ifndef HAVE_WAYLAND_ONLY ecore_x_pointer_ungrab(); +#endif grab_mouse_win = 0; } if (key_win == grab_key_win) { +#ifndef HAVE_WAYLAND_ONLY ecore_x_keyboard_ungrab(); +#endif grab_key_win = 0; if (focus_win != 0) { @@ -140,11 +152,13 @@ e_grabinput_key_win_get(void) static Eina_Bool _e_grabinput_focus_check(void *data __UNUSED__) { +#ifndef HAVE_WAYLAND_ONLY if (ecore_x_window_focus_get() != focus_fix_win) { /* fprintf(stderr, "foc do 2\n"); */ _e_grabinput_focus_do(focus_fix_win, focus_fix_method); } +#endif focus_fix_timer = NULL; return EINA_FALSE; } @@ -159,16 +173,22 @@ _e_grabinput_focus_do(Ecore_Window win, E_Focus_Method method) break; case E_FOCUS_METHOD_LOCALLY_ACTIVE: +#ifndef HAVE_WAYLAND_ONLY ecore_x_window_focus_at_time(win, ecore_x_current_time_get()); ecore_x_icccm_take_focus_send(win, ecore_x_current_time_get()); +#endif break; case E_FOCUS_METHOD_GLOBALLY_ACTIVE: +#ifndef HAVE_WAYLAND_ONLY ecore_x_icccm_take_focus_send(win, ecore_x_current_time_get()); +#endif break; case E_FOCUS_METHOD_PASSIVE: +#ifndef HAVE_WAYLAND_ONLY ecore_x_window_focus_at_time(win, ecore_x_current_time_get()); +#endif break; default: diff --git a/src/bin/e_hints.c b/src/bin/e_hints.c index 3f7c5e96e..bdd6d4450 100644 --- a/src/bin/e_hints.c +++ b/src/bin/e_hints.c @@ -4,7 +4,7 @@ static void e_hints_openoffice_gnome_fake(Ecore_Window root); //static void e_hints_openoffice_kde_fake(Ecore_Window root); -#ifndef WAYLAND_ONLY +#ifndef HAVE_WAYLAND_ONLY static void e_hints_e16_comms_pretend(Ecore_X_Window root, Ecore_X_Window propwin); EAPI Ecore_X_Atom ATM__QTOPIA_SOFT_MENU = 0; @@ -18,7 +18,7 @@ EAPI Ecore_X_Atom ATM_ENLIGHTENMENT_SCALE = 0; EINTERN void e_hints_init(Ecore_Window root, Ecore_Window propwin) { -#ifdef WAYLAND_ONLY +#ifdef HAVE_WAYLAND_ONLY #else const char *atom_names[] = { "_QTOPIA_SOFT_MENU", @@ -210,7 +210,7 @@ e_hints_init(Ecore_Window root, Ecore_Window propwin) #endif } -#ifndef WAYLAND_ONLY +#ifndef HAVE_WAYLAND_ONLY /* * This is here so we don't have to pretend to be Kwin anymore - we pretend * to do old e16 style ipc. in fact we just ignore it... but set up the @@ -286,7 +286,7 @@ e_hints_manager_init(E_Manager *man) EAPI void e_hints_client_list_set(void) { -#ifdef WAYLAND_ONLY +#ifdef HAVE_WAYLAND_ONLY #else E_Manager *man; const Eina_List *l; @@ -321,7 +321,7 @@ e_hints_client_list_set(void) EAPI void e_hints_client_stacking_set(void) { -#ifdef WAYLAND_ONLY +#ifdef HAVE_WAYLAND_ONLY #else E_Comp *comp; const Eina_List *l; @@ -387,7 +387,7 @@ EAPI void e_hints_active_window_set(E_Manager *man, E_Client *ec) { -#ifdef WAYLAND_ONLY +#ifdef HAVE_WAYLAND_ONLY #else E_OBJECT_CHECK(man); if (e_comp_get(man)->comp_type != E_PIXMAP_TYPE_X) return; @@ -401,7 +401,7 @@ e_hints_active_window_set(E_Manager *man, EINTERN void e_hints_window_init(E_Client *ec) { -#ifdef WAYLAND_ONLY +#ifdef HAVE_WAYLAND_ONLY #else E_Remember *rem = NULL; @@ -577,7 +577,7 @@ e_hints_window_init(E_Client *ec) EAPI void e_hints_window_state_set(E_Client *ec) { -#ifdef WAYLAND_ONLY +#ifdef HAVE_WAYLAND_ONLY #else Ecore_X_Window_State state[10]; int num = 0; @@ -623,7 +623,7 @@ e_hints_window_state_set(E_Client *ec) EAPI void e_hints_allowed_action_set(E_Client *ec) { -#ifdef WAYLAND_ONLY +#ifdef HAVE_WAYLAND_ONLY #else Ecore_X_Action action[10]; int num = 0; @@ -657,7 +657,7 @@ e_hints_allowed_action_set(E_Client *ec) EAPI void e_hints_window_type_set(E_Client *ec) { -#ifdef WAYLAND_ONLY +#ifdef HAVE_WAYLAND_ONLY #else if (!e_pixmap_is_x(ec->pixmap)) return; ecore_x_netwm_window_type_set(e_client_util_win_get(ec), ec->netwm.type); @@ -667,7 +667,7 @@ e_hints_window_type_set(E_Client *ec) EAPI void e_hints_window_type_get(E_Client *ec) { -#ifdef WAYLAND_ONLY +#ifdef HAVE_WAYLAND_ONLY #else Ecore_X_Window_Type *types = NULL; int num, i, j; @@ -712,13 +712,10 @@ e_hints_window_type_get(E_Client *ec) #endif } +#ifdef E_COMP_X_H EAPI void -e_hints_window_state_update(E_Client *ec, - Ecore_X_Window_State state, - Ecore_X_Window_State_Action action) +e_hints_window_state_update(E_Client *ec, int state, int action) { -#ifdef WAYLAND_ONLY -#else if (!e_pixmap_is_x(ec->pixmap)) return; switch (state) { @@ -976,13 +973,13 @@ e_hints_window_state_update(E_Client *ec, /* Ignore */ break; } -#endif } +#endif EAPI void e_hints_window_state_get(E_Client *ec) { -#ifdef WAYLAND_ONLY +#ifdef HAVE_WAYLAND_ONLY #else unsigned int i, num; Ecore_X_Window_State *state; @@ -1069,10 +1066,9 @@ e_hints_window_state_get(E_Client *ec) } EAPI void -e_hints_allowed_action_update(E_Client *ec, - Ecore_X_Action action) +e_hints_allowed_action_update(E_Client *ec, int action) { -#ifdef WAYLAND_ONLY +#ifdef HAVE_WAYLAND_ONLY #else if (!e_pixmap_is_x(ec->pixmap)) return; switch (action) @@ -1119,7 +1115,7 @@ e_hints_allowed_action_update(E_Client *ec, EAPI void e_hints_allowed_action_get(E_Client *ec) { -#ifdef WAYLAND_ONLY +#ifdef HAVE_WAYLAND_ONLY #else Ecore_X_Action *action; unsigned int i; @@ -1211,7 +1207,7 @@ _e_hints_process_wakeup(E_Client *ec) EAPI void e_hints_window_visible_set(E_Client *ec) { -#ifdef WAYLAND_ONLY +#ifdef HAVE_WAYLAND_ONLY #else if (!e_pixmap_is_x(ec->pixmap)) return; if (ec->icccm.state != ECORE_X_WINDOW_STATE_HINT_NORMAL) @@ -1230,7 +1226,7 @@ e_hints_window_visible_set(E_Client *ec) EAPI void e_hints_window_iconic_set(E_Client *ec) { -#ifdef WAYLAND_ONLY +#ifdef HAVE_WAYLAND_ONLY #else if (!e_pixmap_is_x(ec->pixmap)) return; if (ec->icccm.state != ECORE_X_WINDOW_STATE_HINT_ICONIC) @@ -1249,7 +1245,7 @@ e_hints_window_iconic_set(E_Client *ec) EAPI void e_hints_window_hidden_set(E_Client *ec) { -#ifdef WAYLAND_ONLY +#ifdef HAVE_WAYLAND_ONLY #else if (!e_pixmap_is_x(ec->pixmap)) return; if (ec->icccm.state != ECORE_X_WINDOW_STATE_HINT_WITHDRAWN) @@ -1268,7 +1264,7 @@ e_hints_window_hidden_set(E_Client *ec) EAPI void e_hints_window_shaded_set(E_Client *ec, int on) { -#ifdef WAYLAND_ONLY +#ifdef HAVE_WAYLAND_ONLY #else if (!e_pixmap_is_x(ec->pixmap)) return; if ((!ec->netwm.state.shaded) && (on)) @@ -1294,7 +1290,7 @@ e_hints_window_shaded_set(E_Client *ec, int on) EAPI void e_hints_window_shade_direction_set(E_Client *ec, E_Direction dir) { -#ifdef WAYLAND_ONLY +#ifdef HAVE_WAYLAND_ONLY #else if (!e_pixmap_is_x(ec->pixmap)) return; ecore_x_window_prop_card32_set(e_client_util_win_get(ec), E_ATOM_SHADE_DIRECTION, &dir, 1); @@ -1304,7 +1300,7 @@ e_hints_window_shade_direction_set(E_Client *ec, E_Direction dir) EAPI E_Direction e_hints_window_shade_direction_get(E_Client *ec) { -#ifdef WAYLAND_ONLY +#ifdef HAVE_WAYLAND_ONLY #else int ret; E_Direction dir; @@ -1315,15 +1311,14 @@ e_hints_window_shade_direction_get(E_Client *ec) &dir, 1); if (ret == 1) return dir; - - return E_DIRECTION_UP; #endif + return E_DIRECTION_UP; } EAPI void e_hints_window_size_set(E_Client *ec) { -#ifdef WAYLAND_ONLY +#ifdef HAVE_WAYLAND_ONLY #else unsigned int sizes[4]; @@ -1339,7 +1334,7 @@ e_hints_window_size_set(E_Client *ec) EAPI void e_hints_window_size_unset(E_Client *ec) { -#ifdef WAYLAND_ONLY +#ifdef HAVE_WAYLAND_ONLY #else if (!e_pixmap_is_x(ec->pixmap)) return; ecore_x_window_prop_property_del(e_client_util_win_get(ec), E_ATOM_BORDER_SIZE); @@ -1349,7 +1344,7 @@ e_hints_window_size_unset(E_Client *ec) EAPI int e_hints_window_size_get(E_Client *ec) { -#ifdef WAYLAND_ONLY +#ifdef HAVE_WAYLAND_ONLY #else int ret; unsigned int sizes[4]; @@ -1365,15 +1360,15 @@ e_hints_window_size_get(E_Client *ec) ec->y = sizes[1]; ec->w = sizes[2]; ec->h = sizes[3]; +#endif return 1; -#endif } EAPI void e_hints_window_maximized_set(E_Client *ec, int horizontal, int vertical) { -#ifdef WAYLAND_ONLY +#ifdef HAVE_WAYLAND_ONLY #else if (!e_pixmap_is_x(ec->pixmap)) return; if ((horizontal) && (!ec->netwm.state.maximized_h)) @@ -1407,7 +1402,7 @@ EAPI void e_hints_window_fullscreen_set(E_Client *ec, int on) { -#ifdef WAYLAND_ONLY +#ifdef HAVE_WAYLAND_ONLY #else if (!e_pixmap_is_x(ec->pixmap)) return; if ((!ec->netwm.state.fullscreen) && (on)) @@ -1428,7 +1423,7 @@ e_hints_window_fullscreen_set(E_Client *ec, EAPI void e_hints_window_sticky_set(E_Client *ec, int on) { -#ifdef WAYLAND_ONLY +#ifdef HAVE_WAYLAND_ONLY #else if (!e_pixmap_is_x(ec->pixmap)) return; if ((!ec->netwm.state.sticky) && (on)) @@ -1449,7 +1444,7 @@ e_hints_window_sticky_set(E_Client *ec, int on) EAPI void e_hints_window_stacking_set(E_Client *ec, E_Stacking stacking) { -#ifdef WAYLAND_ONLY +#ifdef HAVE_WAYLAND_ONLY #else if (!e_pixmap_is_x(ec->pixmap)) return; if (ec->netwm.state.stacking == stacking) return; @@ -1462,7 +1457,7 @@ e_hints_window_stacking_set(E_Client *ec, E_Stacking stacking) EAPI void e_hints_window_desktop_set(E_Client *ec) { -#ifdef WAYLAND_ONLY +#ifdef HAVE_WAYLAND_ONLY #else /* This function is only called when really changing desktop, * so just set the property and don't care about the roundtrip. @@ -1489,7 +1484,7 @@ e_hints_window_desktop_set(E_Client *ec) EAPI void e_hints_window_e_state_get(E_Client *ec) { -#ifdef WAYLAND_ONLY +#ifdef HAVE_WAYLAND_ONLY #else /* Remember to update the count if we add more states! */ Ecore_X_Atom state[1]; @@ -1524,7 +1519,7 @@ e_hints_window_e_state_set(E_Client *ec __UNUSED__) EAPI void e_hints_window_qtopia_soft_menu_get(E_Client *ec) { -#ifdef WAYLAND_ONLY +#ifdef HAVE_WAYLAND_ONLY #else unsigned int val; @@ -1539,7 +1534,7 @@ e_hints_window_qtopia_soft_menu_get(E_Client *ec) EAPI void e_hints_window_qtopia_soft_menus_get(E_Client *ec) { -#ifdef WAYLAND_ONLY +#ifdef HAVE_WAYLAND_ONLY #else unsigned int val; @@ -1554,7 +1549,7 @@ e_hints_window_qtopia_soft_menus_get(E_Client *ec) EAPI void e_hints_window_virtual_keyboard_state_get(E_Client *ec) { -#ifdef WAYLAND_ONLY +#ifdef HAVE_WAYLAND_ONLY #else Ecore_X_Atom atom = 0; @@ -1572,7 +1567,7 @@ e_hints_window_virtual_keyboard_state_get(E_Client *ec) EAPI void e_hints_window_virtual_keyboard_get(E_Client *ec) { -#ifdef WAYLAND_ONLY +#ifdef HAVE_WAYLAND_ONLY #else if (!e_pixmap_is_x(ec->pixmap)) return; ec->vkbd.vkbd = ecore_x_e_virtual_keyboard_get(e_client_util_win_get(ec)); @@ -1582,7 +1577,7 @@ e_hints_window_virtual_keyboard_get(E_Client *ec) static void e_hints_openoffice_gnome_fake(Ecore_Window root) { -#ifdef WAYLAND_ONLY +#ifdef HAVE_WAYLAND_ONLY #else const char *string = "ATM_GNOME_SM_PROXY"; @@ -1595,7 +1590,7 @@ e_hints_openoffice_gnome_fake(Ecore_Window root) static void e_hints_openoffice_kde_fake(Ecore_Window root) { -#ifdef WAYLAND_ONLY +#ifdef HAVE_WAYLAND_ONLY #else Ecore_X_Window win2; @@ -1608,7 +1603,7 @@ e_hints_openoffice_kde_fake(Ecore_Window root) EAPI void e_hints_scale_update(void) { -#ifdef WAYLAND_ONLY +#ifdef HAVE_WAYLAND_ONLY #else E_Comp *c; const Eina_List *l; diff --git a/src/bin/e_hints.h b/src/bin/e_hints.h index cfc5cbdbb..2609954b0 100644 --- a/src/bin/e_hints.h +++ b/src/bin/e_hints.h @@ -48,7 +48,7 @@ EAPI void e_hints_scale_update(void); #ifdef E_COMP_X_H -EAPI void e_hints_window_state_update(E_Client *ec, Ecore_X_Window_State state, Ecore_X_Window_State_Action action); +EAPI void e_hints_window_state_update(E_Client *ec, int state, int action); extern EAPI Ecore_X_Atom ATM__QTOPIA_SOFT_MENU; extern EAPI Ecore_X_Atom ATM__QTOPIA_SOFT_MENUS; extern EAPI Ecore_X_Atom ATM_GNOME_SM_PROXY; diff --git a/src/bin/e_includes.h b/src/bin/e_includes.h index 79f7c75d7..959c213ea 100644 --- a/src/bin/e_includes.h +++ b/src/bin/e_includes.h @@ -8,7 +8,7 @@ #include "e_zone.h" #include "e_desk.h" #include "e_auth.h" -#ifndef WAYLAND_ONLY +#ifndef HAVE_WAYLAND_ONLY # include "e_comp_x.h" #endif #include "e_pixmap.h" @@ -154,3 +154,4 @@ #include "e_comp_cfdata.h" #include "e_comp_canvas.h" #include "e_utils.h" +#include "e_hints.h" diff --git a/src/bin/e_int_client_prop.c b/src/bin/e_int_client_prop.c index cbab64b04..f172d842d 100644 --- a/src/bin/e_int_client_prop.c +++ b/src/bin/e_int_client_prop.c @@ -145,6 +145,7 @@ _create_data(E_Dialog *cfd, E_Client *ec) cfdata->client->icccm.max_aspect); cfdata->icccm.aspect = strdup(buf); } +#ifdef E_COMP_X_H if (cfdata->client->icccm.initial_state != ECORE_X_WINDOW_STATE_HINT_NONE) { switch (cfdata->client->icccm.initial_state) @@ -189,6 +190,7 @@ _create_data(E_Dialog *cfd, E_Client *ec) } cfdata->icccm.state = strdup(buf); } +#endif snprintf(buf, sizeof(buf), "0x%08x", (unsigned int)e_client_util_win_get(cfdata->client)); cfdata->icccm.window_id = strdup(buf); @@ -210,6 +212,7 @@ _create_data(E_Dialog *cfd, E_Client *ec) (unsigned int)cfdata->client->icccm.client_leader); cfdata->icccm.client_leader = strdup(buf); } +#ifdef E_COMP_X_H switch (cfdata->client->icccm.gravity) { case ECORE_X_GRAVITY_FORGET: @@ -261,6 +264,7 @@ _create_data(E_Dialog *cfd, E_Client *ec) break; } cfdata->icccm.gravity = strdup(buf); +#endif if (cfdata->client->icccm.command.argv) { int i; diff --git a/src/bin/e_main.c b/src/bin/e_main.c index e813c2a4f..336acda6e 100644 --- a/src/bin/e_main.c +++ b/src/bin/e_main.c @@ -1490,6 +1490,7 @@ _e_main_screens_init(void) if (!e_client_init()) return 0; TS("\tscreens: win"); if (!e_win_init()) return 0; +#ifndef HAVE_WAYLAND_ONLY TS("E_Xkb Init"); if (!e_xkb_init()) { @@ -1497,6 +1498,7 @@ _e_main_screens_init(void) _e_main_shutdown(-1); } TS("E_Xkb Init Done"); +#endif TS("Compositor Init"); if (!e_comp_init()) @@ -1507,6 +1509,7 @@ _e_main_screens_init(void) _e_main_desk_restore(); +#ifndef HAVE_WAYLAND_ONLY if (e_config->show_splash) e_init_status_set(_("Setup DND")); TS("E_Dnd Init"); @@ -1517,6 +1520,7 @@ _e_main_screens_init(void) } TS("E_Dnd Init Done"); _e_main_shutdown_push(e_dnd_shutdown); +#endif return 1; } @@ -1703,7 +1707,9 @@ static Eina_Bool _e_main_cb_x_flusher(void *data __UNUSED__) { eet_clearcache(); +#ifndef HAVE_WAYLAND_ONLY ecore_x_flush(); +#endif return ECORE_CALLBACK_RENEW; } diff --git a/src/bin/e_module.c b/src/bin/e_module.c index 2ac063541..330650944 100644 --- a/src/bin/e_module.c +++ b/src/bin/e_module.c @@ -972,7 +972,8 @@ _e_module_whitelist_check(void) known++; } - { +#ifndef HAVE_WAYLAND_ONLY + { Ecore_X_Atom _x_tainted; char *state; unsigned int _e_tainted; @@ -986,6 +987,7 @@ _e_module_whitelist_check(void) e_env_set("E19_TAINTED", state); } +#endif if (eina_list_count(badl) != known) { diff --git a/src/bin/e_mouse.c b/src/bin/e_mouse.c index cdcb0043f..1074b7703 100644 --- a/src/bin/e_mouse.c +++ b/src/bin/e_mouse.c @@ -6,12 +6,14 @@ e_mouse_update(void) unsigned char map[256] = { 0 }; int n; +#ifndef HAVE_WAYLAND_ONLY if (!ecore_x_pointer_control_set(e_config->mouse_accel_numerator, e_config->mouse_accel_denominator, e_config->mouse_accel_threshold)) return 0; if (!ecore_x_pointer_mapping_get(map, 256)) return 0; +#endif for (n = 0; n < 256; n++) { @@ -35,7 +37,9 @@ e_mouse_update(void) map[2] = 1; } +#ifndef HAVE_WAYLAND_ONLY if (!ecore_x_pointer_mapping_set(map, n)) return 0; +#endif return 1; } diff --git a/src/bin/e_pixmap.c b/src/bin/e_pixmap.c index 46f66469e..be8c29692 100644 --- a/src/bin/e_pixmap.c +++ b/src/bin/e_pixmap.c @@ -3,7 +3,7 @@ #ifdef HAVE_WAYLAND_CLIENTS # include "e_comp_wl.h" #endif -#ifndef WAYLAND_ONLY +#ifndef HAVE_WAYLAND_ONLY # include "e_comp_x.h" #endif @@ -23,7 +23,7 @@ struct _E_Pixmap #ifdef HAVE_WAYLAND_CLIENTS struct wl_resource *resource; #endif -#ifndef WAYLAND_ONLY +#ifndef HAVE_WAYLAND_ONLY uint32_t pixmap; #endif int w, h; @@ -44,7 +44,7 @@ _e_pixmap_clear(E_Pixmap *cp, Eina_Bool cache) cp->image_argb = EINA_FALSE; switch (cp->type) { -#ifndef WAYLAND_ONLY +#ifndef HAVE_WAYLAND_ONLY case E_PIXMAP_TYPE_X: if (cp->pixmap) { @@ -64,7 +64,7 @@ _e_pixmap_clear(E_Pixmap *cp, Eina_Bool cache) } } -#ifndef WAYLAND_ONLY +#ifndef HAVE_WAYLAND_ONLY static void _e_pixmap_image_clear_x(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) { @@ -78,7 +78,7 @@ _e_pixmap_free(E_Pixmap *cp) switch (cp->type) { case E_PIXMAP_TYPE_X: -#ifndef WAYLAND_ONLY +#ifndef HAVE_WAYLAND_ONLY if (!cp->images_cache) break; if (cp->client) evas_object_event_callback_add(cp->client->frame, EVAS_CALLBACK_FREE, _e_pixmap_image_clear_x, cp->images_cache); @@ -121,7 +121,7 @@ _e_pixmap_new(E_Pixmap_Type type) static E_Pixmap * _e_pixmap_find(E_Pixmap_Type type, va_list *l) { -#ifndef WAYLAND_ONLY +#ifndef HAVE_WAYLAND_ONLY Ecore_X_Window xwin; #endif #ifdef HAVE_WAYLAND_CLIENTS @@ -131,7 +131,7 @@ _e_pixmap_find(E_Pixmap_Type type, va_list *l) if (!pixmaps[type]) return NULL; switch (type) { -#ifndef WAYLAND_ONLY +#ifndef HAVE_WAYLAND_ONLY case E_PIXMAP_TYPE_X: xwin = va_arg(*l, uint32_t); return eina_hash_find(pixmaps[type], &xwin); @@ -155,7 +155,7 @@ e_pixmap_free(E_Pixmap *cp) switch (cp->type) { case E_PIXMAP_TYPE_X: -#ifndef WAYLAND_ONLY +#ifndef HAVE_WAYLAND_ONLY if (cp->parent) eina_hash_set(pixmaps[cp->type], &cp->parent, NULL); #endif break; @@ -182,7 +182,7 @@ e_pixmap_new(E_Pixmap_Type type, ...) { E_Pixmap *cp = NULL; va_list l; -#ifndef WAYLAND_ONLY +#ifndef HAVE_WAYLAND_ONLY Ecore_X_Window xwin; #endif #ifdef HAVE_WAYLAND_CLIENTS @@ -194,7 +194,7 @@ e_pixmap_new(E_Pixmap_Type type, ...) switch (type) { case E_PIXMAP_TYPE_X: -#ifndef WAYLAND_ONLY +#ifndef HAVE_WAYLAND_ONLY xwin = va_arg(l, uint32_t); if (pixmaps[type]) { @@ -323,7 +323,7 @@ e_pixmap_refresh(E_Pixmap *cp) switch (cp->type) { case E_PIXMAP_TYPE_X: -#ifndef WAYLAND_ONLY +#ifndef HAVE_WAYLAND_ONLY { uint32_t pixmap; @@ -482,7 +482,7 @@ e_pixmap_native_surface_init(E_Pixmap *cp, Evas_Native_Surface *ns) switch (cp->type) { case E_PIXMAP_TYPE_X: -#ifndef WAYLAND_ONLY +#ifndef HAVE_WAYLAND_ONLY ns->type = EVAS_NATIVE_SURFACE_X11; ns->data.x11.visual = cp->visual; ns->data.x11.pixmap = cp->pixmap; @@ -518,7 +518,7 @@ e_pixmap_image_clear(E_Pixmap *cp, Eina_Bool cache) switch (cp->type) { case E_PIXMAP_TYPE_X: -#ifndef WAYLAND_ONLY +#ifndef HAVE_WAYLAND_ONLY if (cache) { void *i; @@ -578,7 +578,7 @@ e_pixmap_image_refresh(E_Pixmap *cp) switch (cp->type) { case E_PIXMAP_TYPE_X: -#ifndef WAYLAND_ONLY +#ifndef HAVE_WAYLAND_ONLY if ((!cp->visual) || (!cp->client->depth)) return EINA_FALSE; cp->image = ecore_x_image_new(cp->w, cp->h, cp->visual, cp->client->depth); if (cp->image) @@ -629,7 +629,7 @@ e_pixmap_image_data_get(E_Pixmap *cp) switch (cp->type) { case E_PIXMAP_TYPE_X: -#ifndef WAYLAND_ONLY +#ifndef HAVE_WAYLAND_ONLY return ecore_x_image_data_get(cp->image, &cp->ibpl, NULL, &cp->ibpp); #endif break; @@ -653,11 +653,13 @@ e_pixmap_image_data_argb_convert(E_Pixmap *cp, void *pix, void *ipix, Eina_Recta switch (cp->type) { case E_PIXMAP_TYPE_X: +#ifndef HAVE_WAYLAND_ONLY if (cp->image_argb) return EINA_FALSE; return ecore_x_image_to_argb_convert(ipix, cp->ibpp, cp->ibpl, cp->cmap, cp->visual, r->x, r->y, r->w, r->h, pix, stride, r->x, r->y); +#endif case E_PIXMAP_TYPE_WL: return EINA_TRUE; //already guaranteed to be argb default: @@ -674,8 +676,10 @@ e_pixmap_image_draw(E_Pixmap *cp, const Eina_Rectangle *r) switch (cp->type) { case E_PIXMAP_TYPE_X: +#ifndef HAVE_WAYLAND_ONLY if (!cp->pixmap) return EINA_FALSE; return ecore_x_image_get(cp->image, cp->pixmap, r->x, r->y, r->x, r->y, r->w, r->h); +#endif case E_PIXMAP_TYPE_WL: return EINA_TRUE; //this call is a NOP default: diff --git a/src/bin/e_pointer.c b/src/bin/e_pointer.c index d1a0f27b6..e101dcb38 100644 --- a/src/bin/e_pointer.c +++ b/src/bin/e_pointer.c @@ -228,7 +228,7 @@ _e_pointer_type_set(E_Pointer *p, /* Do not set type if in "hidden mode" */ if (!e_config->show_cursor) { -#ifdef WAYLAND_ONLY +#ifdef HAVE_WAYLAND_ONLY evas_object_hide(p->pointer_image); #else if (!p->canvas) @@ -266,7 +266,7 @@ _e_pointer_type_set(E_Pointer *p, return; } fallback: -#ifndef WAYLAND_ONLY +#ifndef HAVE_WAYLAND_ONLY if (p->canvas) return; { Ecore_X_Cursor cursor = 0; @@ -315,6 +315,7 @@ fallback: if (cursor) ecore_x_cursor_free(cursor); } #endif + return; } static void @@ -440,15 +441,16 @@ _e_pointer_idle_timer(void *data) return EINA_TRUE; } -#ifndef WAYLAND_ONLY static Eina_Bool _e_pointer_cb_idle_timer_pre(void *data) { E_Pointer *p; - int x, y; + int x = 0, y = 0; if (!(p = data)) return ECORE_CALLBACK_RENEW; +#ifndef HAVE_WAYLAND_ONLY ecore_x_pointer_xy_get(p->win, &x, &y); +#endif p->x = x; p->y = y; if (p->canvas) @@ -486,7 +488,7 @@ static Eina_Bool _e_pointer_cb_idle_poller(void *data) { E_Pointer *p; - int x, y; + int x = 0, y = 0; if (!(p = data)) return ECORE_CALLBACK_RENEW; if ((e_powersave_mode_get() >= E_POWERSAVE_MODE_MEDIUM) || @@ -495,9 +497,11 @@ _e_pointer_cb_idle_poller(void *data) p->idle_poller = NULL; return ECORE_CALLBACK_CANCEL; } +#ifndef HAVE_WAYLAND_ONLY /* check if pointer actually moved since the 1 second post-mouse move idle * pre-timer that fetches the position */ ecore_x_pointer_xy_get(p->win, &x, &y); +#endif if ((x != p->x) || (y != p->y)) { /* it moved - so we are not idle yet - record position and wait @@ -515,7 +519,6 @@ _e_pointer_cb_idle_poller(void *data) _e_pointer_idle(p); return ECORE_CALLBACK_RENEW; } -#endif /* externally accessible functions */ @@ -561,7 +564,7 @@ e_pointer_window_new(Ecore_Window win, p->color = c->pointer->color; } -#ifndef WAYLAND_ONLY +#ifndef HAVE_WAYLAND_ONLY ecore_x_cursor_size_set(e_config->cursor_size * 3 / 4); #endif if (filled) e_pointer_type_push(p, p, "default"); @@ -653,7 +656,7 @@ e_pointer_image_set(E_Pointer *p, E_Pixmap *cp, int w, int h, int hot_x, int hot evas_object_show(p->pointer_image); } } -#ifndef WAYLAND_ONLY +#ifndef HAVE_WAYLAND_ONLY else if (!p->e_cursor) { Ecore_X_Cursor cur; @@ -685,7 +688,7 @@ e_pointers_size_set(int size) if (!p->canvas) _e_pointer_canvas_resize(p, size, size); } -#ifndef WAYLAND_ONLY +#ifndef HAVE_WAYLAND_ONLY else ecore_x_cursor_size_set(e_config->cursor_size * 3 / 4); #endif @@ -703,7 +706,7 @@ EAPI void e_pointer_hide(E_Pointer *p) { if (!p) return; -#ifdef WAYLAND_ONLY +#ifdef HAVE_WAYLAND_ONLY #else if (p->win) ecore_x_window_cursor_set(p->win, 0); #endif @@ -727,7 +730,7 @@ e_pointer_type_push(E_Pointer *p, if (!p->canvas) { evas_object_hide(p->pointer_image); -#ifndef WAYLAND_ONLY +#ifndef HAVE_WAYLAND_ONLY if (p->blocks) { ecore_x_cursor_size_set(e_config->cursor_size * 3 / 4); @@ -779,7 +782,7 @@ e_pointer_type_pop(E_Pointer *p, if (p->pointer_image) { evas_object_show(p->pointer_image); -#ifndef WAYLAND_ONLY +#ifndef HAVE_WAYLAND_ONLY if (!p->canvas) { int w, h; @@ -801,7 +804,7 @@ e_pointer_type_pop(E_Pointer *p, EAPI void e_pointer_idler_before(void) { -#ifndef WAYLAND_ONLY +#ifndef HAVE_WAYLAND_ONLY Eina_List *l; E_Pointer *p; diff --git a/src/bin/e_scale.c b/src/bin/e_scale.c index 87a2c3b48..b5d5e268a 100644 --- a/src/bin/e_scale.c +++ b/src/bin/e_scale.c @@ -18,12 +18,14 @@ e_scale_shutdown(void) EAPI void e_scale_update(void) { - int dpi; + int dpi = 0; char buf[128]; if (e_config->scale.use_dpi) { +#ifndef HAVE_WAYLAND_ONLY dpi = ecore_x_dpi_get(); +#endif e_scale = (double)dpi / (double)e_config->scale.base_dpi; if (e_scale > e_config->scale.max) e_scale = e_config->scale.max; else if (e_scale < e_config->scale.min) diff --git a/src/bin/e_screensaver.c b/src/bin/e_screensaver.c index 6bc1ee9c3..8964ed790 100644 --- a/src/bin/e_screensaver.c +++ b/src/bin/e_screensaver.c @@ -82,9 +82,9 @@ e_screensaver_update(void) changed = EINA_TRUE; } - if (changed) -#ifdef WAYLAND_ONLY +#ifdef HAVE_WAYLAND_ONLY #else + if (changed) ecore_x_screensaver_set(timeout, interval, blanking, expose); #endif } @@ -93,7 +93,7 @@ EAPI void e_screensaver_force_update(void) { int timeout = e_screensaver_timeout_get(EINA_TRUE); -#ifdef WAYLAND_ONLY +#ifdef HAVE_WAYLAND_ONLY #else if (!getenv("DISPLAY")) return; ecore_x_screensaver_set(timeout + 10, diff --git a/src/bin/e_signals.c b/src/bin/e_signals.c index 784498161..358ca73d4 100644 --- a/src/bin/e_signals.c +++ b/src/bin/e_signals.c @@ -14,6 +14,7 @@ static volatile Eina_Bool _e_x_composite_shutdown_try = 0; static void _e_x_composite_shutdown(void) { +#ifdef E_COMP_X_H // Ecore_X_Display *dpy; Ecore_X_Window root; @@ -26,6 +27,7 @@ _e_x_composite_shutdown(void) /* ignore errors, we really don't care at this point */ ecore_x_composite_unredirect_subwindows(root, ECORE_X_COMPOSITE_UPDATE_MANUAL); _e_x_composite_shutdown_try = 0; +#endif } #if 0 @@ -64,10 +66,12 @@ EAPI void e_sigseg_act(int x __UNUSED__, siginfo_t *info __UNUSED__, void *data __UNUSED__) { _e_x_composite_shutdown(); +#ifdef E_COMP_X_H ecore_x_pointer_ungrab(); ecore_x_keyboard_ungrab(); ecore_x_ungrab(); ecore_x_sync(); +#endif e_alert_show(); } @@ -93,10 +97,12 @@ EAPI void e_sigfpe_act(int x __UNUSED__, siginfo_t *info __UNUSED__, void *data __UNUSED__) { _e_x_composite_shutdown(); +#ifdef E_COMP_X_H ecore_x_pointer_ungrab(); ecore_x_keyboard_ungrab(); ecore_x_ungrab(); ecore_x_sync(); +#endif e_alert_show(); } @@ -104,10 +110,12 @@ EAPI void e_sigbus_act(int x __UNUSED__, siginfo_t *info __UNUSED__, void *data __UNUSED__) { _e_x_composite_shutdown(); +#ifdef E_COMP_X_H ecore_x_pointer_ungrab(); ecore_x_keyboard_ungrab(); ecore_x_ungrab(); ecore_x_sync(); +#endif e_alert_show(); } @@ -115,10 +123,12 @@ EAPI void e_sigabrt_act(int x __UNUSED__, siginfo_t *info __UNUSED__, void *data __UNUSED__) { _e_x_composite_shutdown(); +#ifdef E_COMP_X_H ecore_x_pointer_ungrab(); ecore_x_keyboard_ungrab(); ecore_x_ungrab(); ecore_x_sync(); +#endif e_alert_show(); } diff --git a/src/bin/e_win.c b/src/bin/e_win.c index bb62a88a2..065b8deeb 100644 --- a/src/bin/e_win.c +++ b/src/bin/e_win.c @@ -1,6 +1,5 @@ #include "e.h" #ifdef HAVE_WAYLAND_CLIENTS -# include # include "e_comp_wl.h" #endif @@ -75,6 +74,7 @@ _elm_win_trap_show(void *data, Evas_Object *o) { Elm_Win_Trap_Ctx *ctx = data; EINA_SAFETY_ON_NULL_RETURN_VAL(ctx, EINA_TRUE); +#ifndef HAVE_WAYLAND_ONLY if (!ctx->client) { Ecore_X_Window xwin = elm_win_xwindow_get(o); @@ -104,6 +104,7 @@ _elm_win_trap_show(void *data, Evas_Object *o) ctx->client->internal_ecore_evas = ee; evas_object_data_set(o, "E_Client", ctx->client); } +#endif if (ctx->centered) e_comp_object_util_center(ctx->client->frame); evas_object_show(ctx->client->frame); return EINA_TRUE; @@ -324,7 +325,7 @@ e_win_new(E_Comp *c) win->max_aspect = 0.0; wins = eina_list_append(wins, win); -#ifndef WAYLAND_ONLY +#ifndef HAVE_WAYLAND_ONLY if (c->comp_type == E_PIXMAP_TYPE_X) { win->pointer = e_pointer_window_new(win->evas_win, 1); diff --git a/src/bin/e_xkb.c b/src/bin/e_xkb.c index 5d8f53cc3..a2bbd5ad8 100644 --- a/src/bin/e_xkb.c +++ b/src/bin/e_xkb.c @@ -62,7 +62,9 @@ e_xkb_update(int cur_group) if (cur_group != -1) { _e_xkb_cur_group = cur_group; +#ifndef HAVE_WAYLAND_ONLY ecore_x_xkb_select_group(cur_group); +#endif e_deskenv_xmodmap_run(); _e_xkb_update_event(cur_group); return; diff --git a/src/modules/conf_bindings/e_int_config_acpibindings.c b/src/modules/conf_bindings/e_int_config_acpibindings.c index 449ea2663..e7a30c86f 100644 --- a/src/modules/conf_bindings/e_int_config_acpibindings.c +++ b/src/modules/conf_bindings/e_int_config_acpibindings.c @@ -49,7 +49,7 @@ static Eina_Bool _cb_acpi_event(void *data, /* local variables */ static E_Dialog *grab_dlg = NULL; -static Ecore_X_Window grab_win = 0; +static Ecore_Window grab_win = 0; static Eina_List *grab_hdls = NULL; E_Config_Dialog * @@ -129,7 +129,9 @@ _free_data(E_Config_Dialog *cfd __UNUSED__, if (grab_win) { e_grabinput_release(grab_win, grab_win); +#ifndef HAVE_WAYLAND_ONLY ecore_x_window_free(grab_win); +#endif } grab_win = 0; @@ -528,9 +530,11 @@ _cb_add_binding(void *data, e_win_centered_set(grab_dlg->win, EINA_TRUE); e_win_borderless_set(grab_dlg->win, EINA_TRUE); +#ifndef HAVE_WAYLAND_ONLY grab_win = ecore_x_window_input_new(man->root, 0, 0, 1, 1); ecore_x_window_show(grab_win); e_grabinput_get(grab_win, 0, grab_win); +#endif grab_hdls = eina_list_append(grab_hdls, @@ -545,8 +549,10 @@ _cb_add_binding(void *data, e_acpi_events_freeze(); e_dialog_show(grab_dlg); +#ifndef HAVE_WAYLAND_ONLY ecore_x_icccm_transient_for_set(grab_dlg->win->evas_win, cfdata->cfd->dia->win->evas_win); +#endif } static void @@ -633,7 +639,9 @@ _cb_grab_key_down(void *data, /* kill the dialog window */ e_grabinput_release(grab_win, grab_win); +#ifndef HAVE_WAYLAND_ONLY ecore_x_window_free(grab_win); +#endif grab_win = 0; e_object_del(E_OBJECT(grab_dlg)); grab_dlg = NULL; @@ -663,7 +671,9 @@ _cb_acpi_event(void *data, /* kill the dialog window */ e_grabinput_release(grab_win, grab_win); +#ifndef HAVE_WAYLAND_ONLY ecore_x_window_free(grab_win); +#endif grab_win = 0; e_object_del(E_OBJECT(grab_dlg)); grab_dlg = NULL; diff --git a/src/modules/conf_display/e_int_config_desklock.c b/src/modules/conf_display/e_int_config_desklock.c index d345cc6de..ff7bac561 100644 --- a/src/modules/conf_display/e_int_config_desklock.c +++ b/src/modules/conf_display/e_int_config_desklock.c @@ -150,7 +150,9 @@ _fill_data(E_Config_Dialog_Data *cfdata) cfdata->bg_method = E_DESKLOCK_BACKGROUND_METHOD_CUSTOM; cfdata->bg_method_prev = cfdata->bg_method; +#ifndef HAVE_WAYLAND_ONLY cfdata->use_xscreensaver = ecore_x_screensaver_event_available_get(); +#endif cfdata->desklock_auth_method = e_config->desklock_auth_method; if (e_config->desklock_custom_desklock_cmd) diff --git a/src/modules/conf_theme/e_int_config_scale.c b/src/modules/conf_theme/e_int_config_scale.c index 8024b5bc4..57e0a45bf 100644 --- a/src/modules/conf_theme/e_int_config_scale.c +++ b/src/modules/conf_theme/e_int_config_scale.c @@ -220,12 +220,14 @@ _basic_create(E_Config_Dialog *cfd __UNUSED__, Evas *evas, E_Config_Dialog_Data { Evas_Object *o, *ob; double sc = 1.0; - int dpi, x = 0, y = 0; + int dpi = 0, x = 0, y = 0; _fill_data(cfdata); o = e_widget_table_add(evas, 1); +#ifndef HAVE_WAYLAND_ONLY dpi = ecore_x_dpi_get(); +#endif if ((dpi > 0) && (cfdata->base_dpi > 0)) sc = (double)dpi / (double)cfdata->base_dpi; @@ -306,8 +308,10 @@ _adv_create(E_Config_Dialog *cfd __UNUSED__, Evas *evas, E_Config_Dialog_Data *c e_widget_on_change_hook_set(ow, _adv_policy_changed, cfdata); e_widget_list_object_append(o, ow, 1, 1, 0.5); +#ifndef HAVE_WAYLAND_ONLY snprintf(buff, sizeof(buff), _("Base DPI (Currently %i DPI)"), ecore_x_dpi_get()); +#endif ow = e_widget_label_add(evas, buff); cfdata->gui.adv.dpi_lbl = ow; e_widget_list_object_append(o, ow, 1, 1, 0.5); diff --git a/src/modules/fileman/e_fwin.c b/src/modules/fileman/e_fwin.c index 7dfb37b06..6115d5c14 100644 --- a/src/modules/fileman/e_fwin.c +++ b/src/modules/fileman/e_fwin.c @@ -882,6 +882,7 @@ _e_fwin_icon_popup(void *data) e_comp_object_util_del_list_append(fwin->popup, list); e_comp_object_util_del_list_append(fwin->popup, o); evas_object_pass_events_set(fwin->popup, 1); +#ifndef HAVE_WAYLAND_ONLY if (!fwin->popup_handlers) { E_LIST_HANDLER_APPEND(fwin->popup_handlers, ECORE_X_EVENT_XDND_ENTER, _e_fwin_icon_popup_handler, fwin); @@ -890,6 +891,7 @@ _e_fwin_icon_popup(void *data) E_LIST_HANDLER_APPEND(fwin->popup_handlers, ECORE_EVENT_MOUSE_BUTTON_DOWN, _e_fwin_icon_popup_handler, fwin); E_LIST_HANDLER_APPEND(fwin->popup_handlers, ECORE_X_EVENT_MOUSE_OUT, _e_fwin_icon_popup_handler, fwin); } +#endif evas_object_show(fwin->popup); return EINA_FALSE; } @@ -922,6 +924,7 @@ _e_fwin_icon_mouse_in(void *data, Evas_Object *obj __UNUSED__, void *event_info) if (!fileman_config->tooltip.enable) return; fwin->popup_timer = ecore_timer_add(fileman_config->tooltip.delay, _e_fwin_icon_popup, fwin); fwin->popup_icon = ici; +#ifndef HAVE_WAYLAND_ONLY if (!fwin->popup_handlers) { E_LIST_HANDLER_APPEND(fwin->popup_handlers, ECORE_X_EVENT_XDND_ENTER, _e_fwin_icon_popup_handler, fwin); @@ -930,6 +933,7 @@ _e_fwin_icon_mouse_in(void *data, Evas_Object *obj __UNUSED__, void *event_info) E_LIST_HANDLER_APPEND(fwin->popup_handlers, ECORE_EVENT_MOUSE_BUTTON_DOWN, _e_fwin_icon_popup_handler, fwin); E_LIST_HANDLER_APPEND(fwin->popup_handlers, ECORE_X_EVENT_MOUSE_OUT, _e_fwin_icon_popup_handler, fwin); } +#endif } static void @@ -2109,7 +2113,9 @@ _e_fwin_path(void *data, E_Menu *m __UNUSED__, E_Menu_Item *mi __UNUSED__) xwin = e_client_util_win_get(page->fwin->win->client); else xwin = page->fwin->zone->comp->ee_win; +#ifndef HAVE_WAYLAND_ONLY ecore_x_selection_clipboard_set(xwin, path, strlen(path) + 1); +#endif } static void diff --git a/src/modules/fileman/e_fwin_nav.c b/src/modules/fileman/e_fwin_nav.c index 6c8bccce1..101b09e1a 100644 --- a/src/modules/fileman/e_fwin_nav.c +++ b/src/modules/fileman/e_fwin_nav.c @@ -215,6 +215,7 @@ _box_button_cb_dnd_selection_notify(void *data, const char *type, void *event) if (!args) goto out; args = e_util_string_append_quoted(args, &size, &length, inst->dnd_path); if (!args) goto out; +#ifndef HAVE_WAYLAND_ONLY if (link_drop || (e_drop_handler_action_get() == ECORE_X_ATOM_XDND_ACTION_LINK)) e_fm2_client_file_symlink(inst->o_fm, args); else if (e_drop_handler_action_get() == ECORE_X_ATOM_XDND_ACTION_COPY) @@ -223,6 +224,7 @@ _box_button_cb_dnd_selection_notify(void *data, const char *type, void *event) e_fm2_client_file_move(inst->o_fm, args); else if (e_drop_handler_action_get() == ECORE_X_ATOM_XDND_ACTION_ASK) e_fm2_drop_menu(inst->o_fm, args); +#endif free(args); out: E_FREE(inst->dnd_path); diff --git a/src/modules/pager/e_mod_main.c b/src/modules/pager/e_mod_main.c index 342e9349c..432929e9b 100644 --- a/src/modules/pager/e_mod_main.c +++ b/src/modules/pager/e_mod_main.c @@ -177,7 +177,7 @@ static void _pager_popup_cb_action_switch(E_Object *obj __UNUSED__, /* variables for pager popup on key actions */ static E_Action *act_popup_show = NULL; static E_Action *act_popup_switch = NULL; -static Ecore_X_Window input_window = 0; +static Ecore_Window input_window = 0; static Eina_List *handlers = NULL; static Pager_Popup *act_popup = NULL; /* active popup */ static int hold_count = 0; @@ -1960,7 +1960,7 @@ _pager_window_cb_drag_finished(E_Drag *drag, int dropped) E_Comp *comp; E_Zone *zone; E_Desk *desk; - int x, y, dx, dy; + int x = 0, y = 0, dx, dy; pw = drag->data; if (!pw) return; @@ -1981,7 +1981,9 @@ _pager_window_cb_drag_finished(E_Drag *drag, int dropped) e_client_desk_set(pw->client, desk); } +#ifndef HAVE_WAYLAND_ONLY ecore_x_pointer_last_xy_get(&x, &y); +#endif dx = (pw->client->w / 2); dy = (pw->client->h / 2); @@ -2411,12 +2413,14 @@ _pager_popup_cb_timeout(void *data) pp->timer = NULL; _pager_popup_free(pp); +#ifndef HAVE_WAYLAND_ONLY if (input_window) { ecore_x_window_free(input_window); e_grabinput_release(input_window, input_window); input_window = 0; } +#endif return ECORE_CALLBACK_CANCEL; } @@ -2442,6 +2446,7 @@ _pager_popup_show(void) pp = _pager_popup_find(zone); if (pp) _pager_popup_free(pp); +#ifndef HAVE_WAYLAND_ONLY input_window = ecore_x_window_input_new(zone->comp->win, 0, 0, 1, 1); ecore_x_window_show(input_window); if (!e_grabinput_get(input_window, 0, input_window)) @@ -2450,6 +2455,7 @@ _pager_popup_show(void) input_window = 0; return 0; } +#endif handlers = eina_list_append (handlers, ecore_event_handler_add diff --git a/src/modules/pager16/e_mod_main.c b/src/modules/pager16/e_mod_main.c index e71fe3a86..6662500ff 100644 --- a/src/modules/pager16/e_mod_main.c +++ b/src/modules/pager16/e_mod_main.c @@ -156,7 +156,7 @@ static void _pager_popup_cb_action_switch(E_Object *obj __UNUSED__, /* variables for pager popup on key actions */ static E_Action *act_popup_show = NULL; static E_Action *act_popup_switch = NULL; -static Ecore_X_Window input_window = 0; +static Ecore_Window input_window = 0; static Eina_List *handlers = NULL; static Pager_Popup *act_popup = NULL; /* active popup */ static int hold_count = 0; @@ -1629,12 +1629,14 @@ _pager_popup_cb_timeout(void *data) pp->timer = NULL; _pager_popup_free(pp); +#ifndef HAVE_WAYLAND_ONLY if (input_window) { ecore_x_window_free(input_window); e_grabinput_release(input_window, input_window); input_window = 0; } +#endif return ECORE_CALLBACK_CANCEL; } @@ -1660,6 +1662,7 @@ _pager_popup_show(void) pp = _pager_popup_find(zone); if (pp) _pager_popup_free(pp); +#ifndef HAVE_WAYLAND_ONLY input_window = ecore_x_window_input_new(zone->comp->win, 0, 0, 1, 1); ecore_x_window_show(input_window); if (!e_grabinput_get(input_window, 0, input_window)) @@ -1668,6 +1671,7 @@ _pager_popup_show(void) input_window = 0; return 0; } +#endif handlers = eina_list_append (handlers, ecore_event_handler_add diff --git a/src/modules/tiling/e_mod_tiling.c b/src/modules/tiling/e_mod_tiling.c index d7688bc17..f6d226e5f 100644 --- a/src/modules/tiling/e_mod_tiling.c +++ b/src/modules/tiling/e_mod_tiling.c @@ -168,7 +168,7 @@ is_tilable(const E_Client *ec) if (ec->icccm.min_h == ec->icccm.max_h && ec->icccm.max_h > 0) return false; -#ifndef WAYLAND_ONLY +#ifndef HAVE_WAYLAND_ONLY if (ec->icccm.gravity == ECORE_X_GRAVITY_STATIC) return false; #endif diff --git a/src/modules/winlist/e_winlist.c b/src/modules/winlist/e_winlist.c index e2be7d778..3df21d930 100644 --- a/src/modules/winlist/e_winlist.c +++ b/src/modules/winlist/e_winlist.c @@ -51,7 +51,7 @@ static int _hold_count = 0; static int _hold_mod = 0; static E_Winlist_Activate_Type _activate_type = 0; static Eina_List *_handlers = NULL; -static Ecore_X_Window _input_window = 0; +static Ecore_Window _input_window = 0; static int _scroll_to = 0; static double _scroll_align_to = 0.0; static double _scroll_align = 0.0; @@ -103,6 +103,7 @@ e_winlist_show(E_Zone *zone, E_Winlist_Filter filter) if (_winlist) return 0; +#ifndef HAVE_WAYLAND_ONLY _input_window = ecore_x_window_input_new(zone->comp->man->root, 0, 0, 1, 1); ecore_x_window_show(_input_window); if (!e_grabinput_get(_input_window, 0, _input_window)) @@ -111,6 +112,7 @@ e_winlist_show(E_Zone *zone, E_Winlist_Filter filter) _input_window = 0; return 0; } +#endif w = (double)zone->w * e_config->winlist_pos_size_w; if (w > e_config->winlist_pos_max_w) w = e_config->winlist_pos_max_w; @@ -131,9 +133,11 @@ e_winlist_show(E_Zone *zone, E_Winlist_Filter filter) e_client_resize_cancel(); e_client_focus_track_freeze(); +#ifndef HAVE_WAYLAND_ONLY evas_event_feed_mouse_in(zone->comp->evas, ecore_x_current_time_get(), NULL); evas_event_feed_mouse_move(zone->comp->evas, -1000000, -1000000, ecore_x_current_time_get(), NULL); +#endif evas_event_freeze(zone->comp->evas); o = edje_object_add(zone->comp->evas); @@ -258,7 +262,9 @@ e_winlist_hide(void) E_FREE_FUNC(_animator, ecore_animator_del); e_grabinput_release(_input_window, _input_window); +#ifndef HAVE_WAYLAND_ONLY ecore_x_window_free(_input_window); +#endif _input_window = 0; if (ec) { diff --git a/src/modules/wizard/page_150.c b/src/modules/wizard/page_150.c index 20c55bf3c..444e5cb64 100644 --- a/src/modules/wizard/page_150.c +++ b/src/modules/wizard/page_150.c @@ -49,7 +49,7 @@ wizard_page_show(E_Wizard_Page *pg) Evas_Object *o, *of, *ob; Ecore_Evas *ee; -#ifndef WAYLAND_ONLY +#ifndef HAVE_WAYLAND_ONLY Ecore_X_Window_Attributes att; if (!ecore_x_composite_query()) return 0; diff --git a/src/modules/wl_desktop_shell/e_mod_main.c b/src/modules/wl_desktop_shell/e_mod_main.c index 114a7c487..52d47956e 100644 --- a/src/modules/wl_desktop_shell/e_mod_main.c +++ b/src/modules/wl_desktop_shell/e_mod_main.c @@ -1336,7 +1336,7 @@ _e_wl_shell_shell_surface_cb_key_up(void *data, Evas *e EINA_UNUSED, Evas_Object /* is the focused surface actually This surface ? */ if (kbd->focus != ews->wl.surface) return; -#ifndef WAYLAND_ONLY +#ifndef HAVE_WAYLAND_ONLY if (_e_wl_comp->kbd_handler) /* get the keycode for this key from X, since we're definitely in X here */ key = ecore_x_keysym_keycode_get(ev->key) - 8; @@ -1402,7 +1402,7 @@ _e_wl_shell_shell_surface_cb_key_down(void *data, Evas *e EINA_UNUSED, Evas_Obje /* if the compositor has a ping callback, call it on this surface */ if (_e_wl_comp->ping_cb) _e_wl_comp->ping_cb(ews, serial); -#ifndef WAYLAND_ONLY +#ifndef HAVE_WAYLAND_ONLY if (_e_wl_comp->kbd_handler) /* get the keycode for this key from X, since we're definitely in X here */ key = ecore_x_keysym_keycode_get(ev->key) - 8;