summaryrefslogtreecommitdiff
path: root/src/lib/ecore_evas
diff options
context:
space:
mode:
authorGwanglim Lee <gl77.lee@samsung.com>2012-12-05 06:48:46 +0000
committerCarsten Haitzler <raster@rasterman.com>2012-12-05 06:48:46 +0000
commit74cdf85ea9a1931e508703ddd1cfb1c9ce68f3c1 (patch)
tree642d82752f5aef6f25a56dab07629a32c25bd30b /src/lib/ecore_evas
parent25ea899dfae39b155f7f0f2b7cafc456cfd1f1d8 (diff)
From: Gwanglim Lee <gl77.lee@samsung.com>
Subject: Re: Re: Re: [E-devel] [RFC] Virtual desktop window profile I've attached 4th patch. May the 4th be with you. ecore patch has been merged with efl and all files are based on r80123. Thanks & Regards, Gwanglim ------- Original Message ------- Sender : Daniel Juyung Seo<seojuyung2@gmail.com> Date : 2012-12-04 01:55 (GMT+09:00) Title : Re: Re: [E-devel] [RFC] Virtual desktop window profile It looks ok to me. Sorry but can you re-generate the patch according to the recent ecore merge to efl single tree? Daniel Juyung Seo (SeoZ) On Thu, Nov 29, 2012 at 12:29 AM, Gwanglim Lee <gl77.lee@samsung.com> wrote: Dear Raster and Daniel Juyung Seo, I've attached 3rd patches and test_config according to your reviews. These are based on r79782. [elementary & ecore] 1. "profile,set" -> "profile,changed" - done 2. spaces after EINA_LIST_FOREACH - done 3. variable type - keep 4. author - done 5. removing deprecated marking in patch - done 6. add elm_win_available_profiles_get to test_config for the debugging purpose - done 7. check whether a given profile is present in an available profiles. otherwise window profile will be one of the item in available profiles. - newly added thing to the elm_win 8. merge with EO - done. :( Any comments would be appreciated. SVN revision: 80214
Diffstat (limited to 'src/lib/ecore_evas')
-rw-r--r--src/lib/ecore_evas/Ecore_Evas.h60
-rw-r--r--src/lib/ecore_evas/ecore_evas.c112
-rw-r--r--src/lib/ecore_evas/ecore_evas_buffer.c19
-rw-r--r--src/lib/ecore_evas/ecore_evas_cocoa.c1
-rw-r--r--src/lib/ecore_evas/ecore_evas_directfb.c1
-rw-r--r--src/lib/ecore_evas/ecore_evas_ews.c1
-rw-r--r--src/lib/ecore_evas/ecore_evas_extn.c161
-rw-r--r--src/lib/ecore_evas/ecore_evas_fb.c1
-rw-r--r--src/lib/ecore_evas/ecore_evas_private.h29
-rw-r--r--src/lib/ecore_evas/ecore_evas_psl1ght.c1
-rw-r--r--src/lib/ecore_evas/ecore_evas_sdl.c1
-rw-r--r--src/lib/ecore_evas/ecore_evas_wayland_egl.c1
-rw-r--r--src/lib/ecore_evas/ecore_evas_wayland_shm.c1
-rw-r--r--src/lib/ecore_evas/ecore_evas_win32.c1
-rw-r--r--src/lib/ecore_evas/ecore_evas_x.c150
15 files changed, 507 insertions, 33 deletions
diff --git a/src/lib/ecore_evas/Ecore_Evas.h b/src/lib/ecore_evas/Ecore_Evas.h
index 3c59c80c84..b701aeec8f 100644
--- a/src/lib/ecore_evas/Ecore_Evas.h
+++ b/src/lib/ecore_evas/Ecore_Evas.h
@@ -662,6 +662,59 @@ EAPI void ecore_evas_maximized_set(Ecore_Evas *ee, Eina_Bool on);
662 */ 662 */
663EAPI Eina_Bool ecore_evas_maximized_get(const Ecore_Evas *ee); 663EAPI Eina_Bool ecore_evas_maximized_get(const Ecore_Evas *ee);
664/** 664/**
665 * @brief Query if the underlying windowing system supports the window profile.
666 *
667 * @param ee The Ecore_Evas
668 * @return @c EINA_TRUE if the window profile is supported, @c EINA_FALSE otherwise.
669 *
670 * @warning Support for this depends on the underlying windowing system.
671 * @since 1.8.0
672 */
673EAPI Eina_Bool ecore_evas_window_profile_supported_get(const Ecore_Evas *ee);
674/**
675 * @brief Set the window profile
676 *
677 * @param ee The Ecore_Evas to set
678 * @param profile The string value of the window profile
679 *
680 * @warning Support for this depends on the underlying windowing system.
681 * @since 1.8.0
682 */
683EAPI void ecore_evas_window_profile_set(Ecore_Evas *ee, const char *profile);
684/**
685 * @brief Get the window profile
686 *
687 * @param ee The Ecore_Evas to get the window profile from.
688 * @return The string value of the window profile, or NULL if none exists
689 *
690 * @warning Support for this depends on the underlying windowing system.
691 * @since 1.8.0
692 */
693EAPI const char *ecore_evas_window_profile_get(const Ecore_Evas *ee);
694/**
695 * @brief Set the array of available window profiles
696 *
697 * @param ee The Ecore_Evas to set
698 * @param profiles The string array of available window profiels
699 * @param count The number of members in profiles
700 *
701 * @warning Support for this depends on the underlying windowing system.
702 * @since 1.8.0
703 */
704EAPI void ecore_evas_window_available_profiles_set(Ecore_Evas *ee, const char **profiles, const unsigned int count);
705/**
706 * @brief Get the array of available window profiles
707 *
708 * @param ee The Ecore_Evas to get available window profiles from.
709 * @param profiles Where to return the string array of available window profiles
710 * @param count Where to return the number of members in profiles
711 * @return EINA_TRUE if available window profiles exist, EINA_FALSE otherwise
712 *
713 * @warning Support for this depends on the underlying windowing system.
714 * @since 1.8.0
715 */
716EAPI Eina_Bool ecore_evas_window_available_profiles_get(Ecore_Evas *ee, char ***profiles, unsigned int *count);
717/**
665 * @brief Move an Ecore_Evas. 718 * @brief Move an Ecore_Evas.
666 * 719 *
667 * @param ee The Ecore_Evas to move 720 * @param ee The Ecore_Evas to move
@@ -1886,6 +1939,13 @@ EAPI unsigned char ecore_getopt_callback_ecore_evas_list_engines(const Ecore_Get
1886 * just deleting the list. 1939 * just deleting the list.
1887 */ 1940 */
1888EAPI Eina_List *ecore_evas_ecore_evas_list_get(void); 1941EAPI Eina_List *ecore_evas_ecore_evas_list_get(void);
1942/**
1943 * @brief Get a list of all the sub ecore_evases.
1944 *
1945 * @param ee Ecore_Evas to get the list from.
1946 * @return A list of sub ecore_evases, or @c NULL if there is no sub ecore_evases.
1947 */
1948EAPI Eina_List *ecore_evas_sub_ecore_evas_list_get(const Ecore_Evas *ee);
1889 1949
1890/* specific calls to an x11 environment ecore_evas */ 1950/* specific calls to an x11 environment ecore_evas */
1891EAPI void ecore_evas_x11_leader_set(Ecore_Evas *ee, Ecore_X_Window win); 1951EAPI void ecore_evas_x11_leader_set(Ecore_Evas *ee, Ecore_X_Window win);
diff --git a/src/lib/ecore_evas/ecore_evas.c b/src/lib/ecore_evas/ecore_evas.c
index 3d841e7db6..9a665fd581 100644
--- a/src/lib/ecore_evas/ecore_evas.c
+++ b/src/lib/ecore_evas/ecore_evas.c
@@ -1859,6 +1859,77 @@ ecore_evas_maximized_get(const Ecore_Evas *ee)
1859 return ee->prop.maximized ? EINA_TRUE : EINA_FALSE; 1859 return ee->prop.maximized ? EINA_TRUE : EINA_FALSE;
1860} 1860}
1861 1861
1862EAPI Eina_Bool
1863ecore_evas_window_profile_supported_get(const Ecore_Evas *ee)
1864{
1865 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1866 {
1867 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1868 "ecore_evas_window_profile_supported_get");
1869 return EINA_FALSE;
1870 }
1871 return ee->profile_supported ? EINA_TRUE : EINA_FALSE;
1872}
1873
1874EAPI void
1875ecore_evas_window_profile_set(Ecore_Evas *ee, const char *profile)
1876{
1877 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1878 {
1879 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1880 "ecore_evas_window_profile_set");
1881 return;
1882 }
1883 IFC(ee, fn_profile_set) (ee, profile);
1884 IFE;
1885}
1886
1887EAPI const char *
1888ecore_evas_window_profile_get(const Ecore_Evas *ee)
1889{
1890 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1891 {
1892 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1893 "ecore_evas_window_profile_get");
1894 return NULL;
1895 }
1896 return ee->prop.profile.name;
1897}
1898
1899EAPI void
1900ecore_evas_window_available_profiles_set(Ecore_Evas *ee, const char **profiles, const unsigned int count)
1901{
1902 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1903 {
1904 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1905 "ecore_evas_window_available_profiles_set");
1906 return;
1907 }
1908 IFC(ee, fn_profiles_set) (ee, profiles, count);
1909 IFE;
1910}
1911
1912EAPI Eina_Bool
1913ecore_evas_window_available_profiles_get(Ecore_Evas *ee, char ***profiles, unsigned int *count)
1914{
1915 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1916 {
1917 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1918 "ecore_evas_window_available_profiles_get");
1919 return EINA_FALSE;
1920 }
1921
1922 if ((ee->prop.profile.available_list) &&
1923 (ee->prop.profile.count >= 1))
1924 {
1925 if (profiles) *profiles = ee->prop.profile.available_list;
1926 if (count) *count = ee->prop.profile.count;
1927 return EINA_TRUE;
1928 }
1929 else
1930 return EINA_FALSE;
1931}
1932
1862EAPI void 1933EAPI void
1863ecore_evas_fullscreen_set(Ecore_Evas *ee, Eina_Bool on) 1934ecore_evas_fullscreen_set(Ecore_Evas *ee, Eina_Bool on)
1864{ 1935{
@@ -2433,6 +2504,10 @@ _ecore_evas_free(Ecore_Evas *ee)
2433 ee->prop.name = NULL; 2504 ee->prop.name = NULL;
2434 if (ee->prop.clas) free(ee->prop.clas); 2505 if (ee->prop.clas) free(ee->prop.clas);
2435 ee->prop.clas = NULL; 2506 ee->prop.clas = NULL;
2507 _ecore_evas_window_profile_free(ee);
2508 ee->prop.profile.name = NULL;
2509 _ecore_evas_window_available_profiles_free(ee);
2510 ee->prop.profile.available_list = NULL;
2436 if (ee->prop.cursor.object) evas_object_del(ee->prop.cursor.object); 2511 if (ee->prop.cursor.object) evas_object_del(ee->prop.cursor.object);
2437 ee->prop.cursor.object = NULL; 2512 ee->prop.cursor.object = NULL;
2438 if (ee->evas) evas_free(ee->evas); 2513 if (ee->evas) evas_free(ee->evas);
@@ -2662,6 +2737,31 @@ _ecore_evas_mouse_multi_up_process(Ecore_Evas *ee, int device,
2662 flags, timestamp, NULL); 2737 flags, timestamp, NULL);
2663} 2738}
2664 2739
2740void
2741_ecore_evas_window_profile_free(Ecore_Evas *ee)
2742{
2743 if (ee->prop.profile.name)
2744 eina_stringshare_del(ee->prop.profile.name);
2745}
2746
2747void
2748_ecore_evas_window_available_profiles_free(Ecore_Evas *ee)
2749{
2750 if (ee->prop.profile.available_list)
2751 {
2752 int i;
2753 for (i = 0; i < ee->prop.profile.count; i++)
2754 {
2755 if (ee->prop.profile.available_list[i])
2756 {
2757 eina_stringshare_del(ee->prop.profile.available_list[i]);
2758 ee->prop.profile.available_list[i] = NULL;
2759 }
2760 }
2761 free(ee->prop.profile.available_list);
2762 }
2763}
2764
2665EAPI Eina_List * 2765EAPI Eina_List *
2666ecore_evas_ecore_evas_list_get(void) 2766ecore_evas_ecore_evas_list_get(void)
2667{ 2767{
@@ -2676,6 +2776,18 @@ ecore_evas_ecore_evas_list_get(void)
2676 return l; 2776 return l;
2677} 2777}
2678 2778
2779EAPI Eina_List *
2780ecore_evas_sub_ecore_evas_list_get(const Ecore_Evas *ee)
2781{
2782 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2783 {
2784 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2785 "ecore_evas_sub_ecore_evas_list_get");
2786 return NULL;
2787 }
2788 return ee->sub_ecore_evas;
2789}
2790
2679EAPI void 2791EAPI void
2680ecore_evas_input_event_register(Ecore_Evas *ee) 2792ecore_evas_input_event_register(Ecore_Evas *ee)
2681{ 2793{
diff --git a/src/lib/ecore_evas/ecore_evas_buffer.c b/src/lib/ecore_evas/ecore_evas_buffer.c
index 26f48ce336..8dcd71442e 100644
--- a/src/lib/ecore_evas/ecore_evas_buffer.c
+++ b/src/lib/ecore_evas/ecore_evas_buffer.c
@@ -467,6 +467,22 @@ _ecore_evas_buffer_alpha_set(Ecore_Evas *ee, int alpha)
467 } 467 }
468} 468}
469 469
470static void
471_ecore_evas_buffer_profile_set(Ecore_Evas *ee, const char *profile)
472{
473 _ecore_evas_window_profile_free(ee);
474 ee->prop.profile.name = NULL;
475
476 if (profile)
477 {
478 ee->prop.profile.name = (char *)eina_stringshare_add(profile);
479
480 /* just change ee's state.*/
481 if (ee->func.fn_state_change)
482 ee->func.fn_state_change(ee);
483 }
484}
485
470static Ecore_Evas_Engine_Func _ecore_buffer_engine_func = 486static Ecore_Evas_Engine_Func _ecore_buffer_engine_func =
471{ 487{
472 _ecore_evas_buffer_free, 488 _ecore_evas_buffer_free,
@@ -516,6 +532,7 @@ static Ecore_Evas_Engine_Func _ecore_buffer_engine_func =
516 _ecore_evas_buffer_alpha_set, 532 _ecore_evas_buffer_alpha_set,
517 NULL, //transparent 533 NULL, //transparent
518 NULL, // profiles_set 534 NULL, // profiles_set
535 _ecore_evas_buffer_profile_set,
519 536
520 NULL, 537 NULL,
521 NULL, 538 NULL,
@@ -583,6 +600,7 @@ ecore_evas_buffer_allocfunc_new(int w, int h, void *(*alloc_func) (void *data, i
583 ee->h = h; 600 ee->h = h;
584 ee->req.w = ee->w; 601 ee->req.w = ee->w;
585 ee->req.h = ee->h; 602 ee->req.h = ee->h;
603 ee->profile_supported = 1;
586 604
587 ee->prop.max.w = 0; 605 ee->prop.max.w = 0;
588 ee->prop.max.h = 0; 606 ee->prop.max.h = 0;
@@ -722,6 +740,7 @@ ecore_evas_object_image_new(Ecore_Evas *ee_target)
722 ee->h = h; 740 ee->h = h;
723 ee->req.w = ee->w; 741 ee->req.w = ee->w;
724 ee->req.h = ee->h; 742 ee->req.h = ee->h;
743 ee->profile_supported = 1;
725 744
726 ee->prop.max.w = 0; 745 ee->prop.max.w = 0;
727 ee->prop.max.h = 0; 746 ee->prop.max.h = 0;
diff --git a/src/lib/ecore_evas/ecore_evas_cocoa.c b/src/lib/ecore_evas/ecore_evas_cocoa.c
index bf88e5e33f..32acb57ccb 100644
--- a/src/lib/ecore_evas/ecore_evas_cocoa.c
+++ b/src/lib/ecore_evas/ecore_evas_cocoa.c
@@ -464,6 +464,7 @@ static Ecore_Evas_Engine_Func _ecore_cocoa_engine_func =
464 NULL, 464 NULL,
465 NULL, //transparent 465 NULL, //transparent
466 NULL, // profiles_set 466 NULL, // profiles_set
467 NULL, // profile_set
467 468
468 NULL, 469 NULL,
469 NULL, 470 NULL,
diff --git a/src/lib/ecore_evas/ecore_evas_directfb.c b/src/lib/ecore_evas/ecore_evas_directfb.c
index f3567341b1..caeed21def 100644
--- a/src/lib/ecore_evas/ecore_evas_directfb.c
+++ b/src/lib/ecore_evas/ecore_evas_directfb.c
@@ -490,6 +490,7 @@ static Ecore_Evas_Engine_Func _ecore_directfb_engine_func =
490 NULL, /* alpha */ 490 NULL, /* alpha */
491 NULL, //transparent 491 NULL, //transparent
492 NULL, // profiles_set 492 NULL, // profiles_set
493 NULL, // profile_set
493 494
494 NULL, 495 NULL,
495 NULL, 496 NULL,
diff --git a/src/lib/ecore_evas/ecore_evas_ews.c b/src/lib/ecore_evas/ecore_evas_ews.c
index ceffd663e6..37f445612b 100644
--- a/src/lib/ecore_evas/ecore_evas_ews.c
+++ b/src/lib/ecore_evas/ecore_evas_ews.c
@@ -684,6 +684,7 @@ static const Ecore_Evas_Engine_Func _ecore_ews_engine_func =
684 _ecore_evas_ews_alpha_set, 684 _ecore_evas_ews_alpha_set,
685 _ecore_evas_ews_transparent_set, 685 _ecore_evas_ews_transparent_set,
686 NULL, // profiles_set 686 NULL, // profiles_set
687 NULL, // profile_set
687 688
688 NULL, 689 NULL,
689 NULL, 690 NULL,
diff --git a/src/lib/ecore_evas/ecore_evas_extn.c b/src/lib/ecore_evas/ecore_evas_extn.c
index 61840723c7..41bdb665e3 100644
--- a/src/lib/ecore_evas/ecore_evas_extn.c
+++ b/src/lib/ecore_evas/ecore_evas_extn.c
@@ -189,6 +189,8 @@ enum // opcodes
189 OP_UPDATE_DONE, 189 OP_UPDATE_DONE,
190 OP_LOCK_FILE, 190 OP_LOCK_FILE,
191 OP_SHM_REF, 191 OP_SHM_REF,
192 OP_PROFILE_CHANGE_REQUEST,
193 OP_PROFILE_CHANGE_DONE,
192 OP_EV_MOUSE_IN, 194 OP_EV_MOUSE_IN,
193 OP_EV_MOUSE_OUT, 195 OP_EV_MOUSE_OUT,
194 OP_EV_MOUSE_UP, 196 OP_EV_MOUSE_UP,
@@ -218,6 +220,7 @@ enum
218 220
219typedef struct _Ipc_Data_Resize Ipc_Data_Resize; 221typedef struct _Ipc_Data_Resize Ipc_Data_Resize;
220typedef struct _Ipc_Data_Update Ipc_Data_Update; 222typedef struct _Ipc_Data_Update Ipc_Data_Update;
223typedef struct _Ipc_Data_Profile Ipc_Data_Profile;
221typedef struct _Ipc_Data_Ev_Mouse_In Ipc_Data_Ev_Mouse_In; 224typedef struct _Ipc_Data_Ev_Mouse_In Ipc_Data_Ev_Mouse_In;
222typedef struct _Ipc_Data_Ev_Mouse_Out Ipc_Data_Ev_Mouse_Out; 225typedef struct _Ipc_Data_Ev_Mouse_Out Ipc_Data_Ev_Mouse_Out;
223typedef struct _Ipc_Data_Ev_Mouse_Up Ipc_Data_Ev_Mouse_Up; 226typedef struct _Ipc_Data_Ev_Mouse_Up Ipc_Data_Ev_Mouse_Up;
@@ -241,6 +244,11 @@ struct _Ipc_Data_Update
241 int x, w, y, h; 244 int x, w, y, h;
242}; 245};
243 246
247struct _Ipc_Data_Profile
248{
249 const char *name;
250};
251
244struct _Ipc_Data_Ev_Mouse_In 252struct _Ipc_Data_Ev_Mouse_In
245{ 253{
246 unsigned int timestamp; 254 unsigned int timestamp;
@@ -368,6 +376,9 @@ struct _Extn
368 Eina_Bool have_lock : 1; 376 Eina_Bool have_lock : 1;
369 Eina_Bool have_real_lock : 1; 377 Eina_Bool have_real_lock : 1;
370 } file; 378 } file;
379 struct {
380 Eina_Bool done : 1; /* need to send change done event to the client(plug) */
381 } profile;
371}; 382};
372 383
373static Eina_List *extn_ee_list = NULL; 384static Eina_List *extn_ee_list = NULL;
@@ -1136,6 +1147,49 @@ _ecore_evas_extn_cb_hide(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_
1136 ecore_ipc_server_send(extn->ipc.server, MAJOR, OP_HIDE, 0, 0, 0, NULL, 0); 1147 ecore_ipc_server_send(extn->ipc.server, MAJOR, OP_HIDE, 0, 0, 0, NULL, 0);
1137} 1148}
1138 1149
1150static void
1151_ecore_evas_extn_plug_profile_set(Ecore_Evas *ee, const char *profile)
1152{
1153 Extn *extn;
1154
1155 _ecore_evas_window_profile_free(ee);
1156 ee->prop.profile.name = NULL;
1157
1158 extn = ee->engine.buffer.data;
1159 if (!extn) return;
1160
1161 if (profile)
1162 {
1163 ee->prop.profile.name = (char *)eina_stringshare_add(profile);
1164 if (extn->ipc.server)
1165 {
1166 Ipc_Data_Profile *ipc;
1167 char *st, *p;
1168 int len = 0;
1169
1170 len += sizeof(Ipc_Data_Profile);
1171 len += strlen(ee->prop.profile.name) + 1;
1172 len += 1;
1173
1174 st = alloca(len);
1175 ipc = (Ipc_Data_Profile *)st;
1176 memset(st, 0, len);
1177 p = st + sizeof(Ipc_Data_Profile);
1178
1179 strcpy(p, ee->prop.profile.name);
1180 ipc->name = p - (long)st;
1181 p += strlen(p) + 1;
1182
1183 /* send window profile change request to the server(socket)
1184 * and wait for profile change done from the server
1185 */
1186 ecore_ipc_server_send(extn->ipc.server, MAJOR,
1187 OP_PROFILE_CHANGE_REQUEST,
1188 0, 0, 0, ipc, len);
1189 }
1190 }
1191}
1192
1139static const Ecore_Evas_Engine_Func _ecore_extn_plug_engine_func = 1193static const Ecore_Evas_Engine_Func _ecore_extn_plug_engine_func =
1140{ 1194{
1141 _ecore_evas_extn_free, 1195 _ecore_evas_extn_free,
@@ -1185,6 +1239,7 @@ static const Ecore_Evas_Engine_Func _ecore_extn_plug_engine_func =
1185 NULL, 1239 NULL,
1186 NULL, //transparent 1240 NULL, //transparent
1187 NULL, // profiles_set 1241 NULL, // profiles_set
1242 _ecore_evas_extn_plug_profile_set,
1188 NULL, 1243 NULL,
1189 NULL, 1244 NULL,
1190 NULL, 1245 NULL,
@@ -1363,6 +1418,10 @@ _ipc_server_data(void *data, int type EINA_UNUSED, void *event)
1363 _ecore_evas_resize(ee, ipc->w, ipc->h); 1418 _ecore_evas_resize(ee, ipc->w, ipc->h);
1364 } 1419 }
1365 break; 1420 break;
1421 case OP_PROFILE_CHANGE_DONE:
1422 /* profile change finished being sent - done now. */
1423 /* do something here */
1424 break;
1366 default: 1425 default:
1367 break; 1426 break;
1368 } 1427 }
@@ -1414,6 +1473,7 @@ ecore_evas_extn_plug_new(Ecore_Evas *ee_target)
1414 ee->h = h; 1473 ee->h = h;
1415 ee->req.w = ee->w; 1474 ee->req.w = ee->w;
1416 ee->req.h = ee->h; 1475 ee->req.h = ee->h;
1476 ee->profile_supported = 1;
1417 1477
1418 ee->prop.max.w = 0; 1478 ee->prop.max.w = 0;
1419 ee->prop.max.h = 0; 1479 ee->prop.max.h = 0;
@@ -1657,6 +1717,40 @@ _ecore_evas_socket_move_resize(Ecore_Evas *ee, int x EINA_UNUSED, int y EINA_UNU
1657 _ecore_evas_socket_resize(ee, w, h); 1717 _ecore_evas_socket_resize(ee, w, h);
1658} 1718}
1659 1719
1720static void
1721_ecore_evas_extn_socket_window_profile_change_done_send(Ecore_Evas *ee)
1722{
1723 Extn *extn;
1724 Ecore_Ipc_Client *client;
1725 Eina_List *l = NULL;
1726 Ipc_Data_Profile *ipc;
1727 char *st, *p;
1728 int len = 0;
1729
1730 extn = ee->engine.buffer.data;
1731 if (!extn) return;
1732
1733 len += sizeof(Ipc_Data_Profile);
1734 len += strlen(ee->prop.profile.name) + 1;
1735 len += 1;
1736
1737 st = alloca(len);
1738 ipc = (Ipc_Data_Profile *)st;
1739 memset(st, 0, len);
1740 p = st + sizeof(Ipc_Data_Profile);
1741
1742 strcpy(p, ee->prop.profile.name);
1743 ipc->name = p - (long)st;
1744 p += strlen(p) + 1;
1745
1746 EINA_LIST_FOREACH(extn->ipc.clients, l, client)
1747 {
1748 ecore_ipc_client_send(client, MAJOR,
1749 OP_PROFILE_CHANGE_DONE,
1750 0, 0, 0, ipc, len);
1751 }
1752}
1753
1660int 1754int
1661_ecore_evas_extn_socket_render(Ecore_Evas *ee) 1755_ecore_evas_extn_socket_render(Ecore_Evas *ee)
1662{ 1756{
@@ -1702,6 +1796,11 @@ _ecore_evas_extn_socket_render(Ecore_Evas *ee)
1702 _ecore_evas_idle_timeout_update(ee); 1796 _ecore_evas_idle_timeout_update(ee);
1703 EINA_LIST_FOREACH(extn->ipc.clients, ll, client) 1797 EINA_LIST_FOREACH(extn->ipc.clients, ll, client)
1704 ecore_ipc_client_send(client, MAJOR, OP_UPDATE_DONE, 0, 0, 0, NULL, 0); 1798 ecore_ipc_client_send(client, MAJOR, OP_UPDATE_DONE, 0, 0, 0, NULL, 0);
1799 if (extn->profile.done)
1800 {
1801 _ecore_evas_extn_socket_window_profile_change_done_send(ee);
1802 extn->profile.done = EINA_FALSE;
1803 }
1705 } 1804 }
1706 1805
1707 if (ee->func.fn_post_render) ee->func.fn_post_render(ee); 1806 if (ee->func.fn_post_render) ee->func.fn_post_render(ee);
@@ -1995,6 +2094,27 @@ _ipc_client_data(void *data, int type EINA_UNUSED, void *event)
1995 evas_event_default_flags_set(ee->evas, flags); 2094 evas_event_default_flags_set(ee->evas, flags);
1996 } 2095 }
1997 break; 2096 break;
2097 case OP_PROFILE_CHANGE_REQUEST:
2098 if (e->size >= (int)sizeof(Ipc_Data_Profile))
2099 {
2100 if ((e->data) && (e->size > 0) &&
2101 (((unsigned char *)e->data)[e->size - 1] == 0))
2102 {
2103 Ipc_Data_Profile *ipc = e->data;
2104 STRGET(name);
2105 if (ipc->name)
2106 {
2107 _ecore_evas_window_profile_free(ee);
2108 ee->prop.profile.name = (char *)eina_stringshare_add(ipc->name);
2109
2110 if (ee->func.fn_state_change)
2111 ee->func.fn_state_change(ee);
2112
2113 extn->profile.done = EINA_TRUE;
2114 }
2115 }
2116 }
2117 break;
1998 default: 2118 default:
1999 break; 2119 break;
2000 } 2120 }
@@ -2034,6 +2154,43 @@ _ecore_evas_extn_socket_alpha_set(Ecore_Evas *ee, int alpha)
2034 } 2154 }
2035} 2155}
2036 2156
2157static void
2158_ecore_evas_extn_socket_profile_set(Ecore_Evas *ee, const char *profile)
2159{
2160 _ecore_evas_window_profile_free(ee);
2161 ee->prop.profile.name = NULL;
2162
2163 if (profile)
2164 {
2165 ee->prop.profile.name = (char *)eina_stringshare_add(profile);
2166
2167 if (ee->func.fn_state_change)
2168 ee->func.fn_state_change(ee);
2169 }
2170}
2171
2172static void
2173_ecore_evas_extn_socket_available_profiles_set(Ecore_Evas *ee, const char **plist, int n)
2174{
2175 int i;
2176 _ecore_evas_window_available_profiles_free(ee);
2177 ee->prop.profile.available_list = NULL;
2178
2179 if ((plist) && (n >= 1))
2180 {
2181 ee->prop.profile.available_list = calloc(n, sizeof(char *));
2182 if (ee->prop.profile.available_list)
2183 {
2184 for (i = 0; i < n; i++)
2185 ee->prop.profile.available_list[i] = (char *)eina_stringshare_add(plist[i]);
2186 ee->prop.profile.count = n;
2187
2188 if (ee->func.fn_state_change)
2189 ee->func.fn_state_change(ee);
2190 }
2191 }
2192}
2193
2037static const Ecore_Evas_Engine_Func _ecore_extn_socket_engine_func = 2194static const Ecore_Evas_Engine_Func _ecore_extn_socket_engine_func =
2038{ 2195{
2039 _ecore_evas_extn_free, 2196 _ecore_evas_extn_free,
@@ -2082,7 +2239,8 @@ static const Ecore_Evas_Engine_Func _ecore_extn_socket_engine_func =
2082 NULL, 2239 NULL,
2083 _ecore_evas_extn_socket_alpha_set, 2240 _ecore_evas_extn_socket_alpha_set,
2084 NULL, //transparent 2241 NULL, //transparent
2085 NULL, // profiles_set 2242 _ecore_evas_extn_socket_available_profiles_set,
2243 _ecore_evas_extn_socket_profile_set,
2086 2244
2087 NULL, 2245 NULL,
2088 NULL, 2246 NULL,
@@ -2123,6 +2281,7 @@ ecore_evas_extn_socket_new(int w, int h)
2123 ee->h = h; 2281 ee->h = h;
2124 ee->req.w = ee->w; 2282 ee->req.w = ee->w;
2125 ee->req.h = ee->h; 2283 ee->req.h = ee->h;
2284 ee->profile_supported = 1; /* to accept the profile change request from the client(plug) */
2126 2285
2127 ee->prop.max.w = 0; 2286 ee->prop.max.w = 0;
2128 ee->prop.max.h = 0; 2287 ee->prop.max.h = 0;
diff --git a/src/lib/ecore_evas/ecore_evas_fb.c b/src/lib/ecore_evas/ecore_evas_fb.c
index 0f98e62d06..8b36e8b825 100644
--- a/src/lib/ecore_evas/ecore_evas_fb.c
+++ b/src/lib/ecore_evas/ecore_evas_fb.c
@@ -552,6 +552,7 @@ static Ecore_Evas_Engine_Func _ecore_fb_engine_func =
552 NULL, 552 NULL,
553 NULL, //transparent 553 NULL, //transparent
554 NULL, // profiles_set 554 NULL, // profiles_set
555 NULL, // profile_set
555 556
556 NULL, 557 NULL,
557 NULL, 558 NULL,
diff --git a/src/lib/ecore_evas/ecore_evas_private.h b/src/lib/ecore_evas/ecore_evas_private.h
index 0c7b03043d..2d9cb016b8 100644
--- a/src/lib/ecore_evas/ecore_evas_private.h
+++ b/src/lib/ecore_evas/ecore_evas_private.h
@@ -163,7 +163,8 @@ struct _Ecore_Evas_Engine_Func
163 void (*fn_ignore_events_set) (Ecore_Evas *ee, int ignore); 163 void (*fn_ignore_events_set) (Ecore_Evas *ee, int ignore);
164 void (*fn_alpha_set) (Ecore_Evas *ee, int alpha); 164 void (*fn_alpha_set) (Ecore_Evas *ee, int alpha);
165 void (*fn_transparent_set) (Ecore_Evas *ee, int transparent); 165 void (*fn_transparent_set) (Ecore_Evas *ee, int transparent);
166 void (*fn_profiles_set) (Ecore_Evas *ee, const char **profiles, int num_profiles); 166 void (*fn_profiles_set) (Ecore_Evas *ee, const char **profiles, int count);
167 void (*fn_profile_set) (Ecore_Evas *ee, const char *profile);
167 168
168 void (*fn_window_group_set) (Ecore_Evas *ee, const Ecore_Evas *ee_group); 169 void (*fn_window_group_set) (Ecore_Evas *ee, const Ecore_Evas *ee_group);
169 void (*fn_aspect_set) (Ecore_Evas *ee, double aspect); 170 void (*fn_aspect_set) (Ecore_Evas *ee, double aspect);
@@ -218,6 +219,11 @@ struct _Ecore_Evas_Engine
218 unsigned char above : 1; 219 unsigned char above : 1;
219 unsigned char below : 1; 220 unsigned char below : 1;
220 } state; 221 } state;
222 struct {
223 unsigned char available : 1; // need to setup available profiles in a window
224 unsigned char change : 1; // need to send change event to the WM
225 unsigned char done : 1; // need to send change done event to the WM
226 } profile;
221 Ecore_X_Window win_shaped_input; 227 Ecore_X_Window win_shaped_input;
222 } x; 228 } x;
223#endif 229#endif
@@ -310,7 +316,11 @@ struct _Ecore_Evas
310 char *title; 316 char *title;
311 char *name; 317 char *name;
312 char *clas; 318 char *clas;
313 char *profile; 319 struct {
320 char *name;
321 char **available_list;
322 int count;
323 } profile;
314 struct { 324 struct {
315 int w, h; 325 int w, h;
316 } min, 326 } min,
@@ -378,6 +388,7 @@ struct _Ecore_Evas
378 unsigned char semi_sync : 1; 388 unsigned char semi_sync : 1;
379 unsigned char deleted : 1; 389 unsigned char deleted : 1;
380 int gl_sync_draw_done; // added by gl77.lee 390 int gl_sync_draw_done; // added by gl77.lee
391 unsigned char profile_supported : 1;
381}; 392};
382 393
383void _ecore_evas_ref(Ecore_Evas *ee); 394void _ecore_evas_ref(Ecore_Evas *ee);
@@ -487,4 +498,18 @@ extern Eina_Bool _ecore_evas_app_comp_sync;
487void _ecore_evas_extn_init(void); 498void _ecore_evas_extn_init(void);
488void _ecore_evas_extn_shutdown(void); 499void _ecore_evas_extn_shutdown(void);
489 500
501/**
502 * @brief Free the string of the window profile.
503 *
504 * This is a helper function to free window profile.
505 */
506void _ecore_evas_window_profile_free(Ecore_Evas *ee);
507
508/**
509 * @brief Free the string array of available window profiles.
510 *
511 * This is a helper function to free available window profiles.
512 */
513void _ecore_evas_window_available_profiles_free(Ecore_Evas *ee);
514
490#endif 515#endif
diff --git a/src/lib/ecore_evas/ecore_evas_psl1ght.c b/src/lib/ecore_evas/ecore_evas_psl1ght.c
index 35252a3703..c9f62e4702 100644
--- a/src/lib/ecore_evas/ecore_evas_psl1ght.c
+++ b/src/lib/ecore_evas/ecore_evas_psl1ght.c
@@ -396,6 +396,7 @@ static Ecore_Evas_Engine_Func _ecore_psl1ght_engine_func =
396 NULL, 396 NULL,
397 NULL, //transparent 397 NULL, //transparent
398 NULL, // profiles_set 398 NULL, // profiles_set
399 NULL, // profile_set
399 400
400 NULL, 401 NULL,
401 NULL, 402 NULL,
diff --git a/src/lib/ecore_evas/ecore_evas_sdl.c b/src/lib/ecore_evas/ecore_evas_sdl.c
index 90b348ef2c..e609b1a60f 100644
--- a/src/lib/ecore_evas/ecore_evas_sdl.c
+++ b/src/lib/ecore_evas/ecore_evas_sdl.c
@@ -438,6 +438,7 @@ static Ecore_Evas_Engine_Func _ecore_sdl_engine_func =
438 NULL, 438 NULL,
439 NULL, //transparent 439 NULL, //transparent
440 NULL, // profiles_set 440 NULL, // profiles_set
441 NULL, // profile_set
441 442
442 NULL, 443 NULL,
443 NULL, 444 NULL,
diff --git a/src/lib/ecore_evas/ecore_evas_wayland_egl.c b/src/lib/ecore_evas/ecore_evas_wayland_egl.c
index ed176e8b6e..61d0f89e35 100644
--- a/src/lib/ecore_evas/ecore_evas_wayland_egl.c
+++ b/src/lib/ecore_evas/ecore_evas_wayland_egl.c
@@ -85,6 +85,7 @@ static Ecore_Evas_Engine_Func _ecore_wl_engine_func =
85 _ecore_evas_wl_alpha_set, 85 _ecore_evas_wl_alpha_set,
86 _ecore_evas_wl_transparent_set, 86 _ecore_evas_wl_transparent_set,
87 NULL, // func profiles set 87 NULL, // func profiles set
88 NULL, // func profile set
88 NULL, // window group set 89 NULL, // window group set
89 NULL, // aspect set 90 NULL, // aspect set
90 NULL, // urgent set 91 NULL, // urgent set
diff --git a/src/lib/ecore_evas/ecore_evas_wayland_shm.c b/src/lib/ecore_evas/ecore_evas_wayland_shm.c
index 24e349534a..470ac6ddda 100644
--- a/src/lib/ecore_evas/ecore_evas_wayland_shm.c
+++ b/src/lib/ecore_evas/ecore_evas_wayland_shm.c
@@ -101,6 +101,7 @@ static Ecore_Evas_Engine_Func _ecore_wl_engine_func =
101 _ecore_evas_wl_alpha_set, 101 _ecore_evas_wl_alpha_set,
102 _ecore_evas_wl_transparent_set, 102 _ecore_evas_wl_transparent_set,
103 NULL, // func profiles set 103 NULL, // func profiles set
104 NULL, // func profile set
104 NULL, // window group set 105 NULL, // window group set
105 NULL, // aspect set 106 NULL, // aspect set
106 NULL, // urgent set 107 NULL, // urgent set
diff --git a/src/lib/ecore_evas/ecore_evas_win32.c b/src/lib/ecore_evas/ecore_evas_win32.c
index 32ecc46de4..4a2eff7f4f 100644
--- a/src/lib/ecore_evas/ecore_evas_win32.c
+++ b/src/lib/ecore_evas/ecore_evas_win32.c
@@ -1111,6 +1111,7 @@ static Ecore_Evas_Engine_Func _ecore_win32_engine_func =
1111 _ecore_evas_win32_alpha_set, 1111 _ecore_evas_win32_alpha_set,
1112 NULL, //transparent 1112 NULL, //transparent
1113 NULL, // profiles_set 1113 NULL, // profiles_set
1114 NULL, // profile_set
1114 1115
1115 NULL, 1116 NULL,
1116 NULL, 1117 NULL,
diff --git a/src/lib/ecore_evas/ecore_evas_x.c b/src/lib/ecore_evas/ecore_evas_x.c
index d94f055319..4608d56860 100644
--- a/src/lib/ecore_evas/ecore_evas_x.c
+++ b/src/lib/ecore_evas/ecore_evas_x.c
@@ -133,6 +133,63 @@ _ecore_evas_x_sync_clear(Ecore_Evas *ee)
133 ee->engine.x.sync_counter = 0; 133 ee->engine.x.sync_counter = 0;
134} 134}
135 135
136static void
137_ecore_evas_x_window_profile_protocol_set(Ecore_Evas *ee)
138{
139 /* check and set profile protocol hint */
140 if (ecore_x_e_window_profile_supported_get(ee->engine.x.win_root))
141 {
142 unsigned int v = 1;
143 ecore_x_window_prop_card32_set
144 (ee->prop.window,
145 ECORE_X_ATOM_E_WINDOW_PROFILE_SUPPORTED,
146 &v, 1);
147
148 ee->profile_supported = 1;
149 }
150 else
151 ee->profile_supported = 0;
152}
153
154static void
155_ecore_evas_x_window_profile_set(Ecore_Evas *ee)
156{
157 if (((ee->should_be_visible) || (ee->visible)) &&
158 (ee->profile_supported))
159 {
160 if (ee->engine.x.profile.available)
161 {
162 ecore_x_e_window_available_profiles_set
163 (ee->prop.window,
164 (const char **)ee->prop.profile.available_list,
165 (const int)ee->prop.profile.count);
166
167 ee->engine.x.profile.available = 0;
168 }
169
170 if (ee->engine.x.profile.change)
171 {
172 if (ee->prop.profile.name)
173 {
174 /* We need to keep the profile as an x property to let the WM.
175 * Then the WM reads it when creating the border window.
176 */
177 Ecore_X_Atom a = ecore_x_atom_get(ee->prop.profile.name);
178 ecore_x_window_prop_atom_set
179 (ee->prop.window,
180 ECORE_X_ATOM_E_WINDOW_PROFILE_CHANGE,
181 &a, 1);
182
183 ecore_x_e_window_profile_change_send
184 (ee->engine.x.win_root,
185 ee->prop.window,
186 ee->prop.profile.name);
187 }
188 ee->engine.x.profile.change = 0;
189 }
190 }
191}
192
136# ifdef BUILD_ECORE_EVAS_OPENGL_X11 193# ifdef BUILD_ECORE_EVAS_OPENGL_X11
137static Ecore_X_Window 194static Ecore_X_Window
138_ecore_evas_x_gl_window_new(Ecore_Evas *ee, Ecore_X_Window parent, int x, int y, int w, int h, int override, int argb, const int *opt) 195_ecore_evas_x_gl_window_new(Ecore_Evas *ee, Ecore_X_Window parent, int x, int y, int w, int h, int override, int argb, const int *opt)
@@ -650,34 +707,6 @@ _ecore_evas_x_event_property_change(void *data EINA_UNUSED, int type EINA_UNUSED
650 break; 707 break;
651 } 708 }
652 } 709 }
653 else if (e->atom == ECORE_X_ATOM_E_PROFILE)
654 {
655 char *p = ecore_x_e_window_profile_get(e->win);
656 if ((p) && (ee->prop.profile))
657 {
658 if (strcmp(p, ee->prop.profile) != 0)
659 {
660 free(ee->prop.profile);
661 ee->prop.profile = strdup(p);
662 state_change = 1;
663 }
664 }
665 else if ((!p) && (ee->prop.profile))
666 {
667 free(ee->prop.profile);
668 ee->prop.profile = NULL;
669 state_change = 1;
670 }
671 else if ((p) && (!ee->prop.profile))
672 {
673 ee->prop.profile = strdup(p);
674 state_change = 1;
675 }
676
677 if (p)
678 free(p);
679 }
680
681 if (state_change) 710 if (state_change)
682 { 711 {
683 if (ee->func.fn_state_change) ee->func.fn_state_change(ee); 712 if (ee->func.fn_state_change) ee->func.fn_state_change(ee);
@@ -757,6 +786,29 @@ _ecore_evas_x_event_client_message(void *data EINA_UNUSED, int type EINA_UNUSED,
757 ee->engine.x.netwm_sync_val_hi = (int)e->data.l[3]; 786 ee->engine.x.netwm_sync_val_hi = (int)e->data.l[3];
758 ee->engine.x.netwm_sync_set = 1; 787 ee->engine.x.netwm_sync_set = 1;
759 } 788 }
789 else if ((e->message_type == ECORE_X_ATOM_E_WINDOW_PROFILE_CHANGE_REQUEST))
790 {
791 ee = ecore_event_window_match(e->win);
792 if (!ee) return ECORE_CALLBACK_PASS_ON; /* pass on event */
793 if (ee->profile_supported)
794 {
795 char *p = ecore_x_atom_name_get(e->data.l[1]);
796 if (p)
797 {
798 _ecore_evas_window_profile_free(ee);
799 ee->prop.profile.name = (char *)eina_stringshare_add(p);
800
801 /* window profiles of each sub_ecore_evas will be changed
802 * in fn_state_change callback.
803 */
804 if (ee->func.fn_state_change)
805 ee->func.fn_state_change(ee);
806
807 ee->engine.x.profile.done = 1;
808 free(p);
809 }
810 }
811 }
760 return ECORE_CALLBACK_PASS_ON; 812 return ECORE_CALLBACK_PASS_ON;
761} 813}
762 814
@@ -1879,6 +1931,7 @@ _ecore_evas_x_alpha_set(Ecore_Evas *ee, int alpha)
1879 _ecore_evas_x_group_leader_update(ee); 1931 _ecore_evas_x_group_leader_update(ee);
1880 ecore_x_window_defaults_set(ee->prop.window); 1932 ecore_x_window_defaults_set(ee->prop.window);
1881 _ecore_evas_x_protocols_set(ee); 1933 _ecore_evas_x_protocols_set(ee);
1934 _ecore_evas_x_window_profile_protocol_set(ee);
1882 _ecore_evas_x_sync_set(ee); 1935 _ecore_evas_x_sync_set(ee);
1883 _ecore_evas_x_size_pos_hints_update(ee); 1936 _ecore_evas_x_size_pos_hints_update(ee);
1884#endif /* BUILD_ECORE_EVAS_SOFTWARE_X11 */ 1937#endif /* BUILD_ECORE_EVAS_SOFTWARE_X11 */
@@ -1999,6 +2052,7 @@ _ecore_evas_x_alpha_set(Ecore_Evas *ee, int alpha)
1999 _ecore_evas_x_group_leader_update(ee); 2052 _ecore_evas_x_group_leader_update(ee);
2000 ecore_x_window_defaults_set(ee->prop.window); 2053 ecore_x_window_defaults_set(ee->prop.window);
2001 _ecore_evas_x_protocols_set(ee); 2054 _ecore_evas_x_protocols_set(ee);
2055 _ecore_evas_x_window_profile_protocol_set(ee);
2002 _ecore_evas_x_sync_set(ee); 2056 _ecore_evas_x_sync_set(ee);
2003 _ecore_evas_x_size_pos_hints_update(ee); 2057 _ecore_evas_x_size_pos_hints_update(ee);
2004#endif /* BUILD_ECORE_EVAS_OPENGL_X11 */ 2058#endif /* BUILD_ECORE_EVAS_OPENGL_X11 */
@@ -2128,6 +2182,7 @@ _ecore_evas_x_show(Ecore_Evas *ee)
2128 if (ee->prop.avoid_damage) 2182 if (ee->prop.avoid_damage)
2129 _ecore_evas_x_render(ee); 2183 _ecore_evas_x_render(ee);
2130 _ecore_evas_x_sync_set(ee); 2184 _ecore_evas_x_sync_set(ee);
2185 _ecore_evas_x_window_profile_set(ee);
2131 ecore_x_window_show(ee->prop.window); 2186 ecore_x_window_show(ee->prop.window);
2132 if (ee->prop.fullscreen) 2187 if (ee->prop.fullscreen)
2133 ecore_x_window_focus(ee->prop.window); 2188 ecore_x_window_focus(ee->prop.window);
@@ -2436,10 +2491,36 @@ _ecore_evas_x_fullscreen_set(Ecore_Evas *ee, int on)
2436} 2491}
2437 2492
2438static void 2493static void
2494_ecore_evas_x_profile_set(Ecore_Evas *ee, const char *profile)
2495{
2496 _ecore_evas_window_profile_free(ee);
2497 ee->prop.profile.name = NULL;
2498
2499 if (profile)
2500 ee->prop.profile.name = (char *)eina_stringshare_add(profile);
2501 ee->engine.x.profile.change = 1;
2502 _ecore_evas_x_window_profile_set(ee);
2503}
2504
2505static void
2439_ecore_evas_x_profiles_set(Ecore_Evas *ee, const char **plist, int n) 2506_ecore_evas_x_profiles_set(Ecore_Evas *ee, const char **plist, int n)
2440{ 2507{
2441 /* Ecore_Evas's profile will be updated when WM sets the E_PROFILE. */ 2508 int i;
2442 ecore_x_e_window_profile_list_set(ee->prop.window, plist, n); 2509 _ecore_evas_window_available_profiles_free(ee);
2510 ee->prop.profile.available_list = NULL;
2511
2512 if ((plist) && (n >= 1))
2513 {
2514 ee->prop.profile.available_list = calloc(n, sizeof(char *));
2515 if (ee->prop.profile.available_list)
2516 {
2517 for (i = 0; i < n; i++)
2518 ee->prop.profile.available_list[i] = (char *)eina_stringshare_add(plist[i]);
2519 ee->prop.profile.count = n;
2520 }
2521 }
2522 ee->engine.x.profile.available = 1;
2523 _ecore_evas_x_window_profile_set(ee);
2443} 2524}
2444 2525
2445static void 2526static void
@@ -2648,6 +2729,7 @@ static Ecore_Evas_Engine_Func _ecore_x_engine_func =
2648 _ecore_evas_x_alpha_set, 2729 _ecore_evas_x_alpha_set,
2649 _ecore_evas_x_transparent_set, 2730 _ecore_evas_x_transparent_set,
2650 _ecore_evas_x_profiles_set, 2731 _ecore_evas_x_profiles_set,
2732 _ecore_evas_x_profile_set,
2651 2733
2652 _ecore_evas_x_window_group_set, 2734 _ecore_evas_x_window_group_set,
2653 _ecore_evas_x_aspect_set, 2735 _ecore_evas_x_aspect_set,
@@ -2717,6 +2799,12 @@ _ecore_evas_x_flush_post(void *data, Evas *e EINA_UNUSED, void *event_info EINA_
2717 ee->engine.x.netwm_sync_val_lo); 2799 ee->engine.x.netwm_sync_val_lo);
2718 ee->engine.x.netwm_sync_set = 0; 2800 ee->engine.x.netwm_sync_set = 0;
2719 } 2801 }
2802 if (ee->engine.x.profile.done)
2803 {
2804 ecore_x_e_window_profile_change_done_send
2805 (ee->engine.x.win_root, ee->prop.window,ee->prop.profile.name);
2806 ee->engine.x.profile.done = 0;
2807 }
2720} 2808}
2721#endif 2809#endif
2722 2810
@@ -2898,6 +2986,7 @@ ecore_evas_software_x11_new(const char *disp_name, Ecore_X_Window parent,
2898 _ecore_evas_x_group_leader_set(ee); 2986 _ecore_evas_x_group_leader_set(ee);
2899 ecore_x_window_defaults_set(ee->prop.window); 2987 ecore_x_window_defaults_set(ee->prop.window);
2900 _ecore_evas_x_protocols_set(ee); 2988 _ecore_evas_x_protocols_set(ee);
2989 _ecore_evas_x_window_profile_protocol_set(ee);
2901 _ecore_evas_x_sync_set(ee); 2990 _ecore_evas_x_sync_set(ee);
2902 2991
2903 ee->engine.func->fn_render = _ecore_evas_x_render; 2992 ee->engine.func->fn_render = _ecore_evas_x_render;
@@ -3147,6 +3236,7 @@ ecore_evas_gl_x11_options_new(const char *disp_name, Ecore_X_Window parent,
3147 _ecore_evas_x_group_leader_set(ee); 3236 _ecore_evas_x_group_leader_set(ee);
3148 ecore_x_window_defaults_set(ee->prop.window); 3237 ecore_x_window_defaults_set(ee->prop.window);
3149 _ecore_evas_x_protocols_set(ee); 3238 _ecore_evas_x_protocols_set(ee);
3239 _ecore_evas_x_window_profile_protocol_set(ee);
3150 _ecore_evas_x_sync_set(ee); 3240 _ecore_evas_x_sync_set(ee);
3151 3241
3152 ee->engine.func->fn_render = _ecore_evas_x_render; 3242 ee->engine.func->fn_render = _ecore_evas_x_render;