[haiku-commits] r34108 - in haiku/trunk: docs/userguide/en src/kits/interface src/servers/app

  • From: axeld@xxxxxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 18 Nov 2009 11:33:32 +0100 (CET)

Author: axeld
Date: 2009-11-18 11:33:32 +0100 (Wed, 18 Nov 2009)
New Revision: 34108
Changeset: http://dev.haiku-os.org/changeset/34108/haiku

Modified:
   haiku/trunk/docs/userguide/en/gui.html
   haiku/trunk/src/kits/interface/Window.cpp
   haiku/trunk/src/servers/app/ServerWindow.cpp
Log:
* 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.


Modified: haiku/trunk/docs/userguide/en/gui.html
===================================================================
--- haiku/trunk/docs/userguide/en/gui.html      2009-11-18 10:21:25 UTC (rev 
34107)
+++ haiku/trunk/docs/userguide/en/gui.html      2009-11-18 10:33:32 UTC (rev 
34108)
@@ -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"
-       "../../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">
 <head>
-<!-- 
+<!--
  *
- * Copyright 2008, Haiku. All rights reserved.
+ * Copyright 2008-2009, Haiku. All rights reserved.
  * Distributed under the terms of the MIT License.
  *
  * Authors:
@@ -45,14 +45,15 @@
 <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>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 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 "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>
 </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>
 <a href="#logo"><img src="../images/up.png" align="right" alt="index" 
border="0" class="noprint" /></a>

Modified: haiku/trunk/src/kits/interface/Window.cpp
===================================================================
--- haiku/trunk/src/kits/interface/Window.cpp   2009-11-18 10:21:25 UTC (rev 
34107)
+++ haiku/trunk/src/kits/interface/Window.cpp   2009-11-18 10:33:32 UTC (rev 
34108)
@@ -64,6 +64,8 @@
 
 #define _MINIMIZE_                     '_WMZ'
 #define _ZOOM_                         '_WZO'
+#define _SEND_BEHIND_          '_WSB'
+#define _SEND_TO_FRONT_                '_WSF'
 #define _SWITCH_WORKSPACE_     '_SWS'
 
 
@@ -594,11 +596,11 @@
 status_t
 BWindow::SendBehind(const BWindow* window)
 {
-       if (!window || !Lock())
+       if (!Lock())
                return B_ERROR;
 
        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());
 
        status_t status = B_ERROR;
@@ -884,6 +886,14 @@
                                Zoom();
                        break;
 
+               case _SEND_BEHIND_:
+                       SendBehind(NULL);
+                       break;
+
+               case _SEND_TO_FRONT_:
+                       Activate();
+                       break;
+
                case _SWITCH_WORKSPACE_:
                {
                        int32 deltaX = 0;
@@ -2708,6 +2718,10 @@
                new BMessage(_ZOOM_), NULL);
        AddShortcut('H', B_COMMAND_KEY | B_CONTROL_KEY,
                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
        BMessage* message;

Modified: haiku/trunk/src/servers/app/ServerWindow.cpp
===================================================================
--- haiku/trunk/src/servers/app/ServerWindow.cpp        2009-11-18 10:21:25 UTC 
(rev 34107)
+++ haiku/trunk/src/servers/app/ServerWindow.cpp        2009-11-18 10:33:32 UTC 
(rev 34108)
@@ -665,13 +665,13 @@
 
                        link.Read<int32>(&token);
                        if (link.Read<team_id>(&teamID) == B_OK) {
-                               ::Window *behindOf = 
fDesktop->FindWindowByClientToken(token,
+                               ::Window* behindOf = 
fDesktop->FindWindowByClientToken(token,
                                        teamID);
 
                                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);
                                        status = B_OK;
                                } else


Other related posts: