[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kmdi-devel
Subject:    kdelibs/kdeui, KDockSplitter and resize events
From:       dhdev () gmx ! de (Dominik Haumann)
Date:       2005-03-04 23:54:15
Message-ID: 200503042354.06412.dhdev () gmx ! de
[Download RAW message or body]

> --- kdelibs/kdeui/kdockwidget_private.cpp  #1.54:1.55
> @@ -73,60 +72,31 @@ void KDockSplitter::activate(QWidget *c0
>    updateName();
>    divider->show();
> +
> +  // without this resize event, things will not work. why exactly? :(
>    resizeEvent(0);
Number of resize events = 1

>
> -  // dominik: the following is still something I don't understand 100%
> -  // I even think that this includes some bugs!
> -  if (fixedWidth0!=-1) restoreFromForcedFixedSize((KDockWidget*)child0);
> -  if (fixedWidth1!=-1) restoreFromForcedFixedSize((KDockWidget*)child1);
> -  if (((KDockWidget*)child0)->forcedFixedWidth()!=-1)
> -  {
> -
> 
> setForcedFixedWidth(((KDockWidget*)child0),((KDockWidget*)child0)->forced
>F ixedWidth()); -    //QTimer::singleShot(100,this,SLOT(delayedResize()));
> -  }
> -  else
> -  if (((KDockWidget*)child1)->forcedFixedWidth()!=-1)
> -  {
> -
> 
> setForcedFixedWidth(((KDockWidget*)child1),((KDockWidget*)child1)->forced
>F ixedWidth()); -    //QTimer::singleShot(100,this,SLOT(delayedResize()));
> -  }
>
> -  if (((KDockWidget*)child0)->forcedFixedHeight()!=-1)
> -  {
> -
> 
> setForcedFixedHeight(((KDockWidget*)child0),((KDockWidget*)child0)->force
>d FixedHeight()); -   
> //QTimer::singleShot(100,this,SLOT(delayedResize())); -  }
> -  else
> -  if (((KDockWidget*)child1)->forcedFixedHeight()!=-1)
> -  {
> -
> 
> setForcedFixedHeight(((KDockWidget*)child1),((KDockWidget*)child1)->force
>d FixedHeight()); -   
> //QTimer::singleShot(100,this,SLOT(delayedResize())); -  }
> -  /*
> -  if (m_orientation == Horizontal) {
> -    if (fixedHeight0!=-1)
>  restoreFromForcedFixedSize((KDockWidget*)child0); -    if
>  (fixedHeight1!=-1) restoreFromForcedFixedSize((KDockWidget*)child1); +
>  KDockWidget* dw0 = (KDockWidget*) child0;
> +  KDockWidget* dw1 = (KDockWidget*) child1;
>
> -  } else {
> -    if (fixedWidth0!=-1)
> restoreFromForcedFixedSize((KDockWidget*)child0); -    if
> (fixedWidth1!=-1) restoreFromForcedFixedSize((KDockWidget*)child1); -  }
> +  // if fixed size is set, restore first, to restore xpos correctly
> +  if( fixedWidth0 != -1 || fixedHeight0 != -1 )
>  restoreFromForcedFixedSize( dw0 ); +  if( fixedWidth1 != -1 ||
>  fixedHeight1 != -1 ) restoreFromForcedFixedSize( dw1 );
it might happen, that number of resize events now is = 2
>
> -//   if (m_orientation == Vertical) {
>
> -    if (((KDockWidget*)child0)->forcedFixedWidth()!=-1) {
> -
> 
> setForcedFixedWidth(((KDockWidget*)child0),((KDockWidget*)child0)->forced
>F ixedWidth()); +  // now force fixed sizes, if they are set.
> +  if( dw0->forcedFixedWidth() != -1 ) {
> +    setForcedFixedWidth( dw0, dw0->forcedFixedWidth() );
>      }
> -    else if (((KDockWidget*)child1)->forcedFixedWidth()!=-1) {
> -
> 
> setForcedFixedWidth(((KDockWidget*)child1),((KDockWidget*)child1)->forced
>F ixedWidth()); +  else if( dw1->forcedFixedWidth() != -1 ) {
> +    setForcedFixedWidth( dw1, dw1->forcedFixedWidth() );
>      }
> -//    } else {
> -    if (((KDockWidget*)child0)->forcedFixedHeight()!=-1) {
> -
> 
> setForcedFixedHeight(((KDockWidget*)child0),((KDockWidget*)child0)->force
>d FixedHeight()); +
it might happen, that number of resize events now is = 3


> +  if( dw0->forcedFixedHeight() != -1 ) {
> +    setForcedFixedHeight (dw0, dw0->forcedFixedHeight() );
>      }
> -    else if (((KDockWidget*)child1)->forcedFixedHeight()!=-1) {
> -
> 
> setForcedFixedHeight(((KDockWidget*)child1),((KDockWidget*)child1)->force
>d FixedHeight()); +  else if( dw1->forcedFixedHeight() != -1 ) {
> +    setForcedFixedHeight( dw1, dw1->forcedFixedHeight() );
>      }
it might happen, that number of resize events now is = 4
> -//   }
> -  */
>  }

Sum: 4 resize events, debugging shows: This is true!

So if you want to fix the "too many resize events cause flicker"-bug, look 
here (we even have a BR for that). Maybe I'll come up with a patch, but 
feel free to be faster than me :)

n8,
-- 
Dominik
GPG Fingerprint: AC88 49E3 D8A5 0541 5B71 AC6E 29AA 1696 FF64 EDBC
User-Agent: KMail; Desktop: KDE; OS: Gentoo/Linux; *free software*
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kmdi-devel/attachments/20050304/7af07372/attachment.pgp
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic