Commit: f04fd5007310bd36fa4b582e1079cdd51adf12db
Author: Brecht Van Lommel
Date:   Thu Mar 6 18:08:59 2014 +0100
https://developer.blender.org/rBf04fd5007310bd36fa4b582e1079cdd51adf12db

Fix X11 mouse cursor flickering briefly to the standard cursor when changing it.

Not very visible now but it matters for the next commit.

===================================================================

M       intern/ghost/intern/GHOST_WindowX11.cpp
M       intern/ghost/intern/GHOST_WindowX11.h

===================================================================

diff --git a/intern/ghost/intern/GHOST_WindowX11.cpp 
b/intern/ghost/intern/GHOST_WindowX11.cpp
index c32b272..29ba1ff 100644
--- a/intern/ghost/intern/GHOST_WindowX11.cpp
+++ b/intern/ghost/intern/GHOST_WindowX11.cpp
@@ -183,7 +183,8 @@ GHOST_WindowX11(
        m_valid_setup(false),
        m_invalid_window(false),
        m_empty_cursor(None),
-       m_custom_cursor(None)
+       m_custom_cursor(None),
+       m_visible_cursor(None)
 {
        
        /* Set up the minimum atrributes that we require and see if
@@ -1361,7 +1362,10 @@ setWindowCursorVisibility(
        Cursor xcursor;
        
        if (visible) {
-               xcursor = getStandardCursor(getCursorShape() );
+               if (m_visible_cursor)
+                       xcursor = m_visible_cursor;
+               else
+                       xcursor = getStandardCursor(getCursorShape() );
        }
        else {
                xcursor = getEmptyCursor();
@@ -1424,6 +1428,8 @@ setWindowCursorShape(
                GHOST_TStandardCursor shape)
 {
        Cursor xcursor = getStandardCursor(shape);
+
+       m_visible_cursor = xcursor;
        
        XDefineCursor(m_display, m_window, xcursor);
        XFlush(m_display);
@@ -1473,6 +1479,8 @@ setWindowCustomCursorShape(
        m_custom_cursor = XCreatePixmapCursor(m_display, bitmap_pix, mask_pix, 
&fg, &bg, hotX, hotY);
        XDefineCursor(m_display, m_window, m_custom_cursor);
        XFlush(m_display);
+
+       m_visible_cursor = m_custom_cursor;
        
        XFreePixmap(m_display, bitmap_pix);
        XFreePixmap(m_display, mask_pix);
diff --git a/intern/ghost/intern/GHOST_WindowX11.h 
b/intern/ghost/intern/GHOST_WindowX11.h
index 7cbdcde..afe21b0 100644
--- a/intern/ghost/intern/GHOST_WindowX11.h
+++ b/intern/ghost/intern/GHOST_WindowX11.h
@@ -373,6 +373,9 @@ private:
        
        /** XCursor structure of the custom cursor */
        Cursor m_custom_cursor;
+
+       /** XCursor to show when cursor is visible */
+       Cursor m_visible_cursor;
        
        /** Cache of XC_* ID's to XCursor structures */
        std::map<unsigned int, Cursor> m_standard_cursors;

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to