~vanvugt/mir/handoff

« back to all changes in this revision

Viewing changes to src/server/graphics/software_cursor.cpp

  • Committer: Daniel van Vugt
  • Date: 2015-08-12 09:52:57 UTC
  • mfrom: (2798.1.41 trunk)
  • Revision ID: daniel.van.vugt@canonical.com-20150812095257-58wduov90c2mpiqs
Merge latest trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
136
136
{
137
137
    std::shared_ptr<detail::CursorRenderable> new_renderable;
138
138
    std::shared_ptr<detail::CursorRenderable> old_renderable;
139
 
 
 
139
    bool old_visibility = false;
140
140
    // Do a lock dance to make this function threadsafe,
141
141
    // while avoiding calling scene methods under lock
142
142
    {
145
145
        if (renderable)
146
146
            position = renderable->screen_position().top_left;
147
147
        new_renderable = create_renderable_for(cursor_image, position);
 
148
        old_visibility = visible;
148
149
        visible = true;
149
150
    }
150
151
 
160
161
        hotspot = cursor_image.hotspot();
161
162
    }
162
163
 
163
 
    if (old_renderable)
 
164
    if (old_renderable && old_visibility)
164
165
        scene->remove_input_visualization(old_renderable);
165
166
}
166
167