From: Wang Quanxian Date: Fri, 1 Feb 2013 02:24:45 +0000 (+0800) Subject: Keep compatible with Wayland X-Git-Tag: submit/2.0alpha-wayland/20130204.020035^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F09%2F2709%2F3;p=profile%2Fivi%2Fui-gadget-1.git Keep compatible with Wayland xid and disp are not needed by Wayland instead of only by X server. --- diff --git a/src/ug.c b/src/ug.c index 2aaba2d..05e62ec 100755 --- a/src/ug.c +++ b/src/ug.c @@ -90,10 +90,14 @@ UG_API ui_gadget_h ug_create(ui_gadget_h parent, UG_API int ug_init(Display *disp, Window xid, void *win, enum ug_option opt) { - if (!win || !xid || !disp) { + /* XXX Start Hooks for Wayland */ + char *d = getenv("DISPLAY"); + /* xid and disp are not needed by wayland instead of only by X.*/ + if (!win || (d && (!xid || !disp))) { _ERR("ug_init() failed: Invalid arguments\n"); return -1; } + /* XXX End Hooks for Wayland */ if (opt < UG_OPT_INDICATOR_ENABLE || opt >= UG_OPT_MAX) { _ERR("ug_init() failed: Invalid option\n");