From fbeb1fca5fdb84f01f5c253abed47920a75853fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Wed, 1 Nov 2006 16:01:04 +0000 Subject: [PATCH] Notifies input_server about the focus view IM awareness when the window is (de)activated This fixes the last part of bug #658 git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19166 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/Window.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/kits/interface/Window.cpp b/src/kits/interface/Window.cpp index c52a32f3f4..5bdbccd89b 100644 --- a/src/kits/interface/Window.cpp +++ b/src/kits/interface/Window.cpp @@ -900,6 +900,19 @@ FrameMoved(origin); // call hook function 'WindowActivated(bool)' for all // views attached to this window. fTopView->_Activate(active); + + // we notify the input server if we are gaining or losing focus + // from a view which has the B_INPUT_METHOD_AWARE on a window + // (de)activation + bool inputMethodAware = false; + if (fFocus) + inputMethodAware = fFocus->Flags() & B_INPUT_METHOD_AWARE; + BMessage msg(active && inputMethodAware ? IS_FOCUS_IM_AWARE_VIEW : IS_UNFOCUS_IM_AWARE_VIEW); + BMessenger messenger(fFocus); + BMessage reply; + if (fFocus) + msg.AddMessenger("view", messenger); + _control_input_server_(&msg, &reply); } } else target->MessageReceived(msg);