From 1afcf06b683aa333a3f6f42af90d3a03ddeec41d Mon Sep 17 00:00:00 2001 From: rti Date: Thu, 26 May 2011 23:29:56 +0200 Subject: [PATCH] Changed: #1193 Let Qt handle events in GraphicsViewport widget as well (solves focus problem, tested on mac) --- .../src/plugins/object_viewer/graphics_viewport.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/graphics_viewport.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/graphics_viewport.cpp index c5d1ae677..93bc1043e 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/graphics_viewport.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/graphics_viewport.cpp @@ -134,6 +134,9 @@ bool CGraphicsViewport::winEvent(MSG *message, long *result) if (driver) { winProc proc = (winProc)driver->getWindowProc(); + + // TODO: shouldn't it return false like the others? + // see macEvent() and x11Event() below return proc(driver, message->hwnd, message->message, message->wParam, message->lParam); } } @@ -156,10 +159,12 @@ bool CGraphicsViewport::macEvent(EventHandlerCallRef caller, EventRef event) if (driver) { cocoaProc proc = (cocoaProc)driver->getWindowProc(); - return proc(driver, event); + proc(driver, event); } } + // return false to let Qt handle the event as well, + // else the widget would never get focus return false; } @@ -175,10 +180,13 @@ bool CGraphicsViewport::x11Event(XEvent *event) if (driver) { x11Proc proc = (x11Proc)driver->getWindowProc(); - return proc(driver, event); + proc(driver, event); } } + // return false to let Qt handle the event as well, + // else the widget would never get focus + // TODO: test me please, i have no linux at hand (rti) return false; } #endif