Not logged inGosu Forums
Forum back to libgosu.org Help Search Register Login
Up Topic Gosu / Gosu Exchange / Window::needsCursor is not working
- - By TheOm3ga Date 2011-02-04 14:57
Hi.

Looks like Window::needsCursor is not working (using Gosu 0.7.27 under Ubuntu 10.04 64bits, also tried on Ubuntu 10.10 32bits). The cursor will always show regardless of what needsCursor returns.

The solution is simple. Basically, open GosuImpl/WindowX.cpp, go to line 161, where you will find:


        if (showingCursor && !window->needsCursor())

        {

            XUndefineCursor(display, this->window);

            showingCursor = false;

        }

        else if (!showingCursor && window->needsCursor())

        {

            XDefineCursor(display, this->window, emptyCursor);

            showingCursor = true;

        }


You just have to change that for:

        if (showingCursor && !window->needsCursor())
        {
      XDefineCursor(display, this->window, emptyCursor);
            showingCursor = false;
        }
        else if (!showingCursor && window->needsCursor())
        {
      XUndefineCursor(display, this->window);
            showingCursor = true;
        }


That's it.
Parent - By Spooner Date 2011-02-04 17:15
Nice find; this has been affecting me in the Ruby version for a while (Kubuntu 10.04 x64 VM)! Not new in 0.7.27, that is.
Parent - By jlnr (dev) Date 2011-02-05 06:00
Thanks! Will give it a try in a second.
Parent - By jlnr (dev) Date 2011-02-07 07:48
Re-reading the patch, that was a pretty stupid oversight. In SVN now, hopefully out in the wild later today.
Up Topic Gosu / Gosu Exchange / Window::needsCursor is not working

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill