Hey, Thanks for the fix. I don't know this code, but wouldn't it be cleaner to just define the variable win as uint64_t? It'll remove all of the ifdefs, and at worst will require some casts.
Feels much safer to me. Also, I wonder where else we have a similar issue, and why gcc/coverity haven't warned us about truncating the value (or maybe they have and we just ignored them). -- Tom. On 20/04/15 23:18, Derek Foreman wrote: > discomfitor pushed a commit to branch master. > > http://git.enlightenment.org/core/enlightenment.git/commit/?id=1fb1f17db010c575eae32960da84d3fbfab13119 > > commit 1fb1f17db010c575eae32960da84d3fbfab13119 > Author: Derek Foreman <[email protected]> > Date: Mon Apr 20 18:17:55 2015 -0400 > > Fix wayland compositor on 32 bit systems > > Summary: > _e_elm_win_trap_show() treats Ecore_Window as a 64bit data type when > it's actually the same size as the system's pointer type. > > #24HourFullPowerNoToiletNoShower > > Reviewers: devilhorns, zmike > > Subscribers: cedric > > Differential Revision: https://phab.enlightenment.org/D2388 > > fix T2194 > --- > configure.ac | 5 ----- > src/bin/e_win.c | 20 +++++++++++++++++--- > 2 files changed, 17 insertions(+), 8 deletions(-) > > diff --git a/configure.ac b/configure.ac > index 6cbbeea..c29d9ba 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -443,7 +443,6 @@ test -n "$dbus_mount" && > AC_DEFINE_UNQUOTED([HAVE_UDISKS_MOUNT], [1], [enable Ud > AM_CONDITIONAL([HAVE_UDISKS_MOUNT], [test -n "$dbus_mount"]) > AM_CONDITIONAL([HAVE_EEZE_MOUNT], [test -n "$eeze_mount"]) > > -AC_CHECK_SIZEOF([void*]) > # verify "wayland-only" early to adapt dependencies > > have_wayland_only=no > @@ -842,10 +841,6 @@ if test "x${have_wayland}" = "xyes"; then > fi > fi > > -if test "x${have_wayland}" = "xyes" && test "$ac_cv_sizeof_voidp" -ne 8 ; > then > - AC_MSG_ERROR([wayland support is only available for 64bit architectures]) > -fi > - > AM_CONDITIONAL([HAVE_WAYLAND], [test "x${have_wayland}" = "xyes"]) > AM_CONDITIONAL([HAVE_WAYLAND_ONLY], [test "x${have_wayland_only}" = "xyes"]) > AM_CONDITIONAL([HAVE_WAYLAND_CLIENTS], [test "x${have_wayland_clients}" = > "xyes"]) > diff --git a/src/bin/e_win.c b/src/bin/e_win.c > index 8797c67..c13c229 100644 > --- a/src/bin/e_win.c > +++ b/src/bin/e_win.c > @@ -67,6 +67,9 @@ _e_elm_win_trap_show(void *data, Evas_Object *o) > { > E_Client *ec; > Ecore_Window win; > +#ifdef HAVE_WAYLAND > + uint64_t wl_win_id; > +#endif > E_Pixmap_Type type = E_PIXMAP_TYPE_X; > > win = elm_win_window_id_get(o); > @@ -76,7 +79,7 @@ _e_elm_win_trap_show(void *data, Evas_Object *o) > type = E_PIXMAP_TYPE_WL; > ctx->pointer = e_comp->pointer; > elm_win_borderless_set(o, 1); > - win = e_comp_wl_id_get(win, getpid()); > + wl_win_id = e_comp_wl_id_get(win, getpid()); > } > else > #endif > @@ -85,7 +88,12 @@ _e_elm_win_trap_show(void *data, Evas_Object *o) > ctx->pointer = e_pointer_window_new(win, EINA_TRUE); > } > > - ec = e_pixmap_find_client(type, win); > +#ifdef HAVE_WAYLAND > + if (type == E_PIXMAP_TYPE_WL) > + ec = e_pixmap_find_client(type, wl_win_id); > + else > +#endif > + ec = e_pixmap_find_client(type, win); > if (ec) > ctx->client = ec; > else > @@ -101,7 +109,13 @@ _e_elm_win_trap_show(void *data, Evas_Object *o) > if ((!title) || (!title[0])) > title = "E"; > ecore_evas_title_set(ee, title); > - cp = e_pixmap_new(type, win); > + > +#ifdef HAVE_WAYLAND > + if (type == E_PIXMAP_TYPE_WL) > + cp = e_pixmap_new(type, wl_win_id); > + else > +#endif > + cp = e_pixmap_new(type, win); > EINA_SAFETY_ON_NULL_RETURN_VAL(cp, EINA_TRUE); > > ctx->client = e_client_new(cp, 0, 1); > ------------------------------------------------------------------------------ BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT Develop your own process in accordance with the BPMN 2 standard Learn Process modeling best practices with Bonita BPM through live exercises http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_ source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF _______________________________________________ enlightenment-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
