[haiku-commits] haiku: hrev45273 - in src: apps/deskbar kits/tracker

  • From: jscipione@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 12 Feb 2013 04:08:32 +0100 (CET)

hrev45273 adds 2 changesets to branch 'master'
old head: 66e94108063bab01c7859442fe0d9ed777de9808
new head: 3c6d2325c708750408ddbfa8863da9266d34bbb3
overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=3c6d232+%5E66e9410

----------------------------------------------------------------------------

331c909: Move Deskbar prefs window to current workspace if hidden

3c6d232: Update Tracker prefs window workspace behavior.
  
  Basically make the Tracker preferences window work like most other
  windows do as far as workspaces go.
  
  Opens on your current workspace. If you switch workspaces then go
  into Deskbar and select Tracker Preferences it will switch to
  the workspace that already has the window open. If you close the
  window, switch workspaces and then select preferences it will move
  the window to your current workspace and show it.
  
  This is similar to the fix for the same problem on the Deskbar
  preferences window and for the same reason: the window gets hidden
  when you close it, not actually deleted so we need to do a bit more
  work to get the window to behave with workspaces. Hiding instead of
  deleting the window allows us to remember where you were when you
  closed the window, what tab you were on, what control had focus, etc.
  
  Fixes #8000

                                     [ John Scipione <jscipione@xxxxxxxxx> ]

----------------------------------------------------------------------------

3 files changed, 20 insertions(+), 1 deletion(-)
src/apps/deskbar/PreferencesWindow.cpp     | 12 ++++++++++++
src/apps/deskbar/PreferencesWindow.h       |  1 +
src/kits/tracker/TrackerSettingsWindow.cpp |  8 +++++++-

############################################################################

Commit:      331c9098ea57fa4128ed2ec3665c37acc482a968
URL:         http://cgit.haiku-os.org/haiku/commit/?id=331c909
Author:      John Scipione <jscipione@xxxxxxxxx>
Date:        Tue Feb 12 02:49:03 2013 UTC

Move Deskbar prefs window to current workspace if hidden

----------------------------------------------------------------------------

diff --git a/src/apps/deskbar/PreferencesWindow.cpp 
b/src/apps/deskbar/PreferencesWindow.cpp
index 5312603..a43f918 100644
--- a/src/apps/deskbar/PreferencesWindow.cpp
+++ b/src/apps/deskbar/PreferencesWindow.cpp
@@ -284,6 +284,18 @@ PreferencesWindow::QuitRequested()
 
 
 void
+PreferencesWindow::Show()
+{
+       if (IsHidden()) {
+               // move to current workspace
+               SetWorkspaces(B_CURRENT_WORKSPACE);
+       }
+
+       BWindow::Show();
+}
+
+
+void
 PreferencesWindow::WindowActivated(bool active)
 {
        if (!active && IsMinimized())
diff --git a/src/apps/deskbar/PreferencesWindow.h 
b/src/apps/deskbar/PreferencesWindow.h
index 3f0540d..ac1cbbc 100644
--- a/src/apps/deskbar/PreferencesWindow.h
+++ b/src/apps/deskbar/PreferencesWindow.h
@@ -35,6 +35,7 @@ public:
 
        virtual void                    MessageReceived(BMessage* message);
        virtual bool                    QuitRequested();
+       virtual void                    Show();
        virtual void                    WindowActivated(bool active);
 
                        void                    UpdateRecentCounts();

############################################################################

Revision:    hrev45273
Commit:      3c6d2325c708750408ddbfa8863da9266d34bbb3
URL:         http://cgit.haiku-os.org/haiku/commit/?id=3c6d232
Author:      John Scipione <jscipione@xxxxxxxxx>
Date:        Tue Feb 12 02:59:37 2013 UTC

Ticket:      https://dev.haiku-os.org/ticket/8000

Update Tracker prefs window workspace behavior.

Basically make the Tracker preferences window work like most other
windows do as far as workspaces go.

Opens on your current workspace. If you switch workspaces then go
into Deskbar and select Tracker Preferences it will switch to
the workspace that already has the window open. If you close the
window, switch workspaces and then select preferences it will move
the window to your current workspace and show it.

This is similar to the fix for the same problem on the Deskbar
preferences window and for the same reason: the window gets hidden
when you close it, not actually deleted so we need to do a bit more
work to get the window to behave with workspaces. Hiding instead of
deleting the window allows us to remember where you were when you
closed the window, what tab you were on, what control had focus, etc.

Fixes #8000

----------------------------------------------------------------------------

diff --git a/src/kits/tracker/TrackerSettingsWindow.cpp 
b/src/kits/tracker/TrackerSettingsWindow.cpp
index 754ae65..aa9e135 100644
--- a/src/kits/tracker/TrackerSettingsWindow.cpp
+++ b/src/kits/tracker/TrackerSettingsWindow.cpp
@@ -70,11 +70,11 @@ const uint32 kRevertButtonPressed = 'Rebp';
 #undef B_TRANSLATION_CONTEXT
 #define B_TRANSLATION_CONTEXT "TrackerSettingsWindow"
 
+
 TrackerSettingsWindow::TrackerSettingsWindow()
        :
        BWindow(BRect(80, 80, 450, 350), B_TRANSLATE("Tracker preferences"),
                B_TITLED_WINDOW, B_NOT_MINIMIZABLE | B_NOT_RESIZABLE
-               | B_NO_WORKSPACE_ACTIVATION     | B_NOT_ANCHORED_ON_ACTIVATE
                | B_ASYNCHRONOUS_CONTROLS | B_NOT_ZOOMABLE
                | B_AUTO_UPDATE_SIZE_LIMITS)
 {
@@ -184,6 +184,12 @@ TrackerSettingsWindow::Show()
 
                Unlock();
        }
+
+       if (IsHidden()) {
+               // move to current workspace
+               SetWorkspaces(B_CURRENT_WORKSPACE);
+       }
+
        _inherited::Show();
 }
 


Other related posts: