[xhandler] Add _xzone_init_cb callback for initializing zone window
authorjae_hyun.cho <jae_hyun.cho@samsung.com>
Thu, 4 Apr 2013 11:33:46 +0000 (20:33 +0900)
committerSungho Kwak <sungho1.kwak@samsung.com>
Sat, 6 Apr 2013 01:25:15 +0000 (10:25 +0900)
Change-Id: Iab9e617f8fb7e670d9f84aab7716cee444404ac4

Conflicts:

packaging/cbhm.spec

packaging/cbhm.spec
src/xhandler.c

index 63d61bc..8c0e451 100644 (file)
@@ -1,7 +1,7 @@
 #sbs-git:slp/pkgs/c/cbhm cbhm 0.1.0 a67e97190313d19025925d8b9fd0aa9da3d0dc6a
 Name:       cbhm
 Summary:    cbhm application
-Version:    0.1.148r01
+Version:    0.1.149
 Release:    1
 Group:      TO_BE/FILLED_IN
 License:    APLv2
index 433659a..3a3e085 100644 (file)
@@ -702,6 +702,29 @@ static Eina_Bool _xproperty_notify_cb(void *data, int type, void *event)
        return EINA_TRUE;
 }
 
+static Eina_Bool _xzone_init_cb(void *data, int type, void *event)
+{
+       CALLED();
+       if (!data || !event) return EINA_FALSE;
+       AppData *ad = data;
+       ClipdrawerData *cd = ad->clipdrawer;
+       XHandlerData *xd = ad->xhandler;
+       Ecore_X_Event_Window_Property *pevent = (Ecore_X_Event_Window_Property *)event;
+
+       if (pevent->atom == ECORE_X_ATOM_E_ILLUME_ZONE)
+       {
+               Ecore_X_Window zone;
+               int val_len = ecore_x_window_prop_window_get(cd->x_main_win, ECORE_X_ATOM_E_ILLUME_ZONE, &zone, 1);
+               if (val_len > 0)
+               {
+                       ecore_event_handler_del(xd->xproperty_notify_handler);
+                       xd->xproperty_notify_handler = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_PROPERTY, _xproperty_notify_cb, ad);
+               }
+       }
+
+       return EINA_TRUE;
+}
+
 static Eina_Bool _xwin_destroy_cb(void *data, int type, void *event)
 {
        CALLED();
@@ -723,9 +746,14 @@ XHandlerData *init_xhandler(AppData *ad)
        xd->xsel_notify_handler = ecore_event_handler_add(ECORE_X_EVENT_SELECTION_NOTIFY, _xsel_notify_cb, ad);
        xd->xclient_msg_handler = ecore_event_handler_add(ECORE_X_EVENT_CLIENT_MESSAGE, _xclient_msg_cb, ad);
        xd->xfocus_out_handler = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_FOCUS_OUT, _xfocus_out_cb, ad);
-       xd->xproperty_notify_handler = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_PROPERTY, _xproperty_notify_cb, ad);
+       xd->xproperty_notify_handler = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_PROPERTY, _xzone_init_cb, ad);
        xd->xwindow_destroy_handler = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_DESTROY, _xwin_destroy_cb, ad);
 
+       ClipdrawerData *cd = ad->clipdrawer;
+       /* initialize zone window */
+       evas_object_show(cd->main_win);
+       evas_object_hide(cd->main_win);
+
        xd->atomInc = ecore_x_atom_get("INCR");
        xd->atomWindowRotate = ecore_x_atom_get("_E_ILLUME_ROTATE_WINDOW_ANGLE");
        xd->atomCBHM_MSG = ecore_x_atom_get("CBHM_MSG");