Fwd: KDesktop patch - usefull?
David Faure
faure at kde.org
Mon Apr 8 11:27:26 BST 2002
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 at unb.ca>
To: faure at 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 at mandrakesoft.com, faure at kde.org
http://people.mandrakesoft.com/~david/, http://www.konqueror.org/
KDE, Making The Future of Computing Available Today
More information about the kde-core-devel
mailing list