[haiku-commits] r34404 - in haiku/trunk/src: apps/deskbar servers/app

  • From: axeld@xxxxxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 1 Dec 2009 10:47:27 +0100 (CET)

Author: axeld
Date: 2009-12-01 10:47:27 +0100 (Tue, 01 Dec 2009)
New Revision: 34404
Changeset: http://dev.haiku-os.org/changeset/34404/haiku

Modified:
   haiku/trunk/src/apps/deskbar/BarWindow.cpp
   haiku/trunk/src/apps/deskbar/BarWindow.h
   haiku/trunk/src/servers/app/ServerWindow.cpp
   haiku/trunk/src/servers/app/Window.cpp
Log:
* Removed (incorrect) check in ServerWindow::NotifyMinimize() for
  B_NOT_MINIMIZABLE; it should still be possible to hide an application
  programmatically.
* The decorators now honor this flag, though.
* And the Deskbar overrides BWindow::Minimize() to ignore all minimize requests.


Modified: haiku/trunk/src/apps/deskbar/BarWindow.cpp
===================================================================
--- haiku/trunk/src/apps/deskbar/BarWindow.cpp  2009-12-01 09:38:34 UTC (rev 
34403)
+++ haiku/trunk/src/apps/deskbar/BarWindow.cpp  2009-12-01 09:47:27 UTC (rev 
34404)
@@ -32,7 +32,11 @@
 All rights reserved.
 */
 
+
+#include "BarWindow.h"
+
 #include <stdio.h>
+
 #include <Application.h>
 #include <Directory.h>
 #include <FindDirectory.h>
@@ -43,7 +47,6 @@
 #include <MessageFilter.h>
 #include <Screen.h>
 
-#include "BarWindow.h"
 #include "BarApp.h"
 #include "BarMenuBar.h"
 #include "BarView.h"
@@ -224,6 +227,15 @@
 
 
 void
+TBarWindow::Minimize(bool minimize)
+{
+       // Don't allow the Deskbar to be minimized
+       if (!minimize)
+               BWindow::Minimize(false);
+}
+
+
+void
 TBarWindow::SaveSettings()
 {
        fBarView->SaveSettings();
@@ -406,6 +418,7 @@
        fBarView->ChangeState(expand, vertical, left, top);
 }
 
+
 void
 TBarWindow::SetLocation(BMessage* message)
 {

Modified: haiku/trunk/src/apps/deskbar/BarWindow.h
===================================================================
--- haiku/trunk/src/apps/deskbar/BarWindow.h    2009-12-01 09:38:34 UTC (rev 
34403)
+++ haiku/trunk/src/apps/deskbar/BarWindow.h    2009-12-01 09:47:27 UTC (rev 
34404)
@@ -31,58 +31,63 @@
 names are registered trademarks or trademarks of their respective holders.
 All rights reserved.
 */
-
 #ifndef BAR_WINDOW_H
 #define BAR_WINDOW_H
 
+
 #include <Deskbar.h>
 #include <Window.h>
 
+
 class TBeMenu;
 class TBarView;
 
+
 class TBarWindow : public BWindow {
-       public:
-               TBarWindow();
+public:
+                                                               TBarWindow();
 
-               virtual void    MenusBeginning();
-               virtual void    MenusEnded();
-               virtual bool    QuitRequested();
-               virtual void    WorkspaceActivated(int32 ws, bool activate);
-               virtual void    ScreenChanged(BRect size, color_space depth);
-               virtual void    DispatchMessage(BMessage* message, BHandler* 
handler);
-               virtual void    MessageReceived(BMessage* m);
+       virtual void                            MenusBeginning();
+       virtual void                            MenusEnded();
+       virtual bool                            QuitRequested();
+       virtual void                            WorkspaceActivated(int32 
workspace,
+                                                                       bool 
activate);
+       virtual void                            ScreenChanged(BRect size, 
color_space depth);
+       virtual void                            DispatchMessage(BMessage* 
message,
+                                                                       
BHandler* handler);
+       virtual void                            MessageReceived(BMessage* 
message);
+       virtual void                            Minimize(bool minimize);
 
-               void                    SaveSettings();
-               TBarView*               BarView() const { return fBarView; };
-               static  void    SetBeMenu(TBeMenu* menu);
-               TBeMenu*                BeMenu();
+                       void                            SaveSettings();
+                       TBarView*                       BarView() const { 
return fBarView; };
+       static  void                            SetBeMenu(TBeMenu* menu);
+                       TBeMenu*                        BeMenu();
 
-               void                    ShowBeMenu();
-               void                    ShowTeamMenu();
+                       void                            ShowBeMenu();
+                       void                            ShowTeamMenu();
 
-               void                    GetLocation(BMessage*);
-               deskbar_location        DeskbarLocation() const;
-               void                    SetLocation(BMessage*);
-               void                    SetDeskbarLocation(deskbar_location 
location,
-                                                       bool expand);
-               
-               void                    IsExpanded(BMessage*);
-               void                    Expand(BMessage*);
-               
-               void                    ItemInfo(BMessage*);
-               void                    ItemExists(BMessage*);
-               
-               void                    CountItems(BMessage*);
-               
-               void                    AddItem(BMessage*);
-               void                    RemoveItem(BMessage*);
-               
-               void                    GetIconFrame(BMessage*);
+                       void                            GetLocation(BMessage* 
message);
+                       deskbar_location        DeskbarLocation() const;
+                       void                            SetLocation(BMessage* 
message);
+                       void                            
SetDeskbarLocation(deskbar_location location,
+                                                                       bool 
expand);
 
+                       void                            IsExpanded(BMessage* 
message);
+                       void                            Expand(BMessage* 
message);
+
+                       void                            ItemInfo(BMessage* 
message);
+                       void                            ItemExists(BMessage* 
message);
+
+                       void                            CountItems(BMessage* 
message);
+
+                       void                            AddItem(BMessage* 
message);
+                       void                            RemoveItem(BMessage* 
message);
+
+                       void                            GetIconFrame(BMessage* 
message);
+
 private:
-               static  TBeMenu *sBeMenu;
-               TBarView                *fBarView;
+       static  TBeMenu*                        sBeMenu;
+                       TBarView*                       fBarView;
 };
 
 #endif /* BAR_WINDOW_H */

Modified: haiku/trunk/src/servers/app/ServerWindow.cpp
===================================================================
--- haiku/trunk/src/servers/app/ServerWindow.cpp        2009-12-01 09:38:34 UTC 
(rev 34403)
+++ haiku/trunk/src/servers/app/ServerWindow.cpp        2009-12-01 09:47:27 UTC 
(rev 34404)
@@ -401,11 +401,8 @@
                rename_thread(Thread(), name);
        }
 
-       if (fWindow != NULL) {
-//fDesktop->UnlockSingleWindow();
+       if (fWindow != NULL)
                fDesktop->SetWindowTitle(fWindow, newTitle);
-//fDesktop->LockSingleWindow();
-       }
 }
 
 
@@ -425,8 +422,7 @@
 void
 ServerWindow::NotifyMinimize(bool minimize)
 {
-       if (fWindow->Feel() != B_NORMAL_WINDOW_FEEL
-               || ((fWindow->Flags() & B_NOT_MINIMIZABLE) == 0 && minimize))
+       if (fWindow->Feel() != B_NORMAL_WINDOW_FEEL)
                return;
 
        // The client is responsible for the actual minimization

Modified: haiku/trunk/src/servers/app/Window.cpp
===================================================================
--- haiku/trunk/src/servers/app/Window.cpp      2009-12-01 09:38:34 UTC (rev 
34403)
+++ haiku/trunk/src/servers/app/Window.cpp      2009-12-01 09:47:27 UTC (rev 
34404)
@@ -824,8 +824,10 @@
                                break;
 
                        case DEC_MINIMIZE:
-                               fIsMinimizing = true;
-                               STRACE_CLICK(("===> DEC_MINIMIZE\n"));
+                               if ((Flags() & B_NOT_MINIMIZABLE) == 0) {
+                                       fIsMinimizing = true;
+                                       STRACE_CLICK(("===> DEC_MINIMIZE\n"));
+                               }
                                break;
 
                        case DEC_DRAG:


Other related posts:

  • » [haiku-commits] r34404 - in haiku/trunk/src: apps/deskbar servers/app - axeld