Dont keep track of the focus surfaces
authorJørgen Lind <jorgen.lind@nokia.com>
Mon, 9 Jan 2012 18:02:16 +0000 (19:02 +0100)
committerSamuel Rødal <samuel.rodal@nokia.com>
Tue, 10 Jan 2012 14:48:55 +0000 (15:48 +0100)
waylands-server does this for us

Change-Id: Ib9980d6023b9b80a9823162d1685ae64da5b61e0
Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
src/compositor/wayland_wrapper/wlcompositor.cpp
src/compositor/wayland_wrapper/wlcompositor.h

index 1454746..067263c 100644 (file)
@@ -112,8 +112,6 @@ Compositor::Compositor(WaylandCompositor *qt_compositor)
     , m_last_queued_buf(-1)
     , m_qt_compositor(qt_compositor)
     , m_orientation(Qt::UnknownOrientation)
-    , m_pointerFocusSurface(0)
-    , m_keyFocusSurface(0)
     , m_directRenderSurface(0)
 #if defined (QT_COMPOSITOR_WAYLAND_GL)
     , m_graphics_hw_integration(0)
@@ -258,10 +256,6 @@ void Compositor::surfaceDestroyed(Surface *surface)
 {
     m_surfaces.removeOne(surface);
     m_dirty_surfaces.remove(surface);
-    if (m_keyFocusSurface == surface)
-        setKeyFocus(0);
-    if (m_pointerFocusSurface == surface)
-        setPointerFocus(0);
     if (m_directRenderSurface == surface)
         setDirectRenderSurface(0);
 }
@@ -290,24 +284,22 @@ void Compositor::setInputFocus(Surface *surface)
 void Compositor::setKeyFocus(Surface *surface)
 {
     m_input->sendSelectionFocus(surface);
-    m_keyFocusSurface = surface;
     wl_input_device_set_keyboard_focus(m_input->base(), surface ? surface->base() : 0, currentTimeMsecs());
 }
 
 Surface *Compositor::keyFocus() const
 {
-    return m_keyFocusSurface;
+    return wayland_cast<Surface *>(m_input->base()->keyboard_focus);
 }
 
 void Compositor::setPointerFocus(Surface *surface, const QPoint &pos)
 {
-    m_pointerFocusSurface = surface;
     wl_input_device_set_pointer_focus(m_input->base(), surface ? surface->base() : 0, currentTimeMsecs(), pos.x(), pos.y(), pos.x(), pos.y());
 }
 
 Surface *Compositor::pointerFocus() const
 {
-    return m_pointerFocusSurface;
+    return wayland_cast<Surface *>(m_input->base()->pointer_focus);
 }
 
 QWindow *Compositor::window() const
index 2c22670..828df09 100644 (file)
@@ -167,8 +167,6 @@ private:
     WaylandCompositor *m_qt_compositor;
     Qt::ScreenOrientation m_orientation;
 
-    Surface *m_pointerFocusSurface;
-    Surface *m_keyFocusSurface;
     Surface *m_directRenderSurface;
 
 #ifdef QT_COMPOSITOR_WAYLAND_GL