Page 1 of 2
Cannot drag stack with controls set to empty offscreen
Posted: Tue Jun 23, 2020 3:45 pm
by 5imon
I have a stack with a custom window shape whose controls are set to empty. I can drag the stack around the screen using a few lines of code in the stack script to detect the mouse click and drag etc.
However, I noticed I cannot drag the stack off screen unless the controls are set to anything *other* than empty.
To clarify the statement, I *can* drag the stack to as second monitor (so it's technically *off screen*) but I cannot position the stack even 2px off the bottom or left of my screen. It absolutely refuses to be positioned with even a little bit of itself *off screen*.
Usability-wise it makes dragging the stack around feel wrong.
So the question is this: do I need to enable a setting to allow a stack to be dragged party off screen when the controls are set to empty?
Re: Cannot drag stack with controls set to empty offscreen
Posted: Tue Jun 23, 2020 5:09 pm
by 5imon
I should elaborate ... this problem only happens on Ubuntu Linux with 9 .6 .0
Re: Cannot drag stack with controls set to empty offscreen
Posted: Tue Jun 23, 2020 7:07 pm
by dunbarx
I have a stack with a custom window shape whose controls are set to empty.
Hi.
What does that mean? Controls are things like buttons and fields, that are resident on a card, which is part of a stack. How do you 'empty" one? I assume you do not mean to set the contents of such controls to empty. That would make no difference to the stack, and the stack would not know such a thing anyway.
Craig
Re: Cannot drag stack with controls set to empty offscreen
Posted: Tue Jun 23, 2020 7:10 pm
by Klaus
I'm sure Simon means empty "decorations"!

Re: Cannot drag stack with controls set to empty offscreen
Posted: Tue Jun 23, 2020 7:17 pm
by dunbarx
Hi again.
Do you mean that you deleted all controls?
I have never really used windowShapes, though I have played with them.
They usually do not have a titleBar, so dragging them around the screen is a problem. If you place this in the stack script:
Code: Select all
on mouseMove
if the mouse is down then set the loc of this stack to the screenMouseLoc
end mouseMove
With this I have no issue dragging the stack off screen, or to another connected monitor.
Craig
Re: Cannot drag stack with controls set to empty offscreen
Posted: Tue Jun 23, 2020 7:20 pm
by FourthWorld
I believe this is a limitation of the Gnome Shell window manager. If you can find an API to override that behavior it may be worth submitting an enhancement request. Might be worth it without the API call, but since I doubt this would be a high priority the more work we can do up front the easier it becomes for the team to satisfy the request.
Re: Cannot drag stack with controls set to empty offscreen
Posted: Tue Jun 23, 2020 7:21 pm
by dunbarx
Klaus.
I'm sure Simon means empty "decorations"!
Probably. But can you have decorations on a windowShaped stack? I made a oval image, set the windowShape, and I get an oval stack. How would a titlebar "track" the top of such a thing?
Simon, decorations are not controls.
Craig
Re: Cannot drag stack with controls set to empty offscreen
Posted: Tue Jun 23, 2020 7:43 pm
by 5imon
Yes, I mean empty decorations. When I use the Property Inspector to set the decorations the last option is titled "empty".
And to set the decorations to *empty* I need to click on a button with a magic wand icon next to a field labelled *Controls* in the Property Inspector.
Re: Cannot drag stack with controls set to empty offscreen
Posted: Tue Jun 23, 2020 7:49 pm
by 5imon
dunbarx wrote: ↑Tue Jun 23, 2020 7:21 pm
Klaus.
I'm sure Simon means empty "decorations"!
Probably. But can you have decorations on a windowShaped stack? I made a oval image, set the windowShape, and I get an oval stack. How would a titlebar "track" the top of such a thing?
Simon, decorations are not controls.
Craig
On Windows you can drag your oval shaped stack to rest partially outside the left, right or bottom of your visible computer display monitor.
However, on Ubuntu you would not be able to drag your stack partially outside of the visible screen area. This is what I discovered, it's specifically a Linux/Ubuntu bug/feature.
But when I set the *decorations* back to *default* on Ubuntu I can drag the stack partially off screen without issue.
Re: Cannot drag stack with controls set to empty offscreen
Posted: Tue Jun 23, 2020 7:55 pm
by richmond62
So, surely, "the thing" would be to set the 'decorations' to 'default' only for the duration of a drag, and then reset them again?
Of course that might produce odd optical effects.
The last time I did anything with windowshape was about 19 years ago.
Re: Cannot drag stack with controls set to empty offscreen
Posted: Tue Jun 23, 2020 8:14 pm
by richmond62
I just made a stack called "FROG" that looks like this:
-

- Screenshot 2020-06-23 at 22.12.13.png (38.75 KiB) Viewed 8462 times
-
It contains an image "JF" and the following stackScript:
Code: Select all
on preOpenStack
set the windowShape of me to the id of img "JF"
end preOpenStack
Now I am trying to work out how to drag the stack anywhere at all.
Re: Cannot drag stack with controls set to empty offscreen
Posted: Tue Jun 23, 2020 9:36 pm
by 5imon
richmond62 wrote: ↑Tue Jun 23, 2020 8:14 pm
Now I am trying to work out how to drag the stack anywhere at all.
Add the following to the stack cd script. It's likely that the "target" will end up being the frog so you'll need to modify the mouseMove to reflect that.
Code: Select all
# make entire stack draggable
local sgLeftOffset
local sgTopOffset
local sgDragging
local sgBounds
local sgTarget
on mouseDown
put item 1 of the mouseLoc into sgLeftOffset
put item 2 of the mouseLoc into sgTopOffset
put the short name of target into sgTarget
put true into sgDragging
end mouseDown
on mouseMove
lock screen
put sgTarget into msg
if sgTarget is the short name of this cd then
moveFinder
end if
unlock screen
end mouseMove
on moveFinder
if sgDragging is true then
set the left of this stack to item 1 of \
globalloc(the mouseLoc) - sgLeftOffset
set the top of this stack to item 2 of \
globalloc(the mouseLoc) - sgTopOffset
end if
end moveFinder
on mouseRelease
cleanUp
end mouseRelease
on mouseUp
cleanUp
end mouseUp
on cleanUp
put false into sgDragging
end cleanUp
Re: Cannot drag stack with controls set to empty offscreen
Posted: Wed Jun 24, 2020 9:00 am
by Klaus
Hi Simon,
5imon wrote: ↑Tue Jun 23, 2020 9:36 pm
...Add the following to the stack cd script.
to avoid misunderstandings: We can have a STACK script AND a CARD script, and they are different!
You probably mean the CARD script here.
Best
Klaus
Re: Cannot drag stack with controls set to empty offscreen
Posted: Wed Jun 24, 2020 1:51 pm
by dunbarx
Hmmm>
If i set the windowShape of a simple stack to the ID of an oval image on that stack, I get an oval shaped stack the size of the image. Regardless of what I do with the decorations, I cannot move the stack with the mouse. There is nothing to "grab" onto. No titleBar, minimize button, etc, ever appears.
I can move the "underlying" oval image in the oval stack window as normal. Only my little mouseMove handler allows me to move that stack.
Is this a me thing or a Mac thing?
Craig
Re: Cannot drag stack with controls set to empty offscreen
Posted: Wed Jun 24, 2020 2:20 pm
by 5imon
dunbarx wrote: ↑Wed Jun 24, 2020 1:51 pm
Hmmm>
If i set the windowShape of a simple stack to the ID of an oval image on that stack, I get an oval shaped stack the size of the image. Regardless of what I do with the decorations, I cannot move the stack with the mouse. There is nothing to "grab" onto. No titleBar, minimize button, etc, ever appears.
I can move the "underlying" oval image in the oval stack window as normal. Only my little mouseMove handler allows me to move that stack.
Is this a me thing or a Mac thing?
Craig
Probably my poor instructions...
In the mouseMouse script the short name of target *must* be the stack or card name. So if you put the script in the stack you need to update the code to check target for the stack name.
If you have a shape on the card blocking direct clicks to the card then the script will not do anything. Move or hide your shape so you can click on the stack and move it.