Page 1 of 2

Questions regarding standalones on Linux

Posted: Sun Jun 16, 2019 12:46 pm
by redfield
Hey All,
I have let LC create a Linux standalone of my script. One thing I noticed: the standalone window will always open exactly where the corresponding LC window was placed, while creating the standalone. Is that "correct" behaviour? I have no idea what it usually depends on, where on the screen a program chooses to place itself, when opening. But I always had the feeling that programs open at a random point on the screen or maybe there where they were last before being closed or so.

Second: I would like to be able to quit the standalone by using the shortcut ctrl + q. I tried by placing a keyDown handler in the stack script, but without success. I tried something like

Code: Select all

on keyDown ctrl q
quit
end keyDown

Third: Is there any way to place a little program icon at the upper left of the standalone (on Linux)?

Many thanks in advance :D

Re: Questions regarding standalones on Linux

Posted: Sun Jun 16, 2019 2:39 pm
by Klaus
Hi redfield,

1.
Well the runtime is the "former" stack (with all its properties like LOC etc) with the engine "wrapped" around it, so this is normal behavior!
You need to add something like:

Code: Select all

on preopenstack
  set the loc of this stack to the screenloc
endpreopenstack
2.
"keydown" only accepts ONE parameter and does not catch any "special" keys like SHIFT, ALT, Control etc.! Use "commandkeydown", that should do the job:

Code: Select all

on commandkeydown tKey
  if tKey = "q" then
   quit
  end if
end commandkeydown
3.
Sorry no idea, never used Linux.


Best

Klaus

Re: Questions regarding standalones on Linux

Posted: Sun Jun 16, 2019 3:02 pm
by bogs
What Klaus said, with the following additions:
* screenLoc is center screen, if your program gets moved around a lot, you might want to write it's last location to a file, and set the preopen handler to place it at the loc in the file.
* The place you would normally set the application icon I *think* is in the standalone settings, however, where Mac and Windows have an entry for one, Linux does not :?

I think it is possible, and don't see any reason why it would not be, but am not sure of the exact way to go about it. However, it is worth noting that I don't think I ever saw a linux application with an application icon attached to the window in any way shape or form either. Look at the windows you open on 'nix, they are (at least as far as I know) devoid of a window icon, so adding one would be a consistency issue.
Selection_001.png
Icons? We don' need no steenkin icons...

Re: Questions regarding standalones on Linux

Posted: Sun Jun 16, 2019 8:08 pm
by redfield
Thanks both for your replies.
Klaus wrote:
Sun Jun 16, 2019 2:39 pm
so this is normal behavior!
Ok.
Klaus wrote:You need to add something like:

Code: Select all

on preopenstack
  set the loc of this stack to the screenloc
endpreopenstack
I will try this, whereas the Dictionary doesn't know 'loc' but only 'location'.


bogs wrote: you might want to write it's last location to a file
Interesting, will try that too.
bogs wrote: I don't think I ever saw a linux application with an application icon attached to the window
This is how it looks on my Linux:
icon4.png
icon4.png (17.68 KiB) Viewed 8169 times
And in my own program there's some kind of placeholder or so:
icon2.png
icon2.png (18.02 KiB) Viewed 8169 times

Re: Questions regarding standalones on Linux

Posted: Sun Jun 16, 2019 8:31 pm
by Klaus
loc = short for location! :D

Re: Questions regarding standalones on Linux

Posted: Sun Jun 16, 2019 9:09 pm
by bogs
Just out of curiosity, which desktop are you using on linux?

Re: Questions regarding standalones on Linux

Posted: Sun Jun 16, 2019 9:14 pm
by redfield
This is XFCE (running on an Arch system).

Re: Questions regarding standalones on Linux

Posted: Sun Jun 16, 2019 11:35 pm
by bogs
Huh, mine is also running XFCE. Which theme are you using?

Re: Questions regarding standalones on Linux

Posted: Mon Jun 17, 2019 8:30 pm
by redfield
Well in this case it's Koynacity. The themes seem to have a configuration file, containing the line
show_app_icon=(true or false)
So if set to true, icons are displayed but it's a puzzle to me, how the theme "knows" which icon to grab for which program. This is probably far too complicated stuff for me. :?

Re: Questions regarding standalones on Linux

Posted: Mon Jun 17, 2019 8:55 pm
by bogs
Well, I doubt it is too complicated, but it certainly is unusual. As I said, I never saw that before, and I thought I had tried every theme at least once :P

Re: Questions regarding standalones on Linux

Posted: Mon Jun 17, 2019 10:50 pm
by FourthWorld

Re: Questions regarding standalones on Linux

Posted: Tue Jun 18, 2019 10:14 am
by bogs
Was there a particular starting point of the 480 some odd lines of the specs you were thinking of that applies to application icons in the window?

That is a good reference (and one I use often), but I must have missed that entry.

Re: Questions regarding standalones on Linux

Posted: Tue Jun 18, 2019 5:05 pm
by FourthWorld
bogs wrote:
Tue Jun 18, 2019 10:14 am
Was there a particular starting point of the 480 some odd lines of the specs you were thinking of that applies to application icons in the window?
Yes. I have no time for randomness (perhaps instead of "Is there a point?", suggesting the possibility of pointlessness, you'd meant to write "What is the point?", which merely seeks clarification).

redfield wrote:
it's a puzzle to me, how the theme "knows" which icon to grab for which program
The spec I'd linked to defines how icon associations are made with a .desktop file.

Re: Questions regarding standalones on Linux

Posted: Tue Jun 18, 2019 8:54 pm
by bogs
FourthWorld wrote:
Tue Jun 18, 2019 5:05 pm
Yes. I have no time for randomness (perhaps instead of "Is there a point?", suggesting the possibility of pointlessness, you'd meant to write "What is the point?", which merely seeks clarification).
I apologize for not saying it more clearly, the question wasn't meant to read "Is there a point because it looks pointless", but instead was supposed to read
bogs wrote:
Tue Jun 18, 2019 10:14 am
Was there a particular starting point of the 480 some odd lines of the specs you were thinking of that applies to application icons in the window?
I *always* assume you have a point to make, but sometimes the replies you post are a little .... oh, I dunno, vague I guess.

Kind of like when you say things like "Did you read the entire manual that comes in PDF format to understand one point about [x] in LiveCode". Instead of
FourthWorld wrote:
Mon Jun 17, 2019 10:50 pm
Welcome to the rabbit hole:
https://standards.freedesktop.org/deskt ... atest.html
it easily could have been
FourthWorld wrote:
Mon Jun 17, 2019 10:50 pm
Welcome to the rabbit hole, this section on "Desktop entries" should get you started:
https://standards.freedesktop.org/deskt ... atest.html
I KNOW you to be a prolific writer when the mood suits you, I don't think adding 2 to 9 more words would have killed you :wink:

Re: Questions regarding standalones on Linux

Posted: Tue Jun 18, 2019 9:49 pm
by FourthWorld
bogs wrote:
Tue Jun 18, 2019 8:54 pm
Kind of like when you say things like "Did you read the entire manual that comes in PDF format to understand one point about [x] in LiveCode".
When did I write that?
I KNOW you to be a prolific writer when the mood suits you, I don't think adding 2 to 9 more words would have killed you :wink:
Which would explain why I didn't say it would kill me.

I handle about hundred correspondences a day. Some are more detailed than others. I figure folks will ask if anything's not clear.

So to be clear here, the spec is about a lot more than icons, generally useful when deploying to Linux. Those unfamiliar with it will want to be. Those familiar with it will know that's where icon associations are handled.