Cannot drag stack with controls set to empty offscreen

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

5imon
Posts: 19
Joined: Fri Nov 22, 2019 8:09 pm

Cannot drag stack with controls set to empty offscreen

Post by 5imon » Tue Jun 23, 2020 3:45 pm

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?

5imon
Posts: 19
Joined: Fri Nov 22, 2019 8:09 pm

Re: Cannot drag stack with controls set to empty offscreen

Post by 5imon » Tue Jun 23, 2020 5:09 pm

I should elaborate ... this problem only happens on Ubuntu Linux with 9 .6 .0

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10305
Joined: Wed May 06, 2009 2:28 pm

Re: Cannot drag stack with controls set to empty offscreen

Post by dunbarx » Tue Jun 23, 2020 7:07 pm

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

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Cannot drag stack with controls set to empty offscreen

Post by Klaus » Tue Jun 23, 2020 7:10 pm

I'm sure Simon means empty "decorations"! 8)

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10305
Joined: Wed May 06, 2009 2:28 pm

Re: Cannot drag stack with controls set to empty offscreen

Post by dunbarx » Tue Jun 23, 2020 7:17 pm

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

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10043
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Cannot drag stack with controls set to empty offscreen

Post by FourthWorld » Tue Jun 23, 2020 7:20 pm

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.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10305
Joined: Wed May 06, 2009 2:28 pm

Re: Cannot drag stack with controls set to empty offscreen

Post by dunbarx » 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

5imon
Posts: 19
Joined: Fri Nov 22, 2019 8:09 pm

Re: Cannot drag stack with controls set to empty offscreen

Post by 5imon » Tue Jun 23, 2020 7:43 pm

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.

5imon
Posts: 19
Joined: Fri Nov 22, 2019 8:09 pm

Re: Cannot drag stack with controls set to empty offscreen

Post by 5imon » Tue Jun 23, 2020 7:49 pm

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.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10077
Joined: Fri Feb 19, 2010 10:17 am

Re: Cannot drag stack with controls set to empty offscreen

Post by richmond62 » Tue Jun 23, 2020 7:55 pm

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.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10077
Joined: Fri Feb 19, 2010 10:17 am

Re: Cannot drag stack with controls set to empty offscreen

Post by richmond62 » Tue Jun 23, 2020 8:14 pm

I just made a stack called "FROG" that looks like this:
-
Screenshot 2020-06-23 at 22.12.13.png
Screenshot 2020-06-23 at 22.12.13.png (38.75 KiB) Viewed 8435 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.
Attachments
FROG.livecode.zip
Here's the stack.
(13.99 KiB) Downloaded 246 times

5imon
Posts: 19
Joined: Fri Nov 22, 2019 8:09 pm

Re: Cannot drag stack with controls set to empty offscreen

Post by 5imon » Tue Jun 23, 2020 9:36 pm

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

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Cannot drag stack with controls set to empty offscreen

Post by Klaus » Wed Jun 24, 2020 9:00 am

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! :D
You probably mean the CARD script here.


Best

Klaus

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10305
Joined: Wed May 06, 2009 2:28 pm

Re: Cannot drag stack with controls set to empty offscreen

Post by dunbarx » 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

5imon
Posts: 19
Joined: Fri Nov 22, 2019 8:09 pm

Re: Cannot drag stack with controls set to empty offscreen

Post by 5imon » Wed Jun 24, 2020 2:20 pm

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.

Post Reply