Page 1 of 1

Minimise with windowshape -- SOLUTION

Posted: Wed Jun 09, 2010 1:10 pm
by AndyP
There is a well known and long standing bug when minimising when a custom window shape is used.
Basically it does not work!
There is no problem if standard window decorations are used.

Searching the forum the accepted solution is as below:

In the mimimize button script:
on mouseup
set the windowshape of this stack to 0
set the iconic of this stack to true
end mouseup


In the stack script:
on unIconifyStack
set windowShape of me to <your background image id>
end unIconifyStack

However this also does not work correctly and on Win 7 will not show a preview in the taskbar popup.

:idea: WORKING SOLUTION tested on XP and Win7
A bit of lateral thinking.... As minimise works on a standard window, why not just set the minimise decoration prior to minimise?
So the script above becomes:

In the mimimize button script:

on mouseUp
--reset the windowshape to default and add a minimise button, required due to iconic command bug
set the decorations of this stack to "minimize"
set the iconic of this stack to true
end mouseUp

In the stack script:

In the stack script:
on unIconifyStack
-- revert to original window shape, doing so automatically removes the minimise decoration
set windowShape of me to <your background image id>
end unIconifyStack

Hope this helps.

Re: Minimise with windowshape -- SOLUTION

Posted: Wed Jun 09, 2010 7:43 pm
by kotikoti
Thanks Andy

Re: Minimise with windowshape -- SOLUTION

Posted: Thu Jun 10, 2010 6:05 pm
by FourthWorld
Good tip, Andy. Thanks.

And I love your sigline. :)

Re: Minimise with windowshape -- SOLUTION

Posted: Fri Aug 19, 2011 3:22 am
by nlexa
I've tried all the various approaches above and have found my own solution - shorter and perhaps more elegant.

Code: Select all

on preOpenStack
set the windowShape of this stack to 1195 --must be first or the minimise wont work
set the decorations of this stack to "title" 
end preOpenStack
if you add
show this stack
hide this stack
to either side of setting the window shape and decoration and inside the preopenstack it stops the flicker (not that its much of a concern)
there is some kind of conflict between setting the decoration and setting the shape. You have to set them together in that order for it to work.

I'm using 4.6.3 and xp

Re: Minimise with windowshape -- SOLUTION

Posted: Fri Aug 19, 2011 8:47 am
by AndyP
Hi nlexa ,

Just tried this out on Win7...works great.

Nice solution. i will be substituting my code in PointandSee for yours, much more elegant!