Re: Multi-screen widgets on screensaver

2009-11-10 Thread David Palacio
On Lunes 09 Noviembre 2009 15:42:21 Aaron J. Seigo escribió:
 On November 8, 2009, David Palacio wrote:
  I added support to plasma-overlay for multiple screens. For now only
  tested on a TwinView setup.
 
 nice .. Chani should also review it and give it her thumbs up/down and/or
 other input.
 
  I am not sure if the work done on lockprocess.cc will work on non
  Xinerama setups.
 
 this should be sent to Oswald as he maintains that bit of code.

Actually, it should work. It would pick the right root window and map the 
correct coordinates. Though, if there is a better way to get the screen under 
the pointer, please say.

I would like to get rid of the m_views vector. Nothing meaningful is done with 
the views.

plasmaapp.cpp:469
 void PlasmaApp::dialogDestroyed(QObject *obj)
 {
 m_dialogs.removeAll(qobject_castQWidget*(obj));
 if (m_dialogs.isEmpty()) {
 //FIXME multiview
 //if (m_view) {
 //this makes qactions work again
 //m_view-activateWindow();
 //}
Is this still a problem? I am not sure what problems occur regarding QActions.

Move widgets between screens:
Would be nice, but not essential. I think Kephal helps on this? It is not 
documented, though :/


signature.asc
Description: This is a digitally signed message part.
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Re: Multi-screen widgets on screensaver

2009-11-09 Thread Aaron J. Seigo
On November 8, 2009, David Palacio wrote:
 I added support to plasma-overlay for multiple screens. For now only tested
  on a TwinView setup.

nice .. Chani should also review it and give it her thumbs up/down and/or 
other input.

 I am not sure if the work done on lockprocess.cc will work on non Xinerama
 setups.

this should be sent to Oswald as he maintains that bit of code.
 
 To let the plasma app work with multiple views I (ab)use signals/slots.

it looks like a sensible solution.

-- 
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

KDE core developer sponsored by Qt Development Frameworks


signature.asc
Description: This is a digitally signed message part.
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Re: Multi-screen widgets on screensaver

2009-11-09 Thread Chani
On November 9, 2009 12:42:21 Aaron J. Seigo wrote:
 On November 8, 2009, David Palacio wrote:
  I added support to plasma-overlay for multiple screens. For now only
  tested on a TwinView setup.
 
 nice .. Chani should also review it and give it her thumbs up/down and/or
 other input.

my input was that I really don't know enough about multi-screen to judge any 
of it :) it's not doing anything funky, so if a multi-screen person thinks 
it's ok and ossi doesn't have any objections then I'm happy to have it go in. 
:)

although I do find it odd that it's not using kephal, and wonder if there's any 
disadvantage in that. wasn't kephal supposed to do magical important 
multiscreen things?

-- 
This message brought to you by eevil bananas and the number 3.
www.chani3.com


signature.asc
Description: This is a digitally signed message part.
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Multi-screen widgets on screensaver

2009-11-08 Thread David Palacio
I added support to plasma-overlay for multiple screens. For now only tested on 
a TwinView setup.

I am not sure if the work done on lockprocess.cc will work on non Xinerama 
setups.

To let the plasma app work with multiple views I (ab)use signals/slots.

Related bugs:

Bug 193020: Screensaver widgets can't be moved to second monitor
** (not fixed yet)

Bug 197299: screensaver overlay assumes screen starts at (0,0)  screensaver 
overlay assumes screen starts at (0,0)
** (fixed)
Index: krunner/lock/lockprocess.cc
===
--- krunner/lock/lockprocess.cc	(revisión: 1044119)
+++ krunner/lock/lockprocess.cc	(copia de trabajo)
@@ -1410,8 +1410,31 @@
 {
 //kDebug()  forward to plasma;
 XEvent ev2 = *event;
-ev2.xkey.window = ev2.xkey.subwindow = mForeignInputWindows.first();
-XSendEvent(QX11Info::display(), ev2.xkey.window, False, NoEventMask, ev2);
+Window root_return;
+int x_return, y_return;
+unsigned int width_return, height_return, border_width_return, depth_return;
+WId targetWindow = 0;
+kDebug()  root is  winId();
+kDebug()  search window under pointer with  mForeignInputWindows.size()  windows;
+foreach(WId window, mForeignInputWindows)
+{
+XGetGeometry(QX11Info::display(), window, root_return,
+x_return, y_return,
+width_return, height_return,
+border_width_return, depth_return);
+if( (event-xkey.x=x_return  event-xkey.x=x_return+(int)width_return)
+
+(event-xkey.y=y_return  event-xkey.y=y_return+(int)height_return) )
+{
+kDebug()  found window  window;
+targetWindow = window;
+ev2.xkey.window = ev2.xkey.subwindow = targetWindow;
+ev2.xkey.x = event-xkey.x - x_return;
+ev2.xkey.y = event-xkey.y - y_return;
+break;
+}
+}
+XSendEvent(QX11Info::display(), targetWindow, False, NoEventMask, ev2);
 ret = true;
 }
 default:
Index: plasma/screensaver/shell/plasmaapp.cpp
===
--- plasma/screensaver/shell/plasmaapp.cpp	(revisión: 1044119)
+++ plasma/screensaver/shell/plasmaapp.cpp	(copia de trabajo)
@@ -126,7 +126,6 @@
 PlasmaApp::PlasmaApp(Display* display, Qt::HANDLE visual, Qt::HANDLE colormap)
 : KUniqueApplication(display, visual, colormap),
   m_corona(0),
-  m_view(0),
   m_configDialog(0)
 {
 //load translations for libplasma
@@ -142,7 +141,9 @@
 // Add 10% so that other (smaller) pixmaps can also be cached.
 int cacheSize = 0;
 QDesktopWidget *desktop = QApplication::desktop();
-for (int i = 0; i  desktop-numScreens(); i++) {
+int numScreens = desktop-numScreens();
+m_views.resize(numScreens);
+for (int i = 0; i  numScreens; i++) {
 QRect geometry = desktop-screenGeometry(i);
 cacheSize += 4 * geometry.width() * geometry.height() / 1024;
 }
@@ -226,8 +227,8 @@
 m_corona-saveLayout();
 }
 
-delete m_view;
-delete m_corona;
+//delete m_view; //should not be needed
+delete m_corona; //should not be needed?
 
 KGlobal::config()-sync();
 }
@@ -238,10 +239,7 @@
 return;
 }
 m_activeOpacity = opacity;
-if (m_view) {
-//assume it's active, since things are happening
-m_view-setWindowOpacity(opacity);
-}
+emit setViewOpacity(opacity);
 KConfigGroup cg(KGlobal::config(), General);
 cg.writeEntry(activeOpacity, opacity);
 m_corona-requestConfigSync();
@@ -271,41 +269,33 @@
 
 void PlasmaApp::setActive(bool activate)
 {
-if (!m_view) {
-return;
-}
-
 if (activate) {
-m_view-setWindowOpacity(m_activeOpacity);
-m_view-showView();
-m_view-containment()-openToolBox();
-} else if (m_view-isVisible()) {
+emit setViewOpacity(m_activeOpacity);
+emit showViews();
+emit openToolBox(); //TODO slot in Containment?
+} else {
 if (qFuzzyCompare(m_idleOpacity + qreal(1.0), qreal(1.0))) {
 //opacity is 0
-m_view-hideView();
+emit hideViews();
 } else {
 lock();
-m_view-setWindowOpacity(m_idleOpacity);
-m_view-containment()-closeToolBox();
+emit setViewOpacity(m_idleOpacity);
+emit showViews();
+emit closeToolBox(); //TODO slot in Containment?
 }
-} else {
-if (m_idleOpacity  0) {
-