Re: How to fixate a window on another window?



muppet wrote:

A slightly sneakier solution is to use an actual widget as a fake  
popup, by using manual absolute position layout.  We just tell the  
widget that its parent is the toplevel window, and then update the  
widget's position from the toplevel window's size-allocate as though  
we were implementing a fixed-position layout container.  The  
advantage here is that the "popup" tracks the toplevel's position  
perfectly during moves because the X server moves the GdkWindow for  
us, removing all of the lag and z-order problems of the separate  
window solution.  Also, using size-allocate is a little easier.  ;-)

Great, your prototype implements exactly what I was looking for and the
code is quite easy to understand, thanks!

In both solutions, the keyboard focus is an interesting issue.  The  
code i implemented ignores the "popup"'s keyboard focus altogether --  
it doesn't get focus when toggled visible, and doesn't get inserted  
into the toplevel's focus chain.  You didn't mention whether you  
wanted to have actual interactive widgets in your popup, or whether  
it was just for information display.  I leave that as an exercise for  
you.  ;-)

It's for informational purposes, so keyboard focus is not important.

Regards,

Joern

-- 
sub i($){print$_[0]}*j=*ENV;sub w($){sleep$_[0]}sub _($){i"$p:$c> ",w+01
,$_=$_[0],tr;i-za-h,;a-hi-z ;,i$_,w+01,i"\n"}$|=1;$f='HO';($c=$j{PWD})=~
s+$j{$f."ME"}+~+;$p.="$j{USER}\@".`hostname`;chop$p;_"kl",$c='~',_"zu,".
"-zn,*",_"#,epg,lw,gwc,mfmkcbm,cvsvwev,uiqt,kwvbmvb?",i"$p:$c> ";w+1<<07

Attachment: pgprf0kW8P9tt.pgp
Description: PGP signature



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]