diff --git a/legacy/ecore/src/lib/ecore_x/Ecore_X.h b/legacy/ecore/src/lib/ecore_x/Ecore_X.h index 6f2a30028c..12937c9e82 100644 --- a/legacy/ecore/src/lib/ecore_x/Ecore_X.h +++ b/legacy/ecore/src/lib/ecore_x/Ecore_X.h @@ -840,7 +840,9 @@ EAPI Ecore_X_Window ecore_x_window_at_xy_get(int x, int y); EAPI Ecore_X_Window ecore_x_window_parent_get(Ecore_X_Window win); EAPI void ecore_x_window_background_color_set(Ecore_X_Window win, - unsigned long color); + unsigned short r, + unsigned short g, + unsigned short b); EAPI void ecore_x_window_gravity_set(Ecore_X_Window win, Ecore_X_Gravity grav); EAPI void ecore_x_window_pixel_gravity_set(Ecore_X_Window win, diff --git a/legacy/ecore/src/lib/ecore_x/ecore_x_window.c b/legacy/ecore/src/lib/ecore_x/ecore_x_window.c index 957c5bc28e..b4f96f5df1 100644 --- a/legacy/ecore/src/lib/ecore_x/ecore_x_window.c +++ b/legacy/ecore/src/lib/ecore_x/ecore_x_window.c @@ -713,11 +713,21 @@ ecore_x_window_parent_get(Ecore_X_Window win) * @param color The color to set to (i.e. 0xff0000) */ void -ecore_x_window_background_color_set(Ecore_X_Window win, unsigned long color) +ecore_x_window_background_color_set(Ecore_X_Window win, unsigned short r, + unsigned short g, unsigned short b) { XSetWindowAttributes attr; + XColor col; - attr.background_pixel = color; + col.red = r; + col.green = g; + col.blue = b; + + XAllocColor(_ecore_x_disp, DefaultColormap(_ecore_x_disp, + DefaultScreen(_ecore_x_disp)), + &col); + + attr.background_pixel = col.pixel; XChangeWindowAttributes(_ecore_x_disp, win, CWBackPixel, &attr); }