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

List:       kde-core-devel
Subject:    Varying desktop sizes (Was: Roaming User Support - Questions...)
From:       Waldo Bastian <bastian () kde ! org>
Date:       2004-02-04 10:50:50
Message-ID: 200402041150.50443.bastian () kde ! org
[Download RAW message or body]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wed February 4 2004 08:27, Bo Thorsen wrote:
> I have a 2560x1024 desktop and two 1024x768 desktops, and I have learned
> simply not to run KDE with the same .kde between these :-( Just try
> setting reasonable background images on these to see the immediate
> problem. 

I don't have such setup so if you can tell what the problem is that would be 
more helpful.

> After that, you will notice that the location of kicker buttons 
> and applets will be completely screwed up when you go back to the
> xinerama screen. To make matters worse, I have the xinerama support on
> kicker set up so the panel only shows on one monitor. This doesn't
> exactly work well when I log in on the smaller desktops.

Does the attached patch help?

Cheers,
Waldo
- -- 
bastian@kde.org -=|[ SUSE, The Linux Desktop Experts ]|=- bastian@suse.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQFAIM6KN4pvrENfboIRAoUqAJwL248wCaC7QNWD65sLMqyCdu0eMACdE9lx
idzenCW7XNMx8WxqhMMdSq4=
=L4Yr
-----END PGP SIGNATURE-----

["kicker_desktop_sizes.patch" (text/x-diff)]

Index: core/container_base.cpp
===================================================================
RCS file: /home/kde/kdebase/kicker/core/container_base.cpp,v
retrieving revision 1.17
diff -u -p -r1.17 container_base.cpp
--- core/container_base.cpp	7 Feb 2003 14:57:42 -0000	1.17
+++ core/container_base.cpp	4 Feb 2004 10:45:09 -0000
@@ -31,6 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE 
 #include "panel.h"
 #include "appletop_mnu.h"
 
+#include "container_panel.h"
 #include "container_base.h"
 #include "container_base.moc"
 
@@ -54,7 +55,25 @@ BaseContainer::~BaseContainer()
 
 void BaseContainer::loadConfiguration( KConfigGroup& group )
 {
-    setFreeSpace( QMIN( group.readDoubleNumEntry( "FreeSpace", 0 ), 1 ) );
+    QWidget *parent = parentWidget();
+    while(parent && !parent->inherits("PanelContainer"))
+       parent = parent->parentWidget();
+qWarning("BaseContainer::loadConfiguration parent = %p this = %p", parent, this);
+
+    QString key;
+    PanelContainer *container = dynamic_cast<PanelContainer *>(parent);
+    if (container)
+    {
+       key = QString("FreeSpace %1").arg(container->desktopWidth());
+       if (!group.hasKey(key))
+          key = "FreeSpace";
+    }
+    else
+    {
+       key = "FreeSpace";
+    }
+      
+    setFreeSpace( QMIN( group.readDoubleNumEntry( key, 0 ), 1 ) );
     doLoadConfiguration( group );
 }
 
@@ -62,6 +81,18 @@ void BaseContainer::saveConfiguration( K
                                        bool layoutOnly ) const
 {
     // write positioning info
+    QWidget *parent = parentWidget();
+    while(parent && !parent->inherits("PanelContainer"))
+       parent = parent->parentWidget();
+qWarning("BaseContainer::saveConfiguration parent = %p this = %p", parent, this);
+
+    PanelContainer *container = dynamic_cast<PanelContainer *>(parent);
+    if (container)
+    {
+       QString key = QString("FreeSpace %1").arg(container->desktopWidth());
+       group.writeEntry( key, freeSpace() );
+    }
+       
     group.writeEntry( "FreeSpace", freeSpace() );
     // write type specific info
     doSaveConfiguration( group, layoutOnly );
Index: core/container_panel.cpp
===================================================================
RCS file: /home/kde/kdebase/kicker/core/container_panel.cpp,v
retrieving revision 1.86
diff -u -p -r1.86 container_panel.cpp
--- core/container_panel.cpp	11 Nov 2003 16:50:36 -0000	1.86
+++ core/container_panel.cpp	4 Feb 2004 10:45:09 -0000
@@ -111,7 +111,6 @@ void PanelSettings::readConfig( KConfig 
     _hideAnimSpeed     = c->readNumEntry(  "HideAnimationSpeed",     _hideAnimSpeed);
     _unhideLocation    = static_cast<UnhideTrigger::Trigger>(
                          c->readNumEntry(  "UnhideLocation",         _unhideLocation));
-    _sizePercentage    = c->readNumEntry(  "SizePercentage",         _sizePercentage );
     _expandSize        = c->readBoolEntry( "ExpandSize",             _expandSize );
     _resizeablehandle   = c->readBoolEntry( "ResizeableHandle", false );
     int sizeSetting    = c->readNumEntry(  "Size",                   static_cast<int>(_size));
@@ -126,8 +125,6 @@ void PanelSettings::readConfig( KConfig 
     if (_HBwidth < 3) _HBwidth = 3;
     else if (_HBwidth > 24) _HBwidth = 24;
 
-    if ( _sizePercentage < 1 ) _sizePercentage = 1;
-    else if ( _sizePercentage > 100 ) _sizePercentage = 100;
 }
 
 void PanelSettings::writeConfig( KConfig *c ) {
@@ -144,7 +141,6 @@ void PanelSettings::writeConfig( KConfig
     c->writeEntry( "HideAnimation",          _hideAnim);
     c->writeEntry( "HideAnimationSpeed",     _hideAnimSpeed);
     c->writeEntry( "UnhideLocation",         static_cast<int>(_unhideLocation));
-    c->writeEntry( "SizePercentage",         _sizePercentage );
     c->writeEntry( "ExpandSize",             _expandSize );
     c->writeEntry( "ResizeableHandle",         _resizeablehandle );
     c->writeEntry( "Size",                   static_cast<int>(_size));
@@ -234,6 +230,11 @@ int PanelContainer::xineramaScreen() con
       return QApplication::desktop()->primaryScreen();
 }
 
+int PanelContainer::desktopWidth()
+{
+    return QApplication::desktop()->screenGeometry(xineramaScreen()).width();
+}
+
 void PanelContainer::setMainWidget( QWidget* main )
 {
    main->reparent( this, QPoint( 0,0 ) );
@@ -258,6 +259,14 @@ void PanelContainer::readConfig( KConfig
     _settings = defaultSettings();
     _settings.readConfig( config );
 
+    QString key = QString("SizePercentage %1").arg(desktopWidth());
+    if (!config->hasKey(key))
+       key = "SizePercentage";
+    _settings._sizePercentage    = config->readNumEntry(  key, _settings._sizePercentage );
+
+    if ( _settings._sizePercentage < 1 ) _settings._sizePercentage = 1;
+    else if ( _settings._sizePercentage > 100 ) _settings._sizePercentage = 100;
+
     emit positionChange( position() );
     emit alignmentChange( alignment() );
     emit sizeChange( _settings._size, _settings._customSize );
@@ -294,6 +303,8 @@ void PanelContainer::writeConfig( KConfi
 //    kdDebug(1210) << "PanelContainer::writeConfig()" << endl;
 
     _settings.writeConfig( config );
+    config->writeEntry( "SizePercentage", _settings._sizePercentage );
+    config->writeEntry( QString("SizePercentage %1").arg(desktopWidth()), _settings._sizePercentage );
 }
 
 void PanelContainer::arrange( Position p, Alignment a, int XineramaScreen )
Index: core/container_panel.h
===================================================================
RCS file: /home/kde/kdebase/kicker/core/container_panel.h,v
retrieving revision 1.34
diff -u -p -r1.34 container_panel.h
--- core/container_panel.h	27 Nov 2002 21:50:31 -0000	1.34
+++ core/container_panel.h	4 Feb 2004 10:45:09 -0000
@@ -83,6 +83,8 @@ public:
     int xineramaScreen() const;
     void setXineramaScreen(int screen) { arrange(position(),alignment(), screen); }
 
+    int desktopWidth();
+
     bool resizeablehandle() const { return _settings._resizeablehandle; };
     void setResizeableHandle( bool resizeablehandle=true );
     void setSize(Size size, int customSize = 0);


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

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