Transparency Not Working Properly Snow Leopard Build

17 views
Skip to first unread message

Tyson Roberts

unread,
Sep 14, 2009, 10:17:22 AM9/14/09
to vim...@googlegroups.com
This may or may not have anything to do with SL, but I downloaded and compiled MacVim according to the classic instructions to include the perl interpreter (As an aside question, why does the standard install have python/ruby but not perl?).

Anyway, ran:

./configure \
    --enable-gui=macvim
    --enable-perlinterp

Forced it to build in 32 bit mode (a few libraries aren't ready for 64 bit, don't know about Vim itself).

The compile itself goes fine until I run xcodebuild... Getting the following when it tries to build the icons:

PhaseScriptExecution "Make Document Icons" build/MacVim.build/Release/MacVim.build/Script-1D1C31F00EFFBFD6003FE9A5.sh
    cd /Users/nall/Development/MacVim/vim7/src/MacVim
    /bin/sh -c /Users/nall/Development/MacVim/vim7/src/MacVim/build/MacVim.build/Release/MacVim.build/Script-1D1C31F00EFFBFD6003FE9A5.sh

echo /Users/nall/Development/MacVim/vim7/src/MacVim/build/Release/MacVim.app/Contents/Resources > /tmp/result.txt
make -C makeicns
g++ -o makeicns makeicns.o IconFamily.o NSString+CarbonFSRefCreation.o -O2 \
      -framework Foundation -framework AppKit -framework Carbon
Command /bin/sh failed with exit code 2
Command /bin/sh failed with exit code 2
Touch build/Release/MacVim.app
    cd /Users/nall/Development/MacVim/vim7/src/MacVim
    /usr/bin/touch -c /Users/nall/Development/MacVim/vim7/src/MacVim/build/Release/MacVim.app

** BUILD FAILED **


The following build commands failed:
MacVim:
    PhaseScriptExecution "Make Document Icons" /Users/nall/Development/MacVim/vim7/src/MacVim/build/MacVim.build/Release/MacVim.build/Script-1D1C31F00EFFBFD6003FE9A5.sh
(1 failure)

=====================================================================

The app it produces works well, perl works, but for what ever reason, transparancy doesn't work (I get a white mask over the window when I adjust the transparency level, but it doesn't actually affect the alpha).

I'd love any pointers.  If it's not a known issue, I'd be happy to write up a bug.



björn

unread,
Sep 15, 2009, 12:26:10 PM9/15/09
to vim...@googlegroups.com
2009/9/14 Tyson Roberts:

> This may or may not have anything to do with SL, but I downloaded and
> compiled MacVim according to the classic instructions to include the perl
> interpreter (As an aside question, why does the standard install have
> python/ruby but not perl?).

I can't compile as a universal binary with Perl support and pretty
much nobody ever requested Perl support so...


> Anyway, ran:
>
> ./configure \
>     --enable-gui=macvim
>     --enable-perlinterp
>
> Forced it to build in 32 bit mode (a few libraries aren't ready for 64 bit,
> don't know about Vim itself).
>
> The compile itself goes fine until I run xcodebuild... Getting the following
> when it tries to build the icons:
>
> PhaseScriptExecution "Make Document Icons"

There have been a number of threads about this in the past week or so.
Check the archives.

> The app it produces works well, perl works, but for what ever reason,
> transparancy doesn't work (I get a white mask over the window when I adjust
> the transparency level, but it doesn't actually affect the alpha).

That's a new bug which I can confirm. I'll put it on my todo...thanks
for letting me know about it.

Björn

Tyson Roberts

unread,
Sep 15, 2009, 1:12:29 PM9/15/09
to vim...@googlegroups.com
Awesome.  Let me know if you need any further info.

- Tyson

björn

unread,
Sep 15, 2009, 3:25:10 PM9/15/09
to vim...@googlegroups.com
2009/9/15 björn:
> 2009/9/14 Tyson Roberts:

>> The app it produces works well, perl works, but for what ever reason,
>> transparancy doesn't work (I get a white mask over the window when I adjust
>> the transparency level, but it doesn't actually affect the alpha).
>
> That's a new bug which I can confirm.  I'll put it on my todo...thanks
> for letting me know about it.

Does anybody have a clue why transparent views no longer work on Snow
Leopard? I just looked into this bug but I am a bit stumped. Calling
setAlphaValue: on the window containing the text view will make the
view transparent (as on pre-10.6) but it also makes the window itself
transparent (so you can see through the title bar for example).

Any help would be appreciated.

Björn

Frank Hellenkamp

unread,
Sep 15, 2009, 4:39:17 PM9/15/09
to vim...@googlegroups.com
Hi Björn,

> Does anybody have a clue why transparent views no longer work on Snow
> Leopard? I just looked into this bug but I am a bit stumped. Calling
> setAlphaValue: on the window containing the text view will make the
> view transparent (as on pre-10.6) but it also makes the window itself
> transparent (so you can see through the title bar for example).

It does work for me with the old Tiger Build (Snapshot 49) on Snow
Leopard. Do you see it only with a new one build on Snow Leopard?


Frank

--
frank hellenkamp | interface designer
solmsstraße 7 | 10961 berlin

+49.30.49 78 20 70 | tel
+49.173.70 55 781 | mbl
+49.3212.100 35 22 | fax
jo...@depagecms.net

http://www.depagecms.net
http://immerdasgleiche.de
http://everydayisexactlythesame.net/


signature.asc

björn

unread,
Sep 15, 2009, 4:48:19 PM9/15/09
to vim...@googlegroups.com
2009/9/15 Frank Hellenkamp:

>> Does anybody have a clue why transparent views no longer work on Snow
>> Leopard?  I just looked into this bug but I am a bit stumped.  Calling
>> setAlphaValue: on the window containing the text view will make the
>> view transparent (as on pre-10.6) but it also makes the window itself
>> transparent (so you can see through the title bar for example).
>
> It does work for me with the old Tiger Build (Snapshot 49) on Snow
> Leopard. Do you see it only with a new one build on Snow Leopard?

Indeed, snapshot 49 works but not my custom binary built for 10.6.
So, apparently something has changed in the 10.6 Cocoa framework which
breaks transparency. *sigh*

Björn

Joshua Bronson

unread,
Nov 11, 2009, 1:16:44 PM11/11/09
to vim_mac
On Sep 15, 3:48 pm, björn <bjorn.winck...@gmail.com> wrote:
> Indeed, snapshot 49 works but not my custom binary built for 10.6.
> So, apparently something has changed in the 10.6 Cocoa framework which
> breakstransparency.  *sigh*
>
> Björn

I'm running a MacPorts build of snapshot50 on Snow Leopard and I'm
having issues with transparency. I just came across this thread and
noticed it hadn't been updated in a while. Anything blocking progress
on http://code.google.com/p/macvim/issues/detail?id=230?

I created a MacPorts ticket at https://trac.macports.org/ticket/22478
and linked to this discussion.

Thanks!

Josh

björn

unread,
Nov 11, 2009, 8:34:38 PM11/11/09
to vim...@googlegroups.com
2009/11/11 Joshua Bronson:

>
> On Sep 15, 3:48 pm, björn <bjorn.winck...@gmail.com> wrote:
>> Indeed, snapshot 49 works but not my custom binary built for 10.6.
>> So, apparently something has changed in the 10.6 Cocoa framework which
>> breakstransparency.  *sigh*
>>
>> Björn
>
> I'm running a MacPorts build of snapshot50 on Snow Leopard and I'm
> having issues with transparency. I just came across this thread and
> noticed it hadn't been updated in a while. Anything blocking progress
> on http://code.google.com/p/macvim/issues/detail?id=230?

Hi Josh,

Use the official snapshot that I build instead, it fully supports
transparency (since it is built against the 10.5 SDK).

I am not working on the transparency issue: this feature was
contributed in the first place so I am not too familiar with it. I
poked around quickly but couldn't figure out how to fix it, thus I am
waiting for somebody who actually uses this feature (I don't) to fix
it and send me a patch.

Björn

Joshua Bronson

unread,
Nov 12, 2009, 12:24:53 PM11/12/09
to vim...@googlegroups.com
Gotcha, thanks for the update Björn. Who knows, maybe some user in the MacPorts community who could fix it might notice the ticket I put in and send you a patch!

Best,
Josh

Craig Emery

unread,
Nov 13, 2009, 3:34:01 AM11/13/09
to vim...@googlegroups.com
If I build form the source myself, are there any configure options that I should use?
I ask because when I

: set transparency=50

all I get is a weird greyness to the background; I certainly don't see what's underneath my Gvim window.

-C

2009/11/12 Joshua Bronson <jabr...@gmail.com>

René Köcher

unread,
Nov 13, 2009, 3:46:30 AM11/13/09
to vim...@googlegroups.com
On Fri, Nov 13, 2009 at 9:34 AM, Craig Emery <craig...@gmail.com> wrote:
> If I build form the source myself, are there any configure options that I
> should use?
> I ask because when I
>
> : set transparency=50
>
> all I get is a weird greyness to the background; I certainly don't see
> what's underneath my Gvim window.
>
> -C

I can confirm this.

I did a fresh built from git master (against both 10.5 and 10.6 SDK).
All I get is a grayed background in Vim but no transparency.

In addition I did try the same using the core-text branch,
which (apart from not being transparent at all) does some strange ghosting
when you scroll text with transparency < 100.

Cheers,
Shirk
----------------------------------------------------------------------
BitSpin.org :: don't get twisted up!
----------------------------------------------------------------------

björn

unread,
Nov 13, 2009, 11:36:59 AM11/13/09
to vim...@googlegroups.com
2009/11/13 René Köcher:

>
> On Fri, Nov 13, 2009 at 9:34 AM, Craig Emery wrote:
>> If I build form the source myself, are there any configure options that I
>> should use?
>> I ask because when I
>>
>> : set transparency=50
>>
>> all I get is a weird greyness to the background; I certainly don't see
>> what's underneath my Gvim window.
>>
>> -C
>
> I can confirm this.
>
> I did a fresh built from git master (against both 10.5 and 10.6 SDK).
> All I get is a grayed background in Vim but no transparency.

Huh?! Transparency works for me when passing the "--with-macsdk=10.5"
to configure. Are you sure the compilation was ok (e.g. did you make
sure you didn't mistype something)?

Transparency _does_not_work_ when using the 10.6 SDK. This is what
has been reported already (click the link to the Issue report in
Joshua's post).

> In addition I did try the same using the core-text branch,
> which (apart from not being transparent at all) does some strange ghosting
> when you scroll text with transparency < 100.

Core Text does not support transparency (it never did) -- it's just
another one of these things that I haven't gotten around to.

Since transparency seems so important to many people I strongly urge
anybody who uses this setting to try to fix the outstanding issues
(fix 10.6 SDK, fix Core Text) and send me a patch. This is extremely
low priority for me at the moment since I do not use transparency at
all. Please help me out!

Björn

björn

unread,
Nov 13, 2009, 11:39:15 AM11/13/09
to vim...@googlegroups.com
2009/11/13 björn:

>
> Core Text does not support transparency (it never did) -- it's just
> another one of these things that I haven't gotten around to.

Let me reformulate that:

"The MacVim Core Text renderer does not support transparency (it never did)."

Obviously I am not claiming that the Core Text API does not support
transparency. ;-)

Björn

Joshua Bronson

unread,
Nov 13, 2009, 5:04:43 PM11/13/09
to vim...@googlegroups.com
On Fri, Nov 13, 2009 at 11:36 AM, björn <bjorn.w...@gmail.com> wrote:
Since transparency seems so important to many people I strongly urge
anybody who uses this setting to try to fix the outstanding issues
(fix 10.6 SDK, fix Core Text) and send me a patch.  This is extremely
low priority for me at the moment since I do not use transparency at
all.  Please help me out!

If I knew the first thing about Cocoa programming I would totally give this a shot! I've never written a line of Objective-C, but when I finally get a chance to play with it this will be one of the first things I look at if it's not fixed by then. In the meantime, do you have the email address of the contributor of the original transparency patch? Maybe they're not even aware there's an issue for it with 10.6, and the fix is the sort of thing that would only take him or her a second? </wishful thinking> :)

René Köcher

unread,
Nov 14, 2009, 6:31:19 AM11/14/09
to vim...@googlegroups.com

Am 13.11.2009 um 17:36 schrieb björn:

>
> Huh?! Transparency works for me when passing the "--with-macsdk=10.5"
> to configure. Are you sure the compilation was ok (e.g. did you make
> sure you didn't mistype something)?

Holly Steve Jobs! You're right!

I did a separate compile in a new git checkout (same config flags) and now transparency works!
Strange enough.. make clean; git clean -fxd should have resulted in the same.

I can state that these flags work for me even on SL:
./configure --enable-perlinterp --enable-pythoninterp --enable-rubyinterp --with-features=huge --enable-gui=macvim --with-tlib=ncurses --enable-multibyte --with-python-config-dir=/System/Library/Frameworks/Python.framework/Versions/2.6//lib/python2.6/config/

Cheers,
Shirk
----------------------------------------------------------------------------------
BitSpinn.org - don't get twisted up!
----------------------------------------------------------------------------------

björn

unread,
Nov 14, 2009, 3:56:31 PM11/14/09
to vim...@googlegroups.com
2009/11/13 Joshua Bronson:

George Harker wrote the original transparency patch (search the
vim_mac archives). Unfortunately this is not going to be an easy fix
for anybody (I think) since the problem lies with some change within
the Cocoa frameworks between versions 10.5 and 10.6. I'm guessing the
best way to attack this problem is to look around and see if any other
app has working transparency code for 10.6 and try to adapt that.

Björn

Craig

unread,
Nov 16, 2009, 6:07:34 AM11/16/09
to vim...@googlegroups.com
So If I try the below configure rune I get transparency working, but it's failing to give me Python 2.6. :-(
The Python config directory does exist, but

: py print sys.version
2.5.4 (r254:67916, Jul  7 2009, 23:51:24)
[GCC 4.2.1 (Apple Inc. build 5646)]

-C

2009/11/14 björn <bjorn.w...@gmail.com>

René Köcher

unread,
Nov 16, 2009, 6:12:40 AM11/16/09
to vim...@googlegroups.com
On Mon, Nov 16, 2009 at 12:07 PM, Craig <craig...@gmail.com> wrote:
> So If I try the below configure rune I get transparency working, but it's
> failing to give me Python 2.6. :-(
> The Python config directory does exist, but
>
> : py print sys.version
> 2.5.4 (r254:67916, Jul 7 2009, 23:51:24)
> [GCC 4.2.1 (Apple Inc. build 5646)]
>
> -C
>

Craig,

please have a look at my last reply to this topic.
I included my configure flags which will produce a working
transparency-supported AND
python2.6 capable build.

Craig

unread,
Nov 16, 2009, 8:00:06 AM11/16/09
to vim...@googlegroups.com
Hi Shirk,

(to me it looks like) your last post doesn't look like it uses the 10.5 SDK switch and so does give Python2.6 but not transparency.

When I use your configure rune with the 10.5 SDK switch added

./configure --enable-perlinterp --enable-pythoninterp --enable-rubyinterp --with-features=huge --enable-gui=macvim --with-tlib=ncurses --enable-multibyte --with-python-config-dir=/System/Library/Frameworks/Python.framework/Versions/2.6//lib/python2.6/config/ --with-macsdk=10.5

I get transparency but Python 2.5.4 :-(

Am I missing something?

-C

2009/11/16 Craig <craig...@gmail.com>

björn

unread,
Nov 16, 2009, 11:20:32 AM11/16/09
to vim...@googlegroups.com
2009/11/16 Craig:

> Hi Shirk,
>
> (to me it looks like) your last post doesn't look like it uses the 10.5 SDK
> switch and so does give Python2.6 but not transparency.
>
> When I use your configure rune with the 10.5 SDK switch added
>
> ./configure --enable-perlinterp --enable-pythoninterp --enable-rubyinterp
> --with-features=huge --enable-gui=macvim --with-tlib=ncurses
> --enable-multibyte
> --with-python-config-dir=/System/Library/Frameworks/Python.framework/Versions/2.6//lib/python2.6/config/
> --with-macsdk=10.5
>
> I get transparency but Python 2.5.4 :-(
>
> Am I missing something?

There is a typo in the --with-python-config-dir option (two slashes
before "lib"). Don't know if that is the problem since I've never
used that option myself (so I can't say for sure if it should work or
not). After the configure phase you can open up src/auto/config.mk to
make sure that all (Python) flags are set correctly. If not, just
edit the file, then make (note that calling "configure" will overwrite
that file though). (Don't ask me exactly what the "correct" flags
are...you'll have to experiment for yourself to figure that out.)

Björn

Craig

unread,
Nov 16, 2009, 11:49:20 AM11/16/09
to vim...@googlegroups.com
2009/11/16 björn <bjorn.w...@gmail.com>

From configure.in:
        dnl On Mac OS X, when an SDK has been explicitly chosen we can't rely
        dnl on any of the search paths set above.  The -framework flag does it
        dnl all for us.
        if test -n "$MACSDK"; then
          PYTHON_CFLAGS=
          PYTHON_LIBS=-framework Python
          PYTHON_CONFDIR=
          PYTHON_GETPATH_CFLAGS=
        fi

Even if I take the Python section from src/auto/config.mk when NOT using the --with-macsdk switch and putting it into the src/auto/config.mk made when using same, then I still get 2.5.4.

So it seems clear that Python2.6 in SL in incompatible with the 10.5 SDK.

-C

duffnut

unread,
Nov 18, 2009, 6:30:13 AM11/18/09
to vim_mac

> I'm guessing the
> best way to attack this problem is to look around and see if any other
> app has working transparency code for 10.6 and try to adapt that.
>
> Björn

afloat app seems to have figured out transparency in 10.6, might be
something there worth scavenging? I'm no programmer :( maybe ask the
afloat's developer?

René Köcher

unread,
Nov 18, 2009, 4:31:30 PM11/18/09
to duffnut, vim...@googlegroups.com

I'm sorry to tell you this but figuring out transparency is not the problem..

I had a look at this problem for some time now and I did come up with a fix
that enabled a completely transparent vim window (like afloat does).
This was irritating since everything - including the menu and toolbars
was transparent.

What seems broken (or changed) in 10.6 is the feature to have a transparent
View within an otherwise opaque window..

Cheers,
Shirk
----------------------------------------------------------------------------------
BitSpinn.org - don't get twisted up!
----------------------------------------------------------------------------------

björn

unread,
Nov 18, 2009, 4:47:51 PM11/18/09
to vim...@googlegroups.com, duffnut
2009/11/18 René Köcher:

>
> Am 18.11.2009 um 12:30 schrieb duffnut:
>
>>
>>> I'm guessing the
>>> best way to attack this problem is to look around and see if any other
>>> app has working transparency code for 10.6 and try to adapt that.
>>>
>>> Björn
>>
>> afloat app seems to have figured out transparency in 10.6, might be
>> something there worth scavenging? I'm no programmer :( maybe ask the
>> afloat's developer?

Thanks for the suggestion: I did not take a look at it because of
Shirk's post saying the entire window is transparent (including the
title bar etc.).

Does anybody know of any other (open source) app that manages to do
transparency right on 10.6?

> I'm sorry to tell you this but figuring out transparency is not the problem..

I don't think we should give up quite yet...

> I had a look at this problem for some time now and I did come up with a fix
> that enabled a completely transparent vim window (like afloat does).
> This was irritating since everything - including the menu and toolbars
> was transparent.

I'm glad you took a look at the problem. I also managed to get to the
"everything is transparent" stage, but obviously that is not good
enough. The only way this would be useful is if we were to draw all
the window decorations manually and make sure they are opaque, but
this is a bit crazy.

> What seems broken (or changed) in 10.6 is the feature to have a transparent
> View within an otherwise opaque window..

Well, Terminal.app manages to do it...so it is definitely possible
(but probably only by using some private API).

By the way: transparency on pre-10.6 already did use a private API to
disable a window shadow or something like that. So anybody looking
into this problem need to keep the private API option in mind (it may
be the only way to get this to work). Again, the best thing would be
to find some other app that manages to do it and adapt that (obviously
Terminal.app won't be of much help here, unless somebody at Apple were
to give us a hint).

Björn

Ren? K?cher

unread,
Nov 18, 2009, 6:25:00 PM11/18/09
to vim...@googlegroups.com, René Köcher

Am 19.11.2009 um 00:21 schrieb Donuts <duf...@gmail.com>:

oops, disregard that, I'll post to the mailing list instead ^^

2009/11/18 Donuts <duf...@gmail.com>
ah, too bad... but that reminds me, Adium has transparency where the title bar isn't affected... but I don't think they're open source.

2009/11/18 René Köcher <shi...@googlemail.com>



Nice one.. Adium has transparency
AND it is Open Source!

Let's all have a look on how they do it!

(>^_^)>

Cheers,
Shirk

duffnut

unread,
Nov 18, 2009, 6:25:11 PM11/18/09
to vim_mac
Adium? they're open source, and from a quick test their transparency
seems functional in snow leopard!

Jjgod Jiang

unread,
Nov 18, 2009, 8:16:49 PM11/18/09
to vim...@googlegroups.com, duffnut
Hi björn,

On Thu, Nov 19, 2009 at 5:47 AM, björn <bjorn.w...@gmail.com> wrote:
> By the way: transparency on pre-10.6 already did use a private API to
> disable a window shadow or something like that.  So anybody looking
> into this problem need to keep the private API option in mind (it may
> be the only way to get this to work).  Again, the best thing would be
> to find some other app that manages to do it and adapt that (obviously
> Terminal.app won't be of much help here, unless somebody at Apple were
> to give us a hint).

In vim-cocoa I am using exactly the same piece of code (the private API
you mentioned) and transparency works out of box.

I didn't follow this thread lately so I'm not sure what your problem is,
is that related to linking with a specific SDK that could disable the
transparency?

- Jiang

Jjgod Jiang

unread,
Nov 18, 2009, 9:03:19 PM11/18/09
to vim...@googlegroups.com, duffnut, björn
Hi,

On Thu, Nov 19, 2009 at 9:16 AM, Jjgod Jiang <gzj...@gmail.com> wrote:
> In vim-cocoa I am using exactly the same piece of code (the private API
> you mentioned) and transparency works out of box.

OK, this patch fixed the transparency problem by setting correct blend mode
(kCGBlendModeCopy instead of kCGBlendModeNormal) before using
CGContextFillRect().
Only for the Core Text renderer though.

- Jiang

0001-Setting-blend-mode-before-filling-rects-to-fix-trans.patch

björn

unread,
Nov 19, 2009, 11:38:56 AM11/19/09
to Jjgod Jiang, vim...@googlegroups.com, duffnut
2009/11/19 Jjgod Jiang:

> On Thu, Nov 19, 2009 at 9:16 AM, Jjgod Jiang wrote:
>> In vim-cocoa I am using exactly the same piece of code (the private API
>> you mentioned) and transparency works out of box.
>
> OK, this patch fixed the transparency problem by setting correct blend mode
> (kCGBlendModeCopy instead of kCGBlendModeNormal) before using
> CGContextFillRect().
> Only for the Core Text renderer though.

Thanks a bunch Jiang! I can confirm that it works too.

Maybe the problem with the default renderer is due to some change in
NSTextView...? At any rate, the next snapshot will include the Core
Text renderer and I think most people will want to use that instead of
the default renderer anyway, so the transparency issue with the
default renderer may not be that urgent anymore.

Björn

Reply all
Reply to author
Forward
0 new messages