Bug 152848 - Toggle Raise Window With A Single Key
Summary: Toggle Raise Window With A Single Key
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-11-25 05:12 UTC by Truth.seek
Modified: 2019-01-25 09:05 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Truth.seek 2007-11-25 05:12:15 UTC
Version:            (using KDE KDE 3.5.8)
Installed from:    Unlisted Binary Package
OS:                Linux

Currently, there seems to be no easy way to toggle between raising a particular window eg. konsole and returning to the previous view before toggling. This would be highly useful in quickly monitoring etc. without disrupting workflow(allow the user to get back to where he is previously). It is worth nothing that this function is already available in kicker's ability to raise and minimize a window thorough clicking the window tab. However, it would be useful if this toggling effect could be extended to keyboard inputs etc. as well. 

As follows, I think the best way to implement this would be to add another action type under kcontrol>input actions i.e Keyboard Shortcut> Toggle Raise Window. Currently, only Keyboard Shortcut> Activate Window is available. In programming sense, the keyboard shortcut would be bound to a function along the lines of ; If window not raised, raise it. Else, lower it. 

My workaround for this involves placing the konsole window in another desktop, assigning tilda to switch between desktops and Ctrl+tilda to activate the konsole window.

Thanks in advance!
Comment 1 Andreas Pakulat 2007-11-25 11:16:18 UTC
I'm not sure I understand what you say, but the Alt-Tab switching always brings you back to the window you where in before. So if I have konqi and konsole open and switch with alt+tab to konsole another alt+tab brings me back to konqueror.
Comment 2 Truth.seek 2007-11-28 14:55:00 UTC
That is useful only with 2 windows opened. The same trick will not work with more windows without having to cycle through multiple windows. 

What I'm suggesting is more along the lines of the quake-like console activation mechanism i.e press tilda to activate(raise) it and press tilda again to hide(go back to where u previously was before raising the window).
Comment 3 Andreas Pakulat 2007-11-28 15:26:29 UTC
Did you try it? It works quite fine in my kde3 here, having tons of windows open. I hit alt+tab to switch from konqueror to my mail client and alt+tab again to switch back to the konqueror window. 

If that doesn't work in KDE4 thats a bug.
Comment 4 Truth.seek 2007-11-28 18:14:17 UTC
ALT+TAB works fine but the functionality I'm describing is different from that. Say you have many windows opened, among them is 1 konsole window. How do you bring to front/switch to that konsole window with 1 key press and switch back to the window u were previously viewing with another tap of the same key? 

With ALT+TAB, it is almost certain that you have to keep pressing tab while holding down alt to cycle until u get the konsole window u want. IMHO, an unnecessary hassle.
Comment 5 Andreas Pakulat 2007-11-28 18:49:14 UTC
so what you really want is to assign a separate shortcut to each window you have on the desktop? 

And guess what: In KDE3 at least (don't have a kde4 desktop running currently) this is already possible :) 

Open the window menu, select "Advanced" -> Shortcut for window. This will create a small overlayed widget in the top-right corner similar to what you have when setting shortcuts elsewhere in kde.
Comment 6 Truth.seek 2007-12-01 09:11:06 UTC
That function only activates the window assigned to the shortcut. What it can't do is hide the window again when I press the same shortcut when the window is already activated. This could be extended from as well here instead of from input actions.
Comment 7 Lubos Lunak 2007-12-06 18:08:13 UTC
Sorry, but this is featuritis. Use a shortcut for the window and use e.g. Alt+Tab to get back. If that's not enough, you're free to script it yourself (e.g. http://kde-apps.org/content/show.php/WMIface?content=40425).
Comment 8 Dan Harkless 2019-01-25 09:05:04 UTC
FYI for anyone who comes across this bug based on just the title (which apparently didn't unambiguously reflect what the OP was wishing for), assigning a keyboard shortcut to KWin for toggling raise/lower of the window under the cursor is already possible as of KDE 4.  Just go to System Settings: Common Appearance and Behavior: Shortcuts and Gestures, then select KDE component: KWin, then scroll down to Toggle Window Raise/Lower and assign the desired keystroke.

Then go to System Settings: Workspace Appearance and Behavior: Window Behavior: Window Behavior, and select Policy: Focus Under Mouse or Focus Strictly Under Mouse.  Unfortunately it's not possible to get this working with the settings to the left of Focus Under Mouse on the slider, which means no Focus stealing prevention.  You probably also want to set "Delay focus by" to 0 ms or thereabouts.

Ever since CDE in the early '90s, I've found it handy (especially during development) to overlap the borders of two terminal windows (with an editor running in the lefthand window, and a commandline in the righthand window), place the mouse pointer on the overlapping region, and then switch between the windows with a keystroke, so as not to have to keep reaching for the mouse.  

A lot of discussions out there claim this isn't possible with KDE, but it is.  One quirk is that you have to use the assigned keystroke two times in a row for it to lower the active window; not sure why.