From ceedfbdba693127fe1a6ec944001dfc329ee1527 Mon Sep 17 00:00:00 2001 From: Jaehyun Cho Date: Thu, 27 Jun 2013 15:40:15 +0900 Subject: [PATCH] [xhandler] Fix not to activate clipboard window again if clipboard window is already activated Change-Id: I3d502b9b88e93e2f34ef2a2824c5b8d83e9b2347 --- src/xhandler.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/xhandler.c b/src/xhandler.c index 5b126b3..a4cd583 100644 --- a/src/xhandler.c +++ b/src/xhandler.c @@ -436,6 +436,7 @@ static Eina_Bool _xclient_msg_cb(void *data, int type, void *event) CALLED(); AppData *ad = data; XHandlerData *xd = ad->xhandler; + ClipdrawerData *cd = ad->clipdrawer; /* struct _Ecore_X_Event_Client_Message { Ecore_X_Window win; @@ -466,13 +467,19 @@ static Eina_Bool _xclient_msg_cb(void *data, int type, void *event) } else if (strncmp("show", ev->data.b, 4) == 0) { - ad->x_active_win = ev->win; - if (ev->data.b[4] == '1') - clipdrawer_paste_textonly_set(ad, EINA_FALSE); - else - clipdrawer_paste_textonly_set(ad, EINA_TRUE); + Ecore_X_Window zone = ecore_x_e_illume_zone_get(cd->x_main_win); + Ecore_X_Illume_Clipboard_State state = ecore_x_e_illume_clipboard_state_get(zone); - clipdrawer_activate_view(ad); + if ((state != ECORE_X_ILLUME_CLIPBOARD_STATE_ON || ad->x_active_win != ev->win)) + { + ad->x_active_win = ev->win; + if (ev->data.b[4] == '1') + clipdrawer_paste_textonly_set(ad, EINA_FALSE); + else + clipdrawer_paste_textonly_set(ad, EINA_TRUE); + + clipdrawer_activate_view(ad); + } } else if (!strcmp("cbhm_hide", ev->data.b)) { -- 2.7.4