enabling drm output module should NOT require X-less build.

these defines all need to be changed from HAVE_WAYLAND_ONLY to something like WITH_X or we're going to have lots of problems with xwayland later on
This commit is contained in:
Mike Blumenkrantz 2014-03-18 16:14:04 -04:00
parent af3f435d98
commit c04d754ac5
15 changed files with 122 additions and 74 deletions

View File

@ -865,7 +865,7 @@ AM_CONDITIONAL([HAVE_WL_FB], [test "x${WL_FB}" = "xtrue"])
define([CHECK_MODULE_WL_DRM], define([CHECK_MODULE_WL_DRM],
[ [
if test "x${have_wayland}" = "xyes" && test "x${e_cv_want_wayland_only}" = "xyes"; then if test "x${have_wayland}" = "xyes" ; then
AC_E_CHECK_PKG(WL_DRM, [ ecore-drm >= $efl_version ecore >= $efl_version eina >= $efl_version ], [WL_DRM=true], [WL_DRM=false]) AC_E_CHECK_PKG(WL_DRM, [ ecore-drm >= $efl_version ecore >= $efl_version eina >= $efl_version ], [WL_DRM=true], [WL_DRM=false])
else else
WL_DRM=false WL_DRM=false

View File

@ -48,7 +48,7 @@ e_backlight_init(void)
#endif #endif
#ifndef HAVE_WAYLAND_ONLY #ifndef HAVE_WAYLAND_ONLY
if (e_comp_get(NULL)->man->root) if (e_comp_get(NULL)->comp_type == E_PIXMAP_TYPE_X)
xbl_avail = ecore_x_randr_output_backlight_available(); xbl_avail = ecore_x_randr_output_backlight_available();
#endif #endif
e_backlight_update(); e_backlight_update();

View File

@ -1115,7 +1115,6 @@ e_comp_init(void)
actions = eina_list_append(actions, act); actions = eina_list_append(actions, act);
} }
#ifdef HAVE_WAYLAND_ONLY
{ {
const char *eng; const char *eng;
@ -1126,18 +1125,18 @@ e_comp_init(void)
snprintf(buf, sizeof(buf), "wl_%s", eng); snprintf(buf, sizeof(buf), "wl_%s", eng);
if (e_module_enable(e_module_new(buf))) if (e_module_enable(e_module_new(buf)))
return EINA_TRUE; goto out;
} }
} }
#endif
#ifndef HAVE_WAYLAND_ONLY #ifndef HAVE_WAYLAND_ONLY
if (!e_comp_x_init()) return EINA_FALSE; e_comp_x_init();
#endif #endif
#if defined(HAVE_WAYLAND_CLIENTS) || defined(HAVE_WAYLAND_ONLY) #if defined(HAVE_WAYLAND_CLIENTS) || defined(HAVE_WAYLAND_ONLY)
if (!e_comp_wl_init()) return EINA_FALSE; e_comp_wl_init();
#endif #endif
if (!compositors) return EINA_FALSE;
out:
E_LIST_HANDLER_APPEND(handlers, E_EVENT_SCREENSAVER_ON, _e_comp_screensaver_on, NULL); E_LIST_HANDLER_APPEND(handlers, E_EVENT_SCREENSAVER_ON, _e_comp_screensaver_on, NULL);
E_LIST_HANDLER_APPEND(handlers, E_EVENT_SCREENSAVER_OFF, _e_comp_screensaver_off, NULL); E_LIST_HANDLER_APPEND(handlers, E_EVENT_SCREENSAVER_OFF, _e_comp_screensaver_off, NULL);

View File

@ -5060,7 +5060,6 @@ e_comp_x_init(void)
if (!ecore_x_init(NULL)) if (!ecore_x_init(NULL))
{ {
_e_comp_x_print_win(0);
e_error_message_show(_("Enlightenment cannot initialize Ecore_X!\n")); e_error_message_show(_("Enlightenment cannot initialize Ecore_X!\n"));
return EINA_FALSE; return EINA_FALSE;
} }
@ -5069,6 +5068,8 @@ e_comp_x_init(void)
if (!ecore_x_composite_query()) if (!ecore_x_composite_query())
{ {
_e_comp_x_print_win(0);
ecore_x_shutdown();
e_error_message_show e_error_message_show
(_("Your display server does not support XComposite, " (_("Your display server does not support XComposite, "
"or Ecore-X was built without XComposite support. " "or Ecore-X was built without XComposite support. "

View File

@ -111,7 +111,8 @@ e_dnd_init(void)
_type_text_x_moz_url = eina_stringshare_add("text/x-moz-url"); _type_text_x_moz_url = eina_stringshare_add("text/x-moz-url");
_type_enlightenment_x_file = eina_stringshare_add("enlightenment/x-file"); _type_enlightenment_x_file = eina_stringshare_add("enlightenment/x-file");
#ifndef HAVE_WAYLAND_ONLY #ifndef HAVE_WAYLAND_ONLY
_text_atom = ecore_x_atom_get("text/plain"); if (e_comp_get(NULL)->comp_type == E_PIXMAP_TYPE_X)
_text_atom = ecore_x_atom_get("text/plain");
#endif #endif
_drop_win_hash = eina_hash_int32_new(NULL); _drop_win_hash = eina_hash_int32_new(NULL);
@ -121,6 +122,7 @@ e_dnd_init(void)
E_LIST_HANDLER_APPEND(_event_handlers, ECORE_EVENT_MOUSE_MOVE, _e_dnd_cb_mouse_move, 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_DOWN, _e_dnd_cb_key_down, NULL);
E_LIST_HANDLER_APPEND(_event_handlers, ECORE_EVENT_KEY_UP, _e_dnd_cb_key_up, NULL); E_LIST_HANDLER_APPEND(_event_handlers, ECORE_EVENT_KEY_UP, _e_dnd_cb_key_up, NULL);
if (e_comp_get(NULL)->comp_type != E_PIXMAP_TYPE_X) return 1;
#ifndef HAVE_WAYLAND_ONLY #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_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_LEAVE, _e_dnd_cb_event_dnd_leave, NULL);
@ -130,12 +132,10 @@ 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_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_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_X_EVENT_WINDOW_HIDE, _e_dnd_cb_event_hide, NULL);
#endif
EINA_LIST_FOREACH(e_comp_list(), l, c) EINA_LIST_FOREACH(e_comp_list(), l, c)
e_drop_xdnd_register_set(c->ee_win, 1); e_drop_xdnd_register_set(c->ee_win, 1);
#ifndef HAVE_WAYLAND_ONLY
_action = ECORE_X_ATOM_XDND_ACTION_PRIVATE; _action = ECORE_X_ATOM_XDND_ACTION_PRIVATE;
#endif #endif
return 1; return 1;
@ -343,6 +343,7 @@ e_drag_xdnd_start(E_Drag *drag, int x, int y)
if (_drag_win) return 0; if (_drag_win) return 0;
#ifndef HAVE_WAYLAND_ONLY #ifndef HAVE_WAYLAND_ONLY
if (e_comp_get(drag)->comp_type != E_PIXMAP_TYPE_X) return 0;
_drag_win = ecore_x_window_input_new(drag->comp->win, _drag_win = ecore_x_window_input_new(drag->comp->win,
drag->comp->man->x, drag->comp->man->y, drag->comp->man->x, drag->comp->man->y,
drag->comp->man->w, drag->comp->man->h); drag->comp->man->w, drag->comp->man->h);
@ -414,6 +415,7 @@ e_drop_xds_update(Eina_Bool enable, const char *value)
int size; int size;
size_t len; size_t len;
if (e_comp_get(NULL)->comp_type != E_PIXMAP_TYPE_X) return;
enable = !!enable; enable = !!enable;
xwin = ecore_x_selection_owner_get(ECORE_X_ATOM_SELECTION_XDND); xwin = ecore_x_selection_owner_get(ECORE_X_ATOM_SELECTION_XDND);
@ -522,6 +524,7 @@ e_drop_handler_del(E_Drop_Handler *handler)
EAPI int EAPI int
e_drop_xdnd_register_set(Ecore_Window win, int reg) e_drop_xdnd_register_set(Ecore_Window win, int reg)
{ {
if (e_comp_get(NULL)->comp_type != E_PIXMAP_TYPE_X) return 0;
if (reg) if (reg)
{ {
if (!eina_hash_find(_drop_win_hash, &win)) if (!eina_hash_find(_drop_win_hash, &win))

View File

@ -29,7 +29,8 @@ e_dpms_update(void)
{ {
_e_dpms_enabled = enabled; _e_dpms_enabled = enabled;
#ifndef HAVE_WAYLAND_ONLY #ifndef HAVE_WAYLAND_ONLY
ecore_x_dpms_enabled_set(enabled); if (e_comp_get(NULL)->comp_type == E_PIXMAP_TYPE_X)
ecore_x_dpms_enabled_set(enabled);
#endif #endif
} }
if (!enabled) return; if (!enabled) return;
@ -57,7 +58,10 @@ e_dpms_update(void)
changed = EINA_TRUE; changed = EINA_TRUE;
} }
#ifndef HAVE_WAYLAND_ONLY #ifndef HAVE_WAYLAND_ONLY
if (changed) ecore_x_dpms_timeouts_set(standby, suspend, off); if (e_comp_get(NULL)->comp_type == E_PIXMAP_TYPE_X)
{
if (changed) ecore_x_dpms_timeouts_set(standby, suspend, off);
}
#endif #endif
} }
@ -70,7 +74,8 @@ e_dpms_force_update(void)
enabled = ((e_config->screensaver_enable) && enabled = ((e_config->screensaver_enable) &&
(!e_config->mode.presentation)); (!e_config->mode.presentation));
#ifndef HAVE_WAYLAND_ONLY #ifndef HAVE_WAYLAND_ONLY
ecore_x_dpms_enabled_set(enabled); if (e_comp_get(NULL)->comp_type == E_PIXMAP_TYPE_X)
ecore_x_dpms_enabled_set(enabled);
#endif #endif
if (!enabled) return; if (!enabled) return;
@ -82,6 +87,7 @@ e_dpms_force_update(void)
off += 7; off += 7;
} }
#ifndef HAVE_WAYLAND_ONLY #ifndef HAVE_WAYLAND_ONLY
if (e_comp_get(NULL)->comp_type != E_PIXMAP_TYPE_X) return;
ecore_x_dpms_timeouts_set(standby + 10, suspend + 10, off + 10); ecore_x_dpms_timeouts_set(standby + 10, suspend + 10, off + 10);
ecore_x_dpms_timeouts_set(standby, suspend, off); ecore_x_dpms_timeouts_set(standby, suspend, off);
#endif #endif
@ -143,9 +149,12 @@ e_dpms_init(void)
(E_EVENT_DESK_SHOW, _e_dpms_handler_desk_show_cb, NULL); (E_EVENT_DESK_SHOW, _e_dpms_handler_desk_show_cb, NULL);
#ifndef HAVE_WAYLAND_ONLY #ifndef HAVE_WAYLAND_ONLY
_e_dpms_enabled = ecore_x_dpms_enabled_get(); if (e_comp_get(NULL)->comp_type == E_PIXMAP_TYPE_X)
ecore_x_dpms_timeouts_get {
(&_e_dpms_timeout_standby, &_e_dpms_timeout_suspend, &_e_dpms_timeout_off); _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 #endif
e_dpms_force_update(); e_dpms_force_update();

View File

@ -611,6 +611,7 @@ main(int argc, char **argv)
} }
TS("Screens Init Done"); TS("Screens Init Done");
_e_main_shutdown_push(_e_main_screens_shutdown); _e_main_shutdown_push(_e_main_screens_shutdown);
e_screensaver_force_update();
TS("E_Pointer Init"); TS("E_Pointer Init");
if (!e_pointer_init()) if (!e_pointer_init())
@ -1708,7 +1709,8 @@ _e_main_cb_x_flusher(void *data __UNUSED__)
{ {
eet_clearcache(); eet_clearcache();
#ifndef HAVE_WAYLAND_ONLY #ifndef HAVE_WAYLAND_ONLY
ecore_x_flush(); if (e_comp_get(NULL)->comp_type == E_PIXMAP_TYPE_X)
ecore_x_flush();
#endif #endif
return ECORE_CALLBACK_RENEW; return ECORE_CALLBACK_RENEW;
} }

View File

@ -495,7 +495,7 @@ e_module_enable(E_Module *m)
break; break;
} }
} }
if (!_e_modules_initting) if (_e_modules_hash && (!_e_modules_initting))
_e_module_whitelist_check(); _e_module_whitelist_check();
return 1; return 1;
} }
@ -973,17 +973,20 @@ _e_module_whitelist_check(void)
} }
#ifndef HAVE_WAYLAND_ONLY #ifndef HAVE_WAYLAND_ONLY
{ {
Ecore_X_Atom _x_tainted; const char *state;
char *state;
unsigned int _e_tainted;
state = badl ? "YES" : "NO"; state = badl ? "YES" : "NO";
_e_tainted = badl ? 1 : 0;
_x_tainted = ecore_x_atom_get("_E_TAINTED"); if (e_comp_get(NULL)->comp_type == E_PIXMAP_TYPE_X)
ecore_x_window_prop_card32_set(ecore_x_window_root_first_get(), {
_x_tainted, &_e_tainted, 1); Ecore_X_Atom _x_tainted;
unsigned int _e_tainted = badl ? 1 : 0;
_x_tainted = ecore_x_atom_get("_E_TAINTED");
ecore_x_window_prop_card32_set(ecore_x_window_root_first_get(),
_x_tainted, &_e_tainted, 1);
}
e_env_set("E19_TAINTED", state); e_env_set("E19_TAINTED", state);
} }

View File

@ -7,12 +7,15 @@ e_mouse_update(void)
int n; int n;
#ifndef HAVE_WAYLAND_ONLY #ifndef HAVE_WAYLAND_ONLY
if (!ecore_x_pointer_control_set(e_config->mouse_accel_numerator, if (e_comp_get(NULL)->comp_type == E_PIXMAP_TYPE_X)
e_config->mouse_accel_denominator, {
e_config->mouse_accel_threshold)) if (!ecore_x_pointer_control_set(e_config->mouse_accel_numerator,
return 0; e_config->mouse_accel_denominator,
e_config->mouse_accel_threshold))
return 0;
if (!ecore_x_pointer_mapping_get(map, 256)) return 0; if (!ecore_x_pointer_mapping_get(map, 256)) return 0;
}
#endif #endif
for (n = 0; n < 256; n++) for (n = 0; n < 256; n++)
@ -38,7 +41,8 @@ e_mouse_update(void)
} }
#ifndef HAVE_WAYLAND_ONLY #ifndef HAVE_WAYLAND_ONLY
if (!ecore_x_pointer_mapping_set(map, n)) return 0; if (e_comp_get(NULL)->comp_type == E_PIXMAP_TYPE_X)
if (!ecore_x_pointer_mapping_set(map, n)) return 0;
#endif #endif
return 1; return 1;

View File

@ -24,9 +24,12 @@ e_scale_update(void)
if (e_config->scale.use_dpi) if (e_config->scale.use_dpi)
{ {
#ifndef HAVE_WAYLAND_ONLY #ifndef HAVE_WAYLAND_ONLY
dpi = ecore_x_dpi_get(); if (e_comp_get(NULL)->comp_type == E_PIXMAP_TYPE_X)
{
dpi = ecore_x_dpi_get();
e_scale = (double)dpi / (double)e_config->scale.base_dpi;
}
#endif #endif
e_scale = (double)dpi / (double)e_config->scale.base_dpi;
if (e_scale > e_config->scale.max) e_scale = e_config->scale.max; if (e_scale > e_config->scale.max) e_scale = e_config->scale.max;
else if (e_scale < e_config->scale.min) else if (e_scale < e_config->scale.min)
e_scale = e_config->scale.min; e_scale = e_config->scale.min;

View File

@ -82,10 +82,13 @@ e_screensaver_update(void)
changed = EINA_TRUE; changed = EINA_TRUE;
} }
#ifdef HAVE_WAYLAND_ONLY #ifndef HAVE_WAYLAND_ONLY
if (e_comp_get(NULL)->comp_type == E_PIXMAP_TYPE_X)
{
if (changed)
ecore_x_screensaver_set(timeout, interval, blanking, expose);
}
#else #else
if (changed)
ecore_x_screensaver_set(timeout, interval, blanking, expose);
#endif #endif
} }
@ -93,19 +96,21 @@ EAPI void
e_screensaver_force_update(void) e_screensaver_force_update(void)
{ {
int timeout = e_screensaver_timeout_get(EINA_TRUE); int timeout = e_screensaver_timeout_get(EINA_TRUE);
#ifdef HAVE_WAYLAND_ONLY #ifndef HAVE_WAYLAND_ONLY
if (e_comp_get(NULL)->comp_type == E_PIXMAP_TYPE_X)
{
ecore_x_screensaver_set(timeout + 10,
0,
// e_config->screensaver_interval,
!e_config->screensaver_blanking,
!e_config->screensaver_expose);
ecore_x_screensaver_set(timeout,
0,
// e_config->screensaver_interval,
e_config->screensaver_blanking,
e_config->screensaver_expose);
}
#else #else
if (!getenv("DISPLAY")) return;
ecore_x_screensaver_set(timeout + 10,
0,
// e_config->screensaver_interval,
!e_config->screensaver_blanking,
!e_config->screensaver_expose);
ecore_x_screensaver_set(timeout,
0,
// e_config->screensaver_interval,
e_config->screensaver_blanking,
e_config->screensaver_expose);
#endif #endif
} }
@ -336,8 +341,6 @@ e_screensaver_init(void)
_e_screensaver_handler_powersave = ecore_event_handler_add _e_screensaver_handler_powersave = ecore_event_handler_add
(E_EVENT_POWERSAVE_UPDATE, _e_screensaver_handler_powersave_cb, NULL); (E_EVENT_POWERSAVE_UPDATE, _e_screensaver_handler_powersave_cb, NULL);
e_screensaver_force_update();
return 1; return 1;
} }

View File

@ -59,6 +59,7 @@ e_xkb_update(int cur_group)
if (e_config->xkb.dont_touch_my_damn_keyboard) return; if (e_config->xkb.dont_touch_my_damn_keyboard) return;
if ((!e_config->xkb.used_layouts) && (!e_config->xkb.used_options) && (!e_config->xkb.default_model)) return; if ((!e_config->xkb.used_layouts) && (!e_config->xkb.used_options) && (!e_config->xkb.default_model)) return;
if (!getenv("DISPLAY")) return;
if (cur_group != -1) if (cur_group != -1)
{ {
_e_xkb_cur_group = cur_group; _e_xkb_cur_group = cur_group;

View File

@ -30,7 +30,6 @@ src_modules_everything_module_la_SOURCES = $(EVRYHEADERS) \
src/modules/everything/evry_view.c \ src/modules/everything/evry_view.c \
src/modules/everything/evry_view_tabs.c \ src/modules/everything/evry_view_tabs.c \
src/modules/everything/evry_view_help.c \ src/modules/everything/evry_view_help.c \
src/modules/everything/evry_plug_clipboard.c \
src/modules/everything/evry_plug_text.c \ src/modules/everything/evry_plug_text.c \
src/modules/everything/evry_plug_collection.c \ src/modules/everything/evry_plug_collection.c \
src/modules/everything/evry_gadget.c \ src/modules/everything/evry_gadget.c \
@ -42,6 +41,10 @@ src_modules_everything_module_la_SOURCES = $(EVRYHEADERS) \
src/modules/everything/evry_plug_settings.c \ src/modules/everything/evry_plug_settings.c \
src/modules/everything/evry_plug_calc.c src/modules/everything/evry_plug_calc.c
if ! HAVE_WAYLAND_ONLY
src_modules_everything_module_la_SOURCES += src/modules/everything/evry_plug_clipboard.c
endif
everything_headersdir = $(pkgincludedir) everything_headersdir = $(pkgincludedir)
dist_everything_headers_DATA = $(EVRYHEADERS) dist_everything_headers_DATA = $(EVRYHEADERS)

View File

@ -64,7 +64,7 @@ static void _evry_view_hide(Evry_Window *win, Evry_View *v, int slide)
static void _evry_item_desel(Evry_State *s); static void _evry_item_desel(Evry_State *s);
static void _evry_item_sel(Evry_State *s, Evry_Item *it); static void _evry_item_sel(Evry_State *s, Evry_Item *it);
static Eina_Bool _evry_cb_show(Evry_Window *win, int type __UNUSED__, Ecore_X_Event_Window_Show *ev); static void _evry_cb_show(Evry_Window *win, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED);
static Eina_Bool _evry_cb_key_down(void *data, int type, void *event); static Eina_Bool _evry_cb_key_down(void *data, int type, void *event);
static Eina_Bool _evry_cb_selection_notify(void *data, int type, void *event); static Eina_Bool _evry_cb_selection_notify(void *data, int type, void *event);
static Eina_Bool _evry_cb_mouse(void *data, int type, void *event); static Eina_Bool _evry_cb_mouse(void *data, int type, void *event);
@ -178,10 +178,11 @@ evry_show(E_Zone *zone, E_Zone_Edge edge, const char *params, Eina_Bool popup)
if (popup) if (popup)
{ {
//e_win_layer_set(win->ewin, E_WIN_LAYER_ABOVE); #ifndef HAVE_WAYLAND_ONLY
ecore_x_netwm_window_type_set(win->ewin->evas_win, if (e_comp_get(win->ewin)->comp_type == E_PIXMAP_TYPE_X)
ECORE_X_WINDOW_TYPE_UTILITY); ecore_x_netwm_window_type_set(win->ewin->evas_win,
ECORE_X_WINDOW_TYPE_UTILITY);
#endif
ecore_evas_name_class_set(win->ewin->ecore_evas, "E", "everything"); ecore_evas_name_class_set(win->ewin->ecore_evas, "E", "everything");
e_win_show(win->ewin); e_win_show(win->ewin);
@ -204,9 +205,11 @@ evry_show(E_Zone *zone, E_Zone_Edge edge, const char *params, Eina_Bool popup)
_evry_selector_new(win, EVRY_PLUGIN_OBJECT); _evry_selector_new(win, EVRY_PLUGIN_OBJECT);
E_LIST_HANDLER_APPEND(win->handlers, ECORE_EVENT_KEY_DOWN, _evry_cb_key_down, win); E_LIST_HANDLER_APPEND(win->handlers, ECORE_EVENT_KEY_DOWN, _evry_cb_key_down, win);
#ifndef HAVE_WAYLAND_ONLY
if (e_comp_get(win->ewin)->comp_type == E_PIXMAP_TYPE_X)
E_LIST_HANDLER_APPEND(win->handlers, ECORE_X_EVENT_SELECTION_NOTIFY, _evry_cb_selection_notify, win); E_LIST_HANDLER_APPEND(win->handlers, ECORE_X_EVENT_SELECTION_NOTIFY, _evry_cb_selection_notify, win);
E_LIST_HANDLER_APPEND(win->handlers, ECORE_X_EVENT_WINDOW_SHOW, _evry_cb_show, win); #endif
evas_object_event_callback_add(win->ewin->client->frame, EVAS_CALLBACK_SHOW, (Evas_Object_Event_Cb)_evry_cb_show, win);
E_LIST_HANDLER_APPEND(win->handlers, EVRY_EVENT_ITEM_CHANGED, _evry_cb_item_changed, win); E_LIST_HANDLER_APPEND(win->handlers, EVRY_EVENT_ITEM_CHANGED, _evry_cb_item_changed, win);
@ -860,9 +863,8 @@ _evry_window_new(E_Zone *zone, E_Zone_Edge edge)
evas_object_resize(o, mw, mh); evas_object_resize(o, mw, mh);
evas_object_show(o); evas_object_show(o);
evas_event_feed_mouse_in(win->evas, ecore_x_current_time_get(), NULL); evas_event_feed_mouse_in(win->evas, 0, NULL);
evas_event_feed_mouse_move(win->evas, -1000000, -1000000, evas_event_feed_mouse_move(win->evas, -1000000, -1000000, 0, NULL);
ecore_x_current_time_get(), NULL);
e_win_delete_callback_set(win->ewin, _evry_cb_win_delete); e_win_delete_callback_set(win->ewin, _evry_cb_win_delete);
e_win_resize_callback_set(win->ewin, _evry_cb_win_resize); e_win_resize_callback_set(win->ewin, _evry_cb_win_resize);
@ -1921,8 +1923,11 @@ _evry_cb_key_down(void *data, int type __UNUSED__, void *event)
e_grabinput_release(ewin->evas_win, ewin->evas_win); e_grabinput_release(ewin->evas_win, ewin->evas_win);
evas_object_layer_set(ewin->client->frame, E_LAYER_CLIENT_NORMAL); evas_object_layer_set(ewin->client->frame, E_LAYER_CLIENT_NORMAL);
ecore_x_netwm_window_type_set(ewin->evas_win, #ifndef HAVE_WAYLAND_ONLY
ECORE_X_WINDOW_TYPE_DIALOG); if (e_comp_get(ewin)->comp_type == E_PIXMAP_TYPE_X)
ecore_x_netwm_window_type_set(ewin->evas_win,
ECORE_X_WINDOW_TYPE_DIALOG);
#endif
EC_CHANGED(ewin->client); EC_CHANGED(ewin->client);
ewin->client->netwm.fetch.type = 1; ewin->client->netwm.fetch.type = 1;
ewin->client->netwm.state.skip_taskbar = 0; ewin->client->netwm.state.skip_taskbar = 0;
@ -2109,9 +2114,14 @@ _evry_cb_key_down(void *data, int type __UNUSED__, void *event)
_evry_plugin_action(sel, 0); _evry_plugin_action(sel, 0);
else if (!strcmp(ev->key, "v")) else if (!strcmp(ev->key, "v"))
{ {
win->request_selection = EINA_TRUE; #ifndef HAVE_WAYLAND_ONLY
ecore_x_selection_primary_request if (e_comp_get(win->ewin)->comp_type == E_PIXMAP_TYPE_X)
(win->ewin->evas_win, ECORE_X_SELECTION_TARGET_UTF8_STRING); {
win->request_selection = EINA_TRUE;
ecore_x_selection_primary_request
(win->ewin->evas_win, ECORE_X_SELECTION_TARGET_UTF8_STRING);
}
#endif
} }
else else
{ {
@ -3017,15 +3027,14 @@ _evry_plugin_list_insert(Evry_State *s, Evry_Plugin *p)
s->cur_plugins = eina_list_append(s->cur_plugins, p); s->cur_plugins = eina_list_append(s->cur_plugins, p);
} }
static Eina_Bool static void
_evry_cb_show(Evry_Window *win, int type __UNUSED__, Ecore_X_Event_Window_Show *ev) _evry_cb_show(Evry_Window *win, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{ {
if (win->ewin->evas_win != ev->event_win) return ECORE_CALLBACK_RENEW;
if (win->grab) if (win->grab)
e_grabinput_get(win->ewin->evas_win, 0, win->ewin->evas_win); e_grabinput_get(win->ewin->evas_win, 0, win->ewin->evas_win);
return ECORE_CALLBACK_RENEW;
} }
#ifndef HAVE_WAYLAND_ONLY
static Eina_Bool static Eina_Bool
_evry_cb_selection_notify(void *data, int type __UNUSED__, void *event) _evry_cb_selection_notify(void *data, int type __UNUSED__, void *event)
{ {
@ -3055,6 +3064,7 @@ _evry_cb_selection_notify(void *data, int type __UNUSED__, void *event)
return ECORE_CALLBACK_PASS_ON; return ECORE_CALLBACK_PASS_ON;
} }
#endif
void void
evry_item_app_free(Evry_Item_App *app) evry_item_app_free(Evry_Item_App *app)

View File

@ -8,6 +8,8 @@ _action(Evry_Action *action)
{ {
const Evry_Item *it = action->it1.item; const Evry_Item *it = action->it1.item;
if (e_comp_get(NULL)->comp_type != E_PIXMAP_TYPE_X) return 0;
ecore_x_selection_primary_set(clipboard_win, it->label, strlen(it->label)); ecore_x_selection_primary_set(clipboard_win, it->label, strlen(it->label));
ecore_x_selection_clipboard_set(clipboard_win, it->label, strlen(it->label)); ecore_x_selection_clipboard_set(clipboard_win, it->label, strlen(it->label));
@ -23,10 +25,14 @@ _check_item(Evry_Action *action __UNUSED__, const Evry_Item *it)
Eina_Bool Eina_Bool
evry_plug_clipboard_init(void) evry_plug_clipboard_init(void)
{ {
Ecore_X_Window win;
if (!evry_api_version_check(EVRY_API_VERSION)) if (!evry_api_version_check(EVRY_API_VERSION))
return EINA_FALSE; return EINA_FALSE;
Ecore_X_Window win = ecore_x_window_input_new(0, 0, 0, 1, 1); if (e_comp_get(NULL)->comp_type != E_PIXMAP_TYPE_X)
return EINA_FALSE;
win = ecore_x_window_input_new(0, 0, 0, 1, 1);
if (!win) return EINA_FALSE; if (!win) return EINA_FALSE;
ecore_x_icccm_name_class_set(win, "evry", "clipboard"); ecore_x_icccm_name_class_set(win, "evry", "clipboard");
e_comp_ignore_win_add(E_PIXMAP_TYPE_X, win); e_comp_ignore_win_add(E_PIXMAP_TYPE_X, win);
@ -47,6 +53,7 @@ evry_plug_clipboard_init(void)
void void
evry_plug_clipboard_shutdown(void) evry_plug_clipboard_shutdown(void)
{ {
if (e_comp_get(NULL)->comp_type != E_PIXMAP_TYPE_X) return;
ecore_x_window_free(clipboard_win); ecore_x_window_free(clipboard_win);
evry_action_free(act); evry_action_free(act);
} }