ToggleBD 1.04 released
Fred Graute (114) 645 posts |
ToggleBD is a small module task that makes it easy to get at objects pinned to the backdrop by allowing you to raise and lower the backdrop window. It does this by using the message ToggleBackdrop (&400D1) that is implemented on RISC OS 5.18+ and RISC OS Select 4.2+. When the message is not supported it will try to glean the window handle of the backdrop from the Pinboard’s workspace. Obviously this is prone to error but it seems the handle has been stored in the same location from RISC OS 3.5 onwards. The position of the backdrop can be toggled by using the following triggers:
Each of the triggers can be turned on/off and they can be used interchangeably. The iconbar icon can be turned off when the iconbar trigger isn’t used. The hotkeys and screen edge are configurable, either from the configuration window or the command line. Hopefully you’ll find ToggleBD useful. ToggleBD can be downloaded here |
patric aristide (434) 418 posts |
Great! That is something that I always missed, like Win+D or Linux icon. |
patric aristide (434) 418 posts |
Two observations: ToggleBD unfortunately makes !AppDock disappear from the desktop. |
Frederick Bambrough (1372) 837 posts |
It also seems to insist that it’s last up on the iconbar no matter where it’s placed in Configure – Boot – Run, though anything started after boot is ok. Really handy application though. |
Fred Graute (114) 645 posts |
It’s not really disappeared, just hidden underneath the backdrop. You can get it back by hitting Ctrl-Shift-Alt. This seems to be the same problem that RISC OS Select had, where windows were trapped below the backdrop after it had been raised and lowered. A quick test shows that ToggleBD works correctly with AppDock on RO Select 6.0x so it may be that the RO 5 Wimp needs fixing.
Can you be more specific about this? Had a look using the demo version but didn’t spot anything obvious.
That may be due to how ToggleBD reads its choices. There is a delay between the choices being read and the Wimp part displaying the iconbar icon. ToggleBD has gone through several different implementations and the way in which it reads its choices is a bit quirky. I’ll have a look to see if it can be changed such that the delay is removed.
Thanks. Good to hear it’s useful. :-) |
patric aristide (434) 418 posts |
MoreDesk: that’s oidd, yesterday it seemed to prevent ToggleBD from working at all. No problem now however. The only thing I did change was using a sprite instead of my usual plain blue backdrop. |
Chris Johnson (125) 825 posts |
Here you have to hold down Alt and then press ctrl-Shift. Pressing the combination in the wrong order has routinely confused me in the past! |
Steve Pampling (1551) 8170 posts |
Yes, quite handy. BTW. I think the comparison with the Windows Win-D is unflattering, Win-D doesn’t to seem to have an inverse. Win+D, Win+M, Win+Shift+M is required Or just ignore Win+D. I’d say ToggleBD is a better implementation. |
Fred Graute (114) 645 posts |
ToggleBD has been updated to v1.05 which fixes the iconbar icon positioning problem when run at boot (albeit after lots of swearing at the Toolbox for its idiosyncrasies). It also fixes the !Run file staying open and hack mode not always working. ToggleBD 1.05 can be downloaded here |
patric aristide (434) 418 posts |
Nice to see it’s also on !PlingStore as I doubt many newbies check here or c.s.a. |
Frederick Bambrough (1372) 837 posts |
Perfick. |
Steve Revill (20) 1361 posts |
Any reason why you do this (grubby hack ;) rather than using the Wimp_Extend SWI API to traverse the window stack (from back to front) looking for a full(ish) screen window owned by the Pinboard task? That’s how MoreDesk identifies the pinboard’s main window so it doesn’t ever send windows to the back behind it. I think there’s also an “always at the back” window flag that you can look for for extra robustness (I’m away from an RO machine at the moment to check) in making sure you’ve found the Pinboard’s backdrop window (and not an Info window or similar). |
Fred Graute (114) 645 posts |
The hack was taken from PBFront so ToggleBD could be used on versions of RO that don’t support the ToggleBackdrop message. I wasn’t aware that Wimp_Extend could be used the find out the backdrop handle. Details on its use are rather sketchy, I’ve had to look at MoreDesk to find out how to use it. :-) Anyway, I now have a version of ToggleBD that obtains the backdrop handle through Wimp_Extend. Still needs a bit of work, it seems the backdrop window can be larger than the screen and I don’t want to make any assumptions about the height of the iconbar. |
Steve Revill (20) 1361 posts |
Ah, yes – the documentation for Wimp_Extend could be better. The StrongHelp pages are OK but I think the actual documentation is in the Nested Wimp Functional Specification, which really, really should be merged into the PRMs (along with all the other two man years’ worth of stuff that really, really needs doing to the PRMs)! I think the basic algorithm (for your use case) would be to:
I was probably a bit over-zealous with the “check how big the window is” bit. If it’s flagged as a back window, it’s at or near the bottom of the stack and owned by the Pinboard, it’s hard to imagine what else it could be! :) |
Fred Graute (114) 645 posts |
The copy of the Nested Wimp Functional Specification that I have here doesn’t mention use of Wimp_Extend 6-10 at all, only Wimp_Extend 11.
Thanks, that pretty much what I was using already. Note though that you can’t stop when you find a window that doesn’t have bit 11 set. Wimp_Extend seems to go through all the window stacks including the hidden stack where iconised windows live, and iconised windows have bit 11 clear.
Indeed, simplifies things a bit. :-) ToggleBD has been updated to version 1.06 which obtains the backdrop’s window handle by using Wimp_Extend, it can be downloaded here . |
Fred Graute (114) 645 posts |
ToggleBD is now at v1.07. New in this version is the ability to toggle the Iconbar along with the Pinboard so that both can be raised/lowered at the same time. There’s now only one toggle behaviour Lower if not at back. The removed Raise if not at front behaviour didn’t sit well with toggling the Iconbar. The choices window has been updated accordingly, and the Quit ToggleBD button has been removed. The hotkeys would trigger a Backdrop toggle even when other keys were down at the same time. This has been altered to prevent ToggleBD from stealing other hotkey combinations. Some improvements in error handling. The ToggleBD_Configure command failed to pass on the error block so errors weren’t reported correctly. Errors during the initialisation of ToggleBD’s Wimp task are now trapped to allow it to tidy up and exit properly. The module is now killed after such errors. ToggleBD v1.07 can be downloaded here |
Fred Graute (114) 645 posts |
ToggleBD v1.08 has been released. This version fixes some potential problems with the choices file. If it’s missing when ToggleBD is started it now puts up a clearer error message Saving the choices when there’s no choices file would result in a file of type Data where it should be Obey, this caused errors when trying to run it. Now the choices file is built in memory and then saved as a filetyped file. The SetupCfg file has been simplified, if choices$write is present we use it and if empty copy default choices to it. This way it’s no longer necessary to distinguish between read and write locations, so can now always use <ToggleBD$ChoicesDir>.Choices’. The iconbar-icon now provides an indication of the backdrop’s position. The top arrowhead is red when the backdrop is at front, with the bottom one red when the backdrop is at back. The toggling of the iconbar has been changed such that the iconbar is now always in front of the backdrop. (Useful if you’ve hacked the Pinboard module, as I have, to use an iconbar height of 0 so the backdrop covers the entire screen). When the system is shutdown there could be an error if the Pinboard is quit before ToggleBD (this may be due to me softloading the Pinboard module). Whatever the cause it’s fixed now. ToggleBD could receive its own broadcast of Message_ToggleBackdrop before the Pinboard claimed it (this too may be due to softloading the Pinboard). This caused flicker as the iconbar was redrawn twice. Now it only responds to Message_ToggleBackdrop if it’s a reply. ToggleBD v1.08 is now distributed under the BSD licence. It can be downloaded here |