Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Mac window problems  (Read 8265 times)

0 Members and 1 Guest are viewing this topic.

Tal

  • Newbie
  • *
  • Posts: 7
    • View Profile
Mac window problems
« on: September 07, 2009, 09:42:41 pm »
Hi!

I'm having a couple of issues with the Mac build of SFML.

First, Whenever an app using OpenGL launches, the window appears, but I have to move the window myself before processing starts.

This happens with both my app and the included OpenGL tutorial.  Either a white screen, or corruption appears until I move the window around with the mouse.  It works fine after that.

I'm using OS 10.6 (Snow Leopard), and SFML 1.5.


My second issue is with creating a fullscreen window with multiple monitors  (I'm using a Macbook Pro with an external display).  It works fine if I use the current desktop resolution, but if I choose a different (lower) resolution, the primary (external) monitor changes resolutions, and the app appears superimposed over the screen on the secondary monitor -- it changes the resolution on primary, shows the borderless window on the secondary.

The third problem is a relatively minor one compared to the above two.  I want to hide the cursor on the app itself (I display a sprite cursor), but have the cursor appear outside of the window.  I've tried testing if the mouse coords are outside the window bounds (< 0 or > width/height), and I call the showCursor method to set it appropriately.  This works, but there is a 3 to 5 second delay before the cursor appears again, which is highly annoying.

Any help would be appreciated!

Tal

  • Newbie
  • *
  • Posts: 7
    • View Profile
Mac window problems
« Reply #1 on: September 08, 2009, 05:57:29 am »
The first issue turns out to be completely unrelated to SFML -- I resolved that oddity.

The other two issues remain.

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
Re: Mac window problems
« Reply #2 on: September 09, 2009, 09:40:49 pm »
Quote from: "Tal"
My second issue is with creating a fullscreen window with multiple monitors  (I'm using a Macbook Pro with an external display).  It works fine if I use the current desktop resolution, but if I choose a different (lower) resolution, the primary (external) monitor changes resolutions, and the app appears superimposed over the screen on the secondary monitor -- it changes the resolution on primary, shows the borderless window on the secondary.

Uh... I think I didn't understand everything. Your laptop's screen resolution changes, but the SFML window is shown in the external screen ?

Quote from: "Tal"
The third problem is a relatively minor one compared to the above two.  I want to hide the cursor on the app itself (I display a sprite cursor), but have the cursor appear outside of the window.  I've tried testing if the mouse coords are outside the window bounds (< 0 or > width/height), and I call the showCursor method to set it appropriately.  This works, but there is a 3 to 5 second delay before the cursor appears again, which is highly annoying.

Any help would be appreciated!

Did you try to hide/show the mouse cursor with a minimal program to make sure it is not related to something else ?
Want to play movies in your SFML application? Check out sfeMovie!

Tal

  • Newbie
  • *
  • Posts: 7
    • View Profile
Mac window problems
« Reply #3 on: September 11, 2009, 02:36:05 am »
Quote
Uh... I think I didn't understand everything. Your laptop's screen resolution changes, but the SFML window is shown in the external screen ?


Hi!

I'm sorry, that did seem a bit confusing the way I worded it.
I've got the menubar on the external monitor.  The external monitor changes resolutions, but the borderless window appears on the laptop screen.

So for instance if I try to create a fullscreen window with resolution 800x600, the external monitor switches to 800x600, while the laptop screen stays at 1440x900, and an 800x600 borderless window appears on that laptop screen.

I hope that clarifies things a bit -- again I apologize for being unclear.

Quote
Did you try to hide/show the mouse cursor with a minimal program to make sure it is not related to something else ?


I haven't -- I will try that and report back.   :)

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
Mac window problems
« Reply #4 on: September 11, 2009, 01:51:57 pm »
Quote from: "Tal"
Quote
Uh... I think I didn't understand everything. Your laptop's screen resolution changes, but the SFML window is shown in the external screen ?


Hi!

I'm sorry, that did seem a bit confusing the way I worded it.
I've got the menubar on the external monitor.  The external monitor changes resolutions, but the borderless window appears on the laptop screen.

So for instance if I try to create a fullscreen window with resolution 800x600, the external monitor switches to 800x600, while the laptop screen stays at 1440x900, and an 800x600 borderless window appears on that laptop screen.

I hope that clarifies things a bit -- again I apologize for being unclear.

That is really.. funny ! :D A few things happening on one screen and some other on the other screen ^^. I'm going to have a look at why this is happening.

Quote from: "Tal"
Quote
Did you try to hide/show the mouse cursor with a minimal program to make sure it is not related to something else ?


I haven't -- I will try that and report back.   :)
Yep, thanks !


Edit: I've been reading this for the CGMainDisplayID() function I use to choose wich screen must be used for resolution switch:
Quote
In case of hardware mirroring, the drawable display becomes the main display. In case of software mirroring, the display with the highest resolution and deepest pixel depth typically becomes the main display.

I suppose the external display is wider and considered as your main display, right ?
Want to play movies in your SFML application? Check out sfeMovie!

Tal

  • Newbie
  • *
  • Posts: 7
    • View Profile
Mac window problems
« Reply #5 on: September 12, 2009, 08:10:19 am »
Quote
I suppose the external display is wider and considered as your main display, right ?


That's right.

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
Mac window problems
« Reply #6 on: September 12, 2009, 12:56:01 pm »
Ok, I think I know how to fix this.
Want to play movies in your SFML application? Check out sfeMovie!

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
Mac window problems
« Reply #7 on: September 12, 2009, 02:15:06 pm »
Could you download the latest sources from the Subversion repository, build the SFML frameworks (trunk) and tell me if the issue is still present ?
Want to play movies in your SFML application? Check out sfeMovie!

Tal

  • Newbie
  • *
  • Posts: 7
    • View Profile
Mac window problems
« Reply #8 on: September 13, 2009, 05:32:12 am »
Sure, I'll try to do that tomorrow.

Tal

  • Newbie
  • *
  • Posts: 7
    • View Profile
Mac window problems
« Reply #9 on: September 14, 2009, 12:33:12 am »
Quote from: "Ceylo"
Could you download the latest sources from the Subversion repository, build the SFML frameworks (trunk) and tell me if the issue is still present ?


Odd;  I downloaded the latest revision from SVN and built it, but it still exhibits the same behavior.

Interestingly, this works:

sf::RenderWindow App(sf::VideoMode::GetDesktopMode(), "Some Window Title", sf::Style::Fullscreen);

However this does what I described earlier:
//sf::RenderWindow App(sf::VideoMode(800,600,32), "Some Window Title", sf::Style::Fullscreen);

This behavior hasn't changed from the stable 1.5 release and the latest SVN version;  I just thought it pertinent to point out.

Thanks for looking at this Ceylo!  I'm sorry I couldn't test it more quickly for you -- I've been quite busy recently.

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
Mac window problems
« Reply #10 on: September 19, 2009, 01:38:05 pm »
Don't worry about the answer time. You've no obligation (as I have none too).

Thanks for the notice about the desktop mode. I would like you to do some tests : could you check whether the desktop mode matches your primary or external monitor resolution ? I'm almost positive on the answer but I'd like to hear it from you.

And... as for the external display, do you think it would be better if SFML was using the biggest screen, or just kept using the primary screen ?
Want to play movies in your SFML application? Check out sfeMovie!

Tal

  • Newbie
  • *
  • Posts: 7
    • View Profile
Mac window problems
« Reply #11 on: September 22, 2009, 04:17:41 am »
Quote from: "Ceylo"
Don't worry about the answer time. You've no obligation (as I have none too).

Thanks for the notice about the desktop mode. I would like you to do some tests : could you check whether the desktop mode matches your primary or external monitor resolution ? I'm almost positive on the answer but I'd like to hear it from you.

And... as for the external display, do you think it would be better if SFML was using the biggest screen, or just kept using the primary screen ?


sf::VideoMode::GetDesktopMode() returns the video mode of the primary display, and uses the primary display.  It's only when I specify the size that strange things happen.

I would say that using the primary display (As opposed to just the largest one) would be desired, as the user can control that, and it seems to be an intuitive behavior.

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
Mac window problems
« Reply #12 on: September 22, 2009, 06:18:41 pm »
Quote from: "Tal"
sf::VideoMode::GetDesktopMode() returns the video mode of the primary display, and uses the primary display.  It's only when I specify the size that strange things happen.

Errrr... I was almost positive it would be the contrary :evil: .

Quote from: "Tal"
I would say that using the primary display (As opposed to just the largest one) would be desired, as the user can control that, and it seems to be an intuitive behavior.

Okay, I'll do so.
Want to play movies in your SFML application? Check out sfeMovie!

newguy

  • Newbie
  • *
  • Posts: 4
    • View Profile
Mac window problems
« Reply #13 on: October 07, 2009, 12:52:57 pm »
Hello,

  I might have a clue as to what's happening in the window issue: It's not the
difference in resolution, but the aspect ratio. You have your basic
800x600,1024x768,1280x1024 that's common with desktops, and you have
1280x800, 1440x900,etc. with laptops.

   The issue doesn't appear in a dual-desktop setup(or where you maintain the
same aspect ratio), because the aspect ratios match. Yet I tested the same
thing with a Mac Book Pro wide-screen, with an Apple Cinema Display, and
managed to reproduce the issue. When I changed the laptop to 1024x768,
leaving the cinema display to its 1600x1200 resolution, a simple SFML
Application ran into full-screen without a problem.

   I hope this helps, since the svn build still exhibits this problem.

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
Mac window problems
« Reply #14 on: October 07, 2009, 01:35:41 pm »
Hi,

Yep there is no change on the SVN repository about this point.
I'm actually trying to understand what's happening, but... I fail. I use a constant to access the screen I want to use to get the resolutions, and it gives the right ones. But even when using exactly the same display ID it changes the wrong screen... the aspect ratio shouldn't have any effect on this until the resolution you want to set is compatible with your screen. That's really weird...

I think I'll send you a sample Cocoa test application that use different parameters and see what's up.
Want to play movies in your SFML application? Check out sfeMovie!