Bug 59161

Summary: need a way to move windows to screen corners with key bindings
Product: [Plasma] kwin Reporter: Justin Mason <jm-kde>
Component: generalAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: wishlist CC: binsh00
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: RedHat Enterprise Linux   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Proposed patch
patch for window-to-corner

Description Justin Mason 2003-05-31 03:07:57 UTC
Version:            (using KDE KDE 3.1)
Installed from:    RedHat RPMs

Hi folks -- just moved from sawfish/GNOME. ;)   This was a cool feature -- it was possible to control window position with a key binding.  Also doable with E.

Basically, one could bind a key+mouse combo (e.g. CTRL-SHIFT-LMB) which would move the current focused window into the top-left/top-right/bottom-left/bottom-right corner.  very handy for throwing windows around the screen without too much rodent use.

So far, apart from that, I haven't found myself missing very much ;)
Comment 1 Lubos Lunak 2003-06-03 12:30:36 UTC
*** Bug 53552 has been marked as a duplicate of this bug. ***
Comment 2 Viekas Kuriiri 2003-06-03 20:44:20 UTC
Created attachment 1712 [details]
Proposed patch

This patch I made a while ago implements something like it.
Comment 3 Justin Mason 2003-06-05 03:46:16 UTC
Hi Viekas -- it looks useful!   I'm not sure how well it'll work on my desktop,
since I generally carpet the entire screen with rxvts, and have other apps --
browser, mail reader etc. -- visible on top of those.  Given this, it'll always
overlap some client.

I'd like to try it out anyway, and if it doesn't work for me, I have pretty much
all the APIs that would be needed to implement the "corner" behaviour, in that
patch.   But I'm running into what I'm sure is a total newbie KDE developer
issue. ;)

I've installed the Red Hat 3.1.1 KDE rpms, got the source RPM for kdebase, built
it, patched and rebuilt kwin, and did "make install" from the kwin build dir. 
When I restart KDE, those "Pack Window [direction]" config settings do not
appear in kcontrol; if I log out, add them by hand to
~/.kde/share/config/kdeglobals, and restart KDE, they're deleted by the time my
session has fully started.

Is there a step I'm missing?  Sorry if this is a very basic question.
Comment 4 Viekas Kuriiri 2003-06-06 02:22:09 UTC
You need to rebuild and reinstall some other module besides kwin. I don't
remember exactly, but it might have been kcontrol. I think some file in it wants
to include kwinbindings.cpp. I'm sorry for the vague answer but I don't have the
source here. You'll probably find the right module by grepping for kwinbindings.
Alternatively, you could rebuild the whole kdebase after applying the diff.
Comment 5 Lubos Lunak 2003-06-09 20:23:27 UTC
I applied the patch to kwin_iii, after modifying it a bit. Thanks. 
Justin: You need to recompile also kdebase/kcontrol/keys to see the keys in kcontrol. 
 
 
 
Comment 6 Justin Mason 2003-10-01 23:19:41 UTC
Created attachment 2666 [details]
patch for window-to-corner

Hi again guys --
I *finally* got some time to try out Viekas' patch -- sorry about the delay.  

Unfortunately it wasn't quite what I was after; as I thought, on a desktop
that's already got 1 layer of windows all over it (like my one) it gets a bit
confused and the window kind of judders a few pixels along, each time you press
the keys.  If you repeatedly press the keys, hoping to get it all the way over
to one side, sometimes it doesn't find a window "blocking" it underneath
itself, and makes a big jump -- and you find yourself accidentally moving the
window underneath to the right as well because you're tapping the keys and you
weren't expecting that.   Usability-wise that's not quite what I'm after.

But the attached patch implements the "move window to
top-left/top-right/bottom-left/bottom-right corner" functionality along the
same lines.  (Thanks for the tips on what needed rebuilding for the new keys to
become visible BTW.)  It's a patch against current CVS.   I've patched KDE
3.1.2 (what I'm running now) with more-or-less the same code and it works great
-- modulo a keybinding issue I'll open a sep bug against.

BTW if you'd prefer I open this as a separate bug I'd be happy to...
Comment 7 Lubos Lunak 2003-10-02 09:49:24 UTC
Sorry, I don't think there's a need to have separate shortcuts just for moving to corners, 
repeated usage of the "packing" shortcuts does the same as well. 
If you have some problem with the packing shortcuts, please file a separate bugreport about 
that. And I don't actually understand from your description what the problem with it should be. 
 
Comment 8 Justin Mason 2003-10-02 18:41:55 UTC
ok- opened as bug 65388.
Comment 9 Viekas Kuriiri 2003-10-03 21:13:22 UTC
Subject: Re:  need a way to move windows to screen corners with key bindings

Maybe it would be better if the window being moved didn't lost focus even 
though it moved away underneath the cursor? That's how the gnome/sawfish 
packing works.

_________________________________________________________________
The new MSN 8: smart spam protection and 2 months FREE*  
http://join.msn.com/?page=features/junkmail

Comment 10 Justin Mason 2003-10-03 21:37:58 UTC
that would help, I think.   BTW note that I'm using "focus under mouse", not
"focus follows mouse" as I previously stated (oops, sorry about that).   it may
be that with KDE "focus follows mouse", this behaviour is already the case.

(I still maintain that the one-keypress "move to corner" shortcut is extremely
useful, in addition, though. ;)