* BWindow::SendBehind(NULL) will now send the window to back.

* Added shortcuts ctrl-alt-F to get a window to front, and ctrl-alt-b to move it
  to the back.
* Updated the user guide with these shortcuts, and also explained the missing
  "single click to bring window to front" behaviour.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34108 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2009-11-18 10:33:32 +00:00
parent 2ecfe97e37
commit 289d85d2ac
3 changed files with 27 additions and 12 deletions
+8 -7
View File
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"../../html-dtd/xhtml1-strict.dtd"> "../../html-dtd/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">
<head> <head>
<!-- <!--
* *
* Copyright 2008, Haiku. All rights reserved. * Copyright 2008-2009, Haiku. All rights reserved.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
* *
* Authors: * Authors:
@@ -45,14 +45,15 @@
<ol> <ol>
<li><p>The Deskbar is Haiku's "Start" menu and taskbar, if you will. See topic <a href="deskbar.html">Deskbar</a>.</p></li> <li><p>The Deskbar is Haiku's "Start" menu and taskbar, if you will. See topic <a href="deskbar.html">Deskbar</a>.</p></li>
<li>The yellow tab offers more than just a program's name or a document's filename: <li>The yellow tab offers more than just a program's name or a document's filename:
<ul><li>You can move it by holding the <span class="key">SHIFT</span> key while dragging it to another position, enabling you to stack a number of windows and conveniently access them by their named tab.</li> <ul><li>A single click will bring the window to front in case it is not yet there (you can achieve the same by using <span class="key">CTRL</span>&#160;<span class="key">ALT</span>&#160;<span class="key">F</span>).</li>
<li>You can move it by holding the <span class="key">SHIFT</span> key while dragging it to another position, enabling you to stack a number of windows and conveniently access them by their named tab.</li>
<li>You minimize a window with a double-click on its tab (or with <span class="key">CTRL</span>&#160;<span class="key">ALT</span>&#160;<span class="key">M</span>). A such hidden window can be accessed by its entry in the <a href="deskbar.html">Deskbar</a> or the <a href="twitcher.html">Twitcher</a>.</li> <li>You minimize a window with a double-click on its tab (or with <span class="key">CTRL</span>&#160;<span class="key">ALT</span>&#160;<span class="key">M</span>). A such hidden window can be accessed by its entry in the <a href="deskbar.html">Deskbar</a> or the <a href="twitcher.html">Twitcher</a>.</li>
<li>You can send a window to the back with a right-click on its tab (or its border).</li></ul></li> <li>You can send a window to the back with a right-click on its tab (or its border, or with <span class="key">CTRL</span>&#160;<span class="key">ALT</span>&#160;<span class="key">B</span> alternatively).</li></ul></li>
<li><p>The close button.</p></li> <li><p>The close button.</p></li>
<li><p>The "alternative size" button (or <span class="key">CTRL</span>&#160;<span class="key">ALT</span>&#160;<span class="key">Z</span>). In most applications, this will expand a window to maximum size. It doesn't have to, however. Tracker windows, for example, will resize to best fit the contents.</p></li> <li><p>The "alternative size" button (or <span class="key">CTRL</span>&#160;<span class="key">ALT</span>&#160;<span class="key">Z</span>). In most applications, this will expand a window to maximum size. It doesn't have to, however. Tracker windows, for example, will resize to best fit the contents.</p></li>
<li><p>The resize corner. Dragging anywhere else on a window's border will move the window.</p></li> <li><p>The resize corner. Dragging anywhere else on a window's border will move the window.</p></li>
</ol> </ol>
<div class="box-info">While holding <span class="key">CTRL</span>&#160;<span class="key">ALT</span>, you can click anywhere into a window to move it with the left mouse button; the right mouse button sends it to the back.</div> <div class="box-info">While holding <span class="key">CTRL</span>&#160;<span class="key">ALT</span>, you can click anywhere into a window to bring it to front, or click and hold to move it with the left mouse button; the right mouse button sends it to the back.</div>
<h1> <h1>
<a href="#logo"><img src="../images/up.png" align="right" alt="index" border="0" class="noprint" /></a> <a href="#logo"><img src="../images/up.png" align="right" alt="index" border="0" class="noprint" /></a>
+16 -2
View File
@@ -64,6 +64,8 @@
#define _MINIMIZE_ '_WMZ' #define _MINIMIZE_ '_WMZ'
#define _ZOOM_ '_WZO' #define _ZOOM_ '_WZO'
#define _SEND_BEHIND_ '_WSB'
#define _SEND_TO_FRONT_ '_WSF'
#define _SWITCH_WORKSPACE_ '_SWS' #define _SWITCH_WORKSPACE_ '_SWS'
@@ -594,11 +596,11 @@ BWindow::Minimize(bool minimize)
status_t status_t
BWindow::SendBehind(const BWindow* window) BWindow::SendBehind(const BWindow* window)
{ {
if (!window || !Lock()) if (!Lock())
return B_ERROR; return B_ERROR;
fLink->StartMessage(AS_SEND_BEHIND); fLink->StartMessage(AS_SEND_BEHIND);
fLink->Attach<int32>(_get_object_token_(window)); fLink->Attach<int32>(window != NULL ? _get_object_token_(window) : -1);
fLink->Attach<team_id>(Team()); fLink->Attach<team_id>(Team());
status_t status = B_ERROR; status_t status = B_ERROR;
@@ -884,6 +886,14 @@ BWindow::DispatchMessage(BMessage* msg, BHandler* target)
Zoom(); Zoom();
break; break;
case _SEND_BEHIND_:
SendBehind(NULL);
break;
case _SEND_TO_FRONT_:
Activate();
break;
case _SWITCH_WORKSPACE_: case _SWITCH_WORKSPACE_:
{ {
int32 deltaX = 0; int32 deltaX = 0;
@@ -2708,6 +2718,10 @@ BWindow::_InitData(BRect frame, const char* title, window_look look,
new BMessage(_ZOOM_), NULL); new BMessage(_ZOOM_), NULL);
AddShortcut('H', B_COMMAND_KEY | B_CONTROL_KEY, AddShortcut('H', B_COMMAND_KEY | B_CONTROL_KEY,
new BMessage(B_HIDE_APPLICATION), NULL); new BMessage(B_HIDE_APPLICATION), NULL);
AddShortcut('F', B_COMMAND_KEY | B_CONTROL_KEY,
new BMessage(_SEND_TO_FRONT_), NULL);
AddShortcut('B', B_COMMAND_KEY | B_CONTROL_KEY,
new BMessage(_SEND_BEHIND_), NULL);
// Workspace modifier keys // Workspace modifier keys
BMessage* message; BMessage* message;
+3 -3
View File
@@ -665,13 +665,13 @@ ServerWindow::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link)
link.Read<int32>(&token); link.Read<int32>(&token);
if (link.Read<team_id>(&teamID) == B_OK) { if (link.Read<team_id>(&teamID) == B_OK) {
::Window *behindOf = fDesktop->FindWindowByClientToken(token, ::Window* behindOf = fDesktop->FindWindowByClientToken(token,
teamID); teamID);
DTRACE(("ServerWindow %s: Message AS_SEND_BEHIND %s\n", DTRACE(("ServerWindow %s: Message AS_SEND_BEHIND %s\n",
Title(), behindOf ? behindOf->Title() : "NULL")); Title(), behindOf != NULL ? behindOf->Title() : "NULL"));
if (behindOf != NULL) { if (behindOf != NULL || token == -1) {
fDesktop->SendWindowBehind(fWindow, behindOf); fDesktop->SendWindowBehind(fWindow, behindOf);
status = B_OK; status = B_OK;
} else } else