Hi,
This is related to http://bugs.kde.org/show_bug.cgi?id=163676
It seems there is indeed a problem with QDesktopWidget. When I resize
my external monitor, the resize signal is fired with screen=0,
although the screen whose size changed is screen 1. Thus adjustSize
doesn't adjust the size of the panel, which I put on screen 1.

So as a workaround I wrote a hack that calls adjustSize for each
screen when we receive the signal. This works fine, at least on my
machine. The patch is attached. I'll try to have a look at
QDesktopWidget, but in the meantime this patch seems useful.

Regards,
g
Index: plasma/plasmaapp.h
===================================================================
--- plasma/plasmaapp.h  (revision 851076)
+++ plasma/plasmaapp.h  (working copy)
@@ -90,6 +90,7 @@
     void adjustSize(int screen);
 
 private:
+    void doAdjustSize(int screen);
     PlasmaApp(Display* display, Qt::HANDLE visual, Qt::HANDLE colormap);
     static void crashHandler(int signal);
     DesktopView* viewForScreen(int screen) const;
Index: plasma/plasmaapp.cpp
===================================================================
--- plasma/plasmaapp.cpp        (revision 851076)
+++ plasma/plasmaapp.cpp        (working copy)
@@ -333,6 +333,16 @@
 void PlasmaApp::adjustSize(int screen)
 {
     QDesktopWidget *desktop = QApplication::desktop();
+    // QDesktopWidget always thinks that it is screen 0 that was resized, even 
when it
+    // is not the case, so as a workaround we adjust the size of all the 
screens.
+    for (int i=0;i<desktop->numScreens();i++) {
+        doAdjustSize(i);
+    }
+}
+
+void PlasmaApp::doAdjustSize(int screen)
+{
+    QDesktopWidget *desktop = QApplication::desktop();
     bool screenExists = screen < desktop->numScreens();
 
     QRect screenGeom;
_______________________________________________
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel

Reply via email to