nanogui: Thread: about nanowm


[<<] [<] Page 1 of 2 [>] [>>]
Subject: about nanowm
From: "Tony Hoo" ####@####.####
Date: 28 Dec 2000 06:40:45 -0000
Message-Id: <001501c070aa$b9f77f10$354f44d3@HuXianGang>

Greg
   I think the nanowm has two problem:
   First, when you run two programs overlayed eachother, you can swith one to top display only by clicking its titlebar, but I wish it being done by clicking any part not being covered.
   Second, when you drag a window to other place, then the window followed the cursor  refresh sparklingly , specially on low speed CPU it's a problem.

   I have fixed some problem in appendant file. But for the first problem above, to the fltk's program it still can not switch to top when clicking some part not on titlebar. I think that is because nanowm can not get the button_click_event.
   For the Second problem , I had paint a rectangle when drag a window.

Regards.
   Tony Hoo. 

[Content type application/octet-stream not shown. Download]

[Content type application/octet-stream not shown. Download]
Subject: about nanowm
From: xiang ####@####.####
Date: 21 Feb 2001 11:25:36 -0000
Message-Id: <20010221113004.58930.qmail@web11101.mail.yahoo.com>

Dear alex:
  I wanna to add a hotbutton control to nanowm for my
pda(linux-vr).I'm new to win-mw,and there is so few 
docs about this. So I have to glance my eye at the
codes in /demos/nanowm and /nanox/ .  
  At beginning,I try to find out how I can add a
hotbutton event to the nano-X's events ,but I find 
that the most event is come from the Mouse and
Keyboard
it seems not easy to add a new type of events .
  Then  I try to got windows message from nanowm and 
save it in my apps ,when the hotbutton message coming 
this apps send command to nanowm.
  Follow is my test in this way.
1.in nanowm.c ,first make two named-pipe ,after 
 "switch" events read pipe for hotbutton message
 the message is forcedly switch to (GR_WINDOW_ID)
 and I try GrMapWindow(mywin_id);
2. in clients.c ,new_client_window() after  create
container window write the window->wid to the pipe

I can read from pipe wid "3" "5" ....
but when I send "5" to the pipe the nano-X broken
here is some error message:
nanowm: error 2
Got unexpected event -65514
nxclient 3252: Wrong packet type 0 (expected 22)
Got unexpected event 917526
nxclient 3247: Wrong packet type 0 (expected 22)
nano-X: GsError (GrSetGCForeground) Bad graphics
context: 1046
nano-X: GsError (GrLine) Bad graphics context: 1046
nano-X: GsError (GrLine) Bad graphics context: 1046
nano-X: GsError (GrDestroyGC) Bad graphics context:
1046
nano-X: GsError (GrSetGCForeground) Bad graphics
context: 1050
nano-X: GsError (GrLine) Bad graphics context: 1050
nano-X: GsError (GrLine) Bad graphics context: 1050
nano-X: GsError (GrDestroyGC) Bad graphics context:
1050
nano-X: GsError (GrSetGCForeground) Bad graphics
context: 1054
nano-X: GsError (GrLine) Bad graphics context: 1054
nano-X: GsError (GrLine) Bad graphics context: 1054
nano-X: GsError (GrDestroyGC) Bad graphics context:
1054
Got unexpected event 196624
nxclient 3244: Wrong packet type 0 (expected 22)
nxclient 3244: Wrong packet type -1 (expected 22)
nxclient 3244: Wrong packet type 255 (expected 22)
nxclient 3244: Wrong packet type 16526 (expected 22)
Got unexpected event 65536
nxclient 3242: Wrong packet type 40 (expected 22)
nxclient 3242: Wrong packet type 0 (expected 22)
nxclient 3242: Wrong packet type 1 (expected 22)
nxclient 3242: Wrong packet type 0 (expected 22)
Got unexpected event 65558
nxclient 3238: Wrong packet type 0 (expected 22)
nxclient: lost connection to Nano-X server

it seems that I made a silly mistake.
Any good ideas about this? and any doog docs can 
lead me to window-manage? I like a blind man in wm.

Best Regards
liex 

     

_________________________________________________________
Do You Yahoo!? 登录免费雅虎电邮! http://mail.yahoo.com.cn
创建雅虎俱乐部,真我个性尽施展!http://cn.clubs.yahoo.com
Subject: Re: about nanowm
From: Alex Holden ####@####.####
Date: 21 Feb 2001 13:40:26 -0000
Message-Id: <Pine.LNX.4.04.10102211324130.604-100000@hyperspace.linuxhacker.org>

On Wed, 21 Feb 2001, [gb2312] xiang lee wrote:
>   I wanna to add a hotbutton control to nanowm for my

What's a hotbutton control?

>   At beginning,I try to find out how I can add a
> hotbutton event to the nano-X's events ,but I find 
> that the most event is come from the Mouse and
> Keyboard

If you really need to add a new event type (as opposed to a keyboard event
with a special key value or something):

In include/nano-X.h :
Add a new GR_EVENT_TYPE_ #define.
Add a new GR_EVENT_MASK_ #define.
Add a new GR_EVENT_ structure definition. Note that it has to start with
a GR_EVENT_TYPE value.
Add the structure to the GR_EVENT union.

In nanox/srvevent.c :
Add a GsDeliverYourEvent() function which looks through the
rootwp->eventclients list for windows which have selected to receive the
event, and when you find one which you want to send an event to, use
GsAllocEvent() to allocate a new event structure then just fill it in
(then forget about it- GsAllocEvent() adds it to the event list so you
don't have to).

You will then need to call the GsDeliverYourEvent() function whenever you
want to generate your event. How you do this depends on the application
(specifically, how the server decides that it wants to generate an event).

>   Then  I try to got windows message from nanowm and 
> save it in my apps ,when the hotbutton message coming 
> this apps send command to nanowm.

I don't understand.

> but when I send "5" to the pipe the nano-X broken
> here is some error message:
> nanowm: error 2
> Got unexpected event -65514
> nxclient 3252: Wrong packet type 0 (expected 22)

This is the kind of thing which happens if your application tries to write
to stdout. Are you using printf() for debugging or something?

-- 
------- Alex Holden -------
http://www.linuxhacker.org/
 http://www.robogeeks.org/

Subject: Re: about nanowm
From: xiang ####@####.####
Date: 22 Feb 2001 02:09:02 -0000
Message-Id: <20010222021331.16731.qmail@web11105.mail.yahoo.com>

--- Alex Holden ####@####.#### 的正文:> On
Wed, 21 Feb 2001, [gb2312] xiang lee wrote:
> >   I wanna to add a hotbutton control to nanowm for
> my
> 
> What's a hotbutton control?
 Sorry,maybe i cann't call it "hotbutton control"
I means that an application which can receive a
message from hardware button(like PALM Vx ) and send 
a event to the nanowm,in this way the hardware button
can control the windows. (for example,You can control
the scrollbar of a window only with a hardware button
)
 
> >   At beginning,I try to find out how I can add a
> > hotbutton event to the nano-X's events ,but I find
> 
> > that the most event is come from the Mouse and
> > Keyboard
> 
> If you really need to add a new event type (as
> opposed to a keyboard event
> with a special key value or something):
> 
> In include/nano-X.h :
> Add a new GR_EVENT_TYPE_ #define.
> Add a new GR_EVENT_MASK_ #define.
> Add a new GR_EVENT_ structure definition. Note that
> it has to start with
> a GR_EVENT_TYPE value.
> Add the structure to the GR_EVENT union.
> 
> In nanox/srvevent.c :
> Add a GsDeliverYourEvent() function which looks
> through the
> rootwp->eventclients list for windows which have
> selected to receive the
> event, and when you find one which you want to send
> an event to, use
> GsAllocEvent() to allocate a new event structure
> then just fill it in
> (then forget about it- GsAllocEvent() adds it to the
> event list so you
> don't have to).
> 
> You will then need to call the GsDeliverYourEvent()
> function whenever you
> want to generate your event. How you do this depends
> on the application
> (specifically, how the server decides that it wants
> to generate an event).
Thanks,I think this way is too difficult for me.
Currently I can only read "0" or "1" from the hardware
buttons,In your means,I must register my event to the
X-server?  

> >   Then  I try to got windows message from nanowm
> and 
> > save it in my apps ,when the hotbutton message
> coming 
> > this apps send command to nanowm.
> 
> I don't understand.
..My Engish is not good enough to express my means,
sorry ,I send you codes,I think you will known what 
i means.
In the nanowm.c ln28-ln31 ln102-ln115
In the clients.c ln136-ln142
rp.c is read test which get window->wid from wmpipe
wp.c is write test which put window->wid to mappipe
 
Best Regards
liex 


_________________________________________________________
Do You Yahoo!? 登录免费雅虎电邮! http://mail.yahoo.com.cn
创建雅虎俱乐部,真我个性尽施展!http://cn.clubs.yahoo.com

[Content type application/x-zip-compressed not shown. Download]
Subject: Re: about nanowm
From: Alex Holden ####@####.####
Date: 22 Feb 2001 13:32:42 -0000
Message-Id: <Pine.LNX.4.04.10102221255370.11593-100000@www.linuxhacker.org>

On Thu, 22 Feb 2001, [gb2312] xiang lee wrote:
>  Sorry,maybe i cann't call it "hotbutton control"
> I means that an application which can receive a
> message from hardware button(like PALM Vx ) and send 
> a event to the nanowm,in this way the hardware button

I see. I would try to implement something similar to drivers/kbd_ipaq.c
which reads the button device and generates a keyboard event with a
special key code when the button is pressed. This will be a little more
difficult if your hardware has an ordinary keyboard (PS2 or whatever) as
well- in that case you'll have to monitor three inputs instead of the
usual two. If your button device doesn't have a kernel driver and you're
monitoring a memory bit via /dev/mem or something, you'll need to do
something a little more complicated. As you may know, you can't get
interrupts in user space so you'll have to poll it even if your hardware
is physically capable of generating an interrupt on the key press (which
is one good reason to implement a kernel driver instead). The easiest way
to do that is to use the register a timer callback with GdAddTimer() which
checks if the button status has changed, emits a keyboard event with
GsDeliverKeyboardEvent() if it has, then re-registers itself.

The problem I see with this is that you want the button press to always go
to the window manager, but the way the keyboard event currently works is
that only one window ever gets a particular key event. Arguably it would
be better to fix this properly rather than trying to work around it
somehow, though I can't see any particularly "nice" solutions to it. What
we probably want is some way for a window to say "when you get a key event
with this combination of key code and modifiers, send it to me regardless
of where the input focus is". That way applications like the window
manager can register "hot key" combinations which will work regardless of
whether another window has the current input focus or not. 

-- 
------- Alex Holden -------
http://www.linuxhacker.org/
 http://www.robogeeks.org/

Subject: Re: about nanowm
From: Jordan Crouse ####@####.####
Date: 22 Feb 2001 15:06:32 -0000
Message-Id: <3A952C34.B9CBC14E@censoft.com>

Alex Holden wrote:
>As you may know, you can't get
> interrupts in user space so you'll have to poll it even if your hardware
> is physically capable of generating an interrupt on the key press (which
> is one good reason to implement a kernel driver instead).

You should always use kernel drivers when you can.  Not only does the
kernel provide better support
and infrastrucure for handling hardware events, it also maintains
consistancy with the Linux model.

> 
> The problem I see with this is that you want the button press to always go
> to the window manager, but the way the keyboard event currently works is
> that only one window ever gets a particular key event. Arguably it would
> be better to fix this properly rather than trying to work around it
> somehow, though I can't see any particularly "nice" solutions to it. What
> we probably want is some way for a window to say "when you get a key event
> with this combination of key code and modifiers, send it to me regardless
> of where the input focus is". That way applications like the window
> manager can register "hot key" combinations which will work regardless of
> whether another window has the current input focus or not.

Somewhere on this hard drive that I call home is a server function that
allows individual clients to 
request that a keystroke trigger an event regardless of focus.  I coded
it up for the Ipaq (since some of the keys 
on the Ipaq can really be considered "global" -- like the menu key), but
then other stuff came up and I had to shove that aside.  It was a little
bit kludgy, but it fit well with the microwindows model.  I will track
that down and send it out for comments.  

But definately a good idea that needs further attention.

> --
> ------- Alex Holden -------
> http://www.linuxhacker.org/
>  http://www.robogeeks.org/
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ####@####.####
> For additional commands, e-mail: ####@####.####
Subject: Re: about nanowm
From: "Greg Haerr" ####@####.####
Date: 22 Feb 2001 17:11:50 -0000
Message-Id: <030601c09cf2$fefebd20$15320cd0@gregh>

: Sorry,maybe i cann't call it "hotbutton control"
: I means that an application which can receive a
message from hardware button(like PALM Vx ) and send 
a event to the nanowm,in this way the hardware button
can control the windows. (for example,You can control
the scrollbar of a window only with a hardware button


I'll take a look at the code.  In the mean time,
the best way to interface buttons to the hardware
is to add them into the low-level Microwindows
keyboard driver, and have the button presses come
up as MWKEY_* values.

There is room for "virtual" MWKEY_ values, which can
then be passed to the widget set, and used for controlling
scrollbars, etc.  Normally, you won't have to create
another virtual value, since I have added quite
a few already.  For controlling the scrollbars, for
instance, I recommend using MWKEY_UP/DOWN.  Add these
values to the widget, and you'll be in business.

Take a look at kbd_ipaq.c, this is exactly what we've
done to interface the iPAQ buttons to Microwindows,
they look like keystrokes.

Regards,

Greg


Subject: Re: about nanowm
From: "Greg Haerr" ####@####.####
Date: 22 Feb 2001 17:26:24 -0000
Message-Id: <035001c09cf5$08d6f680$15320cd0@gregh>

: The problem I see with this is that you want the button press to always go
: to the window manager, but the way the keyboard event currently works is
: that only one window ever gets a particular key event. 

One way to do this would be for the WM to create a full-screen
input-only window, and select for keyup and down events.  It will at least
get them, although another application may get them as well.

Regards,

Greg

Subject: Re: about nanowm
From: Alex Holden ####@####.####
Date: 22 Feb 2001 19:46:20 -0000
Message-Id: <Pine.LNX.4.04.10102221938220.17437-100000@www.linuxhacker.org>

On Thu, 22 Feb 2001, Jordan Crouse wrote:
> You should always use kernel drivers when you can.  Not only does the
> kernel provide better support and infrastrucure for handling hardware
> events, it also maintains consistancy with the Linux model.

I agree totally. Be careful not to say so on the LKML though unless you
have asbestos underpants on ;) The more common view seems to be that if a
driver can possibly be implemented in user space without incurring a major
performance impact, it should be.

-- 
------- Alex Holden -------
http://www.linuxhacker.org/
 http://www.robogeeks.org/

Subject: about nanowm
From: "xgzhang" ####@####.####
Date: 3 Jul 2002 03:22:14 -0000
Message-Id: <000a01bedb02$762de790$1301a8c0@pc019>

Hello:

     May i use the microwindows with nanowm when LINK_APP_INTO_SERVER is set to  Y mode ? If so how can i do it ? 

    By the way if viewml can work when microwin is in LINK_APP_INTO_SERVER = Y mode  ?

    Thanks in advance !

                      xgzhang
[<<] [<] Page 1 of 2 [>] [>>]


Powered by ezmlm-browse 0.20.