Re: Tk 8.5.11 fullscreen broken on MacOS X 10.7 Lion?



On 1/28/12 10:49 PM, Jerry Orjuela wrote:

Is there something else that has to be specified for Lion that I've
missed, or is this a known problem?


After a lot of experimentation, I've concluded that there isn't a feasible fix to the issue, for several reasons:

1. It's not a Lion-specific issue, it's a Cocoa-specific issue. Cocoa (the preferred UI framework for Apple) doesn't allow as much flexibility in changing window styles as did Carbon (the deprecated Apple UI that Tk Aqua was originally built on). As a result, Tk can no longer change the window style on the fly to a borderless, full-screen window--the current implementation is the best it can do with manual drawing. The difference you are seeing is the difference between Carbon and Cocoa Tk.

2. I've looked at a few different alternative API's, but they are either poorly supported, cf. NSView enterFullScreenMode:screen withOptions:], or they are Lion-specific, cf. [NSWindow toggleFullScreen], which works well for resizing the window BUT doesn't play nice with Tk's internal sense of window state (is it fullscreen or not)? Additionally, I am reluctant to use a 10.7 Lion-only API because Tk-Cocoa's minimum version is 10.5, Leopard.

I'm sorry that I wasn't able to put together a fix for this issue. I've spent several hours on it, partly because I have been meaning to experiment with the shiny new full-screen API in Lion--it's pretty slick the way the window animates out to full-screen and back with just a few lines of code. But getting this to actually work well with Tk's internals was giving me nothing but headaches.

As a result, I'm going to have to leave it as is, because it's the only working implementation, even though it doesn't work as well as we'd like. Cocoa has many advantages over Carbon, and it was absolutely necessary for Tk to adapt to Apple's preferred API (a thousand kudos to Daniel Steffen for his heroic solo work on the port), but there are some areas where the Cocoa implementation has limitations that the Carbon version did not. This is one of them.

--Kevin

--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
.



Relevant Pages

  • Re: Why has the Metrowerks sign been taken down?
    ... > I'm looking at your *current*, shipping product. ... my application to Cocoa, and the vast majority of what I write now *is* ... I have an entire window ... isn't a single Carbon API in the entire file. ...
    (comp.sys.mac.programmer.codewarrior)
  • Re: Cocoa/Carbon - creating a Window
    ... What is the equivalent of these three calls under Cocoa? ... What is the equivalent of these three calls under Carbon? ... doing that much handling of a window under OS X ... experienced Mac programmer switching to Windows: ...
    (comp.sys.mac.programmer.help)
  • Re: Common LISP Implementations for Mac OS X?
    ... Have you had a look at Cocoa? ... Carbon. ... most Cocoa apps just look and behave more like I expect it from a Mac OS ... > different Lisp files into the same window. ...
    (comp.lang.lisp)
  • Re: New Ada portable GUI Library?
    ... Currently there are two general GUI APIs on Mac OS X: Carbon and Cocoa. ... No drag&drop, no window grouping. ...
    (comp.lang.ada)
  • Re: Scrolling text like a stock ticker
    ... left to scroll out of the window. ... Normal "ticker" type stuff. ... I'm just not sure what way you would do this in Cocoa. ...
    (comp.sys.mac.programmer.help)