Re: Round corners of borderless NSWindow without set it transparent
Re: Round corners of borderless NSWindow without set it transparent
- Subject: Re: Round corners of borderless NSWindow without set it transparent
- From: Andrea3000 <email@hidden>
- Date: Wed, 29 Feb 2012 17:57:38 +0100
Il giorno 28/feb/2012, alle ore 21:54, Andrea3000 ha scritto:
> Il giorno 28/feb/2012, alle ore 20:20, Corbin Dunn ha scritto:
>>
>> Did you sample it or use Instruments? What is slow?
>
> The resize is slow.
> When the window is small I can resize it as fast as I want and the resize animation is smooth, the window changes size gradually with continuity.
>
> On the other hand, when the window occupies a big portion of the screen and I resize it fast (I mean, not like a mad..just not slowly) it is sluggish during resize animation
> and the bottom right corner of the window doesn't follow the mouse pointer immediatly, there is always a little delay.
>
> This happens regardless of what I display in the NSOpenGLView, it happens even with only a uniform color background.
> Just for completeness, I use a CVDisplayLink to draw to the OpenGLContext and the context is set to flush buffers in sync with the refresh of the monitor.
I've made a very simple example app which shows what I mean. You can download it here: http://dl.dropbox.com/u/11879013/BorderlessDemo.zip
It's made of a borderless window and a view with rounded corners. The view contains two buttons, one for set the window fully opaque and the other one to
set it transparent. If you set it opaque and try to freely resize the window, it responds immediatly and resizes smoothly. Unfortunately, when the window is opaque, the corners aren't rounded.
If you set the window transparent and try tro resize it, you can see that the resize becomes more and more sluggish with the increase of the window size.
It starts to be clearly noticeable over (let's say) 1200x1000 pixels.
It's for this reason that I'm trying to avoid -setOpaque:NO since I need to have a very responsive UI.
Note: I haven't implemented a resize indicator so this can be confusing but if you drag the bottom right corner of the window it will resize.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden