Effective rect of stacks on Windows 10

Bob Sneidar bobsneidar at iotecdigital.com
Mon Oct 21 16:50:57 EDT 2019


I have fits with using these rects. It ought to be as simple as saving the rect of a stack when closing it, and restoring it when opening it, regardless of what monitor is in effect. 

My problem comes in when I run the stack in a 1080p monitor at work, sleep it then go into the field, now Im on a retina display! Stack is now half obscured on the right and top. 

I've tried a number of things but I can't seem to get it to work consistently. I'm just going to say that this is the issue with any pixel based coordinate system. 

I'll probably write something that converts to screen percentages instead of pixels. That is really the way to do this. 

Bob S


> On Oct 21, 2019, at 11:11 , Trevor DeVore via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> I am looking for input from people who are using `the effective rect of
> stack` and the values it reports on Windows. I have some code that uses the
> effective rect of a group to determine if the stack is still on the screen
> after the user moves the stack or when restoring window positions when an
> app relaunches.
> 
> On Windows 10 I just noticed that `the effective rect of stack` includes
> the drop shadow that appears along the left, bottom, and right of a window
> on Windows 10. For my use case including the shadows in the `effective rect
> of stack` serves no value. I'm wondering if someone has a use case where it
> is helpful to have the drop shadow included in `the effective rect`?
> 
> Here is how you can check behavior if you are interested:
> 
> EXPECTED RESULT: The effective rect of a stack on Windows would return the
> rect of the stack that includes stack borders and title bar.
> 
> OBSERVED RESULT: The effective rect includes the drop shadow of the window
> in the rect.
> 
> RECIPE:
> 1. Create a new stack
> 2. Set the topleft of the stack to 0,0
> 3. `put the effective rect of this stack`. The left of the rect will be a
> negative value.
> 4. `set the effective topleft of this stack to 0,0`. The left of the stack
> will be offset by the negative value from (3).
> 
> -- 
> Trevor DeVore
> ScreenSteps
> www.screensteps.com





More information about the use-livecode mailing list