1.11.12 and Retina MacBook Pro

Having trouble with the game? Report issues and get help here. Read this first!

Moderators: Forum Moderators, Developers

Forum rules
Before reporting issues in this section, you must read the following topic:

1.11.12 and Retina MacBook Pro

Postby lindsay40k » April 5th, 2014, 10:15 pm

Installed 1.11.12 on new MBP with OSX 9.2. Slid resolution up to full 2880 to see how things'd look. The Wesnoth window became twice as large as this (presumably it was scaling one BFW pixel to four screen pixels) and I couldn't get resolution switch option onscreen to revert to something sensible. Quit and reloaded, and Wesnoth ran with microscopic text in a screen sized window. The pointer couldn't click on any options, and whilst some keys could navigate a little through menus I couldn't get at the resolution settings.

I'd be very happy if someone could advise on a workaround by editing a setting file so I can get up and running without waiting for an update that's better optimised for high pixel density displays.
currently contributing art to Internet Meme Era
User avatar
lindsay40k
 
Posts: 97
Joined: May 11th, 2009, 2:51 pm

Re: 1.11.12 and Retina MacBook Pro

Postby Alarantalara » April 5th, 2014, 10:57 pm

See viewtopic.php?f=4&t=40042 where another user has the same problem. Unfortunately, the graphics library that Wesnoth currently uses does not handle retina displays at all (to the point that you'll notice significantly better performance if you check the "Open in Low Resolution" option in the Finder's info display), though there appear to currently be plans to update to SDL 2, which I believe does support such displays. It won't be for 1.11 or 1.12, though.
User avatar
Alarantalara
Mac OS X Packager
 
Posts: 757
Joined: April 23rd, 2010, 8:17 pm
Location: Canada

Re: 1.11.12 and Retina MacBook Pro

Postby ancestral » July 4th, 2014, 7:16 am

Alarantalara wrote:See viewtopic.php?f=4&t=40042 where another user has the same problem. Unfortunately, the graphics library that Wesnoth currently uses does not handle retina displays at all (to the point that you'll notice significantly better performance if you check the "Open in Low Resolution" option in the Finder's info display), though there appear to currently be plans to update to SDL 2, which I believe does support such displays. It won't be for 1.11 or 1.12, though.

Actually, this is all wrong.

I was the one who originally filed this bug back almost two years ago, and I’m sorry I didn’t do enough troubleshooting on my brand new Mac at the time, because I just figured it out now.

The part that led me to believe otherwise is the fact that this doesn’t happen in 1.10.

The reason I believe is simple. Wesnoth doesn’t have a resolution to display the window in by default, so it wants to draw it at 1138x904. Well, it thinks it has the space to do it, because it’s somehow reading the total resolution of the display (like 2560 x 1600 or higher), not the normal resolution (half that, which is 1280 x 800).

The workaround is to specify a resolution, and then Wesnoth will be happy. Either, drag the top left or top right corners to make the game window smaller and fit within the screen (when you do this, Wesnoth doesn’t redraw; another bug, but I digress), quit and re-open, and all is gravy. Or, open ~/Library/Preferences/Wesnoth_1.12/preferences and set the xwindowsize and ywindowsize to something smaller than the area on the screen (minus dock and menu bars). 1280x600 worked for me, and you can always drag to make the window bigger later.

Somewhere between 1.10 and 1.11/1.12 the code it uses to grab the screen resolution changed, and we need to figure out what that is. (Never mind, just tested it, and the problem persists in 1.10 also.) If that isn’t found before the next dev release I request placing an #ifdef for OS X on launch where if a windowsize is not set in preferences, that the window be drawn at 800x600.


Developers, it would be nice if you could test these bug reports before assuming they’re upstream problems.
Wesnoth BestiaryPREVIEW IT HERE )
Unit tree and stat browser
CanvasPREVIEW IT HERE )
Exp. map viewer
User avatar
ancestral
Forum Regular
 
Posts: 1014
Joined: August 1st, 2006, 5:29 am
Location: Motion City

Re: 1.11.12 and Retina MacBook Pro

Postby iceiceice » July 4th, 2014, 6:15 pm

ancestral wrote:Actually, this is all wrong.


ancestral wrote:Developers, it would be nice if you could test these bug reports before assuming they’re upstream problems.


Actually, for what its worth 5 minutes of googling revealed a host of reported upstream problems, above an beyond the window size issues. For instance very bad performance on blits which we use constantly (and which could be related to remarks like this:
Alarantalara wrote:(to the point that you'll notice significantly better performance if you check the "Open in Low Resolution" option in the Finder's info display)


https://forums.libsdl.org/viewtopic.php?t=8326

ancestral wrote: I request placing an #ifdef for OS X on launch where if a windowsize is not set in preferences, that the window be drawn at 800x600.


Hmm... won't this itself cause a bug when the upstream problems are fixed?
User avatar
iceiceice
Developer
 
Posts: 627
Joined: August 23rd, 2013, 2:10 am

Re: 1.11.12 and Retina MacBook Pro

Postby shadowm » July 4th, 2014, 7:54 pm

I for one have experienced issues on Linux with Wesnoth/SDL not coping with its window size being overruled by the WM, plenty of times, but I didn’t expect it could be relevant for other OSes, let alone for Retina devices. (This report is most likely the same thing.)
Author of the unofficial UtBS sequels Invasion from the Unknown and After the Storm.
I also made Wesnoth RCX, a team-coloring tool for artists and content creators. Your life can’t possibly be complete without it. Go get it. Now.
Elsewhere: shadowmBlogFollow me on Twitter
User avatar
shadowm
Illusive Idler
 
Posts: 5523
Joined: November 14th, 2006, 5:54 pm
Location: Chile

Re: 1.11.12 and Retina MacBook Pro

Postby ancestral » July 5th, 2014, 3:16 am

iceiceice wrote:Actually, for what its worth 5 minutes of googling revealed a host of reported upstream problems, above an beyond the window size issues. For instance very bad performance on blits which we use constantly
This is my point exactly. SDL probably has hundreds, if not more issues, across all platforms. Any given graphical issue could potentially be an upstream issue.

All I’m saying is, developers, please attempt to reproduce the issue and do a little bit of troubleshooting — or ask us, the users, what troubleshooting we can do — before assuming something is upstream and not worth looking at. If you’re not able to reproduce it (as in, in this case, if no developers have a high-DPI display) then please don’t pidgeonhole the problem. Leave it open, or mark it as “Cannot Reproduce” or “Need Info.” Just like a medical doctor, you can’t make a proper diagnosis without seeing the patient first. Am I right?

iceiceice wrote:
ancestral wrote:I request placing an #ifdef for OS X on launch where if a windowsize is not set in preferences, that the window be drawn at 800x600.

Hmm... won't this itself cause a bug when the upstream problems are fixed?

The problem:
  • Wesnoth draws the window by what windowsize is set to in preferences.
  • If the windowsize in preferences is set larger than the screen size, the problem occurs.
  • If there is no windowed resolution set (windowsize=""), Wesnoth guesses what size to draw it as. (It wants to draw the window at 1138 x 904 on my 1280 x 800 resolution.)
  • This problem happens “out-of-the-box” for users with high DPI displays.

The solution:
Just have Wesnoth draw the window at a smaller size (say, 800 x 600) when the preference file has windowsize="". (When does windowsize not have a resolution defined? When the preference file is created.) The alternative would be to define windowsize automatically. Either case, the only situation that is unresolved is when the resolution is manually entered (or maybe someone migrated their preferences from an older computer with a larger display, or they’re running Wesnoth without their larger monitor connected, etc.), at least if the user runs into the problem they can delete their preferences file and get it working again.


Why 800 x 600? It is a standard resolution but most importantly, it is smaller than any resolution on any MacBook. This means if even the Air, the smallest MacBook today (with a 1366 x 768 resolution) gets a retina display, it will also be fine.)
Wesnoth BestiaryPREVIEW IT HERE )
Unit tree and stat browser
CanvasPREVIEW IT HERE )
Exp. map viewer
User avatar
ancestral
Forum Regular
 
Posts: 1014
Joined: August 1st, 2006, 5:29 am
Location: Motion City

Re: 1.11.12 and Retina MacBook Pro

Postby iceiceice » July 5th, 2014, 3:23 am

I think this misses the point.

The point is, you probably should not enable the retina display with wesnoth at all because it is not supported. This "workaround" to make the window fit on screen when you start is just the tip of the iceberg and may serve only to paper over many more potential problems.

Hence the advice:

Alarantalara wrote:you'll notice significantly better performance if you check the "Open in Low Resolution" option in the Finder's info display
User avatar
iceiceice
Developer
 
Posts: 627
Joined: August 23rd, 2013, 2:10 am

Re: 1.11.12 and Retina MacBook Pro

Postby ancestral » July 5th, 2014, 5:52 pm

iceiceice wrote:I think this misses the point.

The point is, you probably should not enable the retina display with wesnoth at all because it is not supported. This "workaround" to make the window fit on screen when you start is just the tip of the iceberg and may serve only to paper over many more potential problems.

Hence the advice:
Alarantalara wrote:you'll notice significantly better performance if you check the "Open in Low Resolution" option in the Finder's info display
That’s not the problem. (I have that check box enabled by default and makes no difference.)


After a little more troubleshooting with mattsc on IRC, it’s a problem on all Macs.

If you change the ywindowsize in preferences to a larger number than the vertical screen resolution, you’ll have this problem. All Macs, not just retina ones. Wesnoth is scaling the video in the game to try to fit the resolution listed in the preferences file (where really it should resize it to the size the window manager has drawn it to).
Wesnoth BestiaryPREVIEW IT HERE )
Unit tree and stat browser
CanvasPREVIEW IT HERE )
Exp. map viewer
User avatar
ancestral
Forum Regular
 
Posts: 1014
Joined: August 1st, 2006, 5:29 am
Location: Motion City

Re: 1.11.12 and Retina MacBook Pro

Postby ancestral » July 7th, 2014, 7:16 am

I want to apologize, I came across a bit critical earlier. People do great work around here and rarely get recognized — on their own time, for free, and that’s awesome. Also, I realize the best way to make things better is to contribute,

So, in the spirit, I’ve committed a fix which will resolve the issue for retina display Macs and anyone with small displays (pull request #240)

Thank you lindsay40k, WizNut and any others for reporting this issue. It caused me to come back and rethink this ugly bug and come up with a solution.
Wesnoth BestiaryPREVIEW IT HERE )
Unit tree and stat browser
CanvasPREVIEW IT HERE )
Exp. map viewer
User avatar
ancestral
Forum Regular
 
Posts: 1014
Joined: August 1st, 2006, 5:29 am
Location: Motion City


Return to Technical Support

Who is online

Users browsing this forum: No registered users and 1 guest