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

List:       kde-core-devel
Subject:    Fwd: KDesktop patch - usefull?
From:       David Faure <faure () kde ! org>
Date:       2002-04-08 10:27:26
[Download RAW message or body]

What do people think about this feature?
Anyone willing to make a config option for it?

----------  Forwarded Message  ----------

Subject: KDesktop patch - usefull?
Date: 07 Apr 2002 14:49:46 -0300
From: Jason Keirstead <t126r@unb.ca>
To: faure@kde.org

Hi David. According to bugs.kde.org, you are the maintainer of the
kdesktop source. If I am wrong, please let me know :)

I wrote this little patch and I think others would find it extremely
usefull as well. It duplicates the functionality in E whereby if you
scroll the mousewheel on your desktop, it switches virtual desktops
either backward or forward depending on the direction.

I realize some would not want to have this function, and that it should
probably by some kind of option under Desktop settings, but I know
nothing about programming the KDE gui, so I'll just forward this along
to you and you can do what you want with it! It only affects one file,
and is extremely simple.

Happy Trails.

---BEGIN PATCH---
diff -urN kdebase/kdesktop/kdiconview.old kdebase/kdesktop/kdiconview.cc
--- kdebase/kdesktop/kdiconview.old     Sun Apr  7 14:29:31 2002
+++ kdebase/kdesktop/kdiconview.cc      Sun Apr  7 14:29:21 2002
@@ -38,7 +38,7 @@
 #include <kstdaction.h>
 #include <kstandarddirs.h>
 #include <kurldrag.h>
-
+#include <dcopclient.h>
 #include <qdir.h>
 #include <qclipboard.h>
 #include <qregexp.h>
@@ -842,7 +842,14 @@
 // don't scroll when someone uses his nifty mouse wheel
 void KDIconView::viewportWheelEvent( QWheelEvent * e )
 {
-    e->ignore();
+    int _delta = e->delta();
+    if( _delta < 0 ) {
+        kapp->dcopClient()->send("kwin", "KWinInterface",
"previousDesktop()", "");
+    } else {
+        kapp->dcopClient()->send("kwin", "KWinInterface",
"nextDesktop()", "");
+    }
+
+    //e->ignore();
 }

 void KDIconView::updateWorkArea( const QRect &wr )



-------------------------------------------------------

-- 
David FAURE, david@mandrakesoft.com, faure@kde.org
http://people.mandrakesoft.com/~david/, http://www.konqueror.org/
KDE, Making The Future of Computing Available Today


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

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