Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OSX] OS' mouse pointer showing #2585

Closed
DorpsGek opened this issue Jan 25, 2009 · 27 comments
Closed

[OSX] OS' mouse pointer showing #2585

DorpsGek opened this issue Jan 25, 2009 · 27 comments
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)

Comments

@DorpsGek
Copy link
Member

loupdefer opened the ticket and wrote:

I couldn't find anything about this bug, so I hope it is not already known.

I use OpenTTD r15260.
When i run the game in fullscreen with another app running in the background (such as ITunes), there's an annoying mouse pointer printing on the screen (in the upper-left corner of the screenshot). It is not here in window mode, and reappear if i switch to fullscreen. It appears either if i start in fullscreen, or in window mode and then switch to fullscreen.
Also, it doesn't occur when OpenTTD is the only app running (except for the Finder).

Hope someone can fix it.

Edit : I can't achieve to get it on a screenshot, neither with the OSX features, or through the game (takes a clean screenshot, without the bug). But as it doesn't appear with the stable version, i think it is related to the nightly.

Reported version: trunk
Operating system: Mac OS X


This issue was imported from FlySpray: https://bugs.openttd.org/task/2585
@DorpsGek
Copy link
Member Author

dihedral wrote:

which version of os x is it?


This comment was imported from FlySpray: https://bugs.openttd.org/task/2585#comment5472

@DorpsGek
Copy link
Member Author

Rubidium wrote:

20:29 < dihedral> appart from when the game is windowed but maximised, and i move the mouse down to the hidden dock and back into the game (after the dock appeared), then i have the default osx mouse on top of the openttd mouse, and i can get rid of the osx mouse my very quickly moving the mouse back down to the dock and back up again


This comment was imported from FlySpray: https://bugs.openttd.org/task/2585#comment5474

@DorpsGek
Copy link
Member Author

magu wrote:

I second this one. Tested and confirmed on nightly build r15459 and svn r15469 on a MacBook 1st gen running OS X 10.5.6.

All screenshots from fullscreen ended up black, so i snapped a photo with my phone which you can find attached.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/2585#comment5573

@DorpsGek
Copy link
Member Author

m1ss1ontomars2k4 wrote:

I don't think this is an OpenTTD-specific problem, because I get this in StarCraft as well. It happens in both games in 10.5 and 10.6 for me, with both OpenTTD 0.6.3 and r18060.


This comment was imported from FlySpray: https://bugs.openttd.org/task/2585#comment6957

@DorpsGek
Copy link
Member Author

ln wrote:

I cannot reproduce this with 10.4.11 and r18661. Can someone else?


This comment was imported from FlySpray: https://bugs.openttd.org/task/2585#comment7166

@DorpsGek
Copy link
Member Author

hoserama99 wrote:

My hunch is that this is caused by the DivX plugin, as certain versions of it have a bug where it forces the cursor visible every time QuickTime is tickled (e.g. via MoviesTask or in the OS X event loop).

Can affected users note what (if any) QuickTime plugins they have installed?


This comment was imported from FlySpray: https://bugs.openttd.org/task/2585#comment7391

@DorpsGek
Copy link
Member Author

hai wrote:

I do NOT seem to get that problem in Windowed or Fullscreen, starting in Windowed to Fullscreen, or starting in Fullscreen. My configuration is as follows
Macbook Pro 2.66Ghz Core 2
Snow Leopard 10.6.2
XCode 3.2.1 iPhone 3.1 SDK (Open TTD compiled in command line without any additional libraries installed)
At time of test the following apps were running, iTunes 9.03, Mail, Entourage, Text edit. No quicktime plugins.


This comment was imported from FlySpray: https://bugs.openttd.org/task/2585#comment7576

@DorpsGek
Copy link
Member Author

DorpsGek commented May 2, 2010

matheweis wrote:

I WAS able to reproduce the bug on a very limited basis with r19750. Built with Xcode 3.2.2 under 10.6.3. The problem occurred while unning in Windowed mode, without switching between Fullscreen. The only other applications that were running were Xcode and Terminal. I do not have any DivX plugin installed, in fact no Quicktime plugins except Flip4Mac.

I was able to reproduce the bug consistently using a method similar to what Rubidium described.


This comment was imported from FlySpray: https://bugs.openttd.org/task/2585#comment7973

@DorpsGek
Copy link
Member Author

DorpsGek commented May 3, 2010

matheweis wrote:

I took another look at this problem this afternoon, and I believe the attached patch should fully fix this problem.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/2585#comment7975

@DorpsGek
Copy link
Member Author

DorpsGek commented May 5, 2010

planetmaker wrote:

The attached patch unfortunately does not change any behaviour for me.

With 32bpp blitter I have no problem with the mouse pointer with and without patch.
With 8bpp blitter an ugly false-colour print of the mouse cursor remains on the screen where it was at the time when switching to full screen mode, both with and without patch.
Making a screenshot of that is impossible as it returns a black image.

It might be related to FS # 3198 http://bugs.openttd.org/task/3198 as I get in the console:
Wed May 5 00:15:40 aeolusreloaded openttd[866] : kCGErrorFailure: CGSColorProfileCreateWithColorSpace: Invalid ICC color space(0x101af7350)
Wed May 5 00:15:40 aeolusreloaded openttd[866] : kCGErrorFailure: Set a breakpoint @ CGErrorBreakpoint() to catch errors as they are logged.
Wed May 5 00:15:40 aeolusreloaded openttd[866] : kCGErrorCannotComplete: CGSSetWindowColorSpace: Cannot create color profile
Wed May 5 00:15:57 aeolusreloaded openttd[866] : kCGErrorFailure: CGSColorProfileCreateWithColorSpace: Invalid ICC color space(0x1163061c0)
Wed May 5 00:15:57 aeolusreloaded openttd[866] : kCGErrorCannotComplete: CGSSetWindowColorSpace: Cannot create color profile

Tested on r19734.


This comment was imported from FlySpray: https://bugs.openttd.org/task/2585#comment7983

@DorpsGek
Copy link
Member Author

DorpsGek commented May 5, 2010

matheweis wrote:

I think this bug is about two separate issues. The patch fixes this problem:
-----
20:29 < dihedral> appart from when the game is windowed but maximised, and i move the mouse down to the hidden dock and back into the game (after the dock appeared), then i have the default osx mouse on top of the openttd mouse, and i can get rid of the osx mouse my very quickly moving the mouse back down to the dock and back up again.
-----
More simply, it can be reproduced by putting OpenTTD in windowed mode, and moving it to be bottom of the screen so the dock is over it. When moving the mouse over the dock and back to OpenTTD, the OS cursor will not be hidden as it should.

As to the 8bpp issue, as described by Brad Oliver (hoserama99) in http://bugs.openttd.org/task/3194, 8bpp mode has been deprecated or altogether removed in a majority of video drivers starting since OS X 10.5. Does this bug occur in 8bpp mode under 10.4?


This comment was imported from FlySpray: https://bugs.openttd.org/task/2585#comment7985

@DorpsGek
Copy link
Member Author

DorpsGek commented May 5, 2010

matheweis wrote:

Although, it turns out the fix for the same two problems was closely related.

The legacy document found here indicates the CGDisplayHideCursor function should be used before blitting pixels to the display via CGDisplayBaseAddress: http://developer.apple.com/legacy/mac/library/technotes/tn/tn2007.html

The attached patch should fix the problem you describe, but has some problems in Windowed mode. If you can test this patch and let me know if it fixes the full-screen problem, I'll clean it up and get them both working together.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/2585#comment7986

@DorpsGek
Copy link
Member Author

DorpsGek commented May 5, 2010

planetmaker wrote:

Very nice. This 2nd version of the patch fixes also the issue with the mouse cursor on full screen with 8bpp-optimized blitter :-) and there's no double cursor either.


This comment was imported from FlySpray: https://bugs.openttd.org/task/2585#comment7987

@DorpsGek
Copy link
Member Author

DorpsGek commented May 6, 2010

matheweis wrote:

Alright, here's the final version of the patch. This one should fix both problems with no negative side-effects in either direction. The patch should be fully compatible with OS X 10.3 or later, and it does not use any deprecated APIs.
----------------------------
Ignore this patch; labeling it "final" was a poor choice - not only is it buggy, but in terms of "age", it is in between the v2 and v3 listed here.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/2585#comment7991

@DorpsGek
Copy link
Member Author

DorpsGek commented May 6, 2010

planetmaker wrote:

Something more weired goes on. I cannot reproduce my successful testing of the patch yesterday.
Of neither version :S Note though, that I don't experience a double cursor which this bug report is mainly about ;-)


This comment was imported from FlySpray: https://bugs.openttd.org/task/2585#comment7992

@DorpsGek
Copy link
Member Author

urdh wrote:

I can't reproduce this at all. OSX 10.6.4, r20110.


This comment was imported from FlySpray: https://bugs.openttd.org/task/2585#comment8296

@DorpsGek
Copy link
Member Author

DorpsGek commented Oct 8, 2010

matheweis wrote:

Please try this patch. I am about to release a test binary with this patch for users to test.

I believe this patch to offer a final solution for:
A) mouse cursor appearing/disappearing at odd times in windowed mode (particularly near the dock)

Also, as has been discussed, 8bpp mode should be formally considered deprecated and unsupported. That being said, this patch changes the cursor manipulation in full-screen mode to the fully Apple recommended method, and if this does not fix it, I have no hope that it can ever be. (I have tested this patch with blitter = 8bpp-optimized on 10.6)
So, this is I think as good a fix as we will likely get for
B) mouse flicker under full screen 8bpp mode

If the users report no problems with this patch, I would like to consider this bug closed.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/2585#comment8881

@DorpsGek
Copy link
Member Author

DorpsGek commented Oct 8, 2010

planetmaker wrote:

Right, I tested v3, v2 and 'final' again. All with 8bpp-optimized and 32bpp-anim, in windowed and full screen mode.

The 'final' version does NOT fix the mouse cursor showing twice. v2 and v3 DO fix the issue.

v2 solves the problem of the double mouse cursor fine.
v3 solves the problem of the double mouse cursor, but I do get an error in the console:
Fri Oct 8 11:43:09 aeolus openttd[96163] : Not a PNG file

I meanwhile found out more how to reproduce the mouse cursor leaving a residue when switching to full screen: it only happens if both is fulfilled: using 8bpp-optimized blitter and before switching to full screen the mouse cursor is NOT moved out of the window.

v2 does NOT change the mouse cursor residue
v3 fixes with 8bpp-optimized blitter the mouse cursor leaving an ugly residue.

Given the size of patches and that we definitely don't want additional errors, 8bpp is not supported officially on mac anyway, v2 solves THIS problem.

Note that you use a wrong style for the comments. If they're in separate lines, and not describing the function as a whole, they need to be like
/* bla blah
* blubber */

It might be worth to take v3 and use it to look into the 8bpp issue without adding this error about missing PNG.

Cheers


This comment was imported from FlySpray: https://bugs.openttd.org/task/2585#comment8884

@DorpsGek
Copy link
Member Author

DorpsGek commented Oct 8, 2010

matheweis wrote:

So just to clarify, v3 fixes BOTH issues, but creates a new issue re the PNG error? I think the PNG error can be fixed.


This comment was imported from FlySpray: https://bugs.openttd.org/task/2585#comment8891

@DorpsGek
Copy link
Member Author

matheweis wrote:

Here is a v4 of the mouse fix; should fix both problems discussed, and has no PNG error like the v3.

Can you elaborate on the comment/code style issue?

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/2585#comment8928

@DorpsGek
Copy link
Member Author

planetmaker wrote:

v4 exercises a jumping mouse cursor in conjunction with the "show all windows" function of OSX: select the OpenTTD window and see it jump when it's restored to the original window size.
EDIT: that's actually a separate issue. Also present in current trunk


This comment was imported from FlySpray: https://bugs.openttd.org/task/2585#comment8973

@DorpsGek
Copy link
Member Author

matheweis wrote:

Does that mean it looks like v4 solves both problems?


This comment was imported from FlySpray: https://bugs.openttd.org/task/2585#comment8984

@DorpsGek
Copy link
Member Author

DorpsGek commented Nov 6, 2010

planetmaker wrote:

v4 does not even compile:
trunk/src/video/cocoa/fullscreen.mm:300: error: ‘QZ_HideMouse’ was not declared in this scope


This comment was imported from FlySpray: https://bugs.openttd.org/task/2585#comment9033

@DorpsGek
Copy link
Member Author

matheweis wrote:

What are you compiling with/against? I tested it against a clean download of 1.0.4, and built on 10.6.


This comment was imported from FlySpray: https://bugs.openttd.org/task/2585#comment9055

@DorpsGek
Copy link
Member Author

planetmaker wrote:

Of course I compile trunk... that's where development happens: http://hg.openttd.org/openttd/trunk.hg/shortlog


This comment was imported from FlySpray: https://bugs.openttd.org/task/2585#comment9056

@DorpsGek
Copy link
Member Author

planetmaker closed the ticket.

Reason for closing: Implemented

In r21578.


This comment was imported from FlySpray: https://bugs.openttd.org/task/2585

@DorpsGek
Copy link
Member Author

ln wrote:

Since this fix was applied in r21578, on my Mac the system cursor has been visible together with OTTD's own one in windowed mode. (In fullscreen not.)

10.4.11


This comment was imported from FlySpray: https://bugs.openttd.org/task/2585#comment9470

@DorpsGek DorpsGek added Core flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) labels Apr 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)
Projects
None yet
Development

No branches or pull requests

1 participant