History log of /haiku/src/apps/deskbar/Switcher.h
Revision Date Author Comments
# fb885767 04-May-2023 John Scipione <jscipione@gmail.com>

Deskbar: Use hvif window icons & scale with font

Add vector rdefs for shown, hidden, shown switch
and hidden switch icons. Remove unused bitmap
resources. Add window switch vector icons to
artwork.

Create window icon cache in TBarApp and cache the
window icons based on font size.
Fixes memory leak in #18357.

Don't draw off-workspace lines in Switcher, use
switch icon for that instead. Fixes crash reported
in #18359. Position icon and window name better in
Switcher.

Put BarTeamInfo icon parameter last and make it
optional, the icon gets set by caching.

Enable team icon cache and window icon cache.

Fixes #14694

Deskbar: Scale Twitcher icons based on font size

Remove the point ctor parameter and deprecate the
switcherLoc setting by not using or setting it and
leaving it at its default value.

Center window on screen resolution change and
workspace change (as resolution may not match).

Fixes #17924

Change-Id: Ib63cc307f14cda397ffb66ea74091be59e6e5535
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6335
Reviewed-by: John Scipione <jscipione@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>


# 30e6af93 17-Apr-2013 John Scipione <jscipione@gmail.com>

Eliminate background app and Deskbar app checks

This is a follow up on the fix for #9632.

Now that the group list in Deskbar never deals with background apps or the Deskbar app itself we can simplify the code by eliminating the checks, especially in Switcher.cpp (Twitcher).

Checking for background apps and Deskbar has also been eliminated from TExpandoMenuBar and TTeamMenu. The single point of entry for these checks is in TBarApp::AddTeam().

In Switcher.cpp remove OKToUse() since the list is assumed to contain only valid entries. TSwitchManager::CountVisibleGroups() also got removed because all groups are visible. TSwitchManager::_FindNextValidApp(), TSwitchManager::QuitApp(), TIconView::ItemAtPoint(), TIconView::ScrollTo(), and TIconView::FrameOf() all got simplified significantly.


# 1cd61330 02-May-2012 John Scipione <jscipione@gmail.com>

Style fixes including reordering #include's in Deskbar

* Reorder includes according to the Style Guide.
* Whitespace changes, mostly making sure there are 2 newlines
between things and making sure there is 1 newline at the end of
each file.
* Make end of header files all in the style of
#endif\t/* _HEADER_GAURD_H_ */
* The one change that is not purely style is to #include <Path.h>
in DeskbarUtils.h instead of DeskbarUtils.cpp because it is used
to define entry_ref for the AddRefsToDeskbarMenu() prototype.


# 1687edd0 06-Mar-2011 Fredrik Holmqvist <fredrik.holmqvist@gmail.com>

Final set of style cleanup patches by John Scipione as part of #7052.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40849 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f1684e34 22-Aug-2010 Rene Gollent <anevilyak@gmail.com>

Fix a logic hole that would result in hidden teams being visible in switcher (sans icon) on ctrl+~. Fixes #4290.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38311 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 71bd3ba5 30-Sep-2009 Jonas Sundström <jonas@kirilla.com>

Removing ifdefs and code for non-Haiku build targets. Partial clean-up. Enforcing the 80-char limit, renaming constants, newline at end of file.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33377 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a107d167 19-Jan-2009 Axel Dörfler <axeld@pinc-software.de>

* Made the get_token_list() function behave the same way as under BeOS. This
simplifies the code in the Switcher, but has the drawback that the window
list is not "static" anymore, ie. the items in the window list of the Deskbar
will now jump around as in BeOS.
* However, EasyMove now works under Haiku as well out of the box, if that is
something we want :)
* Maybe we should instead add another parameter to the window list to make
it sorted or not; sorting the list as it's done now is much simpler and
faster on the server.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28959 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c2177fe8 19-Jan-2009 Axel Dörfler <axeld@pinc-software.de>

* The Switcher now "remembers" the first app when doing a quick switch over
more than one application, so that will be the next app to switch to for the
next switch.
* This solution is not entirely perfect, though, as it needs to visually bring
the first app to front inbetween to work.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28952 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b8beeb35 12-Aug-2008 Axel Dörfler <axeld@pinc-software.de>

* The Switcher now uses the new application/window order functions to sort
the application/window lists before using them.
* This means that you can now switch just between the two topmost apps when
pressing Control-Tab. If you press it fast enough, it will fall back to the
old method of iterating through all apps.
* Only define the private BeOS window management API for BeOS itself, for
Haiku, better use the private WindowInfo.h header.
* Changed BeOS's window_info structure to match how Haiku does it (improved
naming, separation between client_window_info and window_info).
* Whitespace cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26952 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 04d7b50b 25-Sep-2007 Axel Dörfler <axeld@pinc-software.de>

Added shortcut 'h' to the Switcher to hide applications.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22303 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 10da8181 18-Jan-2007 Axel Dörfler <axeld@pinc-software.de>

* Moved non-public classes into the source file.
* Fixed vector icon drawing under Haiku; but it might now look strange in non-32 bit
modes (background gets a slightly different color, but this might be an app_server
bug).
* Got rid of the TSwitchManager::IdleTime()/Touch() stuff.
* Key repetitions are now accepted in the switcher, only the first (tab) key repetition
to bring up the window is not.
* Cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19858 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 7da06231 01-Jan-2006 Axel Dörfler <axeld@pinc-software.de>

Imported Deskbar from OpenTracker-current.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15774 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 41281cf3 22-May-2005 Axel Dörfler <axeld@pinc-software.de>

Added Tracker and Deskbar from OpenTracker-current to the repository.
They both build fine.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12773 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 30e6af93e4ae245281e73a10e5ffcbd94ce38dc8 17-Apr-2013 John Scipione <jscipione@gmail.com>

Eliminate background app and Deskbar app checks

This is a follow up on the fix for #9632.

Now that the group list in Deskbar never deals with background apps or the Deskbar app itself we can simplify the code by eliminating the checks, especially in Switcher.cpp (Twitcher).

Checking for background apps and Deskbar has also been eliminated from TExpandoMenuBar and TTeamMenu. The single point of entry for these checks is in TBarApp::AddTeam().

In Switcher.cpp remove OKToUse() since the list is assumed to contain only valid entries. TSwitchManager::CountVisibleGroups() also got removed because all groups are visible. TSwitchManager::_FindNextValidApp(), TSwitchManager::QuitApp(), TIconView::ItemAtPoint(), TIconView::ScrollTo(), and TIconView::FrameOf() all got simplified significantly.


# 1cd61330ecd8257551d58f204332d00145c855ec 02-May-2012 John Scipione <jscipione@gmail.com>

Style fixes including reordering #include's in Deskbar

* Reorder includes according to the Style Guide.
* Whitespace changes, mostly making sure there are 2 newlines
between things and making sure there is 1 newline at the end of
each file.
* Make end of header files all in the style of
#endif\t/* _HEADER_GAURD_H_ */
* The one change that is not purely style is to #include <Path.h>
in DeskbarUtils.h instead of DeskbarUtils.cpp because it is used
to define entry_ref for the AddRefsToDeskbarMenu() prototype.


# 1687edd0fde594cd6f7c88f58a264c4787b4327d 06-Mar-2011 Fredrik Holmqvist <fredrik.holmqvist@gmail.com>

Final set of style cleanup patches by John Scipione as part of #7052.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40849 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f1684e3466cbcc6ec6b56e1320b3fa1ac5fa39df 22-Aug-2010 Rene Gollent <anevilyak@gmail.com>

Fix a logic hole that would result in hidden teams being visible in switcher (sans icon) on ctrl+~. Fixes #4290.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38311 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 71bd3ba59c06b130115c3ddd44457d8f9dd78997 30-Sep-2009 Jonas Sundström <jonas@kirilla.com>

Removing ifdefs and code for non-Haiku build targets. Partial clean-up. Enforcing the 80-char limit, renaming constants, newline at end of file.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33377 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a107d1676efac13cd456871cd9ae12fad273e860 19-Jan-2009 Axel Dörfler <axeld@pinc-software.de>

* Made the get_token_list() function behave the same way as under BeOS. This
simplifies the code in the Switcher, but has the drawback that the window
list is not "static" anymore, ie. the items in the window list of the Deskbar
will now jump around as in BeOS.
* However, EasyMove now works under Haiku as well out of the box, if that is
something we want :)
* Maybe we should instead add another parameter to the window list to make
it sorted or not; sorting the list as it's done now is much simpler and
faster on the server.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28959 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c2177fe861eabe1c2622069d08b51c2b213e1a56 19-Jan-2009 Axel Dörfler <axeld@pinc-software.de>

* The Switcher now "remembers" the first app when doing a quick switch over
more than one application, so that will be the next app to switch to for the
next switch.
* This solution is not entirely perfect, though, as it needs to visually bring
the first app to front inbetween to work.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28952 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b8beeb35eab7170de9f204f6e8c8fd60ea821d4f 12-Aug-2008 Axel Dörfler <axeld@pinc-software.de>

* The Switcher now uses the new application/window order functions to sort
the application/window lists before using them.
* This means that you can now switch just between the two topmost apps when
pressing Control-Tab. If you press it fast enough, it will fall back to the
old method of iterating through all apps.
* Only define the private BeOS window management API for BeOS itself, for
Haiku, better use the private WindowInfo.h header.
* Changed BeOS's window_info structure to match how Haiku does it (improved
naming, separation between client_window_info and window_info).
* Whitespace cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26952 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 04d7b50bde21d8aea84736e7858c78d8174ed7fa 25-Sep-2007 Axel Dörfler <axeld@pinc-software.de>

Added shortcut 'h' to the Switcher to hide applications.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22303 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 10da8181b516a1fd0cff32d17d4001f042db8263 18-Jan-2007 Axel Dörfler <axeld@pinc-software.de>

* Moved non-public classes into the source file.
* Fixed vector icon drawing under Haiku; but it might now look strange in non-32 bit
modes (background gets a slightly different color, but this might be an app_server
bug).
* Got rid of the TSwitchManager::IdleTime()/Touch() stuff.
* Key repetitions are now accepted in the switcher, only the first (tab) key repetition
to bring up the window is not.
* Cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19858 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 7da062312a13b77ed1aac63bdd67c44c44ad5824 01-Jan-2006 Axel Dörfler <axeld@pinc-software.de>

Imported Deskbar from OpenTracker-current.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15774 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 41281cf362916855e6eb9ad1d728d919863a1e81 22-May-2005 Axel Dörfler <axeld@pinc-software.de>

Added Tracker and Deskbar from OpenTracker-current to the repository.
They both build fine.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12773 a95241bf-73f2-0310-859d-f6bbb57e9c96