windowing/windowserver/nga/SERVER/EVENT.CPP
changeset 110 7f25ef56562d
parent 0 5d03bc08d59c
child 152 9f1c3fea0f87
--- a/windowing/windowserver/nga/SERVER/EVENT.CPP	Fri Jun 11 14:58:47 2010 +0300
+++ b/windowing/windowserver/nga/SERVER/EVENT.CPP	Wed Jun 23 19:41:15 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 1994-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1994-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -32,6 +32,7 @@
 #include "pointer.h"
 #include "debugbar.h"
 #include "advancedpointereventhelper.h"
+#include "Graphics/wsgraphicdrawerinternal.h"
 
 GLREF_D CDebugLogBase *wsDebugLog;
 
@@ -622,6 +623,21 @@
 	TWsEvent event;
 	event.SetType(EEventDisplayChanged);
 	event.SetTimeNow();
+	
+    // fill in the handle otherwise CONE will discard the notification
+    CWsObjectIx* clientObjList = aWsClient->ObjectIndex();
+    const TWsObject* ptr=clientObjList->FirstObject();
+    const TWsObject* end=ptr+clientObjList->Length();
+    while(++ptr<end)    // first one should always have a NULL object
+        {
+        const CWsObject* obj=ptr->iObject;
+        if (obj && obj->Type()==WS_HANDLE_GROUP_WINDOW)
+            {
+            event.SetHandle(ptr->iHandle);
+            break;
+            }
+        }	
+	
 	TWsDisplayChangedEvent* dispEvent = event.DisplayChanged();
 	dispEvent->iDisplayNumber = aDisplayNumber;
 	dispEvent->iConfigurationChangeId = aConfigurationChangeId;
@@ -1020,7 +1036,9 @@
 		case TRawEvent::EKeyDown:
 			{
 			_LIT(KWSERVDebugLogKeyDownArrival,"Key down arrives %d");
-			if(CDebugBar* dbg = CWsTop::Screen()->DebugBar())
+			CScreen* screen = CWsTop::Screen();
+			WS_ASSERT_ALWAYS(screen, EWsPanicNoScreen);
+			if(CDebugBar* dbg = screen->DebugBar())
 				dbg->OnKeyEvent();
 			if (wsDebugLog)
 				wsDebugLog->MiscMessage(CDebugLogBase::ELogEverything,KWSERVDebugLogKeyDownArrival,aRawEvent.ScanCode());
@@ -1036,7 +1054,9 @@
 		case TRawEvent::EKeyUp:
 			{
 			_LIT(KWSERVDebugLogKeyUpArrival,"Key up arrives %d");
-			if(CDebugBar* dbg = CWsTop::Screen()->DebugBar())
+			CScreen* screen = CWsTop::Screen();
+			WS_ASSERT_ALWAYS(screen, EWsPanicNoScreen);
+			if(CDebugBar* dbg = screen->DebugBar())
 				dbg->OnKeyEvent();
 			if (wsDebugLog)
 				wsDebugLog->MiscMessage(CDebugLogBase::ELogEverything,KWSERVDebugLogKeyUpArrival,aRawEvent.ScanCode());