r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[Linux] group for linux REBOL users

amacleod
2-Apr-2009
[2762]
Firefox has kiosk mode where window frames and titles disappear...may 
work differnetly than normal windows without titlebars..maybe simpler 
to do
Anton
2-Apr-2009
[2763x2]
SDL is something definitely worth checking out, but Rebol does not 
use SDL, it uses X windows, and I want the pointer to those windows 
opened by Rebol.
In order to manipulate windows opened by Rebol, I need to have the 
pointer to them. There is no escaping this.
Pekr
3-Apr-2009
[2765]
Anton - I know. My point is, that if SDL can do it, cross platform, 
looking into their source will reveal actually HOW they do it, no? 
They have to call some Linux underlying code, to achieve no-border 
window. ...
Anton
3-Apr-2009
[2766x2]
Right, but before I get to manipulating the window, I need to have 
the window pointer. If I don't have a way of getting that from the 
process id,  then it remains hypothetical.
X.org maillist doesn't have any easy answers to this, either. Looks 
like it really is time to hack. This will be a big job.
Graham
3-Apr-2009
[2768x2]
if [ -f bin/FaxDispatch ]; then
	. bin/FaxDispatch	
    fi

what's the meaning of this shell script ?
-f ... is that equivalent to exists?
Anton
3-Apr-2009
[2770x4]
Yes.
Search for "-f file" in bash manpage.
-f file
	True if file exists and is a regular file.
There's a whole host of other one-letter variants for checking other 
types of objects that may be present in the filesystem.

It's completely brain-damaged for bash to use one-letter options 
for this - but that's the situation.
Pekr
3-Apr-2009
[2774]
Maybe some small hints in there? http://tonyobryan.com/index.php?article=9
Anton
3-Apr-2009
[2775x2]
Maybe, or definitely? I've been following "maybes" for about 16 hours 
now.
Ok, it does look quite useful. (But only after you have the window 
pointer.)
Pekr
3-Apr-2009
[2777x3]
exactly, the pointer ... don't ask me about usefulness, I have little 
to zero C knowlege, so :-) Waiting for my friend's reply ....
Hmm, so I downloaded SDL sources, looked thru it, but not knowing 
C properly it is not clear to me, what is happening there :-) But 
decomposing various video related parameters I got down to:

SDL_windowid = SDL_getenv("SDL_WINDOWID")


So they seem to get windowID from SDL_getenv call, which is function 
simply getting environmental vars ... so - probably not helpful either 
:-)
So, maybe REBOL process should be responsible to update/provide some 
environmental var for particular window? Is it possible REBOL process 
is not simply doing so?
Anton
3-Apr-2009
[2780x2]
Probably that env var is set up by SDL, and only for a window which 
the SDL system knows about. Since rebol doesn't use SDL to open its 
windows, SDL (most likely) won't know about those windows.
But anyway, I'm heading down the DLL injection path, using LD_PRELOAD. 
I have a simple LD_PRELOAD example working, which intercepts calls 
to the time() function (and works with rebol). The next example I'll 
try will intercept X window calls.
Pekr
3-Apr-2009
[2782]
I know that SDL can't help you to get REBOL's window handles :-) 
I just thought that we might look into how others are obtaining them, 
and then to try similar aproach for REBOL. But anyway, you surely 
will find your way thru!
Anton
3-Apr-2009
[2783]
Ok, I can now intercept the XCreateSimpleWindow call ! Woo!  The 
hard part seems over... Now to remember what I wanted it for...
Henrik
3-Apr-2009
[2784]
:-)
Anton
3-Apr-2009
[2785x2]
The 'xprop' command can see the hacked-in process id. Proof of concept.
Joining more dots - the C code can match the pid to the window. Now 
I can sleep.
Maxim
3-Apr-2009
[2787x2]
anton you mean that you have REBOL callbacks being triggered when 
it tries to open the window!!!!!   :-D
?
Anton
3-Apr-2009
[2789x2]
Not Rebol callbacks. A DLL built using C is injected using LD_PRELOAD 
when running any executable. The executable I'm interested in is 
Rebol, of course. This injected code intercepts calls to XCreateSimpleWindow 
(which creates the X Windows window), and adds some properties to 
it, including one which stores the process id of the application 
opening the window. This means that each X window can be ensured 
to have the process id of the application that opened it (which is 
otherwise not mandated by X). So I could do that to any program and 
it would ensure that there is a way to get the process id. I'm doing 
it to Rebol, and this means it is now possible for another DLL function 
(called from Rebol) to scan all the windows opened on the X display 
and see which one has the Rebol process id. All you need is the process 
id, and this is easy to do with a very small DLL function call.
I was starting to think about how I could possibly get a rebol callback 
happening, though. That should obviate the need to scan all open 
windows, which is a crude way of getting information.
Maxim
3-Apr-2009
[2791]
pretty cool
Pekr
4-Apr-2009
[2792]
I smell someone (Anton) is up to R3 port effort to Linux platforms 
:-)
Anton
4-Apr-2009
[2793x2]
I've just got another method of passing the Window XID to Rebol, 
obviating the need to scan all open windows. Much more direct, it 
sets an environment variable, which Rebol can read with get-env after 
VIEWing a window.
If I was ruled by pragmatism, I would just go with this method, which 
I'm sure would work quite well. But, after my big post in the Rebol3 
group on Friday, in which I advocate modularity and avoidance of 
namespace pollution, I can hardly just be happy using an environment 
variable, despite the relative simplicity of doing so. I will investigate 
some other methods which also intrigue me...
Anton
5-Apr-2009
[2795x6]
Another method: I can use load/library to access the LD_PRELOAD library 
and share information via static variables.
So I don't need to create an environment variable to pass information 
to Rebol.
But using Rebol's External Library Interface, I can also directly 
call functions in the LD_PRELOADed library, too. So there's not so 
much need to pass the Window XID to Rebol to start with.
But I think I caught up to where RT left off on the hunt to implement 
NO-TITLE and NO-BORDER. It looks like there is no window manager 
agnostic way of separately specifying these window decorations. I 
will investigate some more, though. I have managed to open a window 
with no title and no border, but it doesn't respond to events at 
all, because this was achieved by basically telling the window manager 
not to  manage the window at all when X is opening it.
Could be useful for full-screen games/presentors and so on, but requires 
more code to handle events I think. Anyway, that wasn't really the 
goal; to implement NO-TITLE and NO-BORDER, not NO-TITLE-AND-NO-BORDER(-AND-NO-EVENTS...).
amacleod: Hmm.. what was the goal? Did you want to use NO-TITLE and 
NO-BORDER together?
amacleod
5-Apr-2009
[2801x2]
I have a program I would like to run on a netbook (Small screen 800x480) 
so I do not want to lose any realestate to title bar...
(I know it can come with XP but for another $50)

Also, I like the idea of the application "taking over" the netbook 
as if this device and the App are one.

It's for use by non-techies so as little interaction with linux as 
possible is desired...
Full screen no-border works for me...
Anton
5-Apr-2009
[2803]
I see. Hmm...
amacleod
5-Apr-2009
[2804x2]
Sort of like an appliance...


The perfect setup would be to boot into a slim xwindows environment 
with no or minimal wmanger running my app but have  key combo at 
start up to boot into full linux desktop
I think this will be the year of cheap touch tablets which perfect 
for my app...THese cheap tablets are often linux based
Anton
7-Apr-2009
[2806x2]
I've just opened a little Rebol window without title bar or border, 
but it can be moved around and handles events as a normal window 
does (eg. view layout [button area] works).
I think this method, which uses a small amount of code, may be window 
manager agnostic too.
Pekr
7-Apr-2009
[2808]
Cool! I am looking for kiosk mode for Linux with REBOL. Hopefully 
can be added to R3 View ...
amacleod
7-Apr-2009
[2809x2]
or r2-forward
Sounds great Anton..
How do you move it without the title bar?
Anton
7-Apr-2009
[2811]
On KDE here, I can press and hold Alt key, then left-click drag a 
window with the mouse.