#8188: Make Workspaces Auto-raise behave like LaunchBox Auto-raise ---------------------------------------+----------------------------------- Reporter: devine | Owner: axeld Type: enhancement | Status: new Priority: normal | Milestone: R1 Component: Applications/Workspaces | Version: R1/Development Resolution: | Keywords: workspaces, auto- Blocked By: | raise Has a Patch: 1 | Blocking: | Platform: All ---------------------------------------+----------------------------------- Comment (by axeld): Thanks for the quick rework! There are still a lot of coding style violations, just a few hints: * Don't use useless parenthesis "-(offset)" can just be written as "-offset" * There is a blank before '{'. * The first "if" is indented incorrectly. * Using the form: {{{ if (!x) return; else { [...] } }}} is not good style: the "else"-block is completely superfluous and misleading. It should be written like this instead: {{{ if (!x) return; [...] }}} * Write comments either before a block, or with an extra indent on the next line like this: {{{ x = 1 + 2; // This is so complicated because I only have two fingers }}} or: {{{ // Take the tab height into account if (...) { ... } }}} Also, I have a few comments on the contents still: * Instead of kScreenBorderOffset (where does that come from, why /2?) please use the border size as returned by the decorator settings message (I guess it's returned by FindInt32("border size"), but it might be different). * The check windowFrame.Contains(where) should be moved to the top condition, as proceeding with the rest is an worthless effort then. However, it's wrong, too, as the window frame doesn't contain the border, so it should always fail. * The 'else' case if GetDecoratorSettings() failed is the same as the block directly above; always strive to avoid code duplication. Have you tested if your code actually works? -- Ticket URL: <http://dev.haiku-os.org/ticket/8188#comment:5> Haiku <http://dev.haiku-os.org> Haiku - the operating system.