Fwd: KDesktop patch - usefull?

Lubos Lunak l.lunak at sh.cvut.cz
Mon Apr 8 11:54:29 BST 2002


On Mon 8. April 2002 12:27, David Faure wrote:
> 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 )
>

 The patch should rather use KWin::setCurrentDesktop() , at least if we want 
KDE to work also with other WMs.
 I personally don't see how this can be useful. It works only when the mouse 
is above desktop area not covered by any window, and since most people use 
maximized windows, how useful it can be to switch between empty virtual 
desktops? Not that I care much ... who does scrollwheel above the desktop 
after all?

-- 
 Lubos Lunak
 llunak at suse.cz ; l.lunak at kde.org
 http://dforce.sh.cvut.cz/~seli




More information about the kde-core-devel mailing list